- added a few cards
- fixed a bug with spark elemental (now sacrificed at end of turn)
This commit is contained in:
wagic.the.homebrew
2008-11-15 05:28:12 +00:00
parent 28393e8f8a
commit 73f32d2641
7 changed files with 82 additions and 28 deletions
+2
View File
@@ -998,6 +998,7 @@ mana={1}{G}
[/card] [/card]
[card] [card]
text=Flying (This creature can't be blocked except by creatures with flying or reach.) Nightmare's power and toughness are each equal to the number of Swamps you control. text=Flying (This creature can't be blocked except by creatures with flying or reach.) Nightmare's power and toughness are each equal to the number of Swamps you control.
abilities=flying
id=129659 id=129659
alias=1170 alias=1170
name=Nightmare name=Nightmare
@@ -1491,6 +1492,7 @@ toughness=2
[card] [card]
text=Trample, haste (If this creature would deal enough combat damage to its blockers to destroy them, you may have it deal the rest of its damage to defending player. This creature can attack and {T} as soon as it comes under your control.) At end of turn, sacrifice Spark Elemental. text=Trample, haste (If this creature would deal enough combat damage to its blockers to destroy them, you may have it deal the rest of its damage to defending player. This creature can attack and {T} as soon as it comes under your control.) At end of turn, sacrifice Spark Elemental.
abilities=trample,haste abilities=trample,haste
auto=@next endofturn:bury
id=129577 id=129577
name=Spark Elemental name=Spark Elemental
rarity=U rarity=U
+14 -2
View File
@@ -1,6 +1,7 @@
#SET: ICE AGE #SET: ICE AGE
#VERSION: 1.6 #VERSION: 1.6.1
#Number of playable cards: 132 #Number of playable cards: >132
#Note : please try to keep cards in alphabetical order of the name if possible
[card] [card]
text={T}: Centaur Archer deals 1 damage to target creature with flying. text={T}: Centaur Archer deals 1 damage to target creature with flying.
id=2718 id=2718
@@ -1460,3 +1461,14 @@ rarity=R
type=Artifact type=Artifact
mana={3} mana={3}
[/card] [/card]
[card]
text=Vertigo deals 2 damage to target creature with flying; that creature loses flying until end of turn.
id=2658
name=Vertigo
target=creature[flying]
auto=damage:2
auto=-flying
rarity=U
type=Instant
mana={R}
[/card]
-10
View File
@@ -1068,16 +1068,6 @@ type=Instant
mana={3}{G} mana={3}{G}
[/card] [/card]
[card] [card]
text=Vertigo deals 2 damage to target creature with flying; that creature loses flying until end of turn.
id=2658
name=Vertigo
target=creature
auto=damage:2
rarity=U
type=Instant
mana={R}
[/card]
[card]
text=All creatures with flying lose flying until end of turn. If Whiteout is in your graveyard, you may sacrifice a snow-covered land to return Whiteout to your hand. text=All creatures with flying lose flying until end of turn. If Whiteout is in your graveyard, you may sacrifice a snow-covered land to return Whiteout to your hand.
id=2599 id=2599
name=Whiteout name=Whiteout
+1
View File
@@ -45,6 +45,7 @@ resurrection.txt
rootwalla.txt rootwalla.txt
shivan_hellkite.txt shivan_hellkite.txt
shock.txt shock.txt
spark_elemental.txt
stasis.txt stasis.txt
terror.txt terror.txt
volcanic_island.txt volcanic_island.txt
@@ -0,0 +1,24 @@
#Is Spark elemental destroyed at end of turn ? Does it have haste ?
[INIT]
FIRSTMAIN
[PLAYER1]
hand:129577
manapool:{R}
[PLAYER2]
[DO]
129577
next
#combat begin
next
#attackers
129577
eot
129577
[ASSERT]
UNTAP
[PLAYER1]
graveyard:129577
manapool:{0}
[PLAYER2]
life:17
[END]
+5
View File
@@ -157,6 +157,11 @@ public:
int resolve(); int resolve();
}; };
class BuryEvent: public TriggeredEvent{
public:
int resolve();
};
class DestroyCondition:public MTGAbilityBasicFeatures{ class DestroyCondition:public MTGAbilityBasicFeatures{
public: public:
virtual int testDestroy(); virtual int testDestroy();
+36 -16
View File
@@ -56,6 +56,14 @@ Trigger * AbilityFactory::parseTrigger(string magicText){
} }
//Some basic functionalities that can be added automatically in the text file //Some basic functionalities that can be added automatically in the text file
/*
* Several objects are computed from the text string, and have a direct influence on what action we should take
* (direct impact on the game such as draw a card immediately, or create a new GameObserver and add it to the Abilities,etc..)
* These objects are:
* - trigger (if there is an "@" in the string, this is a triggered ability)
* - target (if there ie a "target(" in the string, then this is a TargetAbility)
* - doTap (a dirty way to know if tapping is included in the cost...
*/
int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
int dryMode = 0; int dryMode = 0;
if (!spell) dryMode = 1; if (!spell) dryMode = 1;
@@ -187,28 +195,35 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
result++; result++;
continue; continue;
} }
//Bury //Bury
found = s.find("bury"); found = s.find("bury");
if (found != string::npos){ if (found != string::npos){
if (dryMode) return BAKA_EFFECT_BAD; if (dryMode) return BAKA_EFFECT_BAD;
found = s.find("all("); if (trigger){
if (found != string::npos){ BuryEvent * action = NEW BuryEvent();
int end = s.find(")"); game->addObserver(NEW GenericTriggeredAbility(id, card,trigger,action));
string starget = s.substr(found + 4,end - found - 4);
TargetChooserFactory tcf;
TargetChooser * targetAll = tcf.createTargetChooser(starget, card);
this->destroyAllInPlay(targetAll,1);
delete targetAll;
}else{ }else{
if (tc){ found = s.find("all(");
game->addObserver(NEW ABurier(id, card,tc)); if (found != string::npos){
}else{ int end = s.find(")");
target->controller()->game->putInGraveyard(target); string starget = s.substr(found + 4,end - found - 4);
} TargetChooserFactory tcf;
TargetChooser * targetAll = tcf.createTargetChooser(starget, card);
this->destroyAllInPlay(targetAll,1);
delete targetAll;
}else{
if (tc){
game->addObserver(NEW ABurier(id, card,tc));
}else{
target->controller()->game->putInGraveyard(target);
}
}
} }
result++; result++;
continue; continue;
} }
//Destroy //Destroy
found = s.find("destroy"); found = s.find("destroy");
if (found != string::npos){ if (found != string::npos){
@@ -1742,6 +1757,11 @@ void TriggeredAbility::Update(float dt){
return nbcards; return nbcards;
} }
int BuryEvent::resolve(){
MTGCardInstance * _target = (MTGCardInstance *) target;
_target->controller()->game->putInGraveyard(_target);
return 1;
}
int DestroyCondition::testDestroy(){ int DestroyCondition::testDestroy(){
if (!game->isInPlay(source)){ if (!game->isInPlay(source)){
@@ -1762,9 +1782,9 @@ void TriggeredAbility::Update(float dt){
te = _te; te = _te;
dc = _dc; dc = _dc;
t->init(_source,_target); t->init(source,target);
te->init(_source,_target); te->init(source,target);
if (dc) dc->init(_source,_target); if (dc) dc->init(source,target);
} }
int GenericTriggeredAbility::trigger(){ int GenericTriggeredAbility::trigger(){