- Fixed max hand size.

This commit is contained in:
Sloth
2012-11-28 12:52:27 +00:00
parent b7bfe6781e
commit 0019b72cc9
14 changed files with 40 additions and 17 deletions

View File

@@ -2,7 +2,7 @@ Name:Anvil of Bogardan
ManaCost:2 ManaCost:2
Types:Artifact Types:Artifact
Text:no text Text:no text
S:Mode$ Continuous | Affected$ Player | SetMaxHandSize$ -1 | Description$ Players have no maximum hand size. S:Mode$ Continuous | Affected$ Player | SetMaxHandSize$ Unlimited | Description$ Players have no maximum hand size.
T:Mode$ Phase | Phase$ Draw | ValidPlayer$ Player | TriggerZones$ Battlefield | Execute$ TrigDraw | TriggerDescription$ At the beginning of each player's draw step, that player draws an additional card, then discards a card. T:Mode$ Phase | Phase$ Draw | ValidPlayer$ Player | TriggerZones$ Battlefield | Execute$ TrigDraw | TriggerDescription$ At the beginning of each player's draw step, that player draws an additional card, then discards a card.
SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ TriggeredPlayer | SubAbility$ DBDiscard SVar:TrigDraw:AB$ Draw | Cost$ 0 | NumCards$ 1 | Defined$ TriggeredPlayer | SubAbility$ DBDiscard
SVar:DBDiscard:DB$Discard | Defined$ TriggeredPlayer | NumCards$ 1 | Mode$ TgtChoose SVar:DBDiscard:DB$Discard | Defined$ TriggeredPlayer | NumCards$ 1 | Mode$ TgtChoose

View File

@@ -3,7 +3,7 @@ ManaCost:no cost
Types:Vanguard Types:Vanguard
Text:no text Text:no text
HandLifeModifier:-1/+1 HandLifeModifier:-1/+1
S:Mode$ Continuous | EffectZone$ Command | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. S:Mode$ Continuous | EffectZone$ Command | Affected$ You | SetMaxHandSize$ Unlimited | Description$ You have no maximum hand size.
A:AB$ Draw | ActivationZone$ Command | Cost$ 0 | NumCards$ 3 | Defined$ You | ActivationLimit$ 1 | SubAbility$ DBSkipTurn | SpellDescription$ Draw three cards. You skip your next turn. Activate this ability only once each turn. A:AB$ Draw | ActivationZone$ Command | Cost$ 0 | NumCards$ 3 | Defined$ You | ActivationLimit$ 1 | SubAbility$ DBSkipTurn | SpellDescription$ Draw three cards. You skip your next turn. Activate this ability only once each turn.
SVar:DBSkipTurn:DB$ AddTurn | NumTurns$ 1 | Defined$ Opponent SVar:DBSkipTurn:DB$ AddTurn | NumTurns$ 1 | Defined$ Opponent
SVar:RemAIDeck:True SVar:RemAIDeck:True

View File

@@ -3,7 +3,7 @@ ManaCost:2 U
Types:Creature Human Wizard Types:Creature Human Wizard
Text:no text Text:no text
PT:1/3 PT:1/3
S:Mode$ Continuous | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. S:Mode$ Continuous | Affected$ You | SetMaxHandSize$ Unlimited | Description$ You have no maximum hand size.
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/graceful_adept.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/graceful_adept.jpg
SetInfo:CHK|Uncommon|http://magiccards.info/scans/en/chk/63.jpg SetInfo:CHK|Uncommon|http://magiccards.info/scans/en/chk/63.jpg

View File

