- Added Phase requirements to static abilities.

- Added Hand to Hand.
This commit is contained in:
Sloth
2011-11-05 08:45:10 +00:00
parent 2ecfbffda6
commit 5a38a19f8d
3 changed files with 38 additions and 7 deletions

1
.gitattributes vendored
View File

@@ -3620,6 +3620,7 @@ res/cardsfolder/h/hand_of_emrakul.txt svneol=native#text/plain
res/cardsfolder/h/hand_of_honor.txt svneol=native#text/plain
res/cardsfolder/h/hand_of_justice.txt svneol=native#text/plain
res/cardsfolder/h/hand_of_the_praetors.txt svneol=native#text/plain
res/cardsfolder/h/hand_to_hand.txt -text
res/cardsfolder/h/hanna_ships_navigator.txt svneol=native#text/plain
res/cardsfolder/h/hannas_custody.txt svneol=native#text/plain
res/cardsfolder/h/hanweir_watchkeep_bane_of_hanweir.txt -text

View File

@@ -0,0 +1,12 @@
Name:Hand to Hand
ManaCost:2 R
Types:Enchantment
Text:no text
S:Mode$ CantBeCast | ValidCard$ Instant | Phases$ BeginCombat->EndCombat | Description$ During combat, players can't cast instant spells or activate abilities that aren't mana abilities.
S:Mode$ CantBeActivated | ValidCard$ Card| Phases$ BeginCombat->EndCombat | NonMana$ True
SVar:RemRandomDeck:True
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/hand_to_hand.jpg
SetInfo:TMP|Rare|http://magiccards.info/scans/en/tp/180.jpg
Oracle:During combat, players can't cast instant spells or activate abilities that aren't mana abilities.
End

View File

@@ -327,33 +327,51 @@ public class StaticAbility {
Zone effectZone = Zone.Battlefield; // default
if (this.mapParams.containsKey("EffectZone")) {
if (mapParams.containsKey("EffectZone")) {
effectZone = Zone.smartValueOf(this.mapParams.get("EffectZone"));
}
if ((effectZone != null) && (!this.hostCard.isInZone(effectZone) || this.hostCard.isPhasedOut())) {
if ((effectZone != null) && (!hostCard.isInZone(effectZone) || hostCard.isPhasedOut())) {
return false;
}
if (this.mapParams.containsKey("Threshold") && !controller.hasThreshold()) {
if (mapParams.containsKey("Threshold") && !controller.hasThreshold()) {
return false;
}
if (this.mapParams.containsKey("Hellbent") && !controller.hasHellbent()) {
if (mapParams.containsKey("Hellbent") && !controller.hasHellbent()) {
return false;
}
if (this.mapParams.containsKey("Metalcraft") && !controller.hasMetalcraft()) {
if (mapParams.containsKey("Metalcraft") && !controller.hasMetalcraft()) {
return false;
}
if (this.mapParams.containsKey("PlayerTurn") && !AllZone.getPhase().isPlayerTurn(controller)) {
if (mapParams.containsKey("PlayerTurn") && !AllZone.getPhase().isPlayerTurn(controller)) {
return false;
}
if (this.mapParams.containsKey("OpponentTurn") && !AllZone.getPhase().isPlayerTurn(controller.getOpponent())) {
if (mapParams.containsKey("OpponentTurn") && !AllZone.getPhase().isPlayerTurn(controller.getOpponent())) {
return false;
}
if (mapParams.containsKey("Phases")) {
String phases = mapParams.get("Phases");
if (phases.contains("->")) {
// If phases lists a Range, split and Build Activate String
// Combat_Begin->Combat_End (During Combat)
// Draw-> (After Upkeep)
// Upkeep->Combat_Begin (Before Declare Attackers)
final String[] split = phases.split("->", 2);
phases = AllZone.getPhase().buildActivateString(split[0], split[1]);
}
if (!phases.contains(AllZone.getPhase().getPhase())) {
return false;
}
}
if (this.mapParams.containsKey("TopCardOfLibraryIs")) {
final Card topCard = controller.getCardsIn(Zone.Library).get(0);