Erwan
- code cleanup
This commit is contained in:
@@ -547,6 +547,8 @@ mana={2}{G}{G}
|
|||||||
[card]
|
[card]
|
||||||
text=Destroy target Plains or Island. Cryoclasm deals 3 damage to that land's controller.
|
text=Destroy target Plains or Island. Cryoclasm deals 3 damage to that land's controller.
|
||||||
target=plains,island
|
target=plains,island
|
||||||
|
auto=Damage:3 targetController
|
||||||
|
auto=destroy
|
||||||
id=129909
|
id=129909
|
||||||
name=Cryoclasm
|
name=Cryoclasm
|
||||||
rarity=U
|
rarity=U
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ subtype=Aura
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
text=Whenever a land comes into play, Ankh of Mishra deals 2 damage to that land's controller.
|
text=Whenever a land comes into play, Ankh of Mishra deals 2 damage to that land's controller.
|
||||||
|
auto=@movedTo(land|opponentBattlefield): damage:2 opponent
|
||||||
|
auto=@movedTo(land|myBattlefield): damage:2 controller
|
||||||
id=1094
|
id=1094
|
||||||
name=Ankh of Mishra
|
name=Ankh of Mishra
|
||||||
rarity=R
|
rarity=R
|
||||||
|
|||||||
@@ -425,6 +425,8 @@ toughness=6
|
|||||||
text=Destroy all artifacts and enchantments. You gain 2 life for each permanent destroyed this way.
|
text=Destroy all artifacts and enchantments. You gain 2 life for each permanent destroyed this way.
|
||||||
id=146759
|
id=146759
|
||||||
name=Fracturing Gust
|
name=Fracturing Gust
|
||||||
|
auto=all(artifact,enchantment) life:2
|
||||||
|
auto=destroy all(artifact,enchantment)
|
||||||
rarity=R
|
rarity=R
|
||||||
type=Instant
|
type=Instant
|
||||||
mana={2}{GW}{GW}{GW}
|
mana={2}{GW}{GW}{GW}
|
||||||
@@ -799,6 +801,7 @@ toughness=1
|
|||||||
text=Destroy target land. Poison the Well deals 2 damage to that land's controller.
|
text=Destroy target land. Poison the Well deals 2 damage to that land's controller.
|
||||||
id=147427
|
id=147427
|
||||||
target=Land
|
target=Land
|
||||||
|
auto=Damage:2 targetController
|
||||||
auto=destroy
|
auto=destroy
|
||||||
name=Poison the Well
|
name=Poison the Well
|
||||||
rarity=C
|
rarity=C
|
||||||
@@ -865,6 +868,7 @@ toughness=2
|
|||||||
text=Destroy target artifact. Smash to Smithereens deals 3 damage to that artifact's controller.
|
text=Destroy target artifact. Smash to Smithereens deals 3 damage to that artifact's controller.
|
||||||
id=158243
|
id=158243
|
||||||
target=Artifact
|
target=Artifact
|
||||||
|
auto=damage:3 targetController
|
||||||
auto=destroy
|
auto=destroy
|
||||||
name=Smash to Smithereens
|
name=Smash to Smithereens
|
||||||
rarity=C
|
rarity=C
|
||||||
|
|||||||
@@ -3225,31 +3225,6 @@ class APsychicVenom:public MTGAbility{
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
//1221 Serendib Efreet
|
|
||||||
class ASerendibEfreet:public MTGAbility{
|
|
||||||
public:
|
|
||||||
ASerendibEfreet(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
|
|
||||||
}
|
|
||||||
|
|
||||||
void Update(float dt){
|
|
||||||
if (newPhase == Constants::MTG_PHASE_UPKEEP && newPhase != currentPhase && game->currentPlayer == source->controller()){
|
|
||||||
game->mLayers->stackLayer()->addDamage(source,game->currentPlayer,1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ostream& toString(ostream& out) const
|
|
||||||
{
|
|
||||||
out << "ASerendibEfreet ::: (";
|
|
||||||
return MTGAbility::toString(out) << ")";
|
|
||||||
}
|
|
||||||
ASerendibEfreet * clone() const{
|
|
||||||
ASerendibEfreet * a = NEW ASerendibEfreet(*this);
|
|
||||||
a->isClone = 1;
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//1235 Aspect of Wolf
|
//1235 Aspect of Wolf
|
||||||
class AAspectOfWolf:public ListMaintainerAbility{
|
class AAspectOfWolf:public ListMaintainerAbility{
|
||||||
public:
|
public:
|
||||||
@@ -4059,47 +4034,6 @@ class ASeedbornMuse: public TriggeredAbility{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Graveborn Muse
|
|
||||||
class AGravebornMuse: public TriggeredAbility{
|
|
||||||
public:
|
|
||||||
int nbcards_life;
|
|
||||||
AGravebornMuse(int _id, MTGCardInstance * _source):TriggeredAbility(_id, _source){
|
|
||||||
nbcards_life=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int trigger(){
|
|
||||||
if (newPhase != currentPhase && newPhase == Constants::MTG_PHASE_UPKEEP && ((MTGCardInstance *) source)->controller()== game->currentPlayer){
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int resolve(){
|
|
||||||
for (int j = source->controller()->game->inPlay->nb_cards-1; j >=0 ; j--){
|
|
||||||
MTGCardInstance * current = source->controller()->game->inPlay->cards[j];
|
|
||||||
if (current->hasSubtype("zombie")){
|
|
||||||
nbcards_life++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
source->controller()->life-=nbcards_life;
|
|
||||||
game->mLayers->stackLayer()->addDraw(source->controller(),nbcards_life);
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
virtual ostream& toString(ostream& out) const
|
|
||||||
{
|
|
||||||
out << "AGravebornMuse ::: nbcards_life : " << nbcards_life
|
|
||||||
<< " (";
|
|
||||||
return TriggeredAbility::toString(out) << ")";
|
|
||||||
}
|
|
||||||
|
|
||||||
AGravebornMuse * clone() const{
|
|
||||||
AGravebornMuse * a = NEW AGravebornMuse(*this);
|
|
||||||
a->isClone = 1;
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
//Instant Steal control of a target
|
//Instant Steal control of a target
|
||||||
class AInstantControlSteal: public InstantAbility{
|
class AInstantControlSteal: public InstantAbility{
|
||||||
public:
|
public:
|
||||||
@@ -4184,109 +4118,6 @@ class AAngelicChorus: public ListMaintainerAbility{
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
//Life/Damage for type removed/added from game - Generic Ankh of Mishra/dingus Egg
|
|
||||||
class ALifeModifierPutinplay: public ListMaintainerAbility{
|
|
||||||
public:
|
|
||||||
int init;
|
|
||||||
int life;
|
|
||||||
int PlayerTarget;
|
|
||||||
int AddOrRemove;
|
|
||||||
ALifeModifierPutinplay(int id, MTGCardInstance * _source,TargetChooser * _tc, int _life, int _PlayerTarget, int _AddOrRemove):ListMaintainerAbility(id, _source){
|
|
||||||
init = 0;
|
|
||||||
tc = _tc;
|
|
||||||
PlayerTarget = _PlayerTarget;
|
|
||||||
AddOrRemove = _AddOrRemove;
|
|
||||||
life = _life;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Update(float dt){
|
|
||||||
ListMaintainerAbility::Update(dt);
|
|
||||||
init = 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int canBeInList(MTGCardInstance * card){
|
|
||||||
if (tc->canTarget(card)) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int added(MTGCardInstance * card){
|
|
||||||
if (!init) return 0;
|
|
||||||
if (AddOrRemove == 1){
|
|
||||||
if (life < 0){
|
|
||||||
int damage = life * -1;
|
|
||||||
if (PlayerTarget == 2){
|
|
||||||
game->mLayers->stackLayer()->addDamage(source,card->controller(), damage);
|
|
||||||
}
|
|
||||||
if (PlayerTarget == 1){
|
|
||||||
game->mLayers->stackLayer()->addDamage(source,source->controller(), damage);
|
|
||||||
}
|
|
||||||
if (PlayerTarget == 0){
|
|
||||||
game->mLayers->stackLayer()->addDamage(source,source->controller()->opponent(), damage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (life > 0){
|
|
||||||
if (PlayerTarget == 2){
|
|
||||||
card->controller()->life+=life;
|
|
||||||
}
|
|
||||||
if (PlayerTarget == 1){
|
|
||||||
source->controller()->life+=life;
|
|
||||||
}
|
|
||||||
if (PlayerTarget == 0){
|
|
||||||
source->controller()->opponent()->life+=life;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
int removed(MTGCardInstance * card){
|
|
||||||
if (AddOrRemove == 0){
|
|
||||||
if (life < 0){
|
|
||||||
int damage = life * -1;
|
|
||||||
if (PlayerTarget == 2){
|
|
||||||
game->mLayers->stackLayer()->addDamage(source,card->controller(), damage);
|
|
||||||
}
|
|
||||||
if (PlayerTarget == 1){
|
|
||||||
game->mLayers->stackLayer()->addDamage(source,source->controller(), damage);
|
|
||||||
}
|
|
||||||
if (PlayerTarget == 0){
|
|
||||||
game->mLayers->stackLayer()->addDamage(source,source->controller()->opponent(), damage);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (life > 0){
|
|
||||||
if (PlayerTarget == 2){
|
|
||||||
card->controller()->life+=life;
|
|
||||||
}
|
|
||||||
if (PlayerTarget == 1){
|
|
||||||
source->controller()->life+=life;
|
|
||||||
}
|
|
||||||
if (PlayerTarget == 0){
|
|
||||||
source->controller()->opponent()->life+=life;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual ostream& toString(ostream& out) const
|
|
||||||
{
|
|
||||||
out << "ALifeModifierPutinplay ::: init : " << init
|
|
||||||
<< " ; life : " << life
|
|
||||||
<< " ; PlayerTarget : " << PlayerTarget
|
|
||||||
<< " ; AddOrRemove : " << AddOrRemove
|
|
||||||
<< " (";
|
|
||||||
return ListMaintainerAbility::toString(out) << ")";
|
|
||||||
}
|
|
||||||
ALifeModifierPutinplay * clone() const{
|
|
||||||
ALifeModifierPutinplay * a = NEW ALifeModifierPutinplay(*this);
|
|
||||||
a->isClone = 1;
|
|
||||||
return a;
|
|
||||||
}
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// Work in Progress also from no on all code could be removed...
|
/// Work in Progress also from no on all code could be removed...
|
||||||
|
|
||||||
|
|||||||
@@ -859,14 +859,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
game->addObserver(NEW AConvertToCreatureAura(_id, card,card->target,x,x));
|
game->addObserver(NEW AConvertToCreatureAura(_id, card,card->target,x,x));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 1094: //Ankh of Mishra
|
|
||||||
{
|
|
||||||
TargetChooser * tc = NULL;
|
|
||||||
TargetChooserFactory tcf;
|
|
||||||
tc = tcf.createTargetChooser("land", card);
|
|
||||||
game->addObserver (NEW ALifeModifierPutinplay(_id,card,tc,-2,2,1));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 1095: //Armageddon clock
|
case 1095: //Armageddon clock
|
||||||
{
|
{
|
||||||
AArmageddonClock * ability = NEW AArmageddonClock(_id,card);
|
AArmageddonClock * ability = NEW AArmageddonClock(_id,card);
|
||||||
@@ -1609,6 +1601,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
for (int i=0; i < x; i++){
|
for (int i=0; i < x; i++){
|
||||||
tok->resolve();
|
tok->resolve();
|
||||||
}
|
}
|
||||||
|
delete(tok);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1644,13 +1637,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 129909: //Cryoclasm
|
|
||||||
{
|
|
||||||
card->target->controller()->game->putInGraveyard(card->target);
|
|
||||||
card->target->controller()->life-= 3;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 130373: //Lavaborn Muse
|
case 130373: //Lavaborn Muse
|
||||||
{
|
{
|
||||||
game->addObserver( NEW ALavaborn(_id ,card, Constants::MTG_PHASE_UPKEEP, -3,-3));
|
game->addObserver( NEW ALavaborn(_id ,card, Constants::MTG_PHASE_UPKEEP, -3,-3));
|
||||||
@@ -1732,35 +1718,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//--- addon shm---
|
|
||||||
|
|
||||||
case 147427: // Poison the Well
|
|
||||||
{
|
|
||||||
card->target->controller()->life-=2;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case 158243: //Smash to Smithereens
|
|
||||||
{
|
|
||||||
card->target->controller()->life-=3;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 146759: //Fracturing Gust
|
|
||||||
{
|
|
||||||
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->hasType("Artifact") || current->hasType("Enchantment")){
|
|
||||||
game->players[i]->game->putInGraveyard(current);
|
|
||||||
card->controller()->life+= 2;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// --- addon Invasion---
|
// --- addon Invasion---
|
||||||
case 23195: //Artifact Mutation
|
case 23195: //Artifact Mutation
|
||||||
{
|
{
|
||||||
@@ -1770,6 +1727,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
for (int i=0; i < x; i++){
|
for (int i=0; i < x; i++){
|
||||||
tok->resolve();
|
tok->resolve();
|
||||||
}
|
}
|
||||||
|
delete(tok);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//--- addon Eventide ----
|
//--- addon Eventide ----
|
||||||
@@ -1781,6 +1739,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
for (int i=0; i < x; i++){
|
for (int i=0; i < x; i++){
|
||||||
tok->resolve();
|
tok->resolve();
|
||||||
}
|
}
|
||||||
|
delete(tok);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1808,6 +1767,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
for (int i=0; i < x; i++){
|
for (int i=0; i < x; i++){
|
||||||
tok->resolve();
|
tok->resolve();
|
||||||
}
|
}
|
||||||
|
delete(tok);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user