mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Merge remote-tracking branch 'origin/master' into decouple-client
Conflicts: Mage/src/mage/cards/repository/CardRepository.java
This commit is contained in:
commit
1fccbd6b87
339 changed files with 17278 additions and 1002 deletions
BIN
Mage.Client/plugins/sounds/OnPlayerJoinedTable.wav
Normal file
BIN
Mage.Client/plugins/sounds/OnPlayerJoinedTable.wav
Normal file
Binary file not shown.
BIN
Mage.Client/release/backgrounds/Blue-Abstract.jpg
Normal file
BIN
Mage.Client/release/backgrounds/Blue-Abstract.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 90 KiB |
BIN
Mage.Client/release/backgrounds/Distant-Galaxy.jpg
Normal file
BIN
Mage.Client/release/backgrounds/Distant-Galaxy.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 254 KiB |
BIN
Mage.Client/release/backgrounds/Galaxy.jpg
Normal file
BIN
Mage.Client/release/backgrounds/Galaxy.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 273 KiB |
BIN
Mage.Client/release/backgrounds/Gray.jpg
Normal file
BIN
Mage.Client/release/backgrounds/Gray.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 MiB |
|
@ -0,0 +1,17 @@
|
|||
NAME:Adam Moore's Beck and Affinity
|
||||
4 [DDF:72] Darksteel Citadel
|
||||
4 [GTC:240] Breeding Pool
|
||||
4 [MBS:145] Inkmoth Nexus
|
||||
4 [NPH:76] Vault Skirge
|
||||
4 [MMA:207] Frogmite
|
||||
4 [MMA:223] Glimmervoid
|
||||
3 [LRW:261] Springleaf Drum
|
||||
4 [M11:211] Ornithopter
|
||||
3 [SOM:179] Mox Opal
|
||||
2 [SOM:122] Genesis Wave
|
||||
4 [MMA:209] Myr Enforcer
|
||||
4 [DGM:123] Beck // Call
|
||||
4 [DDF:71] Thoughtcast
|
||||
4 [SOM:174] Memnite
|
||||
4 [MBS:131] Signal Pest
|
||||
4 [DDF:44] Steel Overseer
|
|
@ -0,0 +1,17 @@
|
|||
NAME:Daniel Watson's Zhur-Taawin
|
||||
4 [MMA:59] Pestermite
|
||||
3 [SOM:225] Copperline Gorge
|
||||
2 [NPH:159] Spellskite
|
||||
4 [ROE:165] Splinter Twin
|
||||
4 [M12:63] Mana Leak
|
||||
4 [NPH:33] Deceiver Exarch
|
||||
4 [CHK:234] Orochi Leafcaller
|
||||
4 [GTC:240] Breeding Pool
|
||||
4 [MMA:56] Pact of Negation
|
||||
4 [DGM:120] Zhur-Taa Druid
|
||||
4 [GTC:247] Stomping Ground
|
||||
4 [ZEN:229] Verdant Catacombs
|
||||
3 [MMA:120] Kiki-Jiki, Mirror Breaker
|
||||
4 [SOK:38] Freed from the Real
|
||||
4 [RTR:247] Steam Vents
|
||||
4 [ZEN:220] Misty Rainforest
|
|
@ -0,0 +1,24 @@
|
|||
NAME:Elias Rudin's RUG Vial
|
||||
4 [MMA:166] Tarmogoyf
|
||||
4 [SOM:225] Copperline Gorge
|
||||
1 [ZEN:67] Spell Pierce
|
||||
4 [ZEN:223] Scalding Tarn
|
||||
4 [ISD:78] Snapcaster Mage
|
||||
3 [EVE:177] Flooded Grove
|
||||
2 [M12:63] Mana Leak
|
||||
1 [GTC:240] Breeding Pool
|
||||
1 [MMA:64] Spell Snare
|
||||
4 [M11:149] Lightning Bolt
|
||||
3 [MMA:144] Eternal Witness
|
||||
1 [GTC:247] Stomping Ground
|
||||
1 [RTR:265] Mountain
|
||||
3 [RAV:63] Remand
|
||||
3 [DKA:140] Huntmaster of the Fells
|
||||
1 [MMA:190] Kitchen Finks
|
||||
4 [MMA:197] AEther Vial
|
||||
1 [RTR:247] Steam Vents
|
||||
3 [ZEN:220] Misty Rainforest
|
||||
4 [RTR:255] Island
|
||||
4 [MMA:38] Cryptic Command
|
||||
3 [MMA:70] Vendilion Clique
|
||||
1 [RTR:270] Forest
|
|
@ -0,0 +1,19 @@
|
|||
NAME:Liam Puknys's Possibility Brand
|
||||
1 [ROE:4] Emrakul, the Aeons Torn
|
||||
2 [AVR:106] Griselbrand
|
||||
4 [ZEN:223] Scalding Tarn
|
||||
4 [GTC:240] Breeding Pool
|
||||
4 [GTC:247] Stomping Ground
|
||||
4 [DKA:87] Faithless Looting
|
||||
2 [ROE:6] Kozilek, Butcher of Truth
|
||||
4 [RTR:247] Steam Vents
|
||||
4 [M11:211] Ornithopter
|
||||
4 [DGM:34] Possibility Storm
|
||||
4 [WWK:37] Selective Memory
|
||||
1 [M13:63] Omniscience
|
||||
4 [ZEN:220] Misty Rainforest
|
||||
4 [M13:160] Arbor Elf
|
||||
4 [DGM:123] Beck // Call
|
||||
4 [ZEN:211] Arid Mesa
|
||||
2 [CMD:1] Artisan of Kozilek
|
||||
4 [SOM:174] Memnite
|
|
@ -0,0 +1,18 @@
|
|||
NAME:Trevor Cashmore's Just Kiln Time
|
||||
4 [ISD:248] Sulfur Falls
|
||||
2 [ZEN:67] Spell Pierce
|
||||
4 [ZEN:223] Scalding Tarn
|
||||
4 [ROE:153] Kiln Fiend
|
||||
4 [SOM:82] Assault Strobe
|
||||
3 [5DN:36] Serum Visions
|
||||
2 [DKA:27] Artful Dodge
|
||||
4 [NPH:2] Apostle's Blessing
|
||||
4 [ROE:60] Distortion Strike
|
||||
4 [MMA:191] Manamorphose
|
||||
2 [RTR:265] Mountain
|
||||
4 [RTR:247] Steam Vents
|
||||
4 [NPH:116] Mutagenic Growth
|
||||
4 [RTR:255] Island
|
||||
3 [9ED:99] Sleight of Hand
|
||||
4 [DGM:87] Nivix Cyclops
|
||||
4 [NPH:35] Gitaxian Probe
|
|
@ -0,0 +1,28 @@
|
|||
NAME:Gadin's Robots
|
||||
4 [DDF:72] Darksteel Citadel
|
||||
3 [MMA:220] Blinkmoth Nexus
|
||||
3 [MBS:145] Inkmoth Nexus
|
||||
4 [NPH:76] Vault Skirge
|
||||
4 [HOP:110] Cranial Plating
|
||||
4 [MMA:223] Glimmervoid
|
||||
3 [LRW:261] Springleaf Drum
|
||||
2 [MMA:198] Arcbound Ravager
|
||||
1 [RTR:265] Mountain
|
||||
3 [SOM:154] Etched Champion
|
||||
4 [DDF:48] Master of Etherium
|
||||
4 [M11:211] Ornithopter
|
||||
3 [SOM:179] Mox Opal
|
||||
4 [SOM:91] Galvanic Blast
|
||||
4 [DDF:71] Thoughtcast
|
||||
1 [RTR:255] Island
|
||||
3 [SOM:174] Memnite
|
||||
3 [MBS:131] Signal Pest
|
||||
3 [DDF:44] Steel Overseer
|
||||
SB: 1 [ROE:92] Unified Will
|
||||
SB: 3 [NPH:159] Spellskite
|
||||
SB: 1 [NPH:102] Whipflare
|
||||
SB: 3 [MMA:213] Relic of Progenitus
|
||||
SB: 1 [M13:62] Negate
|
||||
SB: 3 [MMA:106] Blood Moon
|
||||
SB: 2 [PC2:7] Ghostly Prison
|
||||
SB: 1 [ISD:127] Ancient Grudge
|
|
@ -0,0 +1,33 @@
|
|||
NAME:Robert Seder's Esper Control
|
||||
1 [DKA:142] Sorin, Lord of Innistrad
|
||||
1 [DGM:11] AEtherling
|
||||
4 [M13:225] Glacial Fortress
|
||||
3 [ISD:83] Think Twice
|
||||
3 [RTR:145] Azorius Charm
|
||||
4 [ISD:78] Snapcaster Mage
|
||||
2 [RTR:54] Syncopate
|
||||
4 [GTC:249] Watery Grave
|
||||
1 [M13:56] Jace, Memory Adept
|
||||
1 [RTR:35] Cyclonic Rift
|
||||
1 [AVR:79] Tamiyo, the Moon Sage
|
||||
1 [AVR:32] Restoration Angel
|
||||
2 [RTR:44] Jace, Architect of Thought
|
||||
4 [ISD:242] Isolated Chapel
|
||||
4 [DGM:127] Far // Away
|
||||
4 [ISD:245] Nephalia Drownyard
|
||||
2 [ISD:53] Dissipate
|
||||
4 [AVR:38] Terminus
|
||||
4 [RTR:241] Hallowed Fountain
|
||||
4 [M13:223] Drowned Catacomb
|
||||
3 [GTC:242] Godless Shrine
|
||||
4 [RTR:200] Sphinx's Revelation
|
||||
SB: 2 [DKA:76] Tragic Slip
|
||||
SB: 2 [M13:26] Planar Cleansing
|
||||
SB: 1 [GTC:63] Devour Flesh
|
||||
SB: 1 [ISD:212] Evil Twin
|
||||
SB: 1 [RTR:18] Rest in Peace
|
||||
SB: 1 [ISD:27] Purify the Grave
|
||||
SB: 3 [M13:62] Negate
|
||||
SB: 1 [RTR:47] Psychic Spiral
|
||||
SB: 1 [M13:56] Jace, Memory Adept
|
||||
SB: 1 [ISD:119] Tribute to Hunger
|
|
@ -26,8 +26,11 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
private int textOffsetY = 0;
|
||||
private int textOffsetButtonY = 2;
|
||||
private int textOffsetX = -1;
|
||||
private int topTextOffsetX = -1;
|
||||
private Dimension overlayImageSize;
|
||||
|
||||
private String topText;
|
||||
|
||||
private boolean isHovered = false;
|
||||
private boolean isSelected = false;
|
||||
private boolean drawSet = false;
|
||||
|
@ -36,6 +39,7 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
private Command observer = null;
|
||||
private Command onHover = null;
|
||||
private Color textColor = Color.white;
|
||||
private Color textBGColor = Color.black;
|
||||
|
||||
static final Font textFont = new Font("Arial", Font.PLAIN, 12);
|
||||
static final Font textFontMini = new Font("Arial", Font.PLAIN, 11);
|
||||
|
@ -100,6 +104,18 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
} else {
|
||||
g.drawImage(disabledImage, 0, 0, imageSize.width, imageSize.height, this);
|
||||
}
|
||||
if (topText != null) {
|
||||
if (useMiniFont) {
|
||||
g2d.setFont(textFontMini);
|
||||
} else {
|
||||
g2d.setFont(textFont);
|
||||
}
|
||||
topTextOffsetX = calculateOffsetForTop(g2d, topText);
|
||||
g2d.setColor(textBGColor);
|
||||
g2d.drawString(topText, topTextOffsetX+1, 13);
|
||||
g2d.setColor(textColor);
|
||||
g2d.drawString(topText, topTextOffsetX, 12);
|
||||
}
|
||||
if (overlayImage != null) {
|
||||
g.drawImage(overlayImage, (imageSize.width - overlayImageSize.width) / 2, 10, this);
|
||||
} else if (set != null) {
|
||||
|
@ -136,6 +152,15 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
return textOffsetX;
|
||||
}
|
||||
|
||||
private int calculateOffsetForTop(Graphics2D g2d, String text) {
|
||||
if (topTextOffsetX == -1) { // calculate once
|
||||
FontRenderContext frc = g2d.getFontRenderContext();
|
||||
int textWidth = (int) textFont.getStringBounds(text, frc).getWidth();
|
||||
topTextOffsetX = (imageSize.width - textWidth) / 2;
|
||||
}
|
||||
return topTextOffsetX;
|
||||
}
|
||||
|
||||
public void setTextColor(Color textColor) {
|
||||
this.textColor = textColor;
|
||||
}
|
||||
|
@ -242,4 +267,8 @@ public class HoverButton extends JPanel implements MouseListener {
|
|||
observer.execute();
|
||||
}
|
||||
}
|
||||
|
||||
public void setTopText(String topText) {
|
||||
this.topText = topText;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -102,12 +102,12 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (--timeout > 0) {
|
||||
setTimeout(Integer.toString(timeout));
|
||||
setTimeout(timeout);
|
||||
}
|
||||
else {
|
||||
if (updateDeckTask != null)
|
||||
updateDeckTask.cancel(true);
|
||||
setTimeout("0");
|
||||
setTimeout(0);
|
||||
countdown.stop();
|
||||
hideDeckEditor();
|
||||
}
|
||||
|
@ -136,7 +136,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
this.deckArea.showSideboard(false);
|
||||
countdown.stop();
|
||||
this.timeout = time;
|
||||
setTimeout(Integer.toString(timeout));
|
||||
setTimeout(timeout);
|
||||
if (timeout != 0) {
|
||||
countdown.start();
|
||||
if (updateDeckTask == null || updateDeckTask.isDone()) {
|
||||
|
@ -308,7 +308,20 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
|||
}
|
||||
}
|
||||
|
||||
private void setTimeout(String text) {
|
||||
private void setTimeout(int s){
|
||||
int minute = s/60;
|
||||
int second = s - (minute*60);
|
||||
String text;
|
||||
if(minute < 10){
|
||||
text = "0" + Integer.toString(minute) + ":";
|
||||
}else{
|
||||
text = Integer.toString(minute) + ":";
|
||||
}
|
||||
if(second < 10){
|
||||
text = text + "0" + Integer.toString(second);
|
||||
}else{
|
||||
text = text + Integer.toString(second);
|
||||
}
|
||||
this.txtTimeRemaining.setText(text);
|
||||
}
|
||||
|
||||
|
|
|
@ -25,41 +25,49 @@
|
|||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="16" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="lbDeckType" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblGameType" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblName" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="30" max="-2" attributes="0"/>
|
||||
<Component id="lbDeckType" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="cbGameType" min="-2" pref="398" max="-2" attributes="1"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="lblFreeMulligans" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spnFreeMulligans" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="9" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Component id="cbDeckType" alignment="0" max="32767" attributes="1"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="cbGameType" min="-2" pref="398" max="-2" attributes="1"/>
|
||||
<Component id="txtName" min="-2" pref="546" max="-2" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="cbDeckType" max="32767" attributes="1"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="lbTimeLimit" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="lblFreeMulligans" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spnFreeMulligans" pref="50" max="32767" attributes="0"/>
|
||||
<Component id="cbTimeLimit" min="-2" pref="126" max="-2" attributes="1"/>
|
||||
</Group>
|
||||
<Component id="txtName" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="29" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="btnOK" min="-2" max="-2" attributes="0"/>
|
||||
|
@ -88,6 +96,7 @@
|
|||
</Group>
|
||||
</Group>
|
||||
<Component id="jSeparator2" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="player1Panel" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="pnlOtherPlayers" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="jSeparator1" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
|
@ -98,7 +107,7 @@
|
|||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jSeparator3" pref="625" max="32767" attributes="0"/>
|
||||
<Component id="jSeparator3" pref="633" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
|
@ -107,17 +116,19 @@
|
|||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="txtName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="lbDeckType" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cbDeckType" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblName" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="txtName" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="cbDeckType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cbTimeLimit" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lbDeckType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lbTimeLimit" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
|
||||
<Component id="spnFreeMulligans" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
|
@ -157,10 +168,12 @@
|
|||
<Component id="jSeparator2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="player1Panel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="pnlOtherPlayers" pref="205" max="32767" attributes="0"/>
|
||||
<Component id="pnlOtherPlayers" pref="181" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jSeparator1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
|
@ -174,7 +187,7 @@
|
|||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="201" max="-2" attributes="0"/>
|
||||
<Component id="jSeparator3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="248" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="252" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
|
@ -198,6 +211,14 @@
|
|||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbDeckType">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lbTimeLimit">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Time Limit:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="The activie time a player may use to finish the match. If the time runs out, the player looses the current game."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbTimeLimit">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblGameType">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Game Type:"/>
|
||||
|
@ -211,6 +232,7 @@
|
|||
<Component class="javax.swing.JLabel" name="lblFreeMulligans">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Free Mulligans:"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="The number of mulligans a player can use without decreasing the number of drawn cards."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnFreeMulligans">
|
||||
|
@ -264,6 +286,7 @@
|
|||
<ComponentRef name="spnNumWins"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="Wins"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value="How many games has a player to win to win the match."/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JSpinner" name="spnNumWins">
|
||||
|
@ -281,6 +304,8 @@
|
|||
<Property name="text" type="java.lang.String" value="Player 1 (You)"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="mage.client.table.NewPlayerPanel" name="player1Panel">
|
||||
</Component>
|
||||
<Component class="javax.swing.JSeparator" name="jSeparator3">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
|
|
|
@ -27,21 +27,23 @@
|
|||
*/
|
||||
package mage.client.dialog;
|
||||
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.swing.*;
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import javax.swing.DefaultComboBoxModel;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SpinnerNumberModel;
|
||||
import mage.cards.decks.importer.DeckImporterUtil;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.components.MageComponents;
|
||||
import mage.client.table.*;
|
||||
import mage.client.table.TablePlayerPanel;
|
||||
import mage.client.util.Event;
|
||||
import mage.client.util.Listener;
|
||||
import mage.constants.MatchTimeLimit;
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.game.match.MatchOptions;
|
||||
import mage.remote.Session;
|
||||
import mage.view.GameTypeView;
|
||||
|
@ -85,6 +87,8 @@ public class NewTableDialog extends MageDialog {
|
|||
txtName = new javax.swing.JTextField();
|
||||
lbDeckType = new javax.swing.JLabel();
|
||||
cbDeckType = new javax.swing.JComboBox();
|
||||
lbTimeLimit = new javax.swing.JLabel();
|
||||
cbTimeLimit = new javax.swing.JComboBox();
|
||||
lblGameType = new javax.swing.JLabel();
|
||||
cbGameType = new javax.swing.JComboBox();
|
||||
lblFreeMulligans = new javax.swing.JLabel();
|
||||
|
@ -114,6 +118,9 @@ public class NewTableDialog extends MageDialog {
|
|||
|
||||
lbDeckType.setText("Deck Type:");
|
||||
|
||||
lbTimeLimit.setText("Time Limit:");
|
||||
lbTimeLimit.setToolTipText("The activie time a player may use to finish the match. If the time runs out, the player looses the current game.");
|
||||
|
||||
lblGameType.setText("Game Type:");
|
||||
|
||||
cbGameType.addActionListener(new java.awt.event.ActionListener() {
|
||||
|
@ -123,6 +130,7 @@ public class NewTableDialog extends MageDialog {
|
|||
});
|
||||
|
||||
lblFreeMulligans.setText("Free Mulligans:");
|
||||
lblFreeMulligans.setToolTipText("The number of mulligans a player can use without decreasing the number of drawn cards.");
|
||||
|
||||
lblNumPlayers.setLabelFor(spnNumPlayers);
|
||||
lblNumPlayers.setText("Players");
|
||||
|
@ -141,6 +149,7 @@ public class NewTableDialog extends MageDialog {
|
|||
|
||||
lblNumWins.setLabelFor(spnNumWins);
|
||||
lblNumWins.setText("Wins");
|
||||
lblNumWins.setToolTipText("How many games has a player to win to win the match.");
|
||||
|
||||
spnNumWins.addChangeListener(new javax.swing.event.ChangeListener() {
|
||||
public void stateChanged(javax.swing.event.ChangeEvent evt) {
|
||||
|
@ -177,33 +186,39 @@ public class NewTableDialog extends MageDialog {
|
|||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jLabel1))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jLabel2))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(16, 16, 16)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(lbDeckType)
|
||||
.addComponent(lblGameType)
|
||||
.addComponent(lblName))
|
||||
.addComponent(lblName)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(30, 30, 30)
|
||||
.addComponent(lbDeckType)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, 398, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(lblFreeMulligans)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(0, 9, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addComponent(cbDeckType, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, 398, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 546, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(cbDeckType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(lbTimeLimit)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(lblFreeMulligans)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spnFreeMulligans, javax.swing.GroupLayout.DEFAULT_SIZE, 50, Short.MAX_VALUE))
|
||||
.addComponent(txtName))))
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addComponent(cbTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, 126, javax.swing.GroupLayout.PREFERRED_SIZE))))))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(btnOK)
|
||||
|
@ -233,27 +248,30 @@ public class NewTableDialog extends MageDialog {
|
|||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 625, Short.MAX_VALUE)
|
||||
.addComponent(jSeparator3, javax.swing.GroupLayout.DEFAULT_SIZE, 633, Short.MAX_VALUE)
|
||||
.addContainerGap()))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(lblName)
|
||||
.addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(lbDeckType)
|
||||
.addComponent(cbDeckType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblGameType)
|
||||
.addComponent(cbDeckType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(cbTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lbDeckType)
|
||||
.addComponent(lbTimeLimit))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblFreeMulligans)))
|
||||
.addComponent(lblFreeMulligans))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(cbGameType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblGameType)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
|
@ -282,7 +300,7 @@ public class NewTableDialog extends MageDialog {
|
|||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 140, Short.MAX_VALUE)
|
||||
.addComponent(pnlOtherPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 181, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
|
@ -294,7 +312,7 @@ public class NewTableDialog extends MageDialog {
|
|||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(201, 201, 201)
|
||||
.addComponent(jSeparator3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap(240, Short.MAX_VALUE)))
|
||||
.addContainerGap(252, Short.MAX_VALUE)))
|
||||
);
|
||||
|
||||
pack();
|
||||
|
@ -315,6 +333,7 @@ public class NewTableDialog extends MageDialog {
|
|||
}
|
||||
options.setDeckType((String) this.cbDeckType.getSelectedItem());
|
||||
options.setLimited(false);
|
||||
options.setMatchTimeLimit((MatchTimeLimit) this.cbTimeLimit.getSelectedItem());
|
||||
options.setAttackOption((MultiplayerAttackOption) this.cbAttackOption.getSelectedItem());
|
||||
options.setRange((RangeOfInfluence) this.cbRange.getSelectedItem());
|
||||
options.setWinsNeeded((Integer)this.spnNumWins.getValue());
|
||||
|
@ -422,6 +441,7 @@ public class NewTableDialog extends MageDialog {
|
|||
cbGameType.setModel(new DefaultComboBoxModel(session.getGameTypes().toArray()));
|
||||
cbDeckType.setModel(new DefaultComboBoxModel(session.getDeckTypes()));
|
||||
selectLimitedByDefault();
|
||||
cbTimeLimit.setModel(new DefaultComboBoxModel(MatchTimeLimit.values()));
|
||||
cbRange.setModel(new DefaultComboBoxModel(RangeOfInfluence.values()));
|
||||
cbAttackOption.setModel(new DefaultComboBoxModel(MultiplayerAttackOption.values()));
|
||||
|
||||
|
@ -464,13 +484,19 @@ public class NewTableDialog extends MageDialog {
|
|||
break;
|
||||
}
|
||||
}
|
||||
int timeLimit = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_TIME_LIMIT, "1500"));
|
||||
for (MatchTimeLimit mtl :MatchTimeLimit.values()) {
|
||||
if (mtl.getTimeLimit() == timeLimit) {
|
||||
this.cbTimeLimit.setSelectedItem(mtl);
|
||||
break;
|
||||
}
|
||||
}
|
||||
cbDeckType.setSelectedItem(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_DECK_TYPE, "Limited"));
|
||||
String deckFile = PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_DECK_FILE, null);
|
||||
if (deckFile != null) {
|
||||
this.player1Panel.setDeckFile(deckFile);
|
||||
}
|
||||
this.spnNumWins.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_WINS, "2")));
|
||||
this.spnFreeMulligans.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_FREE_MULLIGANS, "0")));
|
||||
this.spnNumPlayers.setValue(Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_PLAYERS, "2")));
|
||||
int range = Integer.parseInt(PreferencesDialog.getCachedValue(PreferencesDialog.KEY_NEW_TABLE_RANGE, "1"));
|
||||
for (RangeOfInfluence roi :RangeOfInfluence.values()) {
|
||||
|
@ -497,9 +523,9 @@ public class NewTableDialog extends MageDialog {
|
|||
private void saveGameSettingsToPrefs(MatchOptions options, String deckFile) {
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NAME, options.getName());
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_DECK_TYPE, options.getDeckType());
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_TIME_LIMIT, Integer.toString(options.getPriorityTime()));
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_GAME_TYPE, options.getGameType());
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_WINS, Integer.toString(options.getWinsNeeded()));
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_OF_FREE_MULLIGANS, Integer.toString(options.getFreeMulligans()));
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_DECK_FILE, deckFile);
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_NUMBER_PLAYERS, spnNumPlayers.getValue().toString());
|
||||
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TABLE_RANGE, Integer.toString(options.getRange().getRange()));
|
||||
|
@ -513,12 +539,14 @@ public class NewTableDialog extends MageDialog {
|
|||
private javax.swing.JComboBox cbDeckType;
|
||||
private javax.swing.JComboBox cbGameType;
|
||||
private javax.swing.JComboBox cbRange;
|
||||
private javax.swing.JComboBox cbTimeLimit;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
private javax.swing.JSeparator jSeparator1;
|
||||
private javax.swing.JSeparator jSeparator2;
|
||||
private javax.swing.JSeparator jSeparator3;
|
||||
private javax.swing.JLabel lbDeckType;
|
||||
private javax.swing.JLabel lbTimeLimit;
|
||||
private javax.swing.JLabel lblAttack;
|
||||
private javax.swing.JLabel lblFreeMulligans;
|
||||
private javax.swing.JLabel lblGameType;
|
||||
|
@ -534,4 +562,4 @@ public class NewTableDialog extends MageDialog {
|
|||
private javax.swing.JTextField txtName;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,54 +27,57 @@
|
|||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jPanel1" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="pnlPacks" alignment="1" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="lblName" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="txtName" max="32767" attributes="0"/>
|
||||
<Component id="cbTournamentType" pref="330" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="lblFreeMulligans" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spnFreeMulligans" max="32767" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="lblNumWins" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
|
||||
<Component id="lblConstructionTime" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="spnConstructTime" pref="48" max="32767" attributes="0"/>
|
||||
<Component id="spnNumWins" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="btnOk" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="btnCancel" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spnNumPlayers" min="-2" pref="45" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="pnlDraftOptions" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" alignment="0" groupAlignment="1" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spnNumPlayers" min="-2" pref="45" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="pnlDraftOptions" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jLabel5" alignment="0" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="lblName" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="txtName" min="-2" pref="233" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="lbTimeLimit" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="cbTimeLimit" pref="115" max="32767" attributes="1"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="cbTournamentType" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="lblConstructionTime" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spnConstructTime" min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="lblFreeMulligans" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="spnFreeMulligans" min="-2" pref="40" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="lblNumWins" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="spnNumWins" min="-2" pref="41" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
|
@ -85,39 +88,30 @@
|
|||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="txtName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cbTournamentType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblConstructionTime" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spnConstructTime" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="spnNumWins" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblNumWins" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spnFreeMulligans" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblFreeMulligans" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="txtName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lbTimeLimit" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cbTimeLimit" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblConstructionTime" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spnConstructTime" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="cbTournamentType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblFreeMulligans" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spnFreeMulligans" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblNumWins" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="spnNumWins" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
<Component id="pnlPacks" pref="65" max="32767" attributes="0"/>
|
||||
<Component id="pnlPacks" pref="62" max="32767" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="spnNumPlayers" alignment="0" pref="28" max="32767" attributes="1"/>
|
||||
<Component id="spnNumPlayers" alignment="0" pref="25" max="32767" attributes="1"/>
|
||||
<Component id="pnlDraftOptions" max="32767" attributes="1"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
@ -140,6 +134,13 @@
|
|||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtName">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lbTimeLimit">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Time Limit:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JComboBox" name="cbTimeLimit">
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblConstructionTime">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Construction Time (Minutes):"/>
|
||||
|
@ -233,7 +234,7 @@
|
|||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jLabel4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="txtPlayer1Name" pref="638" max="32767" attributes="0"/>
|
||||
<Component id="txtPlayer1Name" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" max="-2" attributes="0"/>
|
||||
|
|
|
@ -41,12 +41,13 @@ import javax.swing.DefaultComboBoxModel;
|
|||
import javax.swing.JComboBox;
|
||||
import javax.swing.JOptionPane;
|
||||
import javax.swing.SpinnerNumberModel;
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.cards.Sets;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.table.TournamentPlayerPanel;
|
||||
import mage.constants.MatchTimeLimit;
|
||||
import mage.constants.MultiplayerAttackOption;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.game.draft.DraftOptions;
|
||||
import mage.game.draft.DraftOptions.TimingOption;
|
||||
import mage.game.tournament.LimitedOptions;
|
||||
|
@ -86,6 +87,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
session = MageFrame.getSession();
|
||||
this.txtPlayer1Name.setText(session.getUserName());
|
||||
cbTournamentType.setModel(new DefaultComboBoxModel(session.getTournamentTypes().toArray()));
|
||||
cbTimeLimit.setModel(new DefaultComboBoxModel(MatchTimeLimit.values()));
|
||||
cbDraftTiming.setModel(new DefaultComboBoxModel(DraftOptions.TimingOption.values()));
|
||||
this.setModal(true);
|
||||
setTournamentOptions();
|
||||
|
@ -104,6 +106,8 @@ public class NewTournamentDialog extends MageDialog {
|
|||
|
||||
lblName = new javax.swing.JLabel();
|
||||
txtName = new javax.swing.JTextField();
|
||||
lbTimeLimit = new javax.swing.JLabel();
|
||||
cbTimeLimit = new javax.swing.JComboBox();
|
||||
lblConstructionTime = new javax.swing.JLabel();
|
||||
spnConstructTime = new javax.swing.JSpinner();
|
||||
jLabel1 = new javax.swing.JLabel();
|
||||
|
@ -131,6 +135,8 @@ public class NewTournamentDialog extends MageDialog {
|
|||
|
||||
lblName.setText("Name:");
|
||||
|
||||
lbTimeLimit.setText("Time Limit:");
|
||||
|
||||
lblConstructionTime.setText("Construction Time (Minutes):");
|
||||
|
||||
jLabel1.setText("Tournament Type:");
|
||||
|
@ -198,7 +204,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel1Layout.createSequentialGroup()
|
||||
.addComponent(jLabel4)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(txtPlayer1Name, javax.swing.GroupLayout.DEFAULT_SIZE, 638, Short.MAX_VALUE)))
|
||||
.addComponent(txtPlayer1Name)))
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel1Layout.setVerticalGroup(
|
||||
|
@ -247,76 +253,76 @@ public class NewTournamentDialog extends MageDialog {
|
|||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(pnlPacks, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(lblName)
|
||||
.addComponent(jLabel1))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(txtName)
|
||||
.addComponent(cbTournamentType, 0, 330, Short.MAX_VALUE))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(lblFreeMulligans)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spnFreeMulligans)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(lblNumWins))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGap(19, 19, 19)
|
||||
.addComponent(lblConstructionTime)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(spnConstructTime, javax.swing.GroupLayout.DEFAULT_SIZE, 48, Short.MAX_VALUE)
|
||||
.addComponent(spnNumWins)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(0, 0, Short.MAX_VALUE)
|
||||
.addComponent(btnOk)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(btnCancel))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spnNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(pnlDraftOptions, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING))
|
||||
.addGap(0, 0, Short.MAX_VALUE)))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel2)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spnNumPlayers, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(pnlDraftOptions, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addComponent(lblName)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, 233, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(lbTimeLimit)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(cbTimeLimit, 0, 115, Short.MAX_VALUE))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(cbTournamentType, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(lblConstructionTime)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spnConstructTime, javax.swing.GroupLayout.PREFERRED_SIZE, 50, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, Short.MAX_VALUE))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(lblFreeMulligans)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(lblNumWins)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))))))
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblName))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(lblConstructionTime)
|
||||
.addComponent(spnConstructTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblNumWins)
|
||||
.addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblFreeMulligans))))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblName)
|
||||
.addComponent(lbTimeLimit)
|
||||
.addComponent(cbTimeLimit, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblConstructionTime)
|
||||
.addComponent(spnConstructTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(jLabel1)
|
||||
.addComponent(cbTournamentType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblFreeMulligans)
|
||||
.addComponent(spnFreeMulligans, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblNumWins)
|
||||
.addComponent(spnNumWins, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel5)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(pnlPacks, javax.swing.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
|
||||
.addComponent(pnlPacks, javax.swing.GroupLayout.DEFAULT_SIZE, 62, Short.MAX_VALUE)
|
||||
.addGap(11, 11, 11)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(spnNumPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 28, Short.MAX_VALUE)
|
||||
.addComponent(spnNumPlayers, javax.swing.GroupLayout.DEFAULT_SIZE, 25, Short.MAX_VALUE)
|
||||
.addComponent(pnlDraftOptions, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jLabel2))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
|
@ -351,12 +357,13 @@ public class NewTournamentDialog extends MageDialog {
|
|||
if (tournamentType.isLimited()) {
|
||||
if (tOptions.getLimitedOptions() == null) {
|
||||
tOptions.setLimitedOptions(new LimitedOptions());
|
||||
tOptions.getLimitedOptions().setConstructionTime((Integer)this.spnConstructTime.getValue());
|
||||
tOptions.getLimitedOptions().setConstructionTime((Integer)this.spnConstructTime.getValue() * 60);
|
||||
}
|
||||
for (JComboBox pack: packs) {
|
||||
tOptions.getLimitedOptions().getSetCodes().add(((ExpansionSet) pack.getSelectedItem()).getCode());
|
||||
}
|
||||
}
|
||||
tOptions.getMatchOptions().setMatchTimeLimit((MatchTimeLimit) this.cbTimeLimit.getSelectedItem());
|
||||
tOptions.getMatchOptions().setDeckType("Limited");
|
||||
tOptions.getMatchOptions().setWinsNeeded((Integer)this.spnNumWins.getValue());
|
||||
tOptions.getMatchOptions().setFreeMulligans((Integer)this.spnFreeMulligans.getValue());
|
||||
|
@ -512,6 +519,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
private javax.swing.JButton btnCancel;
|
||||
private javax.swing.JButton btnOk;
|
||||
private javax.swing.JComboBox cbDraftTiming;
|
||||
private javax.swing.JComboBox cbTimeLimit;
|
||||
private javax.swing.JComboBox cbTournamentType;
|
||||
private javax.swing.JLabel jLabel1;
|
||||
private javax.swing.JLabel jLabel2;
|
||||
|
@ -520,6 +528,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
private javax.swing.JLabel jLabel5;
|
||||
private javax.swing.JLabel jLabel6;
|
||||
private javax.swing.JPanel jPanel1;
|
||||
private javax.swing.JLabel lbTimeLimit;
|
||||
private javax.swing.JLabel lblConstructionTime;
|
||||
private javax.swing.JLabel lblFreeMulligans;
|
||||
private javax.swing.JLabel lblName;
|
||||
|
|
|
@ -92,6 +92,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
// default setting for new table dialog
|
||||
public static final String KEY_NEW_TABLE_NAME = "newTableName";
|
||||
public static final String KEY_NEW_TABLE_DECK_TYPE = "newTableDeckType";
|
||||
public static final String KEY_NEW_TABLE_TIME_LIMIT = "newTableTimeLimit";
|
||||
public static final String KEY_NEW_TABLE_GAME_TYPE = "newTableGameType";
|
||||
public static final String KEY_NEW_TABLE_NUMBER_OF_WINS = "newTableNumberOfWins";
|
||||
public static final String KEY_NEW_TABLE_NUMBER_OF_FREE_MULLIGANS = "newTableNumberOfFreeMulligans";
|
||||
|
@ -154,24 +155,18 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
private final JFileChooser fc_i = new JFileChooser();
|
||||
{
|
||||
fc_i.setAcceptAllFileFilterUsed(false);
|
||||
fc_i.addChoosableFileFilter(new ImageFileFilter(".jpg"));
|
||||
fc_i.addChoosableFileFilter(new ImageFileFilter(".jpeg"));
|
||||
fc_i.addChoosableFileFilter(new ImageFileFilter(".png"));
|
||||
fc_i.addChoosableFileFilter(new ImageFileFilter(".bmp"));
|
||||
fc_i.addChoosableFileFilter(new ImageFileFilter());
|
||||
}
|
||||
|
||||
private static class ImageFileFilter extends FileFilter{
|
||||
String extend;
|
||||
public ImageFileFilter(String extend){
|
||||
this.extend = extend;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean accept(File f) {
|
||||
String filename = f.getName();
|
||||
if(f.isDirectory()) return true;
|
||||
if(filename != null){
|
||||
if(filename.endsWith(extend)){
|
||||
if(filename.endsWith(".jpg") || filename.endsWith(".jpeg") ||
|
||||
filename.endsWith(".png") || filename.endsWith(".bmp")){
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -180,13 +175,8 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
if(extend.equals(".png") || extend.equals(".bmp"))
|
||||
return "Image File(*.png, *.bmp)";
|
||||
if(extend.equals(".jpg") || extend.equals(".jpg"))
|
||||
return "JEGP file(*.jpg,*.jepg)";
|
||||
return "";
|
||||
}
|
||||
|
||||
return "*.png | *.bmp |*.jpg | *.jpeg";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -49,6 +49,7 @@ import java.util.List;
|
|||
import java.util.UUID;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import mage.client.util.AudioManager;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -392,6 +393,7 @@ class UpdateSeatsTask extends SwingWorker<Void, TableView> {
|
|||
if (count > 0) {
|
||||
if (current > count) {
|
||||
MageTray.getInstance().displayMessage("New player joined your game.");
|
||||
AudioManager.playPlayerJoinedTable();
|
||||
} else {
|
||||
MageTray.getInstance().displayMessage("A player left your game.");
|
||||
}
|
||||
|
|
|
@ -78,10 +78,10 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
if (--timeout > 0) {
|
||||
setTimeout(Integer.toString(timeout));
|
||||
setTimeout(timeout);
|
||||
}
|
||||
else {
|
||||
setTimeout("0");
|
||||
setTimeout(0);
|
||||
countdown.stop();
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,6 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
SimpleCardView source = (SimpleCardView) event.getSource();
|
||||
DraftPickView view = session.sendCardPick(draftId, source.getId());
|
||||
if (view != null) {
|
||||
//draftBooster.loadBooster(view.getBooster(), bigCard);
|
||||
draftBooster.loadBooster(emptyView, bigCard);
|
||||
draftPicks.loadCards(CardsViewUtil.convertSimple(view.getPicks()), bigCard, null);
|
||||
Plugins.getInstance().getActionCallback().hidePopup();
|
||||
|
@ -132,13 +131,26 @@ public class DraftPanel extends javax.swing.JPanel {
|
|||
setMessage("Pick a card");
|
||||
countdown.stop();
|
||||
this.timeout = draftPickView.getTimeout();
|
||||
setTimeout(Integer.toString(timeout));
|
||||
setTimeout(timeout);
|
||||
if (timeout != 0) {
|
||||
countdown.start();
|
||||
}
|
||||
}
|
||||
|
||||
private void setTimeout(String text) {
|
||||
|
||||
private void setTimeout(int s){
|
||||
int minute = s/60;
|
||||
int second = s - (minute*60);
|
||||
String text;
|
||||
if(minute < 10){
|
||||
text = "0" + Integer.toString(minute) + ":";
|
||||
}else{
|
||||
text = Integer.toString(minute) + ":";
|
||||
}
|
||||
if(second < 10){
|
||||
text = text + "0" + Integer.toString(second);
|
||||
}else{
|
||||
text = text + Integer.toString(second);
|
||||
}
|
||||
this.txtTimeRemaining.setText(text);
|
||||
}
|
||||
|
||||
|
|
|
@ -353,7 +353,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
}
|
||||
}
|
||||
PlayerView player = game.getPlayers().get(playerSeat);
|
||||
PlayAreaPanel sessionPlayer = new PlayAreaPanel(player, bigCard, gameId, true);
|
||||
PlayAreaPanel sessionPlayer = new PlayAreaPanel(player, bigCard, gameId, true, game.getPriorityTime());
|
||||
players.put(player.getPlayerId(), sessionPlayer);
|
||||
GridBagConstraints c = new GridBagConstraints();
|
||||
c.fill = GridBagConstraints.BOTH;
|
||||
|
@ -385,7 +385,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
col = numColumns - 1;
|
||||
}
|
||||
player = game.getPlayers().get(playerNum);
|
||||
PlayAreaPanel playerPanel = new PlayAreaPanel(player, bigCard, gameId, false);
|
||||
PlayAreaPanel playerPanel = new PlayAreaPanel(player, bigCard, gameId, false, game.getPriorityTime());
|
||||
players.put(player.getPlayerId(), playerPanel);
|
||||
c = new GridBagConstraints();
|
||||
c.fill = GridBagConstraints.BOTH;
|
||||
|
|
|
@ -64,9 +64,9 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
addPopupMenu();
|
||||
}
|
||||
|
||||
public PlayAreaPanel(PlayerView player, BigCard bigCard, UUID gameId, boolean me) {
|
||||
public PlayAreaPanel(PlayerView player, BigCard bigCard, UUID gameId, boolean me, int priorityTime) {
|
||||
this();
|
||||
init(player, bigCard, gameId);
|
||||
init(player, bigCard, gameId, priorityTime);
|
||||
update(player);
|
||||
}
|
||||
|
||||
|
@ -99,8 +99,8 @@ public class PlayAreaPanel extends javax.swing.JPanel {
|
|||
});
|
||||
}
|
||||
|
||||
public final void init(PlayerView player, BigCard bigCard, UUID gameId) {
|
||||
this.playerPanel.init(gameId, player.getPlayerId(), bigCard);
|
||||
public final void init(PlayerView player, BigCard bigCard, UUID gameId, int priorityTime) {
|
||||
this.playerPanel.init(gameId, player.getPlayerId(), bigCard, priorityTime);
|
||||
this.battlefieldPanel.init(gameId, bigCard);
|
||||
this.gameId = gameId;
|
||||
if (MageFrame.getSession().isTestMode()) {
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
|
||||
package mage.client.game;
|
||||
|
||||
import mage.MageException;
|
||||
import mage.cards.MageCard;
|
||||
import mage.cards.action.ActionCallback;
|
||||
import mage.cards.decks.importer.DckDeckImporter;
|
||||
|
@ -52,6 +53,7 @@ import mage.client.util.ImageHelper;
|
|||
import mage.client.util.gui.BufferedImageBuilder;
|
||||
import mage.components.ImagePanel;
|
||||
import mage.remote.Session;
|
||||
import mage.utils.timer.PriorityTimer;
|
||||
import mage.view.CardView;
|
||||
import mage.view.ManaPoolView;
|
||||
import mage.view.PlayerView;
|
||||
|
@ -101,19 +103,43 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
|
||||
private int avatarId = -1;
|
||||
|
||||
private PriorityTimer timer;
|
||||
|
||||
/** Creates new form PlayerPanel */
|
||||
public PlayerPanelExt() {
|
||||
setPreferredSize(new Dimension(PANEL_WIDTH, PANEL_HEIGHT));
|
||||
initComponents();
|
||||
}
|
||||
|
||||
public void init(UUID gameId, UUID playerId, BigCard bigCard) {
|
||||
public void init(UUID gameId, UUID playerId, BigCard bigCard, int priorityTime) {
|
||||
this.gameId = gameId;
|
||||
this.playerId = playerId;
|
||||
this.bigCard = bigCard;
|
||||
session = MageFrame.getSession();
|
||||
cheat.setVisible(session.isTestMode());
|
||||
cheat.setFocusable(false);
|
||||
|
||||
if (priorityTime > 0) {
|
||||
long delay = 1000L;
|
||||
|
||||
timer = new PriorityTimer(priorityTime, delay, new mage.interfaces.Action() {
|
||||
@Override
|
||||
public void execute() throws MageException {
|
||||
// do nothing
|
||||
}
|
||||
});
|
||||
final PriorityTimer pt = timer;
|
||||
timer.setTaskOnTick(new mage.interfaces.Action() {
|
||||
@Override
|
||||
public void execute() throws MageException {
|
||||
int priorityTimeValue = pt.getCount();
|
||||
String text = getPriorityTimeLeftString(priorityTimeValue);
|
||||
PlayerPanelExt.this.avatar.setTopText(text);
|
||||
PlayerPanelExt.this.avatar.repaint();
|
||||
}
|
||||
});
|
||||
timer.init();
|
||||
}
|
||||
}
|
||||
|
||||
public void update(PlayerView player) {
|
||||
|
@ -182,6 +208,19 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
}
|
||||
}
|
||||
this.avatar.setText(player.getName());
|
||||
if (this.timer != null) {
|
||||
if (player.getPriorityTimeLeft() != Integer.MAX_VALUE) {
|
||||
String priorityTimeValue = getPriorityTimeLeftString(player);
|
||||
this.timer.setCount(player.getPriorityTimeLeft());
|
||||
this.avatar.setTopText(priorityTimeValue);
|
||||
}
|
||||
if (player.hasPriority()) {
|
||||
this.timer.resume();
|
||||
} else {
|
||||
this.timer.pause();
|
||||
}
|
||||
}
|
||||
|
||||
this.btnPlayer.setText(player.getName());
|
||||
if (player.isActive()) {
|
||||
this.avatar.setBorder(greenBorder);
|
||||
|
@ -193,6 +232,7 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
this.avatar.setBorder(emptyBorder);
|
||||
this.btnPlayer.setBorder(emptyBorder);
|
||||
}
|
||||
|
||||
|
||||
synchronized (this) {
|
||||
if (player.getTopCard() != null) {
|
||||
|
@ -216,6 +256,18 @@ public class PlayerPanelExt extends javax.swing.JPanel {
|
|||
update(player.getManaPool());
|
||||
}
|
||||
|
||||
private String getPriorityTimeLeftString(PlayerView player) {
|
||||
int priorityTimeLeft = player.getPriorityTimeLeft();
|
||||
return getPriorityTimeLeftString(priorityTimeLeft);
|
||||
}
|
||||
|
||||
private String getPriorityTimeLeftString(int priorityTimeLeft) {
|
||||
int h = priorityTimeLeft / 3600;
|
||||
int m = (priorityTimeLeft % 3600) / 60;
|
||||
int s = priorityTimeLeft % 60;
|
||||
return (h < 10 ? "0" : "") + h + ":" + (m < 10 ? "0" : "") + m + ":" + (s < 10 ? "0" : "") + s;
|
||||
}
|
||||
|
||||
protected void update(ManaPoolView pool) {
|
||||
manaLabels.get("B").setText(Integer.toString(pool.getBlack()));
|
||||
manaLabels.get("R").setText(Integer.toString(pool.getRed()));
|
||||
|
|
|
@ -19,11 +19,7 @@
|
|||
<Component id="jPanel1" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="jSplitPane1" alignment="0" pref="848" max="32767" attributes="0"/>
|
||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="jPanel2" pref="809" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="99" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jPanel2" alignment="1" pref="908" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
@ -128,13 +124,12 @@
|
|||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="jButton1" min="-2" pref="65" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel2" max="32767" attributes="0"/>
|
||||
<Component id="jLabel2" pref="701" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="440" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
|
@ -422,7 +422,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
|
||||
jPanel2.setPreferredSize(new java.awt.Dimension(664, 39));
|
||||
|
||||
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11));
|
||||
jLabel1.setFont(new java.awt.Font("Tahoma", 1, 11)); // NOI18N
|
||||
jLabel1.setText("Message of the Day:");
|
||||
jLabel1.setAlignmentY(0.3F);
|
||||
|
||||
|
@ -443,13 +443,12 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
jPanel2Layout.setHorizontalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(jPanel2Layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel1)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jLabel2, 449, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(440, 440, 440))
|
||||
.addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 701, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
jPanel2Layout.setVerticalGroup(
|
||||
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
@ -486,7 +485,7 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
jPanel3.setLayout(jPanel3Layout);
|
||||
jPanel3Layout.setHorizontalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 743, Short.MAX_VALUE)
|
||||
.addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 803, Short.MAX_VALUE)
|
||||
);
|
||||
jPanel3Layout.setVerticalGroup(
|
||||
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
|
@ -502,21 +501,18 @@ public class TablesPanel extends javax.swing.JPanel {
|
|||
.addComponent(jPanel1, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 848, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, 779, Short.MAX_VALUE)
|
||||
.addContainerGap(69, Short.MAX_VALUE)))
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 908, Short.MAX_VALUE))
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(jSplitPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 501, Short.MAX_VALUE)
|
||||
.addComponent(jSplitPane1)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 576, Short.MAX_VALUE))
|
||||
.addGap(0, 580, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
|
|
|
@ -1,6 +1,11 @@
|
|||
<?xml version="1.1" encoding="UTF-8" ?>
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JPanelFormInfo">
|
||||
<Properties>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[908, 580]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/>
|
||||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/>
|
||||
|
@ -16,59 +21,233 @@
|
|||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jScrollPane1" pref="573" max="32767" attributes="2"/>
|
||||
<Component id="jScrollPane2" alignment="1" pref="573" max="32767" attributes="2"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="chatPanel1" min="-2" pref="215" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="actionPanel" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="jSplitPane2" alignment="1" pref="908" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jScrollPane1" min="-2" pref="262" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="0" max="-2" attributes="0"/>
|
||||
<Component id="jScrollPane2" pref="260" max="32767" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="actionPanel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jSplitPane2" pref="489" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="chatPanel1" alignment="0" pref="522" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="mage.client.chat.ChatPanel" name="chatPanel1">
|
||||
</Component>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
<Container class="javax.swing.JPanel" name="actionPanel">
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="lblName" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblType" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Component id="txtName" pref="260" max="32767" attributes="0"/>
|
||||
<Component id="txtType" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="lablEndTime" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="txtEndTime" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="lblStartTime" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="txtStartTime" min="-2" pref="140" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="btnCloseWindow" min="-2" pref="129" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblName" alignment="3" min="-2" pref="23" max="-2" attributes="0"/>
|
||||
<Component id="txtName" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lblStartTime" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="txtStartTime" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="9" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="lblType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="txtType" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="lablEndTime" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="txtEndTime" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="btnCloseWindow" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="0" pref="14" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTable" name="tablePlayers">
|
||||
<Component class="javax.swing.JLabel" name="lblName">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="this.playersModel" type="code"/>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="text" type="java.lang.String" value="Name:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtName">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="text" type="java.lang.String" value="tournament name"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[50, 22]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblType">
|
||||
<Properties>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="text" type="java.lang.String" value="Type:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtType">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="2"/>
|
||||
<Property name="text" type="java.lang.String" value="tournament type"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lblStartTime">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Start time:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtStartTime">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="jTextField1"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="lablEndTime">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="End time:"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JTextField" name="txtEndTime">
|
||||
<Properties>
|
||||
<Property name="editable" type="boolean" value="false"/>
|
||||
<Property name="horizontalAlignment" type="int" value="0"/>
|
||||
<Property name="text" type="java.lang.String" value="jTextField2"/>
|
||||
<Property name="focusable" type="boolean" value="false"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
<Component class="javax.swing.JButton" name="btnCloseWindow">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Close Window"/>
|
||||
<Property name="horizontalAlignment" type="int" value="4"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCloseWindowActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
<Container class="javax.swing.JSplitPane" name="jSplitPane2">
|
||||
<Properties>
|
||||
<Property name="resizeWeight" type="double" value="1.0"/>
|
||||
<Property name="toolTipText" type="java.lang.String" value=""/>
|
||||
</Properties>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTable" name="tableMatches">
|
||||
<Container class="javax.swing.JSplitPane" name="jSplitPane1">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="matchesModel" type="code"/>
|
||||
</Property>
|
||||
<Property name="dividerLocation" type="int" value="230"/>
|
||||
<Property name="orientation" type="int" value="0"/>
|
||||
<Property name="resizeWeight" type="double" value="0.5"/>
|
||||
</Properties>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||
<JSplitPaneConstraints position="left"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane1">
|
||||
<Properties>
|
||||
<Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor">
|
||||
<Color id="Standardcursor"/>
|
||||
</Property>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[400, 100]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||
<JSplitPaneConstraints position="top"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTable" name="tablePlayers">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="this.playersModel" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Container class="javax.swing.JScrollPane" name="jScrollPane2">
|
||||
<Properties>
|
||||
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
|
||||
<Dimension value="[400, 100]"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
<AuxValues>
|
||||
<AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||
<JSplitPaneConstraints position="bottom"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
|
||||
<SubComponents>
|
||||
<Component class="javax.swing.JTable" name="tableMatches">
|
||||
<Properties>
|
||||
<Property name="model" type="javax.swing.table.TableModel" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code="matchesModel" type="code"/>
|
||||
</Property>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="mage.client.chat.ChatPanel" name="chatPanel1">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JSplitPaneSupportLayout$JSplitPaneConstraintsDescription">
|
||||
<JSplitPaneConstraints position="right"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
|
|
|
@ -36,14 +36,17 @@ package mage.client.tournament;
|
|||
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.text.DateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.CancellationException;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import javafx.scene.layout.Pane;
|
||||
import javax.swing.*;
|
||||
import javax.swing.table.AbstractTableModel;
|
||||
import mage.client.MageFrame;
|
||||
import mage.client.MagePane;
|
||||
import mage.client.chat.ChatPanel;
|
||||
import mage.client.util.ButtonColumn;
|
||||
import mage.remote.Session;
|
||||
|
@ -66,6 +69,8 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
private TournamentPlayersTableModel playersModel;
|
||||
private TournamentMatchesTableModel matchesModel;
|
||||
private UpdateTournamentTask updateTask;
|
||||
private boolean titleSet = false;
|
||||
private DateFormat df;
|
||||
|
||||
/** Creates new form TournamentPanel */
|
||||
public TournamentPanel() {
|
||||
|
@ -74,6 +79,8 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
|
||||
initComponents();
|
||||
|
||||
df = DateFormat.getDateTimeInstance();
|
||||
|
||||
tablePlayers.createDefaultColumnsFromModel();
|
||||
tableMatches.createDefaultColumnsFromModel();
|
||||
|
||||
|
@ -95,6 +102,7 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
}
|
||||
};
|
||||
|
||||
// replay button, don't delete this
|
||||
ButtonColumn buttonColumn = new ButtonColumn(tableMatches, action, 6);
|
||||
|
||||
}
|
||||
|
@ -128,6 +136,31 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
public void update(TournamentView tournament) {
|
||||
|
||||
if (!titleSet) {
|
||||
Component c = this.getParent();
|
||||
while (c != null && !(c instanceof TournamentPane)) {
|
||||
c = c.getParent();
|
||||
}
|
||||
if (c != null) {
|
||||
((TournamentPane)c).setTitle("Tournament [" + tournament.getTournamentName() +"]");
|
||||
}
|
||||
titleSet = true;
|
||||
}
|
||||
|
||||
txtName.setText(tournament.getTournamentName());
|
||||
txtType.setText(tournament.getTournamentType());
|
||||
|
||||
txtStartTime.setText(df.format(tournament.getStartTime()));
|
||||
|
||||
if (tournament.getEndTime() != null) {
|
||||
txtEndTime.setText(df.format(tournament.getEndTime()));
|
||||
btnCloseWindow.setVisible(true);
|
||||
} else {
|
||||
txtEndTime.setText("running...");
|
||||
btnCloseWindow.setVisible(false);
|
||||
}
|
||||
|
||||
playersModel.loadData(tournament);
|
||||
matchesModel.loadData(tournament);
|
||||
this.tablePlayers.repaint();
|
||||
|
@ -144,8 +177,9 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
}
|
||||
|
||||
public void stopTasks() {
|
||||
if (updateTask != null)
|
||||
if (updateTask != null) {
|
||||
updateTask.cancel(true);
|
||||
}
|
||||
}
|
||||
|
||||
/** This method is called from within the constructor to
|
||||
|
@ -157,46 +191,175 @@ public class TournamentPanel extends javax.swing.JPanel {
|
|||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
|
||||
chatPanel1 = new mage.client.chat.ChatPanel();
|
||||
actionPanel = new javax.swing.JPanel();
|
||||
lblName = new javax.swing.JLabel();
|
||||
txtName = new javax.swing.JTextField();
|
||||
lblType = new javax.swing.JLabel();
|
||||
txtType = new javax.swing.JTextField();
|
||||
lblStartTime = new javax.swing.JLabel();
|
||||
txtStartTime = new javax.swing.JTextField();
|
||||
lablEndTime = new javax.swing.JLabel();
|
||||
txtEndTime = new javax.swing.JTextField();
|
||||
btnCloseWindow = new javax.swing.JButton();
|
||||
jSplitPane2 = new javax.swing.JSplitPane();
|
||||
jSplitPane1 = new javax.swing.JSplitPane();
|
||||
jScrollPane1 = new javax.swing.JScrollPane();
|
||||
tablePlayers = new javax.swing.JTable();
|
||||
jScrollPane2 = new javax.swing.JScrollPane();
|
||||
tableMatches = new javax.swing.JTable();
|
||||
chatPanel1 = new mage.client.chat.ChatPanel();
|
||||
|
||||
setPreferredSize(new java.awt.Dimension(908, 580));
|
||||
|
||||
lblName.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
lblName.setText("Name:");
|
||||
|
||||
txtName.setEditable(false);
|
||||
txtName.setHorizontalAlignment(javax.swing.JTextField.LEFT);
|
||||
txtName.setText("tournament name");
|
||||
txtName.setFocusable(false);
|
||||
txtName.setMaximumSize(new java.awt.Dimension(50, 22));
|
||||
|
||||
lblType.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
|
||||
lblType.setText("Type:");
|
||||
|
||||
txtType.setEditable(false);
|
||||
txtType.setHorizontalAlignment(javax.swing.JTextField.LEFT);
|
||||
txtType.setText("tournament type");
|
||||
txtType.setFocusable(false);
|
||||
|
||||
lblStartTime.setText("Start time:");
|
||||
|
||||
txtStartTime.setEditable(false);
|
||||
txtStartTime.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
txtStartTime.setText("jTextField1");
|
||||
txtStartTime.setFocusable(false);
|
||||
|
||||
lablEndTime.setText("End time:");
|
||||
|
||||
txtEndTime.setEditable(false);
|
||||
txtEndTime.setHorizontalAlignment(javax.swing.JTextField.CENTER);
|
||||
txtEndTime.setText("jTextField2");
|
||||
txtEndTime.setFocusable(false);
|
||||
|
||||
btnCloseWindow.setText("Close Window");
|
||||
btnCloseWindow.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
|
||||
btnCloseWindow.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
btnCloseWindowActionPerformed(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout actionPanelLayout = new javax.swing.GroupLayout(actionPanel);
|
||||
actionPanel.setLayout(actionPanelLayout);
|
||||
actionPanelLayout.setHorizontalGroup(
|
||||
actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(actionPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(lblName)
|
||||
.addComponent(lblType))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addComponent(txtName, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE)
|
||||
.addComponent(txtType))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
.addGroup(actionPanelLayout.createSequentialGroup()
|
||||
.addComponent(lablEndTime)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
|
||||
.addComponent(txtEndTime))
|
||||
.addGroup(actionPanelLayout.createSequentialGroup()
|
||||
.addComponent(lblStartTime)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(txtStartTime, javax.swing.GroupLayout.PREFERRED_SIZE, 140, javax.swing.GroupLayout.PREFERRED_SIZE)))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(btnCloseWindow, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap())
|
||||
);
|
||||
actionPanelLayout.setVerticalGroup(
|
||||
actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(actionPanelLayout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addGroup(actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(lblName, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(txtName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lblStartTime)
|
||||
.addComponent(txtStartTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGap(9, 9, 9)
|
||||
.addGroup(actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||
.addComponent(lblType)
|
||||
.addComponent(txtType, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(lablEndTime)
|
||||
.addComponent(txtEndTime, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(btnCloseWindow))
|
||||
.addGap(0, 14, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
jSplitPane2.setResizeWeight(1.0);
|
||||
jSplitPane2.setToolTipText("");
|
||||
|
||||
jSplitPane1.setDividerLocation(230);
|
||||
jSplitPane1.setOrientation(javax.swing.JSplitPane.VERTICAL_SPLIT);
|
||||
jSplitPane1.setResizeWeight(0.5);
|
||||
|
||||
jScrollPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
||||
jScrollPane1.setPreferredSize(new java.awt.Dimension(400, 100));
|
||||
|
||||
tablePlayers.setModel(this.playersModel);
|
||||
jScrollPane1.setViewportView(tablePlayers);
|
||||
|
||||
jSplitPane1.setTopComponent(jScrollPane1);
|
||||
|
||||
jScrollPane2.setPreferredSize(new java.awt.Dimension(400, 100));
|
||||
|
||||
tableMatches.setModel(matchesModel);
|
||||
jScrollPane2.setViewportView(tableMatches);
|
||||
|
||||
jSplitPane1.setBottomComponent(jScrollPane2);
|
||||
|
||||
jSplitPane2.setLeftComponent(jSplitPane1);
|
||||
jSplitPane2.setRightComponent(chatPanel1);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
|
||||
this.setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 573, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 573, Short.MAX_VALUE))
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(chatPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 215, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(actionPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jSplitPane2, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 908, Short.MAX_VALUE)
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 262, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 0, 0)
|
||||
.addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 260, Short.MAX_VALUE))
|
||||
.addComponent(chatPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, 522, Short.MAX_VALUE)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(actionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(jSplitPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 489, Short.MAX_VALUE))
|
||||
);
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
private void btnCloseWindowActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCloseWindowActionPerformed
|
||||
hideTournament();
|
||||
}//GEN-LAST:event_btnCloseWindowActionPerformed
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private javax.swing.JPanel actionPanel;
|
||||
private javax.swing.JButton btnCloseWindow;
|
||||
private mage.client.chat.ChatPanel chatPanel1;
|
||||
private javax.swing.JScrollPane jScrollPane1;
|
||||
private javax.swing.JScrollPane jScrollPane2;
|
||||
private javax.swing.JSplitPane jSplitPane1;
|
||||
private javax.swing.JSplitPane jSplitPane2;
|
||||
private javax.swing.JLabel lablEndTime;
|
||||
private javax.swing.JLabel lblName;
|
||||
private javax.swing.JLabel lblStartTime;
|
||||
private javax.swing.JLabel lblType;
|
||||
private javax.swing.JTable tableMatches;
|
||||
private javax.swing.JTable tablePlayers;
|
||||
private javax.swing.JTextField txtEndTime;
|
||||
private javax.swing.JTextField txtName;
|
||||
private javax.swing.JTextField txtStartTime;
|
||||
private javax.swing.JTextField txtType;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
}
|
||||
|
@ -237,8 +400,9 @@ class TournamentPlayersTableModel extends AbstractTableModel {
|
|||
public String getColumnName(int columnIndex) {
|
||||
String colName = "";
|
||||
|
||||
if (columnIndex <= getColumnCount())
|
||||
if (columnIndex <= getColumnCount()) {
|
||||
colName = columnNames[columnIndex];
|
||||
}
|
||||
|
||||
return colName;
|
||||
}
|
||||
|
@ -308,8 +472,9 @@ class TournamentMatchesTableModel extends AbstractTableModel {
|
|||
public String getColumnName(int columnIndex) {
|
||||
String colName = "";
|
||||
|
||||
if (columnIndex <= getColumnCount())
|
||||
if (columnIndex <= getColumnCount()) {
|
||||
colName = columnNames[columnIndex];
|
||||
}
|
||||
|
||||
return colName;
|
||||
}
|
||||
|
@ -321,8 +486,9 @@ class TournamentMatchesTableModel extends AbstractTableModel {
|
|||
|
||||
@Override
|
||||
public boolean isCellEditable(int rowIndex, int columnIndex) {
|
||||
if (columnIndex != 6)
|
||||
if (columnIndex != 6) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package mage.client.util;
|
||||
|
||||
import java.io.File;
|
||||
import javax.sound.sampled.AudioFormat;
|
||||
import javax.sound.sampled.AudioInputStream;
|
||||
import javax.sound.sampled.AudioSystem;
|
||||
import javax.sound.sampled.Clip;
|
||||
import javax.sound.sampled.DataLine;
|
||||
import mage.client.constants.Constants;
|
||||
import mage.client.dialog.PreferencesDialog;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import javax.sound.sampled.*;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* Manager class for playing audio files.
|
||||
*
|
||||
|
@ -42,6 +45,8 @@ public class AudioManager {
|
|||
audioManager.addArtifactClip = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnAddArtifact.wav");
|
||||
audioManager.updateStackClip = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnStackNew.wav");
|
||||
audioManager.onHover = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnHover.wav");
|
||||
|
||||
audioManager.playerJoinedTable = audioManager.loadClip(Constants.BASE_SOUND_PATH + "OnPlayerJoinedTable.wav");
|
||||
}
|
||||
return audioManager;
|
||||
}
|
||||
|
@ -114,6 +119,10 @@ public class AudioManager {
|
|||
checkAndPlayClip(getManager().onHover);
|
||||
}
|
||||
|
||||
public static void playPlayerJoinedTable() {
|
||||
checkAndPlayClip(getManager().playerJoinedTable);
|
||||
}
|
||||
|
||||
private static void checkAndPlayClip(Clip clip) {
|
||||
try {
|
||||
if (clip != null) {
|
||||
|
@ -175,4 +184,6 @@ public class AudioManager {
|
|||
private Clip addArtifactClip = null;
|
||||
private Clip updateStackClip = null;
|
||||
private Clip onHover = null;
|
||||
|
||||
private Clip playerJoinedTable = null;
|
||||
}
|
||||
|
|
|
@ -65,6 +65,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
public final ScaledImagePanel imagePanel;
|
||||
public ImagePanel overlayPanel;
|
||||
public JPanel buttonPanel;
|
||||
public JPanel iconPanel;
|
||||
|
||||
private GlowText titleText;
|
||||
private GlowText ptText;
|
||||
|
@ -94,6 +95,7 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
private boolean transformed;
|
||||
private boolean animationInProgress = false;
|
||||
private JButton dayNightButton;
|
||||
private JButton tokenButton;
|
||||
|
||||
private boolean displayTitleAnyway;
|
||||
|
||||
|
@ -142,6 +144,23 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
}
|
||||
});
|
||||
|
||||
// token icon
|
||||
iconPanel = new JPanel();
|
||||
iconPanel.setLayout(null);
|
||||
iconPanel.setOpaque(false);
|
||||
add(iconPanel);
|
||||
|
||||
tokenButton = new JButton("");
|
||||
tokenButton.setLocation(2, 2);
|
||||
tokenButton.setSize(25, 25);
|
||||
|
||||
iconPanel.setVisible(this.gameCard.isToken());
|
||||
|
||||
BufferedImage tokenIconImage = ImageManagerImpl.getInstance().getTokenIconImage();
|
||||
tokenButton.setIcon(new ImageIcon(tokenIconImage));
|
||||
|
||||
iconPanel.add(tokenButton);
|
||||
|
||||
setBackground(Color.black);
|
||||
setOpaque(false);
|
||||
|
||||
|
@ -411,6 +430,9 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
buttonPanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize);
|
||||
buttonPanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2);
|
||||
|
||||
iconPanel.setLocation(cardXOffset + borderSize, cardYOffset + borderSize);
|
||||
iconPanel.setSize(cardWidth - borderSize * 2, cardHeight - borderSize * 2);
|
||||
|
||||
int fontHeight = Math.round(cardHeight * (27f / 680));
|
||||
boolean showText = (!isAnimationPanel && fontHeight < 12);
|
||||
titleText.setVisible(showText);
|
||||
|
|
|
@ -154,12 +154,15 @@ public class CardInfoPaneImpl extends JEditorPane implements CardInfoPane {
|
|||
} else if (CardUtil.isPlaneswalker(card)) {
|
||||
pt = card.getLoyalty().toString();
|
||||
}
|
||||
if (pt.length() > 0) {
|
||||
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%' valign='bottom'><tr><td>");
|
||||
buffer.append("<b>");
|
||||
buffer.append(pt);
|
||||
buffer.append("</b>");
|
||||
buffer.append("</td></tr></table>");
|
||||
|
||||
if (pt.length() > 0 || card.isToken()) {
|
||||
buffer.append("<table cellspacing=0 cellpadding=0 border=0 width='100%' valign='bottom'><tr><td><b>");
|
||||
buffer.append(pt).append("</b></td>");
|
||||
if (card.isToken()) {
|
||||
buffer.append("<td align='right'>Token</td>");
|
||||
}
|
||||
|
||||
buffer.append("</tr></table>");
|
||||
}
|
||||
|
||||
StringBuilder rule = new StringBuilder("<br/>");
|
||||
|
|
|
@ -11,6 +11,8 @@ public interface ImageManager {
|
|||
Image getSicknessImage();
|
||||
Image getDayImage();
|
||||
Image getNightImage();
|
||||
|
||||
Image getTokenIconImage();
|
||||
|
||||
Image getDlgAcceptButtonImage();
|
||||
Image getDlgActiveAcceptButtonImage();
|
||||
|
|
|
@ -97,6 +97,15 @@ public class ImageManagerImpl implements ImageManager {
|
|||
return imageNight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BufferedImage getTokenIconImage() {
|
||||
if (imageTokenIcon == null) {
|
||||
Image image = getImageFromResourceTransparent("/card/token.png", Color.WHITE, new Rectangle(20, 20));
|
||||
imageTokenIcon = BufferedImageBuilder.bufferImage(image, BufferedImage.TYPE_INT_ARGB);
|
||||
}
|
||||
return imageTokenIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Image getDlgCancelButtonImage() {
|
||||
if (imageDlgCancelButton == null) {
|
||||
|
@ -216,6 +225,8 @@ public class ImageManagerImpl implements ImageManager {
|
|||
private static BufferedImage imageDay;
|
||||
private static BufferedImage imageNight;
|
||||
|
||||
private static BufferedImage imageTokenIcon;
|
||||
|
||||
private static BufferedImage imageDlgAcceptButton;
|
||||
private static BufferedImage imageDlgActiveAcceptButton;
|
||||
private static BufferedImage imageDlgCancelButton;
|
||||
|
|
|
@ -78,25 +78,12 @@ public class ThemePluginImpl implements ThemePlugin {
|
|||
background = loadbuffer_default();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
if(loadimages()){
|
||||
int it = (int)Math.abs(Math.random()*(flist.getItemCount()));
|
||||
filename = BackgroundDir + flist.getItem(it);
|
||||
background = ImageIO.read(new File(filename));
|
||||
}else{
|
||||
filename = "/dragon.png";
|
||||
InputStream is = this.getClass().getResourceAsStream(filename);
|
||||
if (is == null)
|
||||
throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
background = ImageIO.read(is);
|
||||
if (background == null) {
|
||||
background = loadbuffer_default();
|
||||
}
|
||||
if (background == null){
|
||||
throw new FileNotFoundException("Couldn't find in resources.");
|
||||
}
|
||||
*/
|
||||
if (background == null) {
|
||||
throw new FileNotFoundException("Couldn't find background file in resources.");
|
||||
}
|
||||
|
||||
if (ui.containsKey("gamePanel") && ui.containsKey("jLayeredPane")) {
|
||||
ImagePanel bgPanel = new ImagePanel(background, ImagePanel.TILED);
|
||||
|
||||
|
@ -143,9 +130,13 @@ public class ThemePluginImpl implements ThemePlugin {
|
|||
BufferedImage res;
|
||||
String path = PreferencesDialog.getCachedValue(PreferencesDialog.
|
||||
KEY_BATTLEFIELD_IMAGE, "");
|
||||
if(path != null){
|
||||
res = ImageIO.read(new File(path));
|
||||
return res;
|
||||
if(path != null && !path.equals("")){
|
||||
try{
|
||||
res = ImageIO.read(new File(path));
|
||||
return res;
|
||||
}catch(Exception e){
|
||||
res = null;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
@ -176,23 +167,28 @@ public class ThemePluginImpl implements ThemePlugin {
|
|||
if (is == null)
|
||||
throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
background = ImageIO.read(is);
|
||||
}else if(PreferencesDialog.getCachedValue(PreferencesDialog.
|
||||
KEY_BACKGROUND_IMAGE, "") != null){
|
||||
}else{
|
||||
String path = PreferencesDialog.getCachedValue(PreferencesDialog.
|
||||
KEY_BATTLEFIELD_IMAGE, "");
|
||||
if(path != null){
|
||||
background = ImageIO.read(new File(path));
|
||||
}else{
|
||||
InputStream is = this.getClass().getResourceAsStream(filename);
|
||||
if (is == null)
|
||||
throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
background = ImageIO.read(is);
|
||||
}
|
||||
KEY_BACKGROUND_IMAGE, "");
|
||||
if(path != null && !path.equals("")){
|
||||
try{
|
||||
File f = new File(path);
|
||||
if(f != null)
|
||||
background = ImageIO.read(f);
|
||||
}catch(Exception e){
|
||||
background = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (background == null)
|
||||
if (background == null){
|
||||
InputStream is = this.getClass().getResourceAsStream(filename);
|
||||
if (is == null)
|
||||
throw new FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
} catch (Exception e) {
|
||||
background = ImageIO.read(is);
|
||||
}
|
||||
if(background == null) throw new
|
||||
FileNotFoundException("Couldn't find " + filename + " in resources.");
|
||||
}catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return null;
|
||||
}
|
||||
|
|
BIN
Mage.Client/src/main/resources/card/token.png
Normal file
BIN
Mage.Client/src/main/resources/card/token.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 753 B |
|
@ -60,6 +60,6 @@ ptk=p3k
|
|||
gur=guru
|
||||
mpr=mprp
|
||||
# Remove DGM as sson as the images can be downloaded
|
||||
ignore.urls=TOK,EMBLEM
|
||||
ignore.urls=TOK,EMBLEM,M14
|
||||
# sets ordered by release time (newest goes first)
|
||||
token.lookup.order=MMA,DGM,GTC,RTR,M13,AVR,DDI,DKA,ISD,M12,NPH,MBS,SOM,M11,ROE,PVC,WWK,ZEN,M10,GVL,ARB,DVD,CFX,JVC,ALA,EVE,SHM,EVG,MOR,LRW,10E,CLS,CHK
|
|
@ -68,6 +68,11 @@ public final class Constants {
|
|||
|
||||
public static final double SCALE_FACTOR = 0.5;
|
||||
|
||||
/**
|
||||
* Time each player has during the game to play using his\her priority.
|
||||
*/
|
||||
public static final int PRIORITY_TIME_SEC = 1200;
|
||||
|
||||
public enum SessionState {
|
||||
DISCONNECTED, CONNECTED, CONNECTING, DISCONNECTING, SERVER_UNAVAILABLE, SERVER_STARTING;
|
||||
}
|
||||
|
|
127
Mage.Common/src/mage/utils/timer/PriorityTimer.java
Normal file
127
Mage.Common/src/mage/utils/timer/PriorityTimer.java
Normal file
|
@ -0,0 +1,127 @@
|
|||
package mage.utils.timer;
|
||||
|
||||
import mage.MageException;
|
||||
import mage.interfaces.Action;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.Timer;
|
||||
import java.util.TimerTask;
|
||||
|
||||
/**
|
||||
* @author noxx
|
||||
*/
|
||||
public class PriorityTimer extends TimerTask {
|
||||
|
||||
private static final Logger logger = Logger.getLogger(PriorityTimer.class);
|
||||
|
||||
private int count;
|
||||
|
||||
private long delay;
|
||||
|
||||
private Action taskOnTimeout;
|
||||
|
||||
private Action taskOnTick;
|
||||
|
||||
private States state = States.NONE;
|
||||
|
||||
enum States {
|
||||
NONE,
|
||||
INIT,
|
||||
RUNNING,
|
||||
PAUSED,
|
||||
FINISHED
|
||||
}
|
||||
|
||||
public PriorityTimer(int count, long delay, Action taskOnTimeout) {
|
||||
this.count = count;
|
||||
this.delay = delay;
|
||||
this.taskOnTimeout = taskOnTimeout;
|
||||
}
|
||||
|
||||
public void init() {
|
||||
state = States.INIT;
|
||||
Timer timer = new Timer("Priority Timer", false);
|
||||
long delayMs = delay * (int) (1000L / delay);
|
||||
timer.scheduleAtFixedRate(this, delayMs, delayMs);
|
||||
}
|
||||
|
||||
public void start() {
|
||||
if (state == States.NONE) {
|
||||
throw new IllegalStateException("Timer should have been initialized first");
|
||||
}
|
||||
if (state == States.FINISHED) {
|
||||
throw new IllegalStateException("Timer has already finished its work");
|
||||
}
|
||||
state = States.RUNNING;
|
||||
}
|
||||
|
||||
public void pause() {
|
||||
state = States.PAUSED;
|
||||
}
|
||||
|
||||
public void stop() {
|
||||
state = States.FINISHED;
|
||||
count = 0;
|
||||
}
|
||||
|
||||
public void resume() {
|
||||
if (state == States.FINISHED) {
|
||||
throw new IllegalStateException("Timer has already finished its work");
|
||||
}
|
||||
state = States.RUNNING;
|
||||
}
|
||||
|
||||
public int getCount() {
|
||||
return count;
|
||||
}
|
||||
|
||||
public void setCount(int count) {
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
public void setTaskOnTick(Action taskOnTick) {
|
||||
this.taskOnTick = taskOnTick;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
if (state == States.RUNNING) {
|
||||
count--;
|
||||
if (taskOnTick != null) {
|
||||
try {
|
||||
taskOnTick.execute();
|
||||
} catch (MageException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (logger.isDebugEnabled()) logger.debug("Count is: " + count);
|
||||
//System.out.println("Count is: " + count);
|
||||
if (count <= 0) {
|
||||
cancel();
|
||||
try {
|
||||
taskOnTimeout.execute();
|
||||
} catch (MageException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
long delay = 250L;
|
||||
int count = 5;
|
||||
PriorityTimer timer = new PriorityTimer(count, delay, new Action() {
|
||||
@Override
|
||||
public void execute() throws MageException {
|
||||
System.out.println("Exit");
|
||||
System.exit(0);
|
||||
}
|
||||
});
|
||||
timer.init();
|
||||
timer.start();
|
||||
Thread.sleep(2000);
|
||||
timer.pause();
|
||||
Thread.sleep(3000);
|
||||
timer.resume();
|
||||
}
|
||||
}
|
|
@ -47,6 +47,7 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.Modes;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.cards.SplitCard;
|
||||
|
@ -82,6 +83,7 @@ public class CardView extends SimpleCardView {
|
|||
protected boolean transformed;
|
||||
|
||||
protected boolean isSplitCard;
|
||||
protected boolean isToken;
|
||||
protected String leftSplitName;
|
||||
protected ManaCosts leftSplitCosts;
|
||||
protected List<String> leftSplitRules;
|
||||
|
@ -152,12 +154,23 @@ public class CardView extends SimpleCardView {
|
|||
|
||||
|
||||
if (card instanceof PermanentToken) {
|
||||
this.isToken = true;
|
||||
this.rarity = Rarity.COMMON;
|
||||
this.expansionSetCode = ((PermanentToken) card).getExpansionSetCode();
|
||||
if (((PermanentToken) card).getToken().getOriginalCardNumber() > 0) {
|
||||
// a token copied from permanent
|
||||
this.expansionSetCode = ((PermanentToken) card).getToken().getOriginalExpansionSetCode();
|
||||
this.cardNumber = ((PermanentToken) card).getToken().getOriginalCardNumber();
|
||||
} else {
|
||||
// a created token
|
||||
this.expansionSetCode = ((PermanentToken) card).getExpansionSetCode();
|
||||
}
|
||||
//
|
||||
// set code und card number for token copies to get the image
|
||||
this.rules = ((PermanentToken) card).getRules();
|
||||
this.type = ((PermanentToken)card).getToken().getTokenType();
|
||||
} else {
|
||||
this.rarity = card.getRarity();
|
||||
this.isToken = false;
|
||||
}
|
||||
if (card.getCounters() != null && !card.getCounters().isEmpty()) {
|
||||
counters = new ArrayList<CounterView>();
|
||||
|
@ -172,15 +185,19 @@ public class CardView extends SimpleCardView {
|
|||
if (card instanceof Spell) {
|
||||
Spell<?> spell = (Spell<?>) card;
|
||||
for (SpellAbility spellAbility: spell.getSpellAbilities()) {
|
||||
if (spellAbility.getTargets().size() > 0) {
|
||||
setTargets(spellAbility.getTargets());
|
||||
for(UUID modeId : spellAbility.getModes().getSelectedModes()) {
|
||||
spellAbility.getModes().setMode(spellAbility.getModes().get(modeId));
|
||||
if (spellAbility.getTargets().size() > 0) {
|
||||
setTargets(spellAbility.getTargets());
|
||||
}
|
||||
}
|
||||
}
|
||||
// show for modal spell, which mode was choosen
|
||||
if (spell.getSpellAbility().isModal()) {
|
||||
Mode activeMode = spell.getSpellAbility().getModes().getMode();
|
||||
if (activeMode != null) {
|
||||
this.rules.add("<span color='green'><i>Chosen mode: " + activeMode.getEffects().getText(activeMode)+"</i></span>");
|
||||
Modes modes = spell.getSpellAbility().getModes();
|
||||
for(UUID modeId : modes.getSelectedModes()) {
|
||||
modes.setMode(modes.get(modeId));
|
||||
this.rules.add("<span color='green'><i>Chosen mode: " + spell.getSpellAbility().getEffects().getText(modes.get(modeId))+"</i></span>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -453,6 +470,10 @@ public class CardView extends SimpleCardView {
|
|||
return this.secondCardFace;
|
||||
}
|
||||
|
||||
public boolean isToken() {
|
||||
return this.isToken;
|
||||
}
|
||||
|
||||
public void setTransformed(boolean transformed) {
|
||||
this.transformed = transformed;
|
||||
}
|
||||
|
|
|
@ -28,11 +28,16 @@
|
|||
|
||||
package mage.view;
|
||||
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.TurnPhase;
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.TurnPhase;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
|
@ -46,11 +51,6 @@ import mage.game.stack.StackAbility;
|
|||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -59,6 +59,7 @@ import java.util.UUID;
|
|||
public class GameView implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private int priorityTime;
|
||||
private List<PlayerView> players = new ArrayList<PlayerView>();
|
||||
private SimpleCardsView hand;
|
||||
private Map<String, SimpleCardsView> opponentHands;
|
||||
|
@ -75,7 +76,9 @@ public class GameView implements Serializable {
|
|||
private int turn;
|
||||
private boolean special = false;
|
||||
|
||||
|
||||
public GameView(GameState state, Game game) {
|
||||
priorityTime = game.getPriorityTime();
|
||||
for (Player player: state.getPlayers().values()) {
|
||||
players.add(new PlayerView(player, state, game));
|
||||
}
|
||||
|
@ -131,14 +134,16 @@ public class GameView implements Serializable {
|
|||
this.phase = state.getTurn().getPhaseType();
|
||||
this.step = state.getTurn().getStepType();
|
||||
this.turn = state.getTurnNum();
|
||||
if (state.getActivePlayerId() != null)
|
||||
if (state.getActivePlayerId() != null) {
|
||||
this.activePlayerName = state.getPlayer(state.getActivePlayerId()).getName();
|
||||
else
|
||||
} else {
|
||||
this.activePlayerName = "";
|
||||
if (state.getPriorityPlayerId() != null)
|
||||
}
|
||||
if (state.getPriorityPlayerId() != null) {
|
||||
this.priorityPlayerName = state.getPlayer(state.getPriorityPlayerId()).getName();
|
||||
else
|
||||
} else {
|
||||
this.priorityPlayerName = "";
|
||||
}
|
||||
for (CombatGroup combatGroup: state.getCombat().getGroups()) {
|
||||
combat.add(new CombatGroupView(combatGroup, game));
|
||||
}
|
||||
|
@ -253,4 +258,9 @@ public class GameView implements Serializable {
|
|||
public boolean getSpecial() {
|
||||
return special;
|
||||
}
|
||||
|
||||
public int getPriorityTime() {
|
||||
return priorityTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -50,7 +50,6 @@ public class PermanentView extends CardView {
|
|||
private boolean summoningSickness;
|
||||
private int damage;
|
||||
private List<UUID> attachments;
|
||||
private List<CounterView> counters;
|
||||
private CardView original;
|
||||
|
||||
public PermanentView(Permanent permanent, Card card) {
|
||||
|
@ -66,13 +65,7 @@ public class PermanentView extends CardView {
|
|||
attachments = new ArrayList<UUID>();
|
||||
attachments.addAll(permanent.getAttachments());
|
||||
}
|
||||
if (permanent.getCounters().size() > 0) {
|
||||
counters = new ArrayList<CounterView>();
|
||||
for (Counter counter: permanent.getCounters().values()) {
|
||||
counters.add(new CounterView(counter));
|
||||
}
|
||||
}
|
||||
if (permanent instanceof PermanentToken) {
|
||||
if (isToken()) {
|
||||
original = new CardView(((PermanentToken)permanent).getToken());
|
||||
original.expansionSetCode = permanent.getExpansionSetCode();
|
||||
}
|
||||
|
@ -110,10 +103,6 @@ public class PermanentView extends CardView {
|
|||
return attachments;
|
||||
}
|
||||
|
||||
public List<CounterView> getCounters() {
|
||||
return counters;
|
||||
}
|
||||
|
||||
public CardView getOriginal() {
|
||||
return original;
|
||||
}
|
||||
|
|
|
@ -54,6 +54,7 @@ public class PlayerView implements Serializable {
|
|||
private int libraryCount;
|
||||
private int handCount;
|
||||
private boolean isActive;
|
||||
private boolean hasPriority;
|
||||
private boolean hasLeft;
|
||||
private ManaPoolView manaPool;
|
||||
private SimpleCardsView graveyard = new SimpleCardsView();
|
||||
|
@ -63,6 +64,7 @@ public class PlayerView implements Serializable {
|
|||
private List<EmblemView> emblemList = new ArrayList<EmblemView>();
|
||||
private List<UUID> attachments = new ArrayList<UUID>();
|
||||
private int statesSavedSize;
|
||||
private int priorityTimeLeft;
|
||||
|
||||
public PlayerView(Player player, GameState state, Game game) {
|
||||
this.playerId = player.getId();
|
||||
|
@ -73,6 +75,7 @@ public class PlayerView implements Serializable {
|
|||
this.handCount = player.getHand().size();
|
||||
this.manaPool = new ManaPoolView(player.getManaPool());
|
||||
this.isActive = (player.getId().equals(state.getActivePlayerId()));
|
||||
this.hasPriority = player.getId().equals(state.getPriorityPlayerId());
|
||||
this.hasLeft = player.hasLeft();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
graveyard.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown()));
|
||||
|
@ -108,6 +111,7 @@ public class PlayerView implements Serializable {
|
|||
}
|
||||
|
||||
this.statesSavedSize = player.getStoredBookmark();
|
||||
this.priorityTimeLeft = player.getPriorityTimeLeft();
|
||||
}
|
||||
|
||||
private boolean showInBattlefield(Permanent permanent, GameState state) {
|
||||
|
@ -191,4 +195,12 @@ public class PlayerView implements Serializable {
|
|||
public int getStatesSavedSize() {
|
||||
return statesSavedSize;
|
||||
}
|
||||
|
||||
public int getPriorityTimeLeft() {
|
||||
return priorityTimeLeft;
|
||||
}
|
||||
|
||||
public boolean hasPriority() {
|
||||
return hasPriority;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,17 +28,17 @@
|
|||
|
||||
package mage.view;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Modes;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.game.Game;
|
||||
import mage.game.stack.StackAbility;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.TargetPointer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
@ -68,30 +68,43 @@ public class StackAbilityView extends CardView {
|
|||
}
|
||||
|
||||
private void updateTargets(Game game, StackAbility ability) {
|
||||
if (ability.getTargets().size() > 0) {
|
||||
setTargets(ability.getTargets());
|
||||
} else {
|
||||
List<UUID> targetList = new ArrayList<UUID>();
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
TargetPointer targetPointer = effect.getTargetPointer();
|
||||
if (targetPointer instanceof FixedTarget) {
|
||||
targetList.add(((FixedTarget) targetPointer).getTarget());
|
||||
}
|
||||
}
|
||||
if (targetList.size() > 0) {
|
||||
overrideTargets(targetList);
|
||||
List<String> names = new ArrayList<String>();
|
||||
for (UUID uuid : targetList) {
|
||||
MageObject mageObject = game.getObject(uuid);
|
||||
if (mageObject != null) {
|
||||
names.add(mageObject.getName());
|
||||
List<String> names = new ArrayList<String>();
|
||||
for(UUID modeId : ability.getModes().getSelectedModes()) {
|
||||
ability.getModes().setMode(ability.getModes().get(modeId));
|
||||
if (ability.getTargets().size() > 0) {
|
||||
setTargets(ability.getTargets());
|
||||
} else {
|
||||
List<UUID> targetList = new ArrayList<UUID>();
|
||||
for (Effect effect : ability.getEffects()) {
|
||||
TargetPointer targetPointer = effect.getTargetPointer();
|
||||
if (targetPointer instanceof FixedTarget) {
|
||||
targetList.add(((FixedTarget) targetPointer).getTarget());
|
||||
}
|
||||
}
|
||||
if (!names.isEmpty()) {
|
||||
getRules().add("<i>Targets: " + names.toString() + "</i>");
|
||||
if (targetList.size() > 0) {
|
||||
overrideTargets(targetList);
|
||||
|
||||
for (UUID uuid : targetList) {
|
||||
MageObject mageObject = game.getObject(uuid);
|
||||
if (mageObject != null) {
|
||||
names.add(mageObject.getName());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!names.isEmpty()) {
|
||||
getRules().add("<i>Targets: " + names.toString() + "</i>");
|
||||
}
|
||||
// show for modal ability, which mode was choosen
|
||||
if (ability.isModal()) {
|
||||
Modes modes = ability.getModes();
|
||||
for(UUID modeId : modes.getSelectedModes()) {
|
||||
modes.setMode(modes.get(modeId));
|
||||
this.rules.add("<span color='green'><i>Chosen mode: " + ability.getEffects().getText(modes.get(modeId))+"</i></span>");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public CardView getSourceCard() {
|
||||
|
|
|
@ -30,6 +30,7 @@ package mage.view;
|
|||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import mage.game.tournament.Round;
|
||||
import mage.game.tournament.Tournament;
|
||||
|
@ -42,10 +43,23 @@ import mage.game.tournament.TournamentPlayer;
|
|||
public class TournamentView implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
List<RoundView> rounds = new ArrayList<RoundView>();
|
||||
List<TournamentPlayerView> players = new ArrayList<TournamentPlayerView>();
|
||||
private String tournamentName;
|
||||
private String tournamentType;
|
||||
|
||||
private Date startTime;
|
||||
private Date endTime;
|
||||
|
||||
|
||||
private List<RoundView> rounds = new ArrayList<RoundView>();
|
||||
private List<TournamentPlayerView> players = new ArrayList<TournamentPlayerView>();
|
||||
|
||||
public TournamentView(Tournament tournament) {
|
||||
|
||||
tournamentName = tournament.getOptions().getName();
|
||||
tournamentType = tournament.getOptions().getTournamentType();
|
||||
startTime = tournament.getStartTime();
|
||||
endTime = tournament.getEndTime();
|
||||
|
||||
for (TournamentPlayer player: tournament.getPlayers()) {
|
||||
players.add(new TournamentPlayerView(player));
|
||||
}
|
||||
|
@ -54,6 +68,22 @@ public class TournamentView implements Serializable {
|
|||
}
|
||||
}
|
||||
|
||||
public String getTournamentName() {
|
||||
return tournamentName;
|
||||
}
|
||||
|
||||
public String getTournamentType() {
|
||||
return tournamentType;
|
||||
}
|
||||
|
||||
public Date getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
public Date getEndTime() {
|
||||
return endTime;
|
||||
}
|
||||
|
||||
public List<TournamentPlayerView> getPlayers() {
|
||||
return players;
|
||||
}
|
||||
|
|
|
@ -1230,7 +1230,13 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
|||
return modes.getMode();
|
||||
}
|
||||
//TODO: improve this;
|
||||
return modes.values().iterator().next();
|
||||
for (Mode mode: modes.values()) {
|
||||
if (!modes.getSelectedModes().contains(mode.getId()) // select only modes not already selected
|
||||
&& mode.getTargets().canChoose(source.getSourceId(), source.getControllerId(), game)) { // and where targets are available
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -28,11 +28,6 @@
|
|||
|
||||
package mage.player.human;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.constants.Zone;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.*;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
|
@ -46,6 +41,9 @@ import mage.cards.Cards;
|
|||
import mage.cards.decks.Deck;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceImpl;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.RangeOfInfluence;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterAttackingCreature;
|
||||
import mage.filter.common.FilterBlockingCreature;
|
||||
import mage.filter.common.FilterCreatureForCombat;
|
||||
|
@ -67,6 +65,9 @@ import mage.target.common.TargetDefender;
|
|||
import mage.util.ManaUtil;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -98,40 +99,43 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
super(player);
|
||||
}
|
||||
|
||||
protected void waitForResponse() {
|
||||
protected void waitForResponse(Game game) {
|
||||
response.clear();
|
||||
log.debug("Waiting response from player: " + getId());
|
||||
game.resumeTimer(playerId);
|
||||
synchronized(response) {
|
||||
try {
|
||||
response.wait();
|
||||
log.debug("Got response from player: " + getId());
|
||||
} catch (InterruptedException ex) {
|
||||
ex.printStackTrace();
|
||||
} finally {
|
||||
game.pauseTimer(playerId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void waitForBooleanResponse() {
|
||||
protected void waitForBooleanResponse(Game game) {
|
||||
do {
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
} while (response.getBoolean() == null && !abort);
|
||||
}
|
||||
|
||||
protected void waitForUUIDResponse() {
|
||||
protected void waitForUUIDResponse(Game game) {
|
||||
do {
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
} while (response.getUUID() == null && !abort);
|
||||
}
|
||||
|
||||
protected void waitForStringResponse() {
|
||||
protected void waitForStringResponse(Game game) {
|
||||
do {
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
} while (response.getString() == null && !abort);
|
||||
}
|
||||
|
||||
protected void waitForIntegerResponse() {
|
||||
protected void waitForIntegerResponse(Game game) {
|
||||
do {
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
} while (response.getInteger() == null && !abort);
|
||||
}
|
||||
|
||||
|
@ -143,7 +147,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
.append(getHand().size() > nextHandSize?"down to ":"for free, draw ")
|
||||
.append(nextHandSize)
|
||||
.append(nextHandSize == 1?" card?":" cards?").toString());
|
||||
waitForBooleanResponse();
|
||||
waitForBooleanResponse(game);
|
||||
if (!abort) {
|
||||
return response.getBoolean();
|
||||
}
|
||||
|
@ -154,7 +158,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
public boolean chooseUse(Outcome outcome, String message, Game game) {
|
||||
updateGameStatePriority("chooseUse", game);
|
||||
game.fireAskPlayerEvent(playerId, message);
|
||||
waitForBooleanResponse();
|
||||
waitForBooleanResponse(game);
|
||||
if (!abort) {
|
||||
return response.getBoolean();
|
||||
}
|
||||
|
@ -175,7 +179,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
}
|
||||
while (!abort) {
|
||||
game.fireChooseEvent(playerId, replacementEffectChoice);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
log.debug("Choose effect: " + response.getString());
|
||||
if (response.getString() != null) {
|
||||
replacementEffectChoice.setChoice(response.getString());
|
||||
|
@ -196,7 +200,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
updateGameStatePriority("choose(3)", game);
|
||||
while (!abort) {
|
||||
game.fireChooseEvent(playerId, choice);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getString() != null) {
|
||||
choice.setChoice(response.getString());
|
||||
return true;
|
||||
|
@ -218,7 +222,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
while (!abort) {
|
||||
Set<UUID> cards = target.possibleTargets(null, playerId, game);
|
||||
game.fireSelectTargetEvent(playerId, target.getMessage(), cards, target.isRequired(), options);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
if (target instanceof TargetPermanent) {
|
||||
if (((TargetPermanent)target).canTarget(playerId, response.getUUID(), sourceId, game, false)) {
|
||||
|
@ -267,7 +271,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
Set<UUID> possibleTargets = target.possibleTargets(source==null?null:source.getSourceId(), playerId, game);
|
||||
boolean required = possibleTargets.isEmpty() ? false : target.isRequired();
|
||||
game.fireSelectTargetEvent(playerId, target.getMessage(), possibleTargets, required, getOptions(target));
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
if (possibleTargets.contains(response.getUUID())) {
|
||||
if (target instanceof TargetPermanent) {
|
||||
|
@ -323,7 +327,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
options.put("chosen", (Serializable)chosen);
|
||||
}
|
||||
game.fireSelectTargetEvent(playerId, target.getMessage(), cards, required, options);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
if (target.canTarget(response.getUUID(), cards, game)) {
|
||||
target.add(response.getUUID(), game);
|
||||
|
@ -358,7 +362,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
}
|
||||
}
|
||||
game.fireSelectTargetEvent(playerId, target.getMessage(), cards, target.isRequired(), null);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
if (target.canTarget(response.getUUID(), cards, game)) {
|
||||
target.addTarget(response.getUUID(), source, game);
|
||||
|
@ -383,7 +387,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
updateGameStatePriority("chooseTargetAmount", game);
|
||||
while (!abort) {
|
||||
game.fireSelectTargetEvent(playerId, target.getMessage() + "\n Amount remaining:" + target.getAmountRemaining(), target.possibleTargets(source==null?null:source.getId(), playerId, game), target.isRequired(), null);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
if (target.canTarget(response.getUUID(), source, game)) {
|
||||
UUID targetId = response.getUUID();
|
||||
|
@ -412,7 +416,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
}
|
||||
updateGameStatePriority("priority", game);
|
||||
game.firePriorityEvent(playerId);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getBoolean() != null) {
|
||||
pass(game);
|
||||
return false;
|
||||
|
@ -450,7 +454,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
updateGameStatePriority("chooseTriggeredAbility", game);
|
||||
while (!abort) {
|
||||
game.fireSelectTargetEvent(playerId, "Pick triggered ability (goes to the stack first)", abilities);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
for (TriggeredAbility ability: abilities) {
|
||||
if (ability.getId().equals(response.getUUID())) {
|
||||
|
@ -466,7 +470,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
public boolean playMana(ManaCost unpaid, Game game) {
|
||||
updateGameStatePriority("playMana", game);
|
||||
game.firePlayManaEvent(playerId, "Pay " + unpaid.getText());
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getBoolean() != null) {
|
||||
return false;
|
||||
} else if (response.getUUID() != null) {
|
||||
|
@ -500,7 +504,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
public int announceXMana(int min, int max, String message, Game game, Ability ability) {
|
||||
updateGameStatePriority("announceXMana", game);
|
||||
game.fireGetAmountEvent(playerId, message, min, max);
|
||||
waitForIntegerResponse();
|
||||
waitForIntegerResponse(game);
|
||||
return response.getInteger();
|
||||
}
|
||||
|
||||
|
@ -530,7 +534,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
return;
|
||||
}
|
||||
game.fireSelectEvent(playerId, "Select attackers");
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getBoolean() != null) {
|
||||
return;
|
||||
} else if (response.getInteger() != null) {
|
||||
|
@ -593,7 +597,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
filter.add(new ControllerIdPredicate(defendingPlayerId));
|
||||
while (!abort) {
|
||||
game.fireSelectEvent(playerId, "Select blockers");
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getBoolean() != null) {
|
||||
return;
|
||||
} else if (response.getInteger() != null) {
|
||||
|
@ -622,7 +626,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
updateGameStatePriority("chooseAttackerOrder", game);
|
||||
while (!abort) {
|
||||
game.fireSelectTargetEvent(playerId, "Pick attacker", attackers, true);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
for (Permanent perm: attackers) {
|
||||
if (perm.getId().equals(response.getUUID())) {
|
||||
|
@ -640,7 +644,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
updateGameStatePriority("chooseBlockerOrder", game);
|
||||
while (!abort) {
|
||||
game.fireSelectTargetEvent(playerId, "Pick blocker", blockers, true);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
for (Permanent perm: blockers) {
|
||||
if (perm.getId().equals(response.getUUID())) {
|
||||
|
@ -656,7 +660,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
updateGameStatePriority("selectCombatGroup", game);
|
||||
TargetAttackingCreature target = new TargetAttackingCreature();
|
||||
game.fireSelectTargetEvent(playerId, "Select attacker to block", target.possibleTargets(null, playerId, game), target.isRequired(), null);
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getBoolean() != null) {
|
||||
// do nothing
|
||||
} else if (response.getUUID() != null) {
|
||||
|
@ -696,7 +700,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
public int getAmount(int min, int max, String message, Game game) {
|
||||
updateGameStatePriority("getAmount", game);
|
||||
game.fireGetAmountEvent(playerId, message, min, max);
|
||||
waitForIntegerResponse();
|
||||
waitForIntegerResponse(game);
|
||||
return response.getInteger();
|
||||
}
|
||||
|
||||
|
@ -719,7 +723,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
updateGameStatePriority("specialAction", game);
|
||||
LinkedHashMap<UUID, SpecialAction> specialActions = game.getState().getSpecialActions().getControlledBy(playerId);
|
||||
game.fireGetChoiceEvent(playerId, name, new ArrayList<SpecialAction>(specialActions.values()));
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
if (specialActions.containsKey(response.getUUID())) {
|
||||
activateAbility(specialActions.get(response.getUUID()), game);
|
||||
|
@ -737,7 +741,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
}
|
||||
}
|
||||
game.fireGetChoiceEvent(playerId, name, new ArrayList<ActivatedAbility>(abilities.values()));
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
if (abilities.containsKey(response.getUUID())) {
|
||||
activateAbility(abilities.get(response.getUUID()), game);
|
||||
|
@ -757,7 +761,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
return (SpellAbility) useableAbilities.values().iterator().next();
|
||||
} else if (useableAbilities != null && useableAbilities.size() > 0) {
|
||||
game.fireGetChoiceEvent(playerId, name, new ArrayList<ActivatedAbility>(useableAbilities.values()));
|
||||
waitForResponse();
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
if (useableAbilities.containsKey(response.getUUID())) {
|
||||
return (SpellAbility) useableAbilities.get(response.getUUID());
|
||||
|
@ -778,18 +782,23 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
MageObject obj = game.getObject(source.getSourceId());
|
||||
Map<UUID, String> modeMap = new LinkedHashMap<UUID, String>();
|
||||
for (Mode mode: modes.values()) {
|
||||
String modeText = mode.getEffects().getText(mode);
|
||||
if (obj != null) {
|
||||
modeText = modeText.replace("{source}", obj.getName());
|
||||
if (!modes.getSelectedModes().contains(mode.getId()) // show only modes not already selected
|
||||
&& mode.getTargets().canChoose(source.getSourceId(), source.getControllerId(), game)) { // and where targets are available
|
||||
String modeText = mode.getEffects().getText(mode);
|
||||
if (obj != null) {
|
||||
modeText = modeText.replace("{source}", obj.getName());
|
||||
}
|
||||
modeMap.put(mode.getId(), modeText);
|
||||
}
|
||||
modeMap.put(mode.getId(), modeText);
|
||||
}
|
||||
game.fireGetModeEvent(playerId, "Choose Mode", modeMap);
|
||||
waitForResponse();
|
||||
if (response.getUUID() != null) {
|
||||
for (Mode mode: modes.values()) {
|
||||
if (mode.getId().equals(response.getUUID())) {
|
||||
return mode;
|
||||
if (modeMap.size() > 0) {
|
||||
game.fireGetModeEvent(playerId, "Choose Mode", modeMap);
|
||||
waitForResponse(game);
|
||||
if (response.getUUID() != null) {
|
||||
for (Mode mode: modes.values()) {
|
||||
if (mode.getId().equals(response.getUUID())) {
|
||||
return mode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -802,7 +811,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
|||
public boolean choosePile(Outcome outcome, String message, List<? extends Card> pile1, List<? extends Card> pile2, Game game) {
|
||||
updateGameStatePriority("choosePile", game);
|
||||
game.fireChoosePileEvent(playerId, message, pile1, pile2);
|
||||
waitForBooleanResponse();
|
||||
waitForBooleanResponse(game);
|
||||
if (!abort) {
|
||||
return response.getBoolean();
|
||||
}
|
||||
|
|
|
@ -50,7 +50,6 @@ public class BoosterDraftEliminationTournament extends TournamentSingleEliminati
|
|||
|
||||
public BoosterDraftEliminationTournament(TournamentOptions options) {
|
||||
super(options);
|
||||
this.getOptions().getLimitedOptions().setConstructionTime(600);
|
||||
currentStep = TournamentStep.START;
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ public class SealedEliminationTournament extends TournamentSingleElimination {
|
|||
|
||||
public SealedEliminationTournament(TournamentOptions options) {
|
||||
super(options);
|
||||
this.getOptions().getLimitedOptions().setConstructionTime(1200);
|
||||
currentStep = TournamentStep.START;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#default levels
|
||||
log4j.rootLogger=info, console, logfile
|
||||
log4j.rootLogger=warn, console, logfile
|
||||
|
||||
#console log
|
||||
log4j.appender.console=org.apache.log4j.ConsoleAppender
|
||||
|
|
|
@ -396,6 +396,7 @@ public class TableController {
|
|||
User user = UserManager.getInstance().getUser(entry.getKey());
|
||||
user.tournamentStarted(tournament.getId(), entry.getValue());
|
||||
}
|
||||
ServerMessagesUtil.getInstance().incTournamentsStarted();
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
|
||||
package mage.server.game;
|
||||
|
||||
import mage.constants.Zone;
|
||||
import mage.MageException;
|
||||
import mage.abilities.Ability;
|
||||
import mage.cards.Card;
|
||||
|
@ -37,17 +36,21 @@ import mage.cards.decks.Deck;
|
|||
import mage.cards.decks.DeckCardLists;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.constants.Constants;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.GameException;
|
||||
import mage.game.events.Listener;
|
||||
import mage.game.events.PlayerQueryEvent;
|
||||
import mage.game.events.TableEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.interfaces.Action;
|
||||
import mage.players.Player;
|
||||
import mage.server.*;
|
||||
import mage.server.util.Splitter;
|
||||
import mage.server.util.SystemUtil;
|
||||
import mage.server.util.ThreadExecutor;
|
||||
import mage.utils.timer.PriorityTimer;
|
||||
import mage.view.AbilityPickerView;
|
||||
import mage.view.CardsView;
|
||||
import mage.view.ChatMessage.MessageColor;
|
||||
|
@ -75,6 +78,8 @@ public class GameController implements GameCallback {
|
|||
|
||||
private ConcurrentHashMap<UUID, GameSession> gameSessions = new ConcurrentHashMap<UUID, GameSession>();
|
||||
private ConcurrentHashMap<UUID, GameWatcher> watchers = new ConcurrentHashMap<UUID, GameWatcher>();
|
||||
private ConcurrentHashMap<UUID, PriorityTimer> timers = new ConcurrentHashMap<UUID, PriorityTimer>();
|
||||
|
||||
private ConcurrentHashMap<UUID, UUID> userPlayerMap;
|
||||
private UUID gameSessionId;
|
||||
private Game game;
|
||||
|
@ -106,6 +111,8 @@ public class GameController implements GameCallback {
|
|||
@Override
|
||||
public void event(TableEvent event) {
|
||||
try {
|
||||
PriorityTimer timer;
|
||||
UUID playerId;
|
||||
switch (event.getEventType()) {
|
||||
case UPDATE:
|
||||
updateGame();
|
||||
|
@ -124,6 +131,44 @@ public class GameController implements GameCallback {
|
|||
case ERROR:
|
||||
error(event.getMessage(), event.getException());
|
||||
break;
|
||||
case INIT_TIMER:
|
||||
final UUID initPlayerId = event.getPlayerId();
|
||||
if (initPlayerId == null) {
|
||||
throw new IllegalStateException("INIT_TIMER: playerId can't be null");
|
||||
}
|
||||
long delay = 250L; // run each 250 ms
|
||||
timer = new PriorityTimer(game.getPriorityTime(), delay, new Action() {
|
||||
@Override
|
||||
public void execute() throws MageException {
|
||||
game.concede(initPlayerId);
|
||||
logger.info("Game timeout for player: " + initPlayerId + ". Conceding.");
|
||||
}
|
||||
});
|
||||
timers.put(initPlayerId, timer);
|
||||
timer.init();
|
||||
break;
|
||||
case RESUME_TIMER:
|
||||
playerId = event.getPlayerId();
|
||||
if (playerId == null) {
|
||||
throw new IllegalStateException("RESUME_TIMER: playerId can't be null");
|
||||
}
|
||||
timer = timers.get(playerId);
|
||||
if (timer == null) {
|
||||
throw new IllegalStateException("RESUME_TIMER: couldn't find timer for player: " + playerId);
|
||||
}
|
||||
timer.resume();
|
||||
break;
|
||||
case PAUSE_TIMER:
|
||||
playerId = event.getPlayerId();
|
||||
if (playerId == null) {
|
||||
throw new IllegalStateException("PAUSE_TIMER: playerId can't be null");
|
||||
}
|
||||
timer = timers.get(playerId);
|
||||
if (timer == null) {
|
||||
throw new IllegalStateException("PAUSE_TIMER: couldn't find timer for player: " + playerId);
|
||||
}
|
||||
timer.pause();
|
||||
break;
|
||||
}
|
||||
} catch (MageException ex) {
|
||||
logger.fatal("Table event listener error ", ex);
|
||||
|
@ -388,6 +433,14 @@ public class GameController implements GameCallback {
|
|||
}
|
||||
|
||||
private synchronized void updateGame() {
|
||||
if (!timers.isEmpty()) {
|
||||
for (Player player: game.getState().getPlayers().values()) {
|
||||
PriorityTimer timer = timers.get(player.getId());
|
||||
if (timer != null) {
|
||||
player.setPriorityTimeLeft(timer.getCount());
|
||||
}
|
||||
}
|
||||
}
|
||||
for (final GameSession gameSession: gameSessions.values()) {
|
||||
gameSession.update();
|
||||
}
|
||||
|
|
|
@ -229,6 +229,10 @@ public class TournamentController {
|
|||
public void submitDeck(UUID playerId, Deck deck) {
|
||||
if (tournamentSessions.containsKey(playerId)) {
|
||||
tournamentSessions.get(playerId).submitDeck(deck);
|
||||
TournamentPlayer player = tournament.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
ChatManager.getInstance().broadcast(chatId, "", player.getPlayer().getName() + " has submitted the deck", MessageColor.BLACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ public class ServerMessagesUtil {
|
|||
|
||||
private static long startDate;
|
||||
private static AtomicInteger gamesStarted = new AtomicInteger(0);
|
||||
private static AtomicInteger tournamentsStarted = new AtomicInteger(0);
|
||||
|
||||
static {
|
||||
pathToExternalMessages = System.getProperty("messagesPath");
|
||||
|
@ -170,6 +171,8 @@ public class ServerMessagesUtil {
|
|||
statistics.append(hours);
|
||||
statistics.append(" hour(s), games played: ");
|
||||
statistics.append(gamesStarted.get());
|
||||
statistics.append(" tournaments started: ");
|
||||
statistics.append(tournamentsStarted.get());
|
||||
return statistics.toString();
|
||||
}
|
||||
|
||||
|
@ -189,4 +192,13 @@ public class ServerMessagesUtil {
|
|||
value = gamesStarted.get();
|
||||
} while (!gamesStarted.compareAndSet(value, value + 1));
|
||||
}
|
||||
|
||||
public void incTournamentsStarted() {
|
||||
int value;
|
||||
do {
|
||||
value = tournamentsStarted.get();
|
||||
} while (!tournamentsStarted.compareAndSet(value, value + 1));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
55
Mage.Sets/src/mage/sets/Magic2014.java
Normal file
55
Mage.Sets/src/mage/sets/Magic2014.java
Normal file
|
@ -0,0 +1,55 @@
|
|||
/*
|
||||
* 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;
|
||||
|
||||
import java.util.GregorianCalendar;
|
||||
import mage.cards.ExpansionSet;
|
||||
import mage.constants.SetType;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class Magic2014 extends ExpansionSet {
|
||||
|
||||
private static final Magic2014 fINSTANCE = new Magic2014();
|
||||
|
||||
public static Magic2014 getInstance() {
|
||||
return fINSTANCE;
|
||||
}
|
||||
|
||||
private Magic2014() {
|
||||
super("Magic 2014", "M14", "mage.sets.magic2014", new GregorianCalendar(2013, 19, 7).getTime(), SetType.CORE);
|
||||
this.hasBoosters = true;
|
||||
this.numBoosterLands = 1;
|
||||
this.numBoosterCommon = 10;
|
||||
this.numBoosterUncommon = 3;
|
||||
this.numBoosterRare = 1;
|
||||
this.ratioBoosterMythic = 8;
|
||||
}
|
||||
}
|
79
Mage.Sets/src/mage/sets/alarareborn/DeathbringerThoctar.java
Normal file
79
Mage.Sets/src/mage/sets/alarareborn/DeathbringerThoctar.java
Normal file
|
@ -0,0 +1,79 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesCreatureTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class DeathbringerThoctar extends CardImpl<DeathbringerThoctar> {
|
||||
|
||||
public DeathbringerThoctar(UUID ownerId) {
|
||||
super(ownerId, 36, "Deathbringer Thoctar", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{4}{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Zombie");
|
||||
this.subtype.add("Beast");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever another creature dies, you may put a +1/+1 counter on Deathbringer Thoctar.
|
||||
this.addAbility(new DiesCreatureTriggeredAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance()), true, true));
|
||||
|
||||
// Remove a +1/+1 counter from Deathbringer Thoctar: Deathbringer Thoctar deals 1 damage to target creature or player.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new RemoveCountersSourceCost(CounterType.P1P1.createInstance()));
|
||||
ability.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public DeathbringerThoctar(final DeathbringerThoctar card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DeathbringerThoctar copy() {
|
||||
return new DeathbringerThoctar(this);
|
||||
}
|
||||
}
|
67
Mage.Sets/src/mage/sets/alarareborn/DoubleNegative.java
Normal file
67
Mage.Sets/src/mage/sets/alarareborn/DoubleNegative.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.target.TargetSpell;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class DoubleNegative extends CardImpl<DoubleNegative> {
|
||||
|
||||
public DoubleNegative(UUID ownerId) {
|
||||
super(ownerId, 87, "Double Negative", Rarity.UNCOMMON, new CardType[]{CardType.INSTANT}, "{U}{U}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlue(true);
|
||||
|
||||
// Counter up to two target spells.
|
||||
Effect effect = new CounterTargetEffect();
|
||||
effect.setText("Counter up to two target spells");
|
||||
this.getSpellAbility().addEffect(effect);
|
||||
this.getSpellAbility().addTarget(new TargetSpell(0, 2, new FilterSpell()));
|
||||
}
|
||||
|
||||
public DoubleNegative(final DoubleNegative card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DoubleNegative copy() {
|
||||
return new DoubleNegative(this);
|
||||
}
|
||||
}
|
143
Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java
Normal file
143
Mage.Sets/src/mage/sets/alarareborn/DragonAppeasement.java
Normal file
|
@ -0,0 +1,143 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class DragonAppeasement extends CardImpl<DragonAppeasement> {
|
||||
|
||||
public DragonAppeasement(UUID ownerId) {
|
||||
super(ownerId, 115, "Dragon Appeasement", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{3}{B}{R}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Skip your draw step.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SkipYourDrawStepEffect()));
|
||||
|
||||
// Whenever you sacrifice a creature, you may draw a card.
|
||||
this.addAbility(new DragonAppeasementTriggeredAbility());
|
||||
|
||||
}
|
||||
|
||||
public DragonAppeasement(final DragonAppeasement card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DragonAppeasement copy() {
|
||||
return new DragonAppeasement(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SkipYourDrawStepEffect extends ReplacementEffectImpl<SkipYourDrawStepEffect> {
|
||||
|
||||
public SkipYourDrawStepEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Neutral);
|
||||
staticText = "Skip your draw step";
|
||||
}
|
||||
|
||||
public SkipYourDrawStepEffect(final SkipYourDrawStepEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkipYourDrawStepEffect copy() {
|
||||
return new SkipYourDrawStepEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.DRAW_STEP
|
||||
&& (event.getPlayerId().equals(source.getControllerId()))) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class DragonAppeasementTriggeredAbility extends TriggeredAbilityImpl<DragonAppeasementTriggeredAbility> {
|
||||
|
||||
public DragonAppeasementTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DrawCardControllerEffect(1), true);
|
||||
}
|
||||
|
||||
public DragonAppeasementTriggeredAbility(final DragonAppeasementTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DragonAppeasementTriggeredAbility copy() {
|
||||
return new DragonAppeasementTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SACRIFICED_PERMANENT
|
||||
&& event.getPlayerId().equals(this.getControllerId())
|
||||
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever you sacrifice a creature, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
80
Mage.Sets/src/mage/sets/alarareborn/GodtrackerOfJund.java
Normal file
80
Mage.Sets/src/mage/sets/alarareborn/GodtrackerOfJund.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class GodtrackerOfJund extends CardImpl<GodtrackerOfJund> {
|
||||
|
||||
final private static FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
|
||||
|
||||
static {
|
||||
filter.add(new PowerPredicate(Filter.ComparisonType.GreaterThan, 4));
|
||||
}
|
||||
|
||||
String rule = "Whenever a creature with power 5 or greater enters the battlefield under your control, you may put a +1/+1 counter on Godtracker of Jund.";
|
||||
|
||||
public GodtrackerOfJund(UUID ownerId) {
|
||||
super(ownerId, 55, "Godtracker of Jund", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Elf");
|
||||
this.subtype.add("Shaman");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Whenever a creature with power 5 or greater enters the battlefield under your control, you may put a +1/+1 counter on Godtracker of Jund.
|
||||
this.addAbility(new EntersBattlefieldAllTriggeredAbility(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()), filter, true, rule, true));
|
||||
}
|
||||
|
||||
public GodtrackerOfJund(final GodtrackerOfJund card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GodtrackerOfJund copy() {
|
||||
return new GodtrackerOfJund(this);
|
||||
}
|
||||
}
|
81
Mage.Sets/src/mage/sets/alarareborn/JundSojourners.java
Normal file
81
Mage.Sets/src/mage/sets/alarareborn/JundSojourners.java
Normal file
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.CycleTriggeredAbility;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.keyword.CyclingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.target.common.TargetCreatureOrPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class JundSojourners extends CardImpl<JundSojourners> {
|
||||
|
||||
public JundSojourners(UUID ownerId) {
|
||||
super(ownerId, 116, "Jund Sojourners", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{B}{R}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Viashino");
|
||||
this.subtype.add("Shaman");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// When you cycle Jund Sojourners or it dies, you may have it deal 1 damage to target creature or player.
|
||||
Ability ability1 = new CycleTriggeredAbility(new DamageTargetEffect(1));
|
||||
Ability ability2 = new DiesTriggeredAbility(new DamageTargetEffect(1));
|
||||
ability1.addTarget(new TargetCreatureOrPlayer());
|
||||
ability2.addTarget(new TargetCreatureOrPlayer());
|
||||
this.addAbility(ability1);
|
||||
this.addAbility(ability2);
|
||||
|
||||
// Cycling {2}{R}
|
||||
this.addAbility(new CyclingAbility(new ManaCostsImpl("{2}{R}")));
|
||||
}
|
||||
|
||||
public JundSojourners(final JundSojourners card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public JundSojourners copy() {
|
||||
return new JundSojourners(this);
|
||||
}
|
||||
}
|
169
Mage.Sets/src/mage/sets/alarareborn/KarrthusTyrantOfJund.java
Normal file
169
Mage.Sets/src/mage/sets/alarareborn/KarrthusTyrantOfJund.java
Normal file
|
@ -0,0 +1,169 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousEffect;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAllEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class KarrthusTyrantOfJund extends CardImpl<KarrthusTyrantOfJund> {
|
||||
|
||||
private static final FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent("all dragons you control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
filter.add(new SubtypePredicate("Dragon"));
|
||||
}
|
||||
|
||||
public KarrthusTyrantOfJund(UUID ownerId) {
|
||||
super(ownerId, 117, "Karrthus, Tyrant of Jund", Rarity.MYTHIC, new CardType[]{CardType.CREATURE}, "{4}{B}{R}{G}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Dragon");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(7);
|
||||
this.toughness = new MageInt(7);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Haste
|
||||
this.addAbility(HasteAbility.getInstance());
|
||||
|
||||
// When Karrthus, Tyrant of Jund enters the battlefield, gain control of all Dragons, then untap all Dragons.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new KarrthusEffect()));
|
||||
|
||||
// Other Dragon creatures you control have haste.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAllEffect(HasteAbility.getInstance(), Duration.WhileOnBattlefield, filter, true)));
|
||||
|
||||
}
|
||||
|
||||
public KarrthusTyrantOfJund(final KarrthusTyrantOfJund card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KarrthusTyrantOfJund copy() {
|
||||
return new KarrthusTyrantOfJund(this);
|
||||
}
|
||||
}
|
||||
|
||||
class KarrthusEffect extends OneShotEffect<KarrthusEffect> {
|
||||
|
||||
public KarrthusEffect() {
|
||||
super(Outcome.GainControl);
|
||||
this.staticText = "gain control of all dragons";
|
||||
}
|
||||
|
||||
public KarrthusEffect(final KarrthusEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KarrthusEffect copy() {
|
||||
return new KarrthusEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
FilterPermanent filter = new FilterPermanent();
|
||||
filter.add(new SubtypePredicate("Dragon"));
|
||||
List<Permanent> dragons = game.getBattlefield().getAllActivePermanents(filter, game);
|
||||
for (Permanent dragon : dragons) {
|
||||
ContinuousEffect effect = new KarrthusControlEffect(source.getControllerId());
|
||||
effect.setTargetPointer(new FixedTarget(dragon.getId()));
|
||||
game.addEffect(effect, source);
|
||||
}
|
||||
for (Permanent dragon : dragons) {
|
||||
dragon.untap(game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class KarrthusControlEffect extends ContinuousEffectImpl<KarrthusControlEffect> {
|
||||
|
||||
private UUID controllerId;
|
||||
|
||||
public KarrthusControlEffect(UUID controllerId) {
|
||||
super(Duration.EndOfGame, Layer.ControlChangingEffects_2, SubLayer.NA, Outcome.GainControl);
|
||||
this.controllerId = controllerId;
|
||||
}
|
||||
|
||||
public KarrthusControlEffect(final KarrthusControlEffect effect) {
|
||||
super(effect);
|
||||
this.controllerId = effect.controllerId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public KarrthusControlEffect copy() {
|
||||
return new KarrthusControlEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent dragon = game.getPermanent(targetPointer.getFirst(game, source));
|
||||
if (dragon != null && controllerId != null) {
|
||||
return dragon.changeControllerId(controllerId, game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
80
Mage.Sets/src/mage/sets/alarareborn/KathariBomber.java
Normal file
80
Mage.Sets/src/mage/sets/alarareborn/KathariBomber.java
Normal file
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.UnearthAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.permanent.token.GoblinToken;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class KathariBomber extends CardImpl<KathariBomber> {
|
||||
|
||||
public KathariBomber(UUID ownerId) {
|
||||
super(ownerId, 41, "Kathari Bomber", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Bird");
|
||||
this.subtype.add("Shaman");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// When Kathari Bomber deals combat damage to a player, put two 1/1 red Goblin creature tokens onto the battlefield and sacrifice Kathari Bomber.
|
||||
Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new CreateTokenEffect(new GoblinToken(), 2), false);
|
||||
ability.addEffect(new SacrificeSourceEffect());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Unearth {3}{B}{R}
|
||||
this.addAbility(new UnearthAbility(new ManaCostsImpl("{3}{B}{R}")));
|
||||
}
|
||||
|
||||
public KathariBomber(final KathariBomber card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KathariBomber copy() {
|
||||
return new KathariBomber(this);
|
||||
}
|
||||
}
|
150
Mage.Sets/src/mage/sets/alarareborn/KnightOfNewAlara.java
Normal file
150
Mage.Sets/src/mage/sets/alarareborn/KnightOfNewAlara.java
Normal file
|
@ -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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class KnightOfNewAlara extends CardImpl<KnightOfNewAlara> {
|
||||
|
||||
public KnightOfNewAlara(UUID ownerId) {
|
||||
super(ownerId, 70, "Knight of New Alara", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Knight");
|
||||
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Each other multicolored creature you control gets +1/+1 for each of its colors.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new KnightOfNewAlaraEffect()));
|
||||
|
||||
}
|
||||
|
||||
public KnightOfNewAlara(final KnightOfNewAlara card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KnightOfNewAlara copy() {
|
||||
return new KnightOfNewAlara(this);
|
||||
}
|
||||
}
|
||||
|
||||
class KnightOfNewAlaraEffect extends ContinuousEffectImpl<KnightOfNewAlaraEffect> {
|
||||
|
||||
public KnightOfNewAlaraEffect() {
|
||||
super(Duration.WhileOnBattlefield, Layer.AbilityAddingRemovingEffects_6, SubLayer.NA, Outcome.BoostCreature);
|
||||
staticText = "Each other multicolored creature you control gets +1/+1 for each of its colors";
|
||||
}
|
||||
|
||||
public KnightOfNewAlaraEffect(final KnightOfNewAlaraEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KnightOfNewAlaraEffect copy() {
|
||||
return new KnightOfNewAlaraEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
|
||||
filter.add(new MulticoloredPredicate());
|
||||
for (Permanent creature : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||
DynamicValue colors = new KnightOfNewAlaraColorCount(creature);
|
||||
if (creature != null
|
||||
&& creature != game.getPermanent(source.getSourceId())) {
|
||||
creature.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(colors, colors, Duration.WhileOnBattlefield)), source.getId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class KnightOfNewAlaraColorCount implements DynamicValue {
|
||||
|
||||
final Permanent creature;
|
||||
private int count;
|
||||
|
||||
public KnightOfNewAlaraColorCount(Permanent creature) {
|
||||
this.creature = creature;
|
||||
this.count = 0;
|
||||
}
|
||||
|
||||
public KnightOfNewAlaraColorCount(final KnightOfNewAlaraColorCount dynamicValue) {
|
||||
this.creature = dynamicValue.creature;
|
||||
this.count = dynamicValue.count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source) {
|
||||
if (creature != null) {
|
||||
count = creature.getColor().getColorCount();
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue copy() {
|
||||
return new KnightOfNewAlaraColorCount(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "1";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "of its colors";
|
||||
}
|
||||
}
|
77
Mage.Sets/src/mage/sets/alarareborn/LeoninArmorguard.java
Normal file
77
Mage.Sets/src/mage/sets/alarareborn/LeoninArmorguard.java
Normal file
|
@ -0,0 +1,77 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.common.continious.BoostAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TargetController;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class LeoninArmorguard extends CardImpl<LeoninArmorguard> {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creatures you control");
|
||||
|
||||
static {
|
||||
filter.add(new ControllerPredicate(TargetController.YOU));
|
||||
}
|
||||
|
||||
public LeoninArmorguard(UUID ownerId) {
|
||||
super(ownerId, 72, "Leonin Armorguard", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Cat");
|
||||
this.subtype.add("Soldier");
|
||||
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// When Leonin Armorguard enters the battlefield, creatures you control get +1/+1 until end of turn.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new BoostAllEffect(1, 1, Duration.EndOfTurn, filter, false)));
|
||||
}
|
||||
|
||||
public LeoninArmorguard(final LeoninArmorguard card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LeoninArmorguard copy() {
|
||||
return new LeoninArmorguard(this);
|
||||
}
|
||||
}
|
71
Mage.Sets/src/mage/sets/alarareborn/RebornHope.java
Normal file
71
Mage.Sets/src/mage/sets/alarareborn/RebornHope.java
Normal file
|
@ -0,0 +1,71 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToHandTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.MulticoloredPredicate;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class RebornHope extends CardImpl<RebornHope> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("multicolored card from your graveyard");
|
||||
|
||||
static {
|
||||
filter.add(new MulticoloredPredicate());
|
||||
}
|
||||
|
||||
public RebornHope(UUID ownerId) {
|
||||
super(ownerId, 76, "Reborn Hope", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{G}{W}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
this.color.setGreen(true);
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Return target multicolored card from your graveyard to your hand.
|
||||
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(filter));
|
||||
this.getSpellAbility().addEffect(new ReturnFromGraveyardToHandTargetEffect());
|
||||
}
|
||||
|
||||
public RebornHope(final RebornHope card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public RebornHope copy() {
|
||||
return new RebornHope(this);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.common.BlocksAttachedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.SkipNextUntapTargetEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class ShieldOfTheRighteous extends CardImpl<ShieldOfTheRighteous> {
|
||||
|
||||
public ShieldOfTheRighteous(UUID ownerId) {
|
||||
super(ownerId, 11, "Shield of the Righteous", Rarity.UNCOMMON, new CardType[]{CardType.ARTIFACT}, "{W}{U}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Equipment");
|
||||
|
||||
this.color.setBlue(true);
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Equipped creature gets +0/+2 and has vigilance.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(0, 2)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.EQUIPMENT)));
|
||||
|
||||
// Whenever equipped creature blocks a creature, that creature doesn't untap during its controller's next untap step.
|
||||
this.addAbility(new BlocksAttachedTriggeredAbility(new SkipNextUntapTargetEffect("that creature"), "equipped", false, false, true));
|
||||
|
||||
// Equip {2}
|
||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2), new TargetControlledCreaturePermanent()));
|
||||
}
|
||||
|
||||
public ShieldOfTheRighteous(final ShieldOfTheRighteous card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShieldOfTheRighteous copy() {
|
||||
return new ShieldOfTheRighteous(this);
|
||||
}
|
||||
}
|
133
Mage.Sets/src/mage/sets/alarareborn/ThoughtHemorrhage.java
Normal file
133
Mage.Sets/src/mage/sets/alarareborn/ThoughtHemorrhage.java
Normal file
|
@ -0,0 +1,133 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.repository.CardRepository;
|
||||
import mage.choices.Choice;
|
||||
import mage.choices.ChoiceImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class ThoughtHemorrhage extends CardImpl<ThoughtHemorrhage> {
|
||||
|
||||
public ThoughtHemorrhage(UUID ownerId) {
|
||||
super(ownerId, 47, "Thought Hemorrhage", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B}{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Name a nonland card. Target player reveals his or her hand. Thought Hemorrhage deals 3 damage to that player for each card with that name revealed this way. Search that player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library.
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
this.getSpellAbility().addEffect(new ThoughtHemorrhageEffect());
|
||||
}
|
||||
|
||||
public ThoughtHemorrhage(final ThoughtHemorrhage card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThoughtHemorrhage copy() {
|
||||
return new ThoughtHemorrhage(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ThoughtHemorrhageEffect extends OneShotEffect<ThoughtHemorrhageEffect> {
|
||||
|
||||
String cardName;
|
||||
final String rule = "Name a nonland card. Target player reveals his or her hand. Thought Hemorrhage deals 3 damage to that player for each card with that name revealed this way. Search that player's graveyard, hand, and library for all cards with that name and exile them. Then that player shuffles his or her library";
|
||||
|
||||
public ThoughtHemorrhageEffect() {
|
||||
super(Outcome.Detriment);
|
||||
staticText = rule;
|
||||
}
|
||||
|
||||
public ThoughtHemorrhageEffect(final ThoughtHemorrhageEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you != null) {
|
||||
Choice cardChoice = new ChoiceImpl();
|
||||
cardChoice.setChoices(CardRepository.instance.getNonLandNames());
|
||||
cardChoice.clearChoice();
|
||||
while (!you.choose(Outcome.Detriment, cardChoice, game)) {
|
||||
game.debugMessage("player canceled choosing name. retrying.");
|
||||
}
|
||||
cardName = cardChoice.getChoice();
|
||||
game.informPlayers("Thought Hemorrhage, named card: [" + cardName + "]");
|
||||
}
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (targetPlayer != null) {
|
||||
targetPlayer.revealCards("hand of target player", targetPlayer.getHand(), game);
|
||||
for (Card card : targetPlayer.getHand().getCards(game)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
targetPlayer.damage(3, source.getId(), game, false, true);
|
||||
}
|
||||
}
|
||||
for (Card card : targetPlayer.getGraveyard().getCards(game)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
card.moveToExile(null, "", source.getId(), game);
|
||||
}
|
||||
}
|
||||
for (Card card : targetPlayer.getHand().getCards(game)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
card.moveToExile(null, "", source.getId(), game);
|
||||
}
|
||||
}
|
||||
for (Card card : targetPlayer.getLibrary().getCards(game)) {
|
||||
if (card.getName().equals(cardName)) {
|
||||
card.moveToExile(null, "", source.getId(), game);
|
||||
}
|
||||
}
|
||||
targetPlayer.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ThoughtHemorrhageEffect copy() {
|
||||
return new ThoughtHemorrhageEffect(this);
|
||||
}
|
||||
}
|
207
Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java
Normal file
207
Mage.Sets/src/mage/sets/alarareborn/UnscytheKillerOfKings.java
Normal file
|
@ -0,0 +1,207 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EquipAbility;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.WatcherScope;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.ZombieToken;
|
||||
import mage.target.common.TargetControlledCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.watchers.WatcherImpl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class UnscytheKillerOfKings extends CardImpl<UnscytheKillerOfKings> {
|
||||
|
||||
public UnscytheKillerOfKings(UUID ownerId) {
|
||||
super(ownerId, 114, "Unscythe, Killer of Kings", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{R}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Equipment");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlue(true);
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Equipped creature gets +3/+3 and has first strike.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEquippedEffect(3, 3)));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainAbilityAttachedEffect(FirstStrikeAbility.getInstance(), AttachmentType.EQUIPMENT)));
|
||||
|
||||
// Whenever a creature dealt damage by equipped creature this turn dies, you may exile that card. If you do, put a 2/2 black Zombie creature token onto the battlefield.
|
||||
this.addAbility(new UnscytheKillerOfKingsTriggeredAbility(new UnscytheEffect()));
|
||||
this.addWatcher(new EquippedDidDamageWatcher());
|
||||
|
||||
// Equip {2}
|
||||
this.addAbility(new EquipAbility(Outcome.AddAbility, new GenericManaCost(2), new TargetControlledCreaturePermanent()));
|
||||
}
|
||||
|
||||
public UnscytheKillerOfKings(final UnscytheKillerOfKings card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnscytheKillerOfKings copy() {
|
||||
return new UnscytheKillerOfKings(this);
|
||||
}
|
||||
}
|
||||
|
||||
class UnscytheKillerOfKingsTriggeredAbility extends TriggeredAbilityImpl<UnscytheKillerOfKingsTriggeredAbility> {
|
||||
|
||||
public UnscytheKillerOfKingsTriggeredAbility(Effect effect) {
|
||||
this(effect, true);
|
||||
}
|
||||
|
||||
public UnscytheKillerOfKingsTriggeredAbility(Effect effect, boolean optional) {
|
||||
super(Zone.ALL, effect, optional);
|
||||
}
|
||||
|
||||
public UnscytheKillerOfKingsTriggeredAbility(final UnscytheKillerOfKingsTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnscytheKillerOfKingsTriggeredAbility copy() {
|
||||
return new UnscytheKillerOfKingsTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null) {
|
||||
EquippedDidDamageWatcher watcher = (EquippedDidDamageWatcher) game.getState().getWatchers().get("equippedDamagedTargets", this.getSourceId());
|
||||
if (watcher != null
|
||||
&& watcher.equippedDamagedTargets.contains(event.getTargetId())) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a creature dealt damage by {this} this turn dies, " + super.getRule();
|
||||
}
|
||||
}
|
||||
|
||||
class UnscytheEffect extends OneShotEffect<UnscytheEffect> {
|
||||
|
||||
public UnscytheEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
this.staticText = "put a 2/2 black Zombie creature token onto the battlefield";
|
||||
}
|
||||
|
||||
public UnscytheEffect(final UnscytheEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public UnscytheEffect copy() {
|
||||
return new UnscytheEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Card card = game.getCard(targetPointer.getFirst(game, source));
|
||||
if (card != null) {
|
||||
if (card.moveToExile(null, "Unscythe Exile", source.getId(), game)) {
|
||||
ZombieToken zombie = new ZombieToken();
|
||||
return zombie.putOntoBattlefield(1, game, source.getId(), source.getControllerId());
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
class EquippedDidDamageWatcher extends WatcherImpl<EquippedDidDamageWatcher> {
|
||||
|
||||
public List<UUID> equippedDamagedTargets = new ArrayList<UUID>();
|
||||
|
||||
public EquippedDidDamageWatcher() {
|
||||
super("equippedDamagedTargets", WatcherScope.CARD);
|
||||
}
|
||||
|
||||
public EquippedDidDamageWatcher(final EquippedDidDamageWatcher watcher) {
|
||||
super(watcher);
|
||||
this.equippedDamagedTargets.addAll(watcher.equippedDamagedTargets);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EquippedDidDamageWatcher copy() {
|
||||
return new EquippedDidDamageWatcher(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == EventType.DAMAGED_CREATURE) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (permanent != null) {
|
||||
if (permanent.getAttachments().contains(this.getSourceId())) {
|
||||
if (!equippedDamagedTargets.contains(event.getTargetId())) {
|
||||
equippedDamagedTargets.add(event.getTargetId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reset() {
|
||||
super.reset();
|
||||
equippedDamagedTargets.clear();
|
||||
}
|
||||
}
|
121
Mage.Sets/src/mage/sets/alarareborn/VectisDominator.java
Normal file
121
Mage.Sets/src/mage/sets/alarareborn/VectisDominator.java
Normal file
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* 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.alarareborn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jeffwadsworth
|
||||
*/
|
||||
public class VectisDominator extends CardImpl<VectisDominator> {
|
||||
|
||||
public VectisDominator(UUID ownerId) {
|
||||
super(ownerId, 84, "Vectis Dominator", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{1}{W}{B}");
|
||||
this.expansionSetCode = "ARB";
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Wizard");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// {tap}: Tap target creature unless its controller pays 2 life.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new VectisDominatorEffect(new PayLifeCost(2)), new ManaCostsImpl("{1}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public VectisDominator(final VectisDominator card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public VectisDominator copy() {
|
||||
return new VectisDominator(this);
|
||||
}
|
||||
}
|
||||
|
||||
class VectisDominatorEffect extends OneShotEffect<VectisDominatorEffect> {
|
||||
|
||||
protected Cost cost;
|
||||
|
||||
public VectisDominatorEffect(Cost cost) {
|
||||
super(Outcome.Detriment);
|
||||
this.staticText = "Tap target creature unless its controller pays 2 life";
|
||||
this.cost = cost;
|
||||
}
|
||||
|
||||
public VectisDominatorEffect(final VectisDominatorEffect effect) {
|
||||
super(effect);
|
||||
this.cost = effect.cost.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public VectisDominatorEffect copy() {
|
||||
return new VectisDominatorEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent targetCreature = game.getPermanent(source.getFirstTarget());
|
||||
if (targetCreature != null) {
|
||||
Player player = game.getPlayer(targetCreature.getControllerId());
|
||||
if (player != null) {
|
||||
cost.clearPaid();
|
||||
final StringBuilder sb = new StringBuilder("Pay 2 life otherwise ").append(targetCreature.getName()).append(" will be tapped)");
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
|
||||
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true);
|
||||
}
|
||||
if (!cost.isPaid()) {
|
||||
return targetCreature.tap(game);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* 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.betrayersofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.costs.common.ExileFromGraveCost;
|
||||
import mage.abilities.decorator.ConditionalOneShotEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.keyword.SpliceOntoArcaneAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class HorobisWhisper extends CardImpl<HorobisWhisper> {
|
||||
|
||||
private static final FilterCreaturePermanent filterTarget = new FilterCreaturePermanent("nonblack creature");
|
||||
private static final FilterLandPermanent filterCondition = new FilterLandPermanent("Swamp");
|
||||
|
||||
static {
|
||||
filterTarget.add(Predicates.not(new ColorPredicate(ObjectColor.BLACK)));
|
||||
filterCondition.add(new SubtypePredicate("Swamp"));
|
||||
}
|
||||
|
||||
public HorobisWhisper(UUID ownerId) {
|
||||
super(ownerId, 70, "Horobi's Whisper", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{1}{B}{B}");
|
||||
this.expansionSetCode = "BOK";
|
||||
this.subtype.add("Arcane");
|
||||
|
||||
this.color.setBlack(true);
|
||||
|
||||
|
||||
// If you control a Swamp, destroy target nonblack creature.
|
||||
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(new DestroyTargetEffect(),
|
||||
new ControlsPermanentCondition(filterCondition),"If you control a Swamp, destroy target nonblack creature"));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(filterTarget) );
|
||||
|
||||
// Splice onto Arcane-Exile four cards from your graveyard.
|
||||
this.addAbility(new SpliceOntoArcaneAbility(new ExileFromGraveCost(new TargetCardInYourGraveyard(4,4, new FilterCard("cards")))));
|
||||
|
||||
|
||||
}
|
||||
|
||||
public HorobisWhisper(final HorobisWhisper card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public HorobisWhisper copy() {
|
||||
return new HorobisWhisper(this);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
/*
|
||||
* 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.betrayersofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.effects.common.DamageTargetEffect;
|
||||
import mage.abilities.keyword.SpliceOntoArcaneAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterLandPermanent;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TorrentOfStone extends CardImpl<TorrentOfStone> {
|
||||
private static final FilterLandPermanent filterSacrifice = new FilterLandPermanent("two Mountains");
|
||||
|
||||
static {
|
||||
filterSacrifice.add(new SubtypePredicate("Mountain"));
|
||||
}
|
||||
|
||||
public TorrentOfStone(UUID ownerId) {
|
||||
super(ownerId, 119, "Torrent of Stone", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{R}");
|
||||
this.expansionSetCode = "BOK";
|
||||
this.subtype.add("Arcane");
|
||||
|
||||
this.color.setRed(true);
|
||||
|
||||
// Torrent of Stone deals 4 damage to target creature.
|
||||
this.getSpellAbility().addEffect(new DamageTargetEffect(4));
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
// Splice onto Arcane-Sacrifice two Mountains.
|
||||
this.addAbility(new SpliceOntoArcaneAbility(new SacrificeTargetCost(new TargetControlledPermanent(2,2, filterSacrifice, false))));
|
||||
}
|
||||
|
||||
public TorrentOfStone(final TorrentOfStone card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TorrentOfStone copy() {
|
||||
return new TorrentOfStone(this);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DampenThought extends mage.sets.modernmasters.DampenThought {
|
||||
|
||||
public DampenThought(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 57;
|
||||
this.expansionSetCode = "CHK";
|
||||
this.rarity = Rarity.UNCOMMON;
|
||||
}
|
||||
|
||||
public DampenThought(final DampenThought card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DampenThought copy() {
|
||||
return new DampenThought(this);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class DesperateRitual extends mage.sets.modernmasters.DesperateRitual {
|
||||
|
||||
public DesperateRitual(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 163;
|
||||
this.expansionSetCode = "CHK";
|
||||
this.rarity = Rarity.COMMON;
|
||||
}
|
||||
|
||||
public DesperateRitual(final DesperateRitual card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DesperateRitual copy() {
|
||||
return new DesperateRitual(this);
|
||||
}
|
||||
}
|
|
@ -62,6 +62,7 @@ public class Earthshaker extends CardImpl<Earthshaker> {
|
|||
this.color.setRed(true);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(5);
|
||||
// Whenever you cast a Spirit or Arcane spell, Earthshaker deals 2 damage to each creature without flying.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new DamageAllEffect(new StaticValue(2) , creatureFilter), filter, false));
|
||||
}
|
||||
|
||||
|
|
52
Mage.Sets/src/mage/sets/championsofkamigawa/GlacialRay.java
Normal file
52
Mage.Sets/src/mage/sets/championsofkamigawa/GlacialRay.java
Normal file
|
@ -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.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class GlacialRay extends mage.sets.modernmasters.GlacialRay {
|
||||
|
||||
public GlacialRay(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 168;
|
||||
this.expansionSetCode = "CHK";
|
||||
}
|
||||
|
||||
public GlacialRay(final GlacialRay card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GlacialRay copy() {
|
||||
return new GlacialRay(this);
|
||||
}
|
||||
}
|
|
@ -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.championsofkamigawa;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class KodamasReach extends mage.sets.commander.KodamasReach {
|
||||
|
||||
public KodamasReach(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 225;
|
||||
this.expansionSetCode = "CHK";
|
||||
}
|
||||
|
||||
public KodamasReach(final KodamasReach card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KodamasReach copy() {
|
||||
return new KodamasReach(this);
|
||||
}
|
||||
}
|
88
Mage.Sets/src/mage/sets/commander/AustereCommand.java
Normal file
88
Mage.Sets/src/mage/sets/commander/AustereCommand.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
/*
|
||||
* 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.commander;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.common.DestroyAllEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.common.FilterArtifactPermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.common.FilterEnchantmentPermanent;
|
||||
import mage.filter.predicate.mageobject.ConvertedManaCostPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class AustereCommand extends CardImpl<AustereCommand> {
|
||||
|
||||
private static final FilterCreaturePermanent filter3orLess = new FilterCreaturePermanent("creatures with converted mana cost 3 or less");
|
||||
private static final FilterCreaturePermanent filter4orMore = new FilterCreaturePermanent("creatures with converted mana cost 4 or greater");
|
||||
static {
|
||||
filter3orLess.add(new ConvertedManaCostPredicate(Filter.ComparisonType.LessThan, 4));
|
||||
filter4orMore.add(new ConvertedManaCostPredicate(Filter.ComparisonType.GreaterThan, 3));
|
||||
}
|
||||
|
||||
public AustereCommand(UUID ownerId) {
|
||||
super(ownerId, 8, "Austere Command", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{4}{W}{W}");
|
||||
this.expansionSetCode = "CMD";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Choose two -
|
||||
this.getSpellAbility().getModes().setMinModes(2);
|
||||
this.getSpellAbility().getModes().setMaxModes(2);
|
||||
// Destroy all artifacts;
|
||||
this.getSpellAbility().addEffect(new DestroyAllEffect(new FilterArtifactPermanent("artifacts")));
|
||||
// or destroy all enchantments;
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new DestroyAllEffect(new FilterEnchantmentPermanent("enchantments")));
|
||||
this.getSpellAbility().getModes().addMode(mode);
|
||||
// or destroy all creatures with converted mana cost 3 or less;
|
||||
mode = new Mode();
|
||||
mode.getEffects().add(new DestroyAllEffect(filter3orLess));
|
||||
this.getSpellAbility().getModes().addMode(mode);
|
||||
// or destroy all creatures with converted mana cost 4 or greater.
|
||||
mode = new Mode();
|
||||
mode.getEffects().add(new DestroyAllEffect(filter4orMore));
|
||||
this.getSpellAbility().getModes().addMode(mode);
|
||||
}
|
||||
|
||||
public AustereCommand(final AustereCommand card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AustereCommand copy() {
|
||||
return new AustereCommand(this);
|
||||
}
|
||||
}
|
139
Mage.Sets/src/mage/sets/commander/KodamasReach.java
Normal file
139
Mage.Sets/src/mage/sets/commander/KodamasReach.java
Normal file
|
@ -0,0 +1,139 @@
|
|||
/*
|
||||
* 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.commander;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.common.FilterBasicLandCard;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetCard;
|
||||
import mage.target.common.TargetCardInLibrary;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class KodamasReach extends CardImpl<KodamasReach> {
|
||||
|
||||
public KodamasReach(UUID ownerId) {
|
||||
super(ownerId, 163, "Kodama's Reach", Rarity.COMMON, new CardType[]{CardType.SORCERY}, "{2}{G}");
|
||||
this.expansionSetCode = "CMD";
|
||||
this.subtype.add("Arcane");
|
||||
|
||||
this.color.setGreen(true);
|
||||
|
||||
// Search your library for up to two basic land cards, reveal those cards, and put one onto the battlefield tapped and the other into your hand. Then shuffle your library.
|
||||
this.getSpellAbility().addEffect(new KodamasReachEffect());
|
||||
}
|
||||
|
||||
public KodamasReach(final KodamasReach card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KodamasReach copy() {
|
||||
return new KodamasReach(this);
|
||||
}
|
||||
}
|
||||
|
||||
class KodamasReachEffect extends OneShotEffect<KodamasReachEffect> {
|
||||
|
||||
protected static final FilterCard filter = new FilterCard("card to put on the battlefield tapped");
|
||||
|
||||
public KodamasReachEffect() {
|
||||
super(Outcome.PutLandInPlay);
|
||||
staticText = "Search your library for up to two basic land cards, reveal those cards, and put one onto the battlefield tapped and the other into your hand. Then shuffle your library";
|
||||
}
|
||||
|
||||
public KodamasReachEffect(final KodamasReachEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KodamasReachEffect copy() {
|
||||
return new KodamasReachEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
TargetCardInLibrary target = new TargetCardInLibrary(0, 2, new FilterBasicLandCard());
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player.searchLibrary(target, game)) {
|
||||
if (target.getTargets().size() > 0) {
|
||||
Cards revealed = new CardsImpl();
|
||||
for (UUID cardId: (List<UUID>)target.getTargets()) {
|
||||
Card card = player.getLibrary().getCard(cardId, game);
|
||||
revealed.add(card);
|
||||
}
|
||||
player.revealCards("Kodama's Reach", revealed, game);
|
||||
if (target.getTargets().size() == 2) {
|
||||
TargetCard target2 = new TargetCard(Zone.PICK, filter);
|
||||
target2.setRequired(true);
|
||||
player.choose(Outcome.Benefit, revealed, target2, game);
|
||||
Card card = revealed.get(target2.getFirstTarget(), game);
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId());
|
||||
revealed.remove(card);
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
permanent.setTapped(true);
|
||||
}
|
||||
card = revealed.getCards(game).iterator().next();
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
}
|
||||
else if (target.getTargets().size() == 1) {
|
||||
Card card = revealed.getCards(game).iterator().next();
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getId(), source.getControllerId());
|
||||
Permanent permanent = game.getPermanent(card.getId());
|
||||
if (permanent != null) {
|
||||
permanent.setTapped(true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return true;
|
||||
}
|
||||
player.shuffleLibrary(game);
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
108
Mage.Sets/src/mage/sets/conflux/BrackwaterElemental.java
Normal file
108
Mage.Sets/src/mage/sets/conflux/BrackwaterElemental.java
Normal file
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* 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.conflux;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.AttacksOrBlocksTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtEndOfTurnDelayedTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.SacrificeTargetEffect;
|
||||
import mage.abilities.keyword.UnearthAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BrackwaterElemental extends CardImpl<BrackwaterElemental> {
|
||||
|
||||
public BrackwaterElemental(UUID ownerId) {
|
||||
super(ownerId, 21, "Brackwater Elemental", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{U}");
|
||||
this.expansionSetCode = "CON";
|
||||
this.subtype.add("Elemental");
|
||||
|
||||
this.color.setBlue(true);
|
||||
this.power = new MageInt(4);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// When Brackwater Elemental attacks or blocks, sacrifice it at the beginning of the next end step.
|
||||
this.addAbility(new AttacksOrBlocksTriggeredAbility(new BrackwaterElementalSacrificeEffect(), false));
|
||||
// Unearth {2}{U}
|
||||
this.addAbility(new UnearthAbility(new ManaCostsImpl("{2}{U}")));
|
||||
}
|
||||
|
||||
public BrackwaterElemental(final BrackwaterElemental card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrackwaterElemental copy() {
|
||||
return new BrackwaterElemental(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BrackwaterElementalSacrificeEffect extends OneShotEffect<BrackwaterElementalSacrificeEffect> {
|
||||
|
||||
public BrackwaterElementalSacrificeEffect() {
|
||||
super(Outcome.Sacrifice);
|
||||
this.staticText = "sacrifice it at the beginning of the next end step";
|
||||
}
|
||||
|
||||
public BrackwaterElementalSacrificeEffect(final BrackwaterElementalSacrificeEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BrackwaterElementalSacrificeEffect copy() {
|
||||
return new BrackwaterElementalSacrificeEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent != null) {
|
||||
SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice {this}");
|
||||
sacrificeEffect.setTargetPointer(new FixedTarget(sourcePermanent.getId()));
|
||||
DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
|
||||
delayedAbility.setSourceId(source.getSourceId());
|
||||
delayedAbility.setControllerId(source.getControllerId());
|
||||
game.addDelayedTriggeredAbility(delayedAbility);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -63,7 +63,7 @@ public class EtherswornAdjudicator extends CardImpl<EtherswornAdjudicator> {
|
|||
public EtherswornAdjudicator(UUID ownerId) {
|
||||
super(ownerId, 26, "Ethersworn Adjudicator", Rarity.MYTHIC, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{4}{U}");
|
||||
this.expansionSetCode = "CON";
|
||||
this.supertype.add("Legendary");
|
||||
|
||||
this.subtype.add("Vedalken");
|
||||
this.subtype.add("Knight");
|
||||
this.color.setBlue(true);
|
||||
|
|
|
@ -32,8 +32,7 @@ import java.util.UUID;
|
|||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.common.DiscardControllerEffect;
|
||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||
import mage.abilities.effects.common.DrawDiscardControllerEffect;
|
||||
import mage.abilities.keyword.FlashbackAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.TimingRule;
|
||||
|
@ -51,8 +50,7 @@ public class FaithlessLooting extends CardImpl<FaithlessLooting> {
|
|||
this.color.setRed(true);
|
||||
|
||||
// Draw two cards, then discard two cards.
|
||||
this.getSpellAbility().addEffect(new DrawCardControllerEffect(2));
|
||||
this.getSpellAbility().addEffect(new DiscardControllerEffect(2));
|
||||
this.getSpellAbility().addEffect(new DrawDiscardControllerEffect(2,2));
|
||||
// Flashback {2}{R}
|
||||
this.addAbility(new FlashbackAbility(new ManaCostsImpl("{2}{R}"), TimingRule.SORCERY));
|
||||
}
|
||||
|
|
52
Mage.Sets/src/mage/sets/darksteel/StirThePride.java
Normal file
52
Mage.Sets/src/mage/sets/darksteel/StirThePride.java
Normal file
|
@ -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.darksteel;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class StirThePride extends mage.sets.modernmasters.StirThePride {
|
||||
|
||||
public StirThePride(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 16;
|
||||
this.expansionSetCode = "DST";
|
||||
}
|
||||
|
||||
public StirThePride(final StirThePride card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StirThePride copy() {
|
||||
return new StirThePride(this);
|
||||
}
|
||||
}
|
54
Mage.Sets/src/mage/sets/darksteel/TestOfFaith.java
Normal file
54
Mage.Sets/src/mage/sets/darksteel/TestOfFaith.java
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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.darksteel;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TestOfFaith extends mage.sets.modernmasters.TestOfFaith {
|
||||
|
||||
public TestOfFaith(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 17;
|
||||
this.expansionSetCode = "DST";
|
||||
this.rarity = Rarity.UNCOMMON;
|
||||
}
|
||||
|
||||
public TestOfFaith(final TestOfFaith card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TestOfFaith copy() {
|
||||
return new TestOfFaith(this);
|
||||
}
|
||||
}
|
52
Mage.Sets/src/mage/sets/dissension/TrygonPredator.java
Normal file
52
Mage.Sets/src/mage/sets/dissension/TrygonPredator.java
Normal file
|
@ -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.dissension;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class TrygonPredator extends mage.sets.modernmasters.TrygonPredator {
|
||||
|
||||
public TrygonPredator(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 133;
|
||||
this.expansionSetCode = "DIS";
|
||||
}
|
||||
|
||||
public TrygonPredator(final TrygonPredator card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TrygonPredator copy() {
|
||||
return new TrygonPredator(this);
|
||||
}
|
||||
}
|
|
@ -75,6 +75,8 @@ public class AdventOfTheWurm extends CardImpl<AdventOfTheWurm> {
|
|||
subtype.add("Wurm");
|
||||
power = new MageInt(5);
|
||||
toughness = new MageInt(5);
|
||||
expansionSetCode = "RTR";
|
||||
|
||||
addAbility(TrampleAbility.getInstance());
|
||||
}
|
||||
|
||||
|
|
52
Mage.Sets/src/mage/sets/eighthedition/FertileGround.java
Normal file
52
Mage.Sets/src/mage/sets/eighthedition/FertileGround.java
Normal file
|
@ -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.eighthedition;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class FertileGround extends mage.sets.urzassaga.FertileGround {
|
||||
|
||||
public FertileGround(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 248;
|
||||
this.expansionSetCode = "8ED";
|
||||
}
|
||||
|
||||
public FertileGround(final FertileGround card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FertileGround copy() {
|
||||
return new FertileGround(this);
|
||||
}
|
||||
}
|
158
Mage.Sets/src/mage/sets/elspethvstezzeret/BlindingBeam.java
Normal file
158
Mage.Sets/src/mage/sets/elspethvstezzeret/BlindingBeam.java
Normal file
|
@ -0,0 +1,158 @@
|
|||
/*
|
||||
* 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.elspethvstezzeret;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.abilities.effects.common.TapTargetEffect;
|
||||
import mage.abilities.keyword.EntwineAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.PhaseStep;
|
||||
import mage.constants.Rarity;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class BlindingBeam extends CardImpl<BlindingBeam> {
|
||||
|
||||
public BlindingBeam(UUID ownerId) {
|
||||
super(ownerId, 28, "Blinding Beam", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{2}{W}");
|
||||
this.expansionSetCode = "DDF";
|
||||
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Choose one -
|
||||
this.getSpellAbility().getModes().setMinModes(1);
|
||||
this.getSpellAbility().getModes().setMaxModes(1);
|
||||
// Tap two target creatures;
|
||||
this.getSpellAbility().addEffect(new TapTargetEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent(2,2));
|
||||
// or creatures don't untap during target player's next untap step.
|
||||
Mode mode = new Mode();
|
||||
mode.getEffects().add(new BlindingBeamEffect());
|
||||
this.getSpellAbility().getModes().addMode(mode);
|
||||
|
||||
// Entwine {1}
|
||||
this.addAbility(new EntwineAbility("{1}"));
|
||||
}
|
||||
|
||||
public BlindingBeam(final BlindingBeam card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlindingBeam copy() {
|
||||
return new BlindingBeam(this);
|
||||
}
|
||||
}
|
||||
|
||||
class BlindingBeamEffect extends OneShotEffect<BlindingBeamEffect> {
|
||||
|
||||
public BlindingBeamEffect() {
|
||||
super(Outcome.Tap);
|
||||
staticText = "creatures don't untap during target player's next untap step";
|
||||
}
|
||||
|
||||
public BlindingBeamEffect(final BlindingBeamEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null) {
|
||||
for (Permanent creature: game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), player.getId(), game)) {
|
||||
game.addEffect(new BlindingBeamEffect2(creature.getId()), source);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlindingBeamEffect copy() {
|
||||
return new BlindingBeamEffect(this);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class BlindingBeamEffect2 extends ReplacementEffectImpl<BlindingBeamEffect2> {
|
||||
|
||||
protected UUID creatureId;
|
||||
|
||||
public BlindingBeamEffect2(UUID creatureId) {
|
||||
super(Duration.OneUse, Outcome.Detriment);
|
||||
this.creatureId = creatureId;
|
||||
}
|
||||
|
||||
public BlindingBeamEffect2(final BlindingBeamEffect2 effect) {
|
||||
super(effect);
|
||||
creatureId = effect.creatureId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BlindingBeamEffect2 copy() {
|
||||
return new BlindingBeamEffect2(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
used = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getTurn().getStepType() == PhaseStep.UNTAP &&
|
||||
event.getType() == EventType.UNTAP &&
|
||||
event.getTargetId().equals(creatureId)) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -28,16 +28,16 @@
|
|||
package mage.sets.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SpellCastTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
||||
import mage.abilities.keyword.FirstStrikeAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
@ -63,9 +63,14 @@ public class BelligerentHatchling extends CardImpl<BelligerentHatchling> {
|
|||
this.color.setWhite(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// First strike
|
||||
this.addAbility(FirstStrikeAbility.getInstance());
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4))));
|
||||
// Belligerent Hatchling enters the battlefield with four -1/-1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4))));
|
||||
// Whenever you cast a red spell, remove a -1/-1 counter from Belligerent Hatchling.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterRedSpell, false));
|
||||
// Whenever you cast a white spell, remove a -1/-1 counter from Belligerent Hatchling.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterWhiteSpell, false));
|
||||
}
|
||||
|
||||
|
|
90
Mage.Sets/src/mage/sets/eventide/CloutOfTheDominus.java
Normal file
90
Mage.Sets/src/mage/sets/eventide/CloutOfTheDominus.java
Normal file
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* 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.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.EnchantedCreatureColorCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.keyword.HasteAbility;
|
||||
import mage.abilities.keyword.ShroudAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class CloutOfTheDominus extends CardImpl<CloutOfTheDominus> {
|
||||
|
||||
public CloutOfTheDominus(UUID ownerId) {
|
||||
super(ownerId, 99, "Clout of the Dominus", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{U/R}");
|
||||
this.expansionSetCode = "EVE";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setBlue(true);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
// As long as enchanted creature is blue, it gets +1/+1 and has shroud.
|
||||
SimpleStaticAbility blueAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.BLUE), "As long as enchanted creature is black, it gets +1/+1"));
|
||||
blueAbility.addEffect(new ConditionalContinousEffect(new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.BLUE), "and has deathtouch"));
|
||||
this.addAbility(blueAbility);
|
||||
// As long as enchanted creature is red, it gets +1/+1 and has haste.
|
||||
SimpleStaticAbility redAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.RED), "As long as enchanted creature is red, it gets +1/+1"));
|
||||
redAbility.addEffect(new ConditionalContinousEffect(new GainAbilityAttachedEffect(HasteAbility.getInstance(), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.RED), "and has haste"));
|
||||
this.addAbility(redAbility);
|
||||
}
|
||||
|
||||
public CloutOfTheDominus(final CloutOfTheDominus card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CloutOfTheDominus copy() {
|
||||
return new CloutOfTheDominus(this);
|
||||
}
|
||||
}
|
105
Mage.Sets/src/mage/sets/eventide/ColdEyedSelkie.java
Normal file
105
Mage.Sets/src/mage/sets/eventide/ColdEyedSelkie.java
Normal file
|
@ -0,0 +1,105 @@
|
|||
/*
|
||||
* 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.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.IslandwalkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ColdEyedSelkie extends CardImpl<ColdEyedSelkie> {
|
||||
|
||||
public ColdEyedSelkie(UUID ownerId) {
|
||||
super(ownerId, 149, "Cold-Eyed Selkie", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{G/U}{G/U}");
|
||||
this.expansionSetCode = "EVE";
|
||||
this.subtype.add("Merfolk");
|
||||
this.subtype.add("Rogue");
|
||||
|
||||
this.color.setBlue(true);
|
||||
this.color.setGreen(true);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// Islandwalk
|
||||
this.addAbility(new IslandwalkAbility());
|
||||
// Whenever Cold-Eyed Selkie deals combat damage to a player, you may draw that many cards.
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new ColdEyeSelkieEffect(), true, true));
|
||||
|
||||
}
|
||||
|
||||
public ColdEyedSelkie(final ColdEyedSelkie card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColdEyedSelkie copy() {
|
||||
return new ColdEyedSelkie(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ColdEyeSelkieEffect extends OneShotEffect<ColdEyeSelkieEffect> {
|
||||
|
||||
public ColdEyeSelkieEffect() {
|
||||
super(Outcome.DrawCard);
|
||||
this.staticText = "draw that many cards";
|
||||
}
|
||||
|
||||
public ColdEyeSelkieEffect(final ColdEyeSelkieEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ColdEyeSelkieEffect copy() {
|
||||
return new ColdEyeSelkieEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int amount = (Integer) getValue("damage");
|
||||
if (amount > 0) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
controller.drawCards(amount, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
86
Mage.Sets/src/mage/sets/eventide/EdgeOfTheDivinity.java
Normal file
86
Mage.Sets/src/mage/sets/eventide/EdgeOfTheDivinity.java
Normal file
|
@ -0,0 +1,86 @@
|
|||
/*
|
||||
* 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.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.EnchantedCreatureColorCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class EdgeOfTheDivinity extends CardImpl<EdgeOfTheDivinity> {
|
||||
|
||||
public EdgeOfTheDivinity(UUID ownerId) {
|
||||
super(ownerId, 87, "Edge of the Divinity", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{W/B}");
|
||||
this.expansionSetCode = "EVE";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
// As long as enchanted creature is white, it gets +1/+2.
|
||||
SimpleStaticAbility whiteAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(1, 2), new EnchantedCreatureColorCondition(ObjectColor.WHITE), "As long as enchanted creature is white, it gets +1/+2"));
|
||||
this.addAbility(whiteAbility);
|
||||
// As long as enchanted creature is black, it gets +2/+1.
|
||||
SimpleStaticAbility blackAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(2, 1), new EnchantedCreatureColorCondition(ObjectColor.BLACK), "As long as enchanted creature is black, it gets +2/+1"));
|
||||
this.addAbility(blackAbility);
|
||||
}
|
||||
|
||||
public EdgeOfTheDivinity(final EdgeOfTheDivinity card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public EdgeOfTheDivinity copy() {
|
||||
return new EdgeOfTheDivinity(this);
|
||||
}
|
||||
}
|
90
Mage.Sets/src/mage/sets/eventide/FavorOfTheOverbeing.java
Normal file
90
Mage.Sets/src/mage/sets/eventide/FavorOfTheOverbeing.java
Normal file
|
@ -0,0 +1,90 @@
|
|||
/*
|
||||
* 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.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.EnchantedCreatureColorCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.abilities.keyword.VigilanceAbility;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class FavorOfTheOverbeing extends CardImpl<FavorOfTheOverbeing> {
|
||||
|
||||
public FavorOfTheOverbeing(UUID ownerId) {
|
||||
super(ownerId, 151, "Favor of the Overbeing", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G/U}");
|
||||
this.expansionSetCode = "EVE";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
this.color.setBlue(true);
|
||||
this.color.setGreen(true);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
// As long as enchanted creature is green, it gets +1/+1 and has vigilance.
|
||||
SimpleStaticAbility greenAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.GREEN), "As long as enchanted creature is green, it gets +1/+1"));
|
||||
greenAbility.addEffect(new ConditionalContinousEffect(new GainAbilityAttachedEffect(VigilanceAbility.getInstance(), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.GREEN), "and has vigilance"));
|
||||
this.addAbility(greenAbility);
|
||||
// As long as enchanted creature is blue, it gets +1/+1 and has flying.
|
||||
SimpleStaticAbility blueAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.BLUE), "As long as enchanted creature is blue, it gets +1/+1"));
|
||||
blueAbility.addEffect(new ConditionalContinousEffect(new GainAbilityAttachedEffect(FlyingAbility.getInstance(), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.BLUE), "and has flying"));
|
||||
this.addAbility(blueAbility);
|
||||
}
|
||||
|
||||
public FavorOfTheOverbeing(final FavorOfTheOverbeing card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public FavorOfTheOverbeing copy() {
|
||||
return new FavorOfTheOverbeing(this);
|
||||
}
|
||||
}
|
89
Mage.Sets/src/mage/sets/eventide/GiftOfTheDeity.java
Normal file
89
Mage.Sets/src/mage/sets/eventide/GiftOfTheDeity.java
Normal file
|
@ -0,0 +1,89 @@
|
|||
/*
|
||||
* 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.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.EnchantedCreatureColorCondition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.MustBlockAttachedEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.DeathtouchAbility;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class GiftOfTheDeity extends CardImpl<GiftOfTheDeity> {
|
||||
|
||||
public GiftOfTheDeity(UUID ownerId) {
|
||||
super(ownerId, 122, "Gift of the Deity", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{4}{B/G}");
|
||||
this.expansionSetCode = "EVE";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
// As long as enchanted creature is black, it gets +1/+1 and has deathtouch.
|
||||
SimpleStaticAbility blackAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.BLACK), "As long as enchanted creature is black, it gets +1/+1"));
|
||||
blackAbility.addEffect(new ConditionalContinousEffect(new GainAbilityAttachedEffect(DeathtouchAbility.getInstance(), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.BLACK), "and has deathtouch"));
|
||||
this.addAbility(blackAbility);
|
||||
// As long as enchanted creature is green, it gets +1/+1 and all creatures able to block it do so.
|
||||
SimpleStaticAbility greenAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.GREEN), "As long as enchanted creature is green, it gets +1/+1"));
|
||||
greenAbility.addEffect(new ConditionalContinousEffect(new MustBlockAttachedEffect(AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.GREEN), "and all creatures able to block it do so"));
|
||||
this.addAbility(greenAbility);
|
||||
}
|
||||
|
||||
public GiftOfTheDeity(final GiftOfTheDeity card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GiftOfTheDeity copy() {
|
||||
return new GiftOfTheDeity(this);
|
||||
}
|
||||
}
|
|
@ -28,16 +28,16 @@
|
|||
package mage.sets.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SpellCastTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
||||
import mage.abilities.keyword.WitherAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
@ -64,9 +64,14 @@ public class NoxiousHatchling extends CardImpl<NoxiousHatchling> {
|
|||
this.color.setBlack(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)), false));
|
||||
|
||||
// Noxious Hatchling enters the battlefield with four -1/-1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)), true));
|
||||
// Wither (This deals damage to creatures in the form of -1/-1 counters.)
|
||||
this.addAbility(WitherAbility.getInstance());
|
||||
// Whenever you cast a black spell, remove a -1/-1 counter from Noxious Hatchling.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filterBlackSpell, false));
|
||||
// Whenever you cast a green spell, remove a -1/-1 counter from Noxious Hatchling.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance()), filterGreenSpell, false));
|
||||
}
|
||||
|
||||
|
|
92
Mage.Sets/src/mage/sets/eventide/ScourgeOfTheNobilis.java
Normal file
92
Mage.Sets/src/mage/sets/eventide/ScourgeOfTheNobilis.java
Normal file
|
@ -0,0 +1,92 @@
|
|||
/*
|
||||
* 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.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.common.EnchantedCreatureColorCondition;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.continious.BoostEnchantedEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.continious.GainAbilityAttachedEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.AttachmentType;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class ScourgeOfTheNobilis extends CardImpl<ScourgeOfTheNobilis> {
|
||||
|
||||
public ScourgeOfTheNobilis(UUID ownerId) {
|
||||
super(ownerId, 146, "Scourge of the Nobilis", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{2}{R/W}");
|
||||
this.expansionSetCode = "EVE";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.color.setWhite(true);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.AddAbility));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
// As long as enchanted creature is red, it gets +1/+1 and has "{RW}: This creature gets +1/+0 until end of turn."
|
||||
SimpleStaticAbility redAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.RED), "As long as enchanted creature is red, it gets +1/+1"));
|
||||
redAbility.addEffect(new ConditionalContinousEffect(new GainAbilityAttachedEffect(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R/W}")), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.RED), "and has \"{R/W}: This creature gets +1/+0 until end of turn.\""));
|
||||
this.addAbility(redAbility);
|
||||
// As long as enchanted creature is white, it gets +1/+1 and has lifelink.
|
||||
SimpleStaticAbility whiteAbility = new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(new BoostEnchantedEffect(1, 1), new EnchantedCreatureColorCondition(ObjectColor.WHITE), "As long as enchanted creature is white, it gets +1/+1"));
|
||||
whiteAbility.addEffect(new ConditionalContinousEffect(new GainAbilityAttachedEffect(LifelinkAbility.getInstance(), AttachmentType.AURA), new EnchantedCreatureColorCondition(ObjectColor.WHITE), "and has lifelink"));
|
||||
this.addAbility(whiteAbility);
|
||||
}
|
||||
|
||||
public ScourgeOfTheNobilis(final ScourgeOfTheNobilis card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ScourgeOfTheNobilis copy() {
|
||||
return new ScourgeOfTheNobilis(this);
|
||||
}
|
||||
}
|
|
@ -28,12 +28,9 @@
|
|||
package mage.sets.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SpellCastTriggeredAbility;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
|
@ -42,7 +39,9 @@ import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
|||
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
||||
import mage.abilities.keyword.ShroudAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterSpell;
|
||||
|
@ -69,9 +68,14 @@ public class SturdyHatchling extends CardImpl<SturdyHatchling> {
|
|||
this.color.setGreen(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4)), false));
|
||||
|
||||
// Sturdy Hatchling enters the battlefield with four -1/-1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4))));
|
||||
// {G/U}: Sturdy Hatchling gains shroud until end of turn.
|
||||
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new GainAbilitySourceEffect(ShroudAbility.getInstance(), Duration.EndOfTurn), new ManaCostsImpl("{G/U}")));
|
||||
// Whenever you cast a green spell, remove a -1/-1 counter from Sturdy Hatchling.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterGreenSpell, false));
|
||||
// Whenever you cast a blue spell, remove a -1/-1 counter from Sturdy Hatchling.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterBlueSpell, false));
|
||||
}
|
||||
|
||||
|
|
|
@ -28,16 +28,16 @@
|
|||
package mage.sets.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldAbility;
|
||||
import mage.abilities.common.SpellCastTriggeredAbility;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
||||
import mage.abilities.keyword.LifelinkAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
@ -63,9 +63,14 @@ public class VoraciousHatchling extends CardImpl<VoraciousHatchling> {
|
|||
this.color.setWhite(true);
|
||||
this.power = new MageInt(6);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Lifelink
|
||||
this.addAbility(LifelinkAbility.getInstance());
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4))));
|
||||
// Voracious Hatchling enters the battlefield with four -1/-1 counters on it.
|
||||
this.addAbility(new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.M1M1.createInstance(4))));
|
||||
// Whenever you cast a white spell, remove a -1/-1 counter from Voracious Hatchling.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterWhiteSpell, false));
|
||||
// Whenever you cast a black spell, remove a -1/-1 counter from Voracious Hatchling.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new RemoveCounterSourceEffect(CounterType.M1M1.createInstance(1)), filterBlackSpell, false));
|
||||
}
|
||||
|
||||
|
|
84
Mage.Sets/src/mage/sets/eventide/WormHarvest.java
Normal file
84
Mage.Sets/src/mage/sets/eventide/WormHarvest.java
Normal file
|
@ -0,0 +1,84 @@
|
|||
/*
|
||||
* 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.eventide;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.CardsInControllerGraveyardCount;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.keyword.RetraceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.TimingRule;
|
||||
import mage.filter.common.FilterLandCard;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class WormHarvest extends CardImpl<WormHarvest> {
|
||||
|
||||
public WormHarvest(UUID ownerId) {
|
||||
super(ownerId, 131, "Worm Harvest", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{2}{B/G}{B/G}{B/G}");
|
||||
this.expansionSetCode = "EVE";
|
||||
|
||||
this.color.setGreen(true);
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Put a 1/1 black and green Worm creature token onto the battlefield for each land card in your graveyard.
|
||||
CardsInControllerGraveyardCount value = new CardsInControllerGraveyardCount(new FilterLandCard());
|
||||
this.getSpellAbility().addEffect(new CreateTokenEffect(new WormHarvestToken(), value));
|
||||
|
||||
// Retrace
|
||||
this.addAbility(new RetraceAbility(new ManaCostsImpl("{2}{B/G}{B/G}{B/G}"), TimingRule.SORCERY));
|
||||
}
|
||||
|
||||
public WormHarvest(final WormHarvest card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WormHarvest copy() {
|
||||
return new WormHarvest(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WormHarvestToken extends Token {
|
||||
WormHarvestToken() {
|
||||
super("Worm", "1/1 black and green Worm creature token");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setBlack(true);
|
||||
color.setGreen(true);
|
||||
subtype.add("Worm");
|
||||
power = new MageInt(1);
|
||||
toughness = new MageInt(1);
|
||||
}
|
||||
}
|
|
@ -100,7 +100,11 @@ class ErraticPortalEffect extends OneShotEffect<ErraticPortalEffect> {
|
|||
Player player = game.getPlayer(targetCreature.getControllerId());
|
||||
if (player != null) {
|
||||
cost.clearPaid();
|
||||
if (!cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), false)) {
|
||||
final StringBuilder sb = new StringBuilder("Pay {1} otherwise ").append(targetCreature.getName()).append(" will be returned to its owner's hand)");
|
||||
if (player.chooseUse(Outcome.Benefit, sb.toString(), game)) {
|
||||
cost.pay(source, game, targetCreature.getControllerId(), targetCreature.getControllerId(), true);
|
||||
}
|
||||
if (!cost.isPaid()) {
|
||||
return targetCreature.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -35,8 +35,8 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.StateTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SkipUntapOptionalAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.condition.common.ControlsPermanentCondition;
|
||||
import mage.abilities.condition.common.SourceTappedCondition;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.SacrificeSourceEffect;
|
||||
|
@ -89,7 +89,7 @@ public class Seasinger extends CardImpl<Seasinger> {
|
|||
this.addAbility(new SkipUntapOptionalAbility());
|
||||
|
||||
// {tap}: Gain control of target creature whose controller controls an Island for as long as you control Seasinger and Seasinger remains tapped.
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainControlTargetEffect(Duration.Custom), new ControlsPermanentCondition(seasinger, ControlsPermanentCondition.CountType.EQUAL_TO, 1, TappedCondition.getInstance()), rule);
|
||||
ConditionalContinousEffect effect = new ConditionalContinousEffect(new GainControlTargetEffect(Duration.Custom), new ControlsPermanentCondition(seasinger, ControlsPermanentCondition.CountType.EQUAL_TO, 1, SourceTappedCondition.getInstance()), rule);
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new TapSourceCost());
|
||||
creatureWhoseControllerControlsIsland.add(new ControllerControlsIslandPredicate());
|
||||
ability.addTarget(new TargetCreaturePermanent(creatureWhoseControllerControlsIsland));
|
||||
|
@ -148,21 +148,3 @@ class SeasingerTriggeredAbility extends StateTriggeredAbility<SeasingerTriggered
|
|||
return "When you control no islands, sacrifice {this}.";
|
||||
}
|
||||
}
|
||||
|
||||
class TappedCondition implements Condition {
|
||||
|
||||
private static TappedCondition fInstance = new TappedCondition();
|
||||
|
||||
public static Condition getInstance() {
|
||||
return fInstance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent seasinger = game.getBattlefield().getPermanent(source.getSourceId());
|
||||
if (seasinger != null) {
|
||||
return seasinger.isTapped();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
54
Mage.Sets/src/mage/sets/fifthdawn/ArcboundWanderer.java
Normal file
54
Mage.Sets/src/mage/sets/fifthdawn/ArcboundWanderer.java
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* 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.fifthdawn;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.constants.Rarity;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ArcboundWanderer extends mage.sets.modernmasters.ArcboundWanderer {
|
||||
|
||||
public ArcboundWanderer(UUID ownerId) {
|
||||
super(ownerId);
|
||||
this.cardNumber = 103;
|
||||
this.expansionSetCode = "5DN";
|
||||
this.rarity = Rarity.UNCOMMON;
|
||||
}
|
||||
|
||||
public ArcboundWanderer(final ArcboundWanderer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArcboundWanderer copy() {
|
||||
return new ArcboundWanderer(this);
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue