Erwan
- Added Ice Age cards from Abrasax - Added "untap" and "gainlife" abilities in script
This commit is contained in:
1405
projects/mtg/bin/Res/sets/ICE/_cards.dat
Normal file
1405
projects/mtg/bin/Res/sets/ICE/_cards.dat
Normal file
File diff suppressed because it is too large
Load Diff
@@ -455,6 +455,7 @@ toughness=5
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
text=Add {B}{B}{B} to your mana pool.
|
text=Add {B}{B}{B} to your mana pool.
|
||||||
|
auto=Add{B}{B}{B}
|
||||||
id=1149
|
id=1149
|
||||||
name=Dark Ritual
|
name=Dark Ritual
|
||||||
rarity=C
|
rarity=C
|
||||||
@@ -1193,6 +1194,7 @@ subtype=Aura
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
text={T}: Untap target land.
|
text={T}: Untap target land.
|
||||||
|
auto={T}:untap target(land)
|
||||||
id=1255
|
id=1255
|
||||||
name=Ley Druid
|
name=Ley Druid
|
||||||
rarity=U
|
rarity=U
|
||||||
|
|||||||
@@ -1,124 +1 @@
|
|||||||
|
|
||||||
=============================
|
|
||||||
generic/first_strike.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
generic/first_strike2.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
generic/first_strike3.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
generic/hybrid_mana.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
generic/legendary.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
generic/persist.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
generic/wither.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
animate_dead.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
animate_dead2.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
ascendant_evincar.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
ascendant_evincar2.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
brass_man.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
castle.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
control_magic.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
counsel_of_the_soratami.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
counterspell.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
counterspell2.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
drain_life.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
force_of_nature.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
force_of_nature2.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
force_of_nature3.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
ghost_warden.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
giant_growth.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
goblin_balloon_brigade.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
goblin_balloon_brigade2.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
keldon_warlord.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
kudzu.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
kudzu2.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
lifeforce.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
living_lands.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
lord_of_the_pit.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
lord_of_the_pit2.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
paralysis.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
paralysis2.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
resurrection.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
rootwalla.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
shivan_hellkite.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
shock.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
terror.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
volcanic_island.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
=============================
|
|
||||||
white_knight1.txt
|
|
||||||
==Test Succesful !==
|
|
||||||
|
|||||||
@@ -2747,4 +2747,114 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//--------------Addon Abra------------------
|
||||||
|
//ShieldOfTheAge
|
||||||
|
class AShieldOfTheAge: public TargetAbility{
|
||||||
|
public:
|
||||||
|
AShieldOfTheAge(int _id, MTGCardInstance * card):TargetAbility(_id,card,NEW DamageTargetChooser(card,_id),NEW ManaCost(),0,0){
|
||||||
|
cost->add(MTG_COLOR_ARTIFACT,2);
|
||||||
|
}
|
||||||
|
|
||||||
|
int resolve(){
|
||||||
|
Damage * damage = tc->getNextDamageTarget();
|
||||||
|
if (!damage) return 0;
|
||||||
|
game->mLayers->stackLayer()->Fizzle(damage);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
//2593 Thoughtleech
|
||||||
|
class AThoughtleech:public MTGAbility{
|
||||||
|
public:
|
||||||
|
int nbIslandstapped;
|
||||||
|
|
||||||
|
int countIslandsTapped(){
|
||||||
|
int result = 0;
|
||||||
|
MTGInPlay * inplay = source->controller()->opponent()->game->inPlay;
|
||||||
|
for (int i = 0; i < inplay->nb_cards; i++){
|
||||||
|
MTGCardInstance * card = inplay->cards[i];
|
||||||
|
if (card->tapped && card->hasType("island")) result++;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
AThoughtleech(int _id, MTGCardInstance * source):MTGAbility(_id, source){
|
||||||
|
nbIslandstapped = countIslandsTapped();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update(float dt){
|
||||||
|
int newcount = countIslandsTapped();
|
||||||
|
for (int i=0; i < newcount - nbIslandstapped; i++){
|
||||||
|
source->controller()->life++;
|
||||||
|
}
|
||||||
|
nbIslandstapped = newcount;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//Minion of Leshrac
|
||||||
|
class AMinionofLeshrac: public TargetAbility{
|
||||||
|
public:
|
||||||
|
int paidThisTurn;
|
||||||
|
AMinionofLeshrac(int _id, MTGCardInstance * source):TargetAbility(_id, source, NEW CreatureTargetChooser(),0,1,0){
|
||||||
|
paidThisTurn = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update(float dt){
|
||||||
|
if (newPhase != currentPhase && source->controller() == game->currentPlayer){
|
||||||
|
if (newPhase == MTG_PHASE_UNTAP){
|
||||||
|
paidThisTurn = 0;
|
||||||
|
}else if( newPhase == MTG_PHASE_UPKEEP + 1 && !paidThisTurn){
|
||||||
|
game->mLayers->stackLayer()->addDamage(source,source->controller(), 5);
|
||||||
|
source->tapped = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
TargetAbility::Update(dt);
|
||||||
|
}
|
||||||
|
|
||||||
|
int isReactingToClick(MTGCardInstance * card){
|
||||||
|
if (currentPhase != MTG_PHASE_UPKEEP || paidThisTurn) return 0;
|
||||||
|
return TargetAbility::isReactingToClick(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
int resolve(){
|
||||||
|
MTGCardInstance * card = tc->getNextCardTarget();
|
||||||
|
if (card && card != source && card->controller() == source->controller()){
|
||||||
|
card->controller()->game->putInGraveyard(card);
|
||||||
|
paidThisTurn = 1;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
//2703 Lost Order of Jarkeld
|
||||||
|
class ALostOrderofJarkeld:public ListMaintainerAbility{
|
||||||
|
public:
|
||||||
|
ALostOrderofJarkeld(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
|
||||||
|
}
|
||||||
|
|
||||||
|
int canBeInList(MTGCardInstance * card){
|
||||||
|
if (card==source || (game->currentPlayer->game->inPlay->hasCard(card) && card->isACreature()) ) return 1;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int added(MTGCardInstance * card){
|
||||||
|
source->power += 1;
|
||||||
|
source->addToToughness(1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int removed(MTGCardInstance * card){
|
||||||
|
source->power -= 1;
|
||||||
|
source->addToToughness(-1);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ using std::map;
|
|||||||
class AbilityFactory{
|
class AbilityFactory{
|
||||||
private:
|
private:
|
||||||
int destroyAllFromTypeInPlay(const char * type, MTGCardInstance * source, int bury = 0);
|
int destroyAllFromTypeInPlay(const char * type, MTGCardInstance * source, int bury = 0);
|
||||||
|
int destroyAllFromColorInPlay(int color, MTGCardInstance * source, int bury = 0);
|
||||||
int putInPlayFromZone(MTGCardInstance * card, MTGGameZone * zone, Player * p);
|
int putInPlayFromZone(MTGCardInstance * card, MTGGameZone * zone, Player * p);
|
||||||
public:
|
public:
|
||||||
int magicText(int id, Spell * spell, MTGCardInstance * card = NULL);
|
int magicText(int id, Spell * spell, MTGCardInstance * card = NULL);
|
||||||
|
|||||||
@@ -25,6 +25,23 @@ int AbilityFactory::destroyAllFromTypeInPlay(const char * type, MTGCardInstance
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int AbilityFactory::destroyAllFromColorInPlay(int color, MTGCardInstance * source, int bury){
|
||||||
|
GameObserver * game = GameObserver::GetInstance();
|
||||||
|
for (int i = 0; i < 2 ; i++){
|
||||||
|
for (int j = 0; j < game->players[i]->game->inPlay->nb_cards; j++){
|
||||||
|
MTGCardInstance * current = game->players[i]->game->inPlay->cards[j];
|
||||||
|
if (current->hasColor(color)){
|
||||||
|
if (bury){
|
||||||
|
game->players[i]->game->putInGraveyard(current);
|
||||||
|
}else{
|
||||||
|
game->mLayers->stackLayer()->addPutInGraveyard(current);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
int AbilityFactory::putInPlayFromZone(MTGCardInstance * card, MTGGameZone * zone, Player * p){
|
int AbilityFactory::putInPlayFromZone(MTGCardInstance * card, MTGGameZone * zone, Player * p){
|
||||||
Spell * spell = NEW Spell(card);
|
Spell * spell = NEW Spell(card);
|
||||||
p->game->putInZone(card, zone, p->game->stack);
|
p->game->putInZone(card, zone, p->game->stack);
|
||||||
@@ -107,6 +124,21 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Untapper (Ley Druid...)
|
||||||
|
found = s.find("untap");
|
||||||
|
if (found != string::npos){
|
||||||
|
if (dryMode) return BAKA_EFFECT_GOOD;
|
||||||
|
ManaCost * cost = ManaCost::parseManaCost(s);
|
||||||
|
if (tc){
|
||||||
|
game->addObserver(NEW AUntaper(id, card, cost, tc));
|
||||||
|
}else{
|
||||||
|
target->tapped = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
result++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//Regeneration
|
//Regeneration
|
||||||
@@ -177,6 +209,33 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//gainlife
|
||||||
|
found = s.find("gainlife");
|
||||||
|
if (found != string::npos){
|
||||||
|
unsigned int start = s.find(":",found);
|
||||||
|
unsigned int end = s.find(" ",start);
|
||||||
|
int life;
|
||||||
|
ManaCost * cost = ManaCost::parseManaCost(s);
|
||||||
|
if (end != string::npos){
|
||||||
|
life = atoi(s.substr(start+1,end-start-1).c_str());
|
||||||
|
}else{
|
||||||
|
life = atoi(s.substr(start+1).c_str());
|
||||||
|
}
|
||||||
|
if (dryMode) return BAKA_EFFECT_GOOD;
|
||||||
|
if (tc){
|
||||||
|
//TODO ?
|
||||||
|
}else{
|
||||||
|
if (cost->getConvertedCost() == 0 && !doTap){
|
||||||
|
delete cost;
|
||||||
|
card->controller()->life+=life;
|
||||||
|
}else{
|
||||||
|
//TODO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result++;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
//Draw
|
//Draw
|
||||||
found = s.find("draw");
|
found = s.find("draw");
|
||||||
if (found != string::npos){
|
if (found != string::npos){
|
||||||
@@ -260,7 +319,13 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
|||||||
game->addObserver(NEW AManaProducer(id, target, output, cost));
|
game->addObserver(NEW AManaProducer(id, target, output, cost));
|
||||||
}else{
|
}else{
|
||||||
delete cost;
|
delete cost;
|
||||||
game->addObserver(NEW AManaProducer(id, target, output));
|
if (doTap){
|
||||||
|
game->addObserver(NEW AManaProducer(id, target, output));
|
||||||
|
}else{
|
||||||
|
card->controller()->getManaPool()->add(output);
|
||||||
|
delete output;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
result++;
|
result++;
|
||||||
continue;
|
continue;
|
||||||
@@ -706,11 +771,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
game->addObserver(NEW AWanderlust(_id, card, card->target));
|
game->addObserver(NEW AWanderlust(_id, card, card->target));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1149: // Dark Ritual
|
|
||||||
{
|
|
||||||
game->currentlyActing()->getManaPool()->add(MTG_COLOR_BLACK, 3);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1156: //Drain Life
|
case 1156: //Drain Life
|
||||||
{
|
{
|
||||||
Damageable * target = spell->getNextDamageableTarget();
|
Damageable * target = spell->getNextDamageableTarget();
|
||||||
@@ -964,12 +1024,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1255: //Ley Druid
|
|
||||||
{
|
|
||||||
TargetChooser * tc = NEW TypeTargetChooser("land", card);
|
|
||||||
game->addObserver(NEW AUntaper(_id, card, NEW ManaCost(), tc));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1262: //Regeneration
|
case 1262: //Regeneration
|
||||||
{
|
{
|
||||||
int cost[] = {MTG_COLOR_GREEN, 1};
|
int cost[] = {MTG_COLOR_GREEN, 1};
|
||||||
@@ -1234,6 +1288,107 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
destroyAllFromTypeInPlay("creature", card); //TODO -> bury !!!
|
destroyAllFromTypeInPlay("creature", card); //TODO -> bury !!!
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Addons Abra
|
||||||
|
case 2631: //Jokulhaups
|
||||||
|
{
|
||||||
|
destroyAllFromTypeInPlay("artifact", card);
|
||||||
|
destroyAllFromTypeInPlay("creature", card);
|
||||||
|
destroyAllFromTypeInPlay("land", card);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
case 2491: //Touch of Death
|
||||||
|
{
|
||||||
|
game->currentlyActing()->life+=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2650: //Pyroclasm
|
||||||
|
{
|
||||||
|
int x = 2;
|
||||||
|
for (int i = 0; i < 2 ; i++){
|
||||||
|
game->mLayers->stackLayer()->addDamage(card, game->players[i], 0);
|
||||||
|
for (int j = 0; j < game->players[i]->game->inPlay->nb_cards; j++){
|
||||||
|
MTGCardInstance * current = game->players[i]->game->inPlay->cards[j];
|
||||||
|
if (current->isACreature()){
|
||||||
|
game->mLayers->stackLayer()->addDamage(card, current, x);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2660: //Word of Blasting
|
||||||
|
{
|
||||||
|
card->target->controller()->game->putInGraveyard(card->target);
|
||||||
|
card->target->controller()->life-= card->target->getManaCost()->getConvertedCost();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2443: //Dark Banishing
|
||||||
|
{
|
||||||
|
if (card->target->hasColor(MTG_COLOR_BLACK)){
|
||||||
|
}else{
|
||||||
|
card->target->controller()->game->putInGraveyard(card->target);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2593: //Thoughtleech
|
||||||
|
{
|
||||||
|
game->addObserver(NEW AThoughtleech(_id, card));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2667: //Blessed Wine
|
||||||
|
{
|
||||||
|
game->currentlyActing()->life+=1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2571: //Gorilla Pack
|
||||||
|
{
|
||||||
|
game->addObserver(NEW AStrongLandLinkCreature(_id, card, "forest"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2484: //Songs of the Damned
|
||||||
|
{
|
||||||
|
int mana = card->controller()->game->graveyard->countByType("creature");
|
||||||
|
game->currentlyActing()->getManaPool()->add(MTG_COLOR_BLACK, mana);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2606: //Anarchy
|
||||||
|
{
|
||||||
|
destroyAllFromColorInPlay(MTG_COLOR_WHITE, card);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2474: //Minion of Leshrac
|
||||||
|
{
|
||||||
|
game->addObserver(NEW AMinionofLeshrac( _id, card));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2421: //Shield of the Age
|
||||||
|
{
|
||||||
|
game->addObserver(NEW AShieldOfTheAge( _id, card));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2487: //Spoil of Evil
|
||||||
|
{
|
||||||
|
int mana_cr = game->opponent()->game->graveyard->countByType("creature");
|
||||||
|
int mana_ar = game->opponent()->game->graveyard->countByType("artifact");
|
||||||
|
int spoil = mana_ar + mana_cr;
|
||||||
|
game->currentlyActing()->getManaPool()->add(MTG_COLOR_ARTIFACT, spoil);
|
||||||
|
game->currentlyActing()->life+= spoil;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2435: //Whalebone Glider
|
||||||
|
{
|
||||||
|
int cost[] = {MTG_COLOR_ARTIFACT,2};
|
||||||
|
CreatureTargetChooser * tc = NEW CreatureTargetChooser(card);
|
||||||
|
tc->maxpower = 3;
|
||||||
|
game->addObserver(NEW ABasicAbilityModifierUntilEOT(_id, card, FLYING, NEW ManaCost(cost,1),tc));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case 2703: // Lost Order of Jarkeld
|
||||||
|
{
|
||||||
|
game->addObserver(NEW ALostOrderofJarkeld(_id, card));
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user