- {z} cost becomes l2e (Library To Exile)
- {q} cost becomes s2l (Send to Library) <- from any place to Library
- subtypes leyline, controllsershroud, playershroud become ability keywords
This commit is contained in:
wagic.the.homebrew@gmail.com
2010-09-21 12:18:37 +00:00
parent e2727cb7c3
commit 1c0218326e
8 changed files with 77 additions and 58 deletions
+16 -15
View File
@@ -1962,7 +1962,7 @@ toughness=1
[/card] [/card]
[card] [card]
name=Arc-Slogger name=Arc-Slogger
auto={R}{z}{z}{z}{z}{z}{z}{z}{z}{z}{z}:damage:2 target(creature,player) auto={R}{l2e}{l2e}{l2e}{l2e}{l2e}{l2e}{l2e}{l2e}{l2e}{l2e}:damage:2 target(creature,player)
text={R}, Exile the top ten cards of your library: Arc-Slogger deals 2 damage to target creature or player. text={R}, Exile the top ten cards of your library: Arc-Slogger deals 2 damage to target creature or player.
mana={3}{R}{R} mana={3}{R}{R}
type=Creature type=Creature
@@ -24387,7 +24387,7 @@ name=Imperial Mask
text=When Imperial Mask enters the battlefield, if it's not a token, each of your teammates puts a token that's a copy of Imperial Mask onto the battlefield. -- You can't be the target of spells or abilities your opponents control. text=When Imperial Mask enters the battlefield, if it's not a token, each of your teammates puts a token that's a copy of Imperial Mask onto the battlefield. -- You can't be the target of spells or abilities your opponents control.
mana={4}{W} mana={4}{W}
type=Enchantment type=Enchantment
subtype=controllershroud abilities=controllershroud
[/card] [/card]
[card] [card]
name=Imperial Recruiter name=Imperial Recruiter
@@ -25229,7 +25229,7 @@ name=Ivory Mask
text=You have shroud. (You can't be the target of spells or abilities.) text=You have shroud. (You can't be the target of spells or abilities.)
mana={2}{W}{W} mana={2}{W}{W}
type=Enchantment type=Enchantment
subtype=playershroud abilities=playershroud
[/card] [/card]
[card] [card]
name=Ivory Tower name=Ivory Tower
@@ -28634,7 +28634,7 @@ toughness=3
[/card] [/card]
[card] [card]
name=Leashling name=Leashling
auto={q(*|myhand)}:moveTo(myhand) auto={4l(*|myhand)}:moveTo(myhand)
text=Put a card in your hand on top of your library: Return Leashling to its owner's hand. text=Put a card in your hand on top of your library: Return Leashling to its owner's hand.
mana={6} mana={6}
type=Artifact Creature type=Artifact Creature
@@ -28827,7 +28827,7 @@ auto=all(*[-land]|myhand) flash
text=If Leyline of Anticipation is in your opening hand, you may begin the game with it on the battlefield. -- You may cast nonland cards as though they had flash. (You may cast them any time you could cast an instant.) text=If Leyline of Anticipation is in your opening hand, you may begin the game with it on the battlefield. -- You may cast nonland cards as though they had flash. (You may cast them any time you could cast an instant.)
mana={u}{u}{2} mana={u}{u}{2}
type=enchantment type=enchantment
subtype=leyline abilities=leyline
[/card] [/card]
[card] [card]
name=Leyline of the Meek name=Leyline of the Meek
@@ -28835,7 +28835,7 @@ auto=lord(*[token]) 1/1
text=If Leyline of the Meek is in your opening hand, you may begin the game with it on the battlefield. -- Creature tokens get +1/+1. text=If Leyline of the Meek is in your opening hand, you may begin the game with it on the battlefield. -- Creature tokens get +1/+1.
mana={w}{w}{2} mana={w}{w}{2}
type=enchantment type=enchantment
subtype=leyline abilities=leyline
[/card] [/card]
[card] [card]
name=Leyline of Vitality name=Leyline of Vitality
@@ -28844,14 +28844,14 @@ auto=@movedTo(creature|mybattlefield):life:1
text=If Leyline of Vitality is in your opening hand, you may begin the game with it on the battlefield. -- Creatures you control get +0/+1. -- Whenever a creature enters the battlefield under your control, you gain 1 life. text=If Leyline of Vitality is in your opening hand, you may begin the game with it on the battlefield. -- Creatures you control get +0/+1. -- Whenever a creature enters the battlefield under your control, you gain 1 life.
mana={2}{G}{G} mana={2}{G}{G}
type=Enchantment type=Enchantment
subtype=Leyline abilities=leyline
[/card] [/card]
[card] [card]
name=Leyline of Sanctity name=Leyline of Sanctity
text=If Leyline of Sanctity is in your opening hand, you may begin the game with it on the battlefield. -- You can't be the target of spells or abilities your opponents control. text=If Leyline of Sanctity is in your opening hand, you may begin the game with it on the battlefield. -- You can't be the target of spells or abilities your opponents control.
mana={2}{W}{W} mana={2}{W}{W}
type=Enchantment type=Enchantment
subtype=Leyline controllershroud abilities=leyline,controllershroud
[/card] [/card]
[card] [card]
name=Leyline of Singularity name=Leyline of Singularity
@@ -28859,7 +28859,7 @@ auto=lord(*[-land]) transforms(Legendary)
text=If Leyline of Singularity is in your opening hand, you may begin the game with it on the battlefield. -- All nonland permanents are legendary. text=If Leyline of Singularity is in your opening hand, you may begin the game with it on the battlefield. -- All nonland permanents are legendary.
mana={2}{U}{U} mana={2}{U}{U}
type=Enchantment type=Enchantment
subtype=Leyline abilities=leyline
[/card] [/card]
[card] [card]
name=Leyline of the Void name=Leyline of the Void
@@ -28867,7 +28867,7 @@ auto=@movedTo(*|graveyard):all(trigger) moveTo(exile)
text=If Leyline of the Void is in your opening hand, you may begin the game with it on the battlefield. -- If a card would be put into an opponent's graveyard from anywhere, exile it instead. text=If Leyline of the Void is in your opening hand, you may begin the game with it on the battlefield. -- If a card would be put into an opponent's graveyard from anywhere, exile it instead.
mana={2}{B}{B} mana={2}{B}{B}
type=Enchantment type=Enchantment
subtype=Leyline abilities=leyline
[/card] [/card]
[card] [card]
name=Lhurgoyf name=Lhurgoyf
@@ -41867,7 +41867,7 @@ toughness=1
[/card] [/card]
[card] [card]
name=Royal Herbalist name=Royal Herbalist
auto={2}{Z}:life:1 auto={2}{l2e}:life:1
text={2}, Exile the top card of your library: You gain 1 life. text={2}, Exile the top card of your library: You gain 1 life.
mana={W} mana={W}
type=Creature type=Creature
@@ -48158,11 +48158,11 @@ toughness=1
[/card] [/card]
[card] [card]
name=Spirit of the Hearth name=Spirit of the Hearth
abilities=flying abilities=flying,controllershroud
text=Flying -- You can't be the target of spells or abilities your opponents control. text=Flying -- You can't be the target of spells or abilities your opponents control.
mana={4}{W}{W} mana={4}{W}{W}
type=Creature type=Creature
subtype=Cat Spirit controllershroud subtype=Cat Spirit
power=4 power=4
toughness=5 toughness=5
[/card] [/card]
@@ -54106,7 +54106,8 @@ name=True Believer
text=You have shroud. (You can't be the target of spells or abilities.) text=You have shroud. (You can't be the target of spells or abilities.)
mana={W}{W} mana={W}{W}
type=Creature type=Creature
subtype=Human Cleric playershroud subtype=Human Cleric
abilities=playershroud
power=2 power=2
toughness=2 toughness=2
[/card] [/card]
@@ -58097,7 +58098,7 @@ toughness=3
[/card] [/card]
[card] [card]
name=Whirling Catapult name=Whirling Catapult
auto={2}{Z}{Z}:damage:1 all(creature[flying]) && damage:1 all(player) auto={2}{l2e}{l2e}:damage:1 all(creature[flying]) && damage:1 all(player)
text={2}, Exile the top two cards of your library: Whirling Catapult deals 1 damage to each creature with flying and each player. text={2}, Exile the top two cards of your library: Whirling Catapult deals 1 damage to each creature with flying and each player.
mana={4} mana={4}
type=Artifact type=Artifact
+26 -23
View File
@@ -103,38 +103,41 @@ class Constants
HORSEMANSHIP = 45, HORSEMANSHIP = 45,
CANTREGEN = 46, CANTREGEN = 46,
ONEBLOCKER = 47, ONEBLOCKER = 47,
INFECT = 48, INFECT = 48,
POISONTOXIC = 49, POISONTOXIC = 49,
POISONTWOTOXIC = 50, POISONTWOTOXIC = 50,
POISONTHREETOXIC = 51, POISONTHREETOXIC = 51,
PHANTOM = 52, PHANTOM = 52,
WILTING = 53, WILTING = 53,
VIGOR = 54, VIGOR = 54,
CHANGELING = 55, CHANGELING = 55,
ABSORB = 56,//this need to be coded for players too "If a source would deal damage" ABSORB = 56,//this need to be coded for players too "If a source would deal damage"
TREASON = 57, TREASON = 57,
UNEARTH = 58, UNEARTH = 58,
CANTLOSE = 59, CANTLOSE = 59,
CANTLIFELOSE = 60, CANTLIFELOSE = 60,
CANTMILLLOSE = 61, CANTMILLLOSE = 61,
CANTCASTCREATURE = 62, CANTCASTCREATURE = 62,
CANTCAST = 63, CANTCAST = 63,
CANTCASTTWO = 64, CANTCASTTWO = 64,
STORM = 65, STORM = 65,
BOTHCANTCAST = 66, BOTHCANTCAST = 66,
BOTHNOCREATURE = 67, BOTHNOCREATURE = 67,
ONLYONEBOTH = 68, ONLYONEBOTH = 68,
AFFINITYARTIFACTS = 69, AFFINITYARTIFACTS = 69,
AFFINITYPLAINS = 70, AFFINITYPLAINS = 70,
AFFINITYFOREST = 71, AFFINITYFOREST = 71,
AFFINITYISLAND = 72, AFFINITYISLAND = 72,
AFFINITYMOUNTAIN = 73, AFFINITYMOUNTAIN = 73,
AFFINITYSWAMP = 74, AFFINITYSWAMP = 74,
AFFINITYGREENCREATURES = 75, AFFINITYGREENCREATURES = 75,
CANTWIN = 76, CANTWIN = 76,
NOMAXHAND = 77, NOMAXHAND = 77,
LEYLINE = 78,
PLAYERSHROUD = 79,
CONTROLLERSHROUD = 80,
NB_BASIC_ABILITIES = 78, NB_BASIC_ABILITIES = 81,
RARITY_S = 'S', //Special Rarity RARITY_S = 'S', //Special Rarity
+2 -1
View File
@@ -81,7 +81,8 @@ class MTGGameZone {
void cleanupPhase(); void cleanupPhase();
int countByType(const char * value); int countByType(const char * value);
MTGCardInstance * findByName(string name); MTGCardInstance * findByName(string name);
int hasType(const char * value); int hasAbility(int ability); //returns 1 if one of the cards in the zone has the ability, 0 otherwise
int hasType(const char * value); //returns 1 if one of the cards in the zone has the type, 0 otherwise
void setOwner(Player * player); void setOwner(Player * player);
MTGCardInstance * lastCardDrawn; MTGCardInstance * lastCardDrawn;
static MTGGameZone * stringToZone(string zoneName, MTGCardInstance * source, MTGCardInstance * target); static MTGGameZone * stringToZone(string zoneName, MTGCardInstance * source, MTGCardInstance * target);
+3
View File
@@ -86,6 +86,9 @@ const char* Constants::MTGBasicAbilities[] = {
"affinitygreencreatures", "affinitygreencreatures",
"cantwin", "cantwin",
"nomaxhand", "nomaxhand",
"leyline",
"playershroud",
"controllershroud",
}; };
+9
View File
@@ -328,6 +328,15 @@ int MTGGameZone::hasType(const char * value){
return 0; return 0;
} }
int MTGGameZone::hasAbility(int ability){
for (int i=0; i<(nb_cards); i++) {
if (cards[i]->basicAbilities[ability]){
return 1;
}
}
return 0;
}
void MTGGameZone::cleanupPhase(){ void MTGGameZone::cleanupPhase(){
for (int i=0; i<(nb_cards); i++) for (int i=0; i<(nb_cards); i++)
+2 -2
View File
@@ -15,12 +15,12 @@ int cardsinhand = game->players[0]->game->hand->nb_cards;
Player * player = game->currentlyActing(); Player * player = game->currentlyActing();
Player * currentPlayer = game->currentPlayer; Player * currentPlayer = game->currentPlayer;
if (!player->game->hand->hasCard(card)) return 0; if (!player->game->hand->hasCard(card)) return 0;
if ((game->turn < 1) && (cardsinhand != 0) && (card->hasType("leyline")) if ((game->turn < 1) && (cardsinhand != 0) && (card->basicAbilities[Constants::LEYLINE])
&& game->currentGamePhase == Constants::MTG_PHASE_FIRSTMAIN && game->currentGamePhase == Constants::MTG_PHASE_FIRSTMAIN
&& game->players[0]->game->graveyard->nb_cards == 0 && game->players[0]->game->graveyard->nb_cards == 0
&& game->players[0]->game->exile->nb_cards == 0){ && game->players[0]->game->exile->nb_cards == 0){
Player * p = game->currentPlayer; Player * p = game->currentPlayer;
if (card->hasType("leyline")){ if (card->basicAbilities[Constants::LEYLINE]){
MTGCardInstance * copy = player->game->putInZone(card, player->game->hand, player->game->temp); MTGCardInstance * copy = player->game->putInZone(card, player->game->hand, player->game->temp);
Spell * spell = NEW Spell(copy); Spell * spell = NEW Spell(copy);
spell->resolve(); spell->resolve();
+13 -11
View File
@@ -75,30 +75,32 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
manaCost->addExtraCost(NEW TapTargetCost(tc)); manaCost->addExtraCost(NEW TapTargetCost(tc));
} }
break; break;
case 's': //Sacrifice case 's':
manaCost->addExtraCost(NEW SacrificeCost(tc)); if (value == "s2l") { //Send To Library Cost (move from anywhere to Library)
manaCost->addExtraCost(NEW ToLibraryCost(tc));
} else { //Sacrifice
manaCost->addExtraCost(NEW SacrificeCost(tc));
}
break; break;
case 'e': //Exile case 'e': //Exile
manaCost->addExtraCost(NEW ExileTargetCost(tc)); manaCost->addExtraCost(NEW ExileTargetCost(tc));
break; break;
case 'h': //bounce case 'h': //bounce (move to Hand)
manaCost->addExtraCost(NEW BounceTargetCost(tc)); manaCost->addExtraCost(NEW BounceTargetCost(tc));
break; break;
case 'l': //Life cost case 'l':
manaCost->addExtraCost(NEW LifeCost(tc)); if (value == "l2e") { //Mill to exile yourself as a cost (Library 2 Exile)
manaCost->addExtraCost(NEW MillExileCost(tc));
} else { //Life cost
manaCost->addExtraCost(NEW LifeCost(tc));
}
break; break;
case 'd': //DiscardRandom cost case 'd': //DiscardRandom cost
manaCost->addExtraCost(NEW DiscardRandomCost(tc)); manaCost->addExtraCost(NEW DiscardRandomCost(tc));
break; break;
case 'q': //Hand To Library Cost
manaCost->addExtraCost(NEW ToLibraryCost(tc));
break;
case 'm': //Mill yourself as a cost case 'm': //Mill yourself as a cost
manaCost->addExtraCost(NEW MillCost(tc)); manaCost->addExtraCost(NEW MillCost(tc));
break; break;
case 'z': //Mill to exile yourself as a cost
manaCost->addExtraCost(NEW MillExileCost(tc));
break;
case 'c': //Counters case 'c': //Counters
{ {
size_t counter_start = value.find("("); size_t counter_start = value.find("(");
+6 -6
View File
@@ -689,9 +689,9 @@ PlayerTargetChooser::PlayerTargetChooser(MTGCardInstance * card, int _maxtargets
} }
bool PlayerTargetChooser::canTarget(Targetable * target){ bool PlayerTargetChooser::canTarget(Targetable * target){
if (source && targetter && (targetter->controller() != targetter->controller()->opponent()) && (targetter->controller()->opponent()->game->inPlay->hasType("controllershroud")) && targetter->controller() != target) return false; if (source && targetter && (targetter->controller() != targetter->controller()->opponent()) && (targetter->controller()->opponent()->game->inPlay->hasAbility(Constants::CONTROLLERSHROUD)) && targetter->controller() != target) return false;
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->opponent()->game->inPlay->hasType("playershroud")) && targetter->controller()->opponent() == target) return false; if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->opponent()->game->inPlay->hasAbility(Constants::PLAYERSHROUD)) && targetter->controller()->opponent() == target) return false;
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->game->inPlay->hasType("playershroud")) && targetter->controller()== target) return false; if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->game->inPlay->hasAbility(Constants::PLAYERSHROUD)) && targetter->controller()== target) return false;
return (target->typeAsTarget() == TARGET_PLAYER) && (!p || p == (Player*)target); return (target->typeAsTarget() == TARGET_PLAYER) && (!p || p == (Player*)target);
} }
@@ -703,9 +703,9 @@ if (source && targetter && (targetter->controller() == targetter->controller())
/*Damageable Target */ /*Damageable Target */
bool DamageableTargetChooser::canTarget(Targetable * target){ bool DamageableTargetChooser::canTarget(Targetable * target){
if (source && targetter && (targetter->controller() != targetter->controller()->opponent()) && (targetter->controller()->opponent()->game->inPlay->hasType("controllershroud")) && targetter->controller() != target) return false; if (source && targetter && (targetter->controller() != targetter->controller()->opponent()) && (targetter->controller()->opponent()->game->inPlay->hasAbility(Constants::CONTROLLERSHROUD)) && targetter->controller() != target) return false;
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->opponent()->game->inPlay->hasType("playershroud")) && targetter->controller()->opponent() == target) return false; if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->opponent()->game->inPlay->hasAbility(Constants::PLAYERSHROUD)) && targetter->controller()->opponent() == target) return false;
if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->game->inPlay->hasType("playershroud")) && targetter->controller()== target) return false; if (source && targetter && (targetter->controller() == targetter->controller()) && (targetter->controller()->game->inPlay->hasAbility(Constants::PLAYERSHROUD)) && targetter->controller()== target) return false;
if (target->typeAsTarget() == TARGET_PLAYER){ if (target->typeAsTarget() == TARGET_PLAYER){
return true; return true;
} }