add Reset (from Legends)

This commit is contained in:
jendave
2011-08-06 08:40:37 +00:00
parent 6921c00021
commit 26d7b1ce7d
4 changed files with 63 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -3094,6 +3094,7 @@ res/cardsfolder/repentant_blacksmith.txt -text svneol=native#text/plain
res/cardsfolder/reprisal.txt -text svneol=native#text/plain
res/cardsfolder/repulse.txt -text svneol=native#text/plain
res/cardsfolder/rescind.txt -text svneol=native#text/plain
res/cardsfolder/reset.txt -text svneol=native#text/plain
res/cardsfolder/respite.txt -text svneol=native#text/plain
res/cardsfolder/restless_apparition.txt -text svneol=native#text/plain
res/cardsfolder/restless_bones.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,8 @@
Name:Reset
ManaCost:U U
Types:Instant
Text:Cast Reset only during an opponent's turn after his or her upkeep step.\r\nUntap all lands you control.
SVar:RemAIDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/reset.jpg
End

View File

@@ -5088,6 +5088,37 @@ public class CardFactory_Instants {
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
if( cardName.equals("Reset") ) {
/*
* Cast Reset only during an opponent's turn after his or her upkeep step.
* Untap all lands you control.
*/
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 1399682288920959188L;
@Override
public boolean canPlay() {
String opponent = AllZone.GameAction.getOpponent(card.getController());
return Phase.canPlayAfterUpkeep() && AllZone.GameAction.isPlayerTurn(opponent);
}//canPlay
@Override
public boolean canPlayAI() {
return false;
}//canPlayAI
@Override
public void resolve() {
CardList lands = AllZoneUtil.getPlayerLandsInPlay(card.getController());
for(Card land:lands) land.untap();
}
};//SpellAbility
spell.setStackDescription(card.getName() + " - untap all lands you control.");
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
// -1 means keyword "Cycling" not found
if(hasKeyword(card, "Cycling") != -1) {

View File

@@ -452,4 +452,27 @@ public class Phase extends MyObservable
return validPhases.contains(phase);
}
public static boolean canPlayAfterUpkeep() {
String phase = AllZone.Phase.getPhase();
ArrayList<String> validPhases = new ArrayList<String>();
validPhases.add(Constant.Phase.Draw);
validPhases.add(Constant.Phase.Main1);
validPhases.add(Constant.Phase.Combat_Before_Declare_Attackers_InstantAbility);
validPhases.add(Constant.Phase.Combat_Declare_Attackers);
validPhases.add(Constant.Phase.Combat_Declare_Attackers_InstantAbility);
validPhases.add(Constant.Phase.Combat_Declare_Blockers);
validPhases.add(Constant.Phase.Combat_Declare_Blockers_InstantAbility);
validPhases.add(Constant.Phase.Combat_After_Declare_Blockers);
validPhases.add(Constant.Phase.Combat_FirstStrikeDamage);
validPhases.add(Constant.Phase.Combat_Damage);
validPhases.add(Constant.Phase.Main2);
validPhases.add(Constant.Phase.At_End_Of_Turn);
validPhases.add(Constant.Phase.End_Of_Turn);
validPhases.add(Constant.Phase.Until_End_Of_Turn);
validPhases.add(Constant.Phase.Cleanup);
return validPhases.contains(phase);
}
}