- Added "X" cost for token multiplier
-"daily" build
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-09-27 07:15:23 +00:00
parent 30ef39d49d
commit cbacfdbfd7
7 changed files with 35 additions and 35 deletions
+1
View File
@@ -607,6 +607,7 @@ toughness=2
text=When Rise of the Hobgoblins comes into play, you may pay {X}. If you do, put X 1/1 red and white Goblin Soldier creature tokens into play. {RW}: Red creatures and white creatures you control gain first strike until end of turn. text=When Rise of the Hobgoblins comes into play, you may pay {X}. If you do, put X 1/1 red and white Goblin Soldier creature tokens into play. {RW}: Red creatures and white creatures you control gain first strike until end of turn.
id=151114 id=151114
auto={RW}:lord(creature[white;red]|myinplay) first strike auto={RW}:lord(creature[white;red]|myinplay) first strike
auto=Token(Goblin Soldier,Creature Goblin Soldier,1/1,red white)*x
name=Rise of the Hobgoblins name=Rise of the Hobgoblins
rarity=R rarity=R
type=Enchantment type=Enchantment
+1
View File
@@ -546,6 +546,7 @@ toughness=1
text=Put X 1/1 red Goblin creature tokens onto the battlefield. text=Put X 1/1 red Goblin creature tokens onto the battlefield.
id=8818 id=8818
name=Goblin Offensive name=Goblin Offensive
auto=token(Goblin,Creature Goblin,1/1,red)*x
rarity=U rarity=U
mana={X}{1}{R}{R} mana={X}{1}{R}{R}
type=Sorcery type=Sorcery
+1
View File
@@ -117,6 +117,7 @@ gnarled_effigy.txt
goblin_balloon_brigade.txt goblin_balloon_brigade.txt
goblin_balloon_brigade2.txt goblin_balloon_brigade2.txt
goblin_king.txt goblin_king.txt
goblin_offensive.txt
gravedigger.txt gravedigger.txt
#hammerfist_giant.txt #hammerfist_giant.txt
hannas_custody.txt hannas_custody.txt
@@ -0,0 +1,16 @@
#Test: X for tokens
[INIT]
FIRSTMAIN
[PLAYER1]
manapool:{5}{1}{R}{R}
hand:goblin offensive
[PLAYER2]
[DO]
goblin offensive
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:*,*,*,*,*
graveyard:goblin offensive
[PLAYER2]
[END]
Binary file not shown.
+12 -6
View File
@@ -35,8 +35,8 @@ public:
delete c; delete c;
return x; return x;
} }
WParsedInt(){ WParsedInt(int value = 0){
intValue = 0; intValue = value;
} }
WParsedInt(string s, Spell * spell, MTGCardInstance * card){ WParsedInt(string s, Spell * spell, MTGCardInstance * card){
@@ -517,12 +517,12 @@ public:
list<int>colors; list<int>colors;
int power, toughness; int power, toughness;
string name; string name;
int multiplier; WParsedInt * multiplier;
ATokenCreator(int _id,MTGCardInstance * _source,ManaCost * _cost, string sname, string stypes,int _power,int _toughness, string sabilities, int _doTap, int _multiplier = 1):ActivatedAbility(_id,_source,_cost,0,_doTap){ ATokenCreator(int _id,MTGCardInstance * _source,ManaCost * _cost, string sname, string stypes,int _power,int _toughness, string sabilities, int _doTap, WParsedInt * multiplier = NULL):ActivatedAbility(_id,_source,_cost,0,_doTap), multiplier(multiplier){
power = _power; power = _power;
toughness = _toughness; toughness = _toughness;
name = sname; name = sname;
multiplier = _multiplier; if(!multiplier) this->multiplier = NEW WParsedInt(1);
//TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class; //TODO this is a copy/past of other code that's all around the place, everything should be in a dedicated parser class;
@@ -556,7 +556,7 @@ public:
} }
int resolve(){ int resolve(){
for (int i = 0; i < multiplier; ++i){ for (int i = 0; i < multiplier->getValue(); ++i){
Token * myToken = NEW Token(name,source,power,toughness); Token * myToken = NEW Token(name,source,power,toughness);
list<int>::iterator it; list<int>::iterator it;
for ( it=types.begin() ; it != types.end(); it++ ){ for ( it=types.begin() ; it != types.end(); it++ ){
@@ -594,6 +594,12 @@ public:
return a; return a;
} }
~ATokenCreator(){
if (!isClone){
delete(multiplier);
}
}
}; };
class AAMover:public ActivatedAbility{ class AAMover:public ActivatedAbility{
+3 -28
View File
@@ -367,9 +367,9 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
int power, toughness; int power, toughness;
parsePowerToughness(spt,&power, &toughness); parsePowerToughness(spt,&power, &toughness);
string sabilities = s.substr(end+1); string sabilities = s.substr(end+1);
int multiplier = 1; WParsedInt * multiplier = NULL;
found = s.find("*"); found = s.find("*");
if (found != string::npos)multiplier = atoi(s.substr(found+1).c_str()); if (found != string::npos)multiplier = NEW WParsedInt(s.substr(found+1),spell,card);
ATokenCreator * tok = NEW ATokenCreator(id,card,NULL,sname,stypes,power,toughness,sabilities,0, multiplier); ATokenCreator * tok = NEW ATokenCreator(id,card,NULL,sname,stypes,power,toughness,sabilities,0, multiplier);
tok->oneShot = 1; tok->oneShot = 1;
return tok; return tok;
@@ -1454,19 +1454,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
break; break;
} }
//-- addon Urza Saga---
case 8818: //Goblin Offensive
{
int x = computeX(spell,card);
ATokenCreator * tok = NEW ATokenCreator(id,card,NEW ManaCost(),"Goblin","creature Goblin",1,1,"Red",0);
for (int i=0; i < x; i++){
tok->resolve();
}
delete(tok);
break;
}
//-- addon 10E--- //-- addon 10E---
case 129710: //Angelic Chorus case 129710: //Angelic Chorus
@@ -1557,7 +1544,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
} }
// --- addon Invasion--- // --- addon Invasion---
case 23195: //Artifact Mutation case 23195: //Artifact Mutation
{ {
card->target->controller()->game->putInGraveyard(card->target); card->target->controller()->game->putInGraveyard(card->target);
int x = card->target->getManaCost()->getConvertedCost(); int x = card->target->getManaCost()->getConvertedCost();
@@ -1568,18 +1555,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
delete(tok); delete(tok);
break; break;
} }
//--- addon Eventide ----
case 151114: //Rise of the Hobgoblins
{
int x = computeX(spell,card);
ATokenCreator * tok = NEW ATokenCreator(id,card,NEW ManaCost(),"Goblin Soldier","creature Goblin Soldier",1,1,"red white",0);
for (int i=0; i < x; i++){
tok->resolve();
}
delete(tok);
break;
}
// --- addon Ravnica--- // --- addon Ravnica---