@@ -5,7 +5,7 @@ Text:no text
A:SP$ ChangeZoneAll | Cost$ 5 G G G | Origin$ Graveyard | Destination$ Hand | ChangeType$ Card.YouOwn | SubAbility$ DBChange | SpellDescription$ Return all cards from your graveyard to your hand. Exile CARDNAME. You have no maximum hand size for the rest of the game. A:SP$ ChangeZoneAll | Cost$ 5 G G G | Origin$ Graveyard | Destination$ Hand | ChangeType$ Card.YouOwn | SubAbility$ DBChange | SpellDescription$ Return all cards from your graveyard to your hand. Exile CARDNAME. You have no maximum hand size for the rest of the game.
SVar:DBChange:DB$ChangeZone | Origin$ Stack | Destination$ Exile | SubAbility$ DBEffect SVar:DBChange:DB$ChangeZone | Origin$ Stack | Destination$ Exile | SubAbility$ DBEffect
SVar:DBEffect:DB$ Effect | Name$ Praetor's Counsel Effect | StaticAbilities$ STHandSize | Duration$ Permanent SVar:DBEffect:DB$ Effect | Name$ Praetor's Counsel Effect | StaticAbilities$ STHandSize | Duration$ Permanent
SVar:STHandSize:Mode$ Continuous | EffectZone$ Command | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. SVar:STHandSize:Mode$ Continuous | EffectZone$ Command | Affected$ You | SetMaxHandSize$ Unlimited | Description$ You have no maximum hand size.
SVar:Rarity:Mythic SVar:Rarity:Mythic
SVar:Picture:http://www.wizards.com/global/images/magic/general/praetors_counsel.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/praetors_counsel.jpg
SetInfo:MBS|Mythic|http://magiccards.info/scans/en/mbs/88.jpg SetInfo:MBS|Mythic|http://magiccards.info/scans/en/mbs/88.jpg

View File

@@ -2,7 +2,7 @@ Name:Reliquary Tower
ManaCost:no cost ManaCost:no cost
Types:Land Types:Land
Text:no text Text:no text
S:Mode$ Continuous | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. S:Mode$ Continuous | Affected$ You | SetMaxHandSize$ Unlimited | Description$ You have no maximum hand size.
A:AB$ Mana | Cost$ T | Produced$ 1 | SpellDescription$ Add 1 to your mana pool. A:AB$ Mana | Cost$ T | Produced$ 1 | SpellDescription$ Add 1 to your mana pool.
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/reliquary_tower.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/reliquary_tower.jpg

View File

@@ -2,7 +2,7 @@ Name:Spellbook
ManaCost:0 ManaCost:0
Types:Artifact Types:Artifact
Text:no text Text:no text
S:Mode$ Continuous | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. S:Mode$ Continuous | Affected$ You | SetMaxHandSize$ Unlimited | Description$ You have no maximum hand size.
SVar:RemRandomDeck:True SVar:RemRandomDeck:True
SVar:Rarity:Uncommon SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/spellbook.jpg SVar:Picture:http://www.wizards.com/global/images/magic/general/spellbook.jpg

View File

@@ -8,7 +8,7 @@ SVar:TamiyoPump:DB$ Pump | Defined$ Targeted | Permanent$ True | KW$ HIDDEN This
A:AB$ Draw | Cost$ SubCounter<2/LOYALTY> | ValidTgts$ Player | TgtPrompt$ Select target player | Defined$ You | NumCards$ X | References$ X | Planeswalker$ True | SpellDescription$ Draw a card for each tapped creature target player controls. A:AB$ Draw | Cost$ SubCounter<2/LOYALTY> | ValidTgts$ Player | TgtPrompt$ Select target player | Defined$ You | NumCards$ X | References$ X | Planeswalker$ True | SpellDescription$ Draw a card for each tapped creature target player controls.
SVar:X:Count$Valid Creature.tapped+TargetedPlayerCtrl SVar:X:Count$Valid Creature.tapped+TargetedPlayerCtrl
A:AB$ Effect | Cost$ SubCounter<8/LOYALTY> | Planeswalker$ True | Ultimate$ True | Name$ Tamiyo, the Moon Sage emblem | Image$ tamiyo_the_moon_sage_emblem | StaticAbilities$ UnlimitedHand | Triggers$ TamiyoCardToGrave | SVars$ TamiyoReturn | Stackable$ False | Duration$ Permanent | AILogic$ Always | SpellDescription$ You get an emblem with "You have no maximum hand size" and "Whenever a card is put into your graveyard from anywhere, you may return it to your hand." A:AB$ Effect | Cost$ SubCounter<8/LOYALTY> | Planeswalker$ True | Ultimate$ True | Name$ Tamiyo, the Moon Sage emblem | Image$ tamiyo_the_moon_sage_emblem | StaticAbilities$ UnlimitedHand | Triggers$ TamiyoCardToGrave | SVars$ TamiyoReturn | Stackable$ False | Duration$ Permanent | AILogic$ Always | SpellDescription$ You get an emblem with "You have no maximum hand size" and "Whenever a card is put into your graveyard from anywhere, you may return it to your hand."
SVar:UnlimitedHand:Mode$ Continuous | EffectZone$ Command | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. SVar:UnlimitedHand:Mode$ Continuous | EffectZone$ Command | Affected$ You | SetMaxHandSize$ Unlimited | Description$ You have no maximum hand size.
SVar:TamiyoCardToGrave:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Card.nonToken+YouCtrl | OptionalDecider$ You | Execute$ TamiyoReturn | TriggerDescription$ Whenever a card is put into your graveyard from anywhere, you may return it to your hand. SVar:TamiyoCardToGrave:Mode$ ChangesZone | Origin$ Any | Destination$ Graveyard | ValidCard$ Card.nonToken+YouCtrl | OptionalDecider$ You | Execute$ TamiyoReturn | TriggerDescription$ Whenever a card is put into your graveyard from anywhere, you may return it to your hand.
SVar:TamiyoReturn:AB$ ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Hand SVar:TamiyoReturn:AB$ ChangeZone | Cost$ 0 | Defined$ TriggeredCard | Origin$ Graveyard | Destination$ Hand
SVar:Rarity:Mythic SVar:Rarity:Mythic

View File

@@ -2,7 +2,7 @@ Name:Venser's Journal
ManaCost:5 ManaCost:5
Types:Artifact Types:Artifact
Text:no text Text:no text
S:Mode$ Continuous | Affected$ You | SetMaxHandSize$ -1 | Description$ You have no maximum hand size. S:Mode$ Continuous | Affected$ You | SetMaxHandSize$ Unlimited | Description$ You have no maximum hand size.
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigGainLife | TriggerDescription$ At the beginning of your upkeep, you gain 1 life for each card in your hand. T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigGainLife | TriggerDescription$ At the beginning of your upkeep, you gain 1 life for each card in your hand.
SVar:TrigGainLife:AB$GainLife | Cost$ 0 | LifeAmount$ X | References$ X SVar:TrigGainLife:AB$GainLife | Cost$ 0 | LifeAmount$ X | References$ X
SVar:X:Count$InYourHand SVar:X:Count$InYourHand

View File

@@ -159,6 +159,9 @@ public class StaticEffects {
// modify players // modify players
for (final Player p : affectedPlayers) { for (final Player p : affectedPlayers) {
p.setUnlimitedHandSize(false);
p.setMaxHandSize(7);
if (params.containsKey("AddKeyword")) { if (params.containsKey("AddKeyword")) {
addKeywords = params.get("AddKeyword").split(" & "); addKeywords = params.get("AddKeyword").split(" & ");
} }

View File

@@ -285,12 +285,16 @@ public class StaticAbilityContinuous {
if (params.containsKey("SetMaxHandSize")) { if (params.containsKey("SetMaxHandSize")) {
String mhs = params.get("SetMaxHandSize"); String mhs = params.get("SetMaxHandSize");
int max = mhs.matches("[0-9][0-9]?") ? Integer.parseInt(mhs) if (mhs.equals("Unlimited")) {
: AbilityFactory.calculateAmount(hostCard, mhs, null); p.setUnlimitedHandSize(true);
p.setMaxHandSize(max); } else {
int max = mhs.matches("[0-9][0-9]?") ? Integer.parseInt(mhs)
: AbilityFactory.calculateAmount(hostCard, mhs, null);
p.setMaxHandSize(max);
}
} }
if (params.containsKey("RaiseMaxHandSize") && p.getMaxHandSize() != -1) { if (params.containsKey("RaiseMaxHandSize")) {
String rmhs = params.get("RaiseMaxHandSize"); String rmhs = params.get("RaiseMaxHandSize");
int rmax = rmhs.matches("[0-9][0-9]?") ? Integer.parseInt(rmhs) int rmax = rmhs.matches("[0-9][0-9]?") ? Integer.parseInt(rmhs)
: AbilityFactory.calculateAmount(hostCard, rmhs, null); : AbilityFactory.calculateAmount(hostCard, rmhs, null);

View File

@@ -50,7 +50,7 @@ public class InputCleanup extends Input {
final int n = active.getCardsIn(ZoneType.Hand).size(); final int n = active.getCardsIn(ZoneType.Hand).size();
final int max = active.getMaxHandSize(); final int max = active.getMaxHandSize();
// goes to the next phase // goes to the next phase
if (n <= max || n <= 0) { if (active.isUnlimitedHandSize() || n <= max || n <= 0) {
Singletons.getModel().getGame().getPhaseHandler().passPriority(); Singletons.getModel().getGame().getPhaseHandler().passPriority();
return; return;
} }
@@ -84,7 +84,7 @@ public class InputCleanup extends Input {
public void aiCleanupDiscard(final Player ai) { public void aiCleanupDiscard(final Player ai) {
final int size = ai.getCardsIn(ZoneType.Hand).size(); final int size = ai.getCardsIn(ZoneType.Hand).size();
if (ai.getMaxHandSize() != -1) { if (!ai.isUnlimitedHandSize()) {
final int numDiscards = size - ai.getMaxHandSize(); final int numDiscards = size - ai.getMaxHandSize();
ai.discard(numDiscards, null); ai.discard(numDiscards, null);
} }

View File

@@ -20,7 +20,6 @@ import forge.CardPredicates;
import forge.CardUtil; import forge.CardUtil;
import forge.GameAction; import forge.GameAction;
import forge.Singletons; import forge.Singletons;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.trigger.TriggerHandler; import forge.card.trigger.TriggerHandler;
import forge.card.trigger.TriggerType; import forge.card.trigger.TriggerType;
import forge.control.input.InputControl; import forge.control.input.InputControl;
@@ -34,7 +33,6 @@ import forge.game.player.Player;
import forge.game.zone.PlayerZone; import forge.game.zone.PlayerZone;
import forge.game.zone.ZoneType; import forge.game.zone.ZoneType;
import forge.gui.match.views.VAntes; import forge.gui.match.views.VAntes;
import forge.item.CardDb;
import forge.item.CardPrinted; import forge.item.CardPrinted;
import forge.properties.ForgePreferences.FPref; import forge.properties.ForgePreferences.FPref;
import forge.util.Aggregates; import forge.util.Aggregates;

View File

@@ -108,6 +108,9 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
/** The max hand size. */ /** The max hand size. */
private int maxHandSize = 7; private int maxHandSize = 7;
/** The unlimited hand size. */
private boolean unlimitedHandSize = false;
/** The last drawn card. */ /** The last drawn card. */
private Card lastDrawnCard = null; private Card lastDrawnCard = null;
@@ -2520,6 +2523,21 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
maxHandSize = size; maxHandSize = size;
} }
/**
* @return the unlimitedHandSize
*/
public boolean isUnlimitedHandSize() {
return unlimitedHandSize;
}
/**
* @param unlimitedHandSize0 the unlimitedHandSize to set
*/
public void setUnlimitedHandSize(boolean unlimited) {
this.unlimitedHandSize = unlimited;
}
/** /**
* <p> * <p>
* Getter for the field <code>maxLandsToPlay</code>. * Getter for the field <code>maxLandsToPlay</code>.

View File

@@ -325,7 +325,7 @@ public class VField implements IVDoc<CField> {
*/ */
public void updateZones(final Player p0) { public void updateZones(final Player p0) {
this.getLblHand().setText("" + p0.getZone(ZoneType.Hand).size()); this.getLblHand().setText("" + p0.getZone(ZoneType.Hand).size());
final String handMaxToolTip = p0.getMaxHandSize() < 0 final String handMaxToolTip = p0.isUnlimitedHandSize()
? "no maximum hand size" : String.valueOf(p0.getMaxHandSize()); ? "no maximum hand size" : String.valueOf(p0.getMaxHandSize());
this.getLblHand().setToolTipText("Cards in hand (max: " + handMaxToolTip + ")"); this.getLblHand().setToolTipText("Cards in hand (max: " + handMaxToolTip + ")");
this.getLblGraveyard().setText("" + p0.getZone(ZoneType.Graveyard).size()); this.getLblGraveyard().setText("" + p0.getZone(ZoneType.Graveyard).size());