- Added Condition to PutCounter, PutCounterAll, RemoveCounter, LosesGame, WinsGame

- Added Mayael's Aria
This commit is contained in:
jendave
2011-08-07 00:20:53 +00:00
parent 69210a5cc9
commit f644ac8a47
4 changed files with 50 additions and 34 deletions

1
.gitattributes vendored
View File

@@ -4310,6 +4310,7 @@ res/cardsfolder/matsu_tribe_sniper.txt svneol=native#text/plain
res/cardsfolder/maul_splicer.txt -text svneol=native#text/plain
res/cardsfolder/mawcor.txt -text svneol=native#text/plain
res/cardsfolder/mayael_the_anima.txt -text svneol=native#text/plain
res/cardsfolder/mayaels_aria.txt -text svneol=native#text/plain
res/cardsfolder/maze_of_ith.txt -text svneol=native#text/plain
res/cardsfolder/maze_of_shadows.txt -text svneol=native#text/plain
res/cardsfolder/meadowboon.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,11 @@
Name:Mayael's Aria
ManaCost:R G W
Types:Enchantment
Text:no text
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigPutCounterAll | TriggerDescription$ At the beginning of your upkeep, put a +1/+1 counter on each creature you control if you control a creature with power 5 or greater. Then you gain 10 life if you control a creature with power 10 or greater. Then you win the game if you control a creature with power 20 or greater.
SVar:TrigPutCounterAll:DB$ PutCounterAll | ValidCards$ Creature.YouCtrl | CounterType$ P1P1 | CounterNum$ 1 | ConditionPresent$ Creature.YouCtrl+powerGE5 | SubAbility$ SVar=DBGainLife
SVar:DBGainLife:DB$ GainLife | LifeAmount$ 10 | Defined$ You | ConditionPresent$ Creature.YouCtrl+powerGE10 | SubAbility$ SVar=DBWinGame
SVar:DBWinGame:DB$ WinsGame | Defined$ You | ConditionPresent$ Creature.YouCtrl+powerGE20
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mayaels_aria.jpg
End

View File

@@ -478,7 +478,11 @@ public class AbilityFactory_Counters {
public static void putResolve(final AbilityFactory af, final SpellAbility sa){
HashMap<String,String> params = af.getMapParams();
String DrawBack = params.get("SubAbility");
if (!AbilityFactory.checkConditional(params, sa)){
AbilityFactory.resolveSubAbility(sa);
return;
}
Card card = af.getHostCard();
String type = params.get("CounterType");
int counterAmount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("CounterNum"), sa);
@@ -501,14 +505,7 @@ public class AbilityFactory_Counters {
}
}
if (af.hasSubAbility()){
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else
CardFactoryUtil.doDrawBack(DrawBack, counterAmount, card.getController(), card.getController().getOpponent(), card.getController(), card, tgtCards.get(0), sa);
}
AbilityFactory.resolveSubAbility(sa);
}
// *******************************************
@@ -754,7 +751,11 @@ public class AbilityFactory_Counters {
public static void removeResolve(final AbilityFactory af, final SpellAbility sa){
HashMap<String,String> params = af.getMapParams();
String DrawBack = params.get("SubAbility");
if (!AbilityFactory.checkConditional(params, sa)){
AbilityFactory.resolveSubAbility(sa);
return;
}
Card card = af.getHostCard();
String type = params.get("CounterType");
int counterAmount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("CounterNum"), sa);
@@ -782,14 +783,7 @@ public class AbilityFactory_Counters {
tgtCard.subtractCounter(Counters.valueOf(type), counterAmount);
}
if (af.hasSubAbility()){
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else
CardFactoryUtil.doDrawBack(DrawBack, counterAmount, card.getController(), card.getController().getOpponent(), card.getController(), card, null, sa);
}
AbilityFactory.resolveSubAbility(sa);
}
// *******************************************
@@ -926,6 +920,12 @@ public class AbilityFactory_Counters {
}
private static void proliferateResolve(final AbilityFactory AF, SpellAbility sa) {
HashMap<String,String> params = AF.getMapParams();
if (!AbilityFactory.checkConditional(params, sa)){
AbilityFactory.resolveSubAbility(sa);
return;
}
CardList hperms = AllZoneUtil.getPlayerCardsInPlay(AllZone.HumanPlayer);
hperms = hperms.filter(new CardListFilter() {
public boolean addCard(Card crd)
@@ -1065,12 +1065,7 @@ public class AbilityFactory_Counters {
} //comp
if (AF.hasSubAbility()){
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
}
AbilityFactory.resolveSubAbility(sa);
}
// *******************************************
@@ -1277,8 +1272,11 @@ public class AbilityFactory_Counters {
public static void putAllResolve(final AbilityFactory af, final SpellAbility sa) {
HashMap<String,String> params = af.getMapParams();
String DrawBack = params.get("SubAbility");
Card card = af.getHostCard();
if (!AbilityFactory.checkConditional(params, sa)){
AbilityFactory.resolveSubAbility(sa);
return;
}
String type = params.get("CounterType");
int counterAmount = AbilityFactory.calculateAmount(af.getHostCard(), params.get("CounterNum"), sa);
String valid = params.get("ValidCards");
@@ -1299,13 +1297,6 @@ public class AbilityFactory_Counters {
tgtCard.addCounterFromNonEffect(Counters.valueOf(type), counterAmount);
}
if (af.hasSubAbility()){
Ability_Sub abSub = sa.getSubAbility();
if (abSub != null){
abSub.resolve();
}
else
CardFactoryUtil.doDrawBack(DrawBack, counterAmount, card.getController(), card.getController().getOpponent(), card.getController(), card, cards.get(0), sa);
}
AbilityFactory.resolveSubAbility(sa);
}
}

View File

@@ -1,6 +1,7 @@
package forge.card.abilityFactory;
import java.util.ArrayList;
import java.util.HashMap;
import forge.AllZone;
@@ -163,6 +164,12 @@ public class AbilityFactory_EndGameCondition {
}
public static void winsGameResolve(final AbilityFactory af, final SpellAbility sa){
HashMap<String,String> params = af.getMapParams();
if (!AbilityFactory.checkConditional(params, sa)){
AbilityFactory.resolveSubAbility(sa);
return;
}
Card card = af.getHostCard();
ArrayList<Player> players = AbilityFactory.getDefinedPlayers(card, af.getMapParams().get("Defined"), sa);
@@ -357,6 +364,12 @@ public class AbilityFactory_EndGameCondition {
}
public static void losesGameResolve(final AbilityFactory af, final SpellAbility sa){
HashMap<String,String> params = af.getMapParams();
if (!AbilityFactory.checkConditional(params, sa)){
AbilityFactory.resolveSubAbility(sa);
return;
}
Card card = af.getHostCard();
Target tgt = sa.getTarget();