Laurent - Updated the discard function. Also you can now target the opponent or yourself. Once again this is the discard random function also mind rot (10E) is not 100% correct since if you were to play on yourself you should be able to choose which card to discard. If a card as no target(either in the target= line or in the discard:x target(X) line then it automatically applies to you.) it means cards that require you to discard a card at random in addition to its cost can now be coded (e.g. balduvian horde from alliance), but at the moment nothing will happen if you have no card to discard (did not test this one but it could be added if necessary).

Updated the deplete function. You can use deplete in instant and sorcery (not tested)
Updated rampage (add an issue with the last parameter and the annulation of the bonuses at end of turn) should be resolved now (not tested).
Added Basilik from 10E and also lavaborn (not tested yet), should try to do a more generic basilik (abomination, cockatrice, basilik, all have the same abilities but different criteria for the “type” of creature that would be or not be affected.
Also added Elvish promenade from LRW (this one is fun ;D)
This commit is contained in:
wagic.laurent
2009-05-25 21:07:17 +00:00
parent cfc76f5f22
commit 182b133719
13 changed files with 246 additions and 143 deletions

View File

@@ -1174,6 +1174,18 @@ type=Sorcery
mana={4}{R}
[/card]
[card]
text=At the beginning of each opponent's upkeep, if that player has two or fewer cards in hand, Lavaborn Muse deals 3 damage to him or her.
id=130373
name=Lavaborn Muse
rarity=R
color=Red
type=Creature
mana={3}{R}
power=3
subtype=Spirit
toughness=3
[/card]
[card]
text=Haste (This creature can attack and {T} as soon as it comes under your control.)
abilities=Haste
id=129624
@@ -2239,6 +2251,18 @@ subtype=Drake
toughness=2
[/card]
[card]
text=Target player loses 4 life and you gain 4 life.
id=129739
name=Soul Feast
target=player
auto=damage:4
auto=life:4
rarity=U
color=Black
type=Sorcery
mana={3}{B}{B}
[/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.
abilities=trample,haste
auto=@next endofturn:bury
@@ -2415,6 +2439,18 @@ type=Basic Land
subtype=Swamp
[/card]
[card]
text=Whenever Sylvan Basilisk becomes blocked by a creature, destroy that creature.
id=135215
name=Sylvan Basilisk
rarity=U
color=Green
type=Creature
mana={3}{G}{G}
power=2
subtype=Basilisk
toughness=4
[/card]
[card]
text=Flash (You may play this spell any time you could play an instant.) Reach (This creature can block creatures with flying.)
abilities=flash,reach
id=135231

View File

@@ -702,18 +702,6 @@ subtype=Human Knight
toughness=2
[/card]
[card]
text=At the beginning of each opponent's upkeep, if that player has two or fewer cards in hand, Lavaborn Muse deals 3 damage to him or her.
id=130373
name=Lavaborn Muse
rarity=R
color=Red
type=Creature
mana={3}{R}
power=3
subtype=Spirit
toughness=3
[/card]
[card]
text={W}{U}{B}{R}{G}: Remove target permanent from the game. If Legacy Weapon would be put into a graveyard from anywhere, reveal Legacy Weapon and shuffle it into its owner's library instead.
id=135242
name=Legacy Weapon
@@ -1202,16 +1190,6 @@ subtype=Minion
toughness=3
[/card]
[card]
text=Target player loses 4 life and you gain 4 life.
id=129739
name=Soul Feast
target=player
rarity=U
color=Black
type=Sorcery
mana={3}{B}{B}
[/card]
[card]
text=Whenever another creature comes into play, you gain 1 life.
id=129740
name=Soul Warden
@@ -1348,18 +1326,6 @@ type=Enchantment
mana={3}{U}{U}
[/card]
[card]
text=Whenever Sylvan Basilisk becomes blocked by a creature, destroy that creature.
id=135215
name=Sylvan Basilisk
rarity=U
color=Green
type=Creature
mana={3}{G}{G}
power=2
subtype=Basilisk
toughness=4
[/card]
[card]
text=Search your library for a land card, reveal it, and put it into your hand. Then shuffle your library.
id=130513
name=Sylvan Scrying
@@ -1397,6 +1363,7 @@ type=Land
[card]
text=Flying (This creature can't be blocked except by creatures with flying or reach.) Whenever Thieving Magpie deals damage to an opponent, you draw a card.
id=129764
abilities=flying
name=Thieving Magpie
rarity=U
color=Blue

View File

@@ -450,7 +450,7 @@ toughness=2
[card]
text=Double strike {B}{G}: Viashino Slaughtermaster gets +1/+1 until end of turn. Play this ability only once each turn.
abilities=double strike
auto={B}{G}:1/1 limit 1
auto={B}{G}:1/1 limit:1
id=179245
name=Viashino Slaughtermaster
rarity=U

View File

@@ -125,6 +125,15 @@ subtype=Merfolk Rogue
toughness=1
[/card]
[card]
text=Put a 1/1 green Elf Warrior creature token into play for each Elf you control.
id=139676
name=Elvish Promenade
rarity=U
type=Sorcery
mana={3}{G}
subtype=Tribal Elf
[/card]
[card]
text=Flash Enchant creature Enchanted creature gets +5/+5 and has trample.
abilities=flash
target=creature
@@ -451,6 +460,18 @@ type=Instant
mana={3}{W}
[/card]
[card]
text=Flying Nightshade Stinger can't block.
id=139456
name=Nightshade Stinger
abilities=flying,cantblock
rarity=C
type=Creature
mana={B}
power=1
subtype=Faerie Rogue
toughness=1
[/card]
[card]
text=Vigilance, trample
abilities=vigilance,trample
id=139494

View File

@@ -564,15 +564,6 @@ subtype=Elf Druid
toughness=2
[/card]
[card]
text=Put a 1/1 green Elf Warrior creature token into play for each Elf you control.
id=139676
name=Elvish Promenade
rarity=U
type=Tribal Sorcery
mana={3}{G}
subtype=Elf
[/card]
[card]
text=Whenever you clash, tap target creature an opponent controls. If you won, that creature doesn't untap during its controller's next untap step. (This ability triggers after the clash ends.)
id=146583
name=Entangling Trap

View File

@@ -654,6 +654,18 @@ type=Enchantment
rarity=U
[/card]
[card]
text=When Minotaur Explorer comes into play, sacrifice it unless you discard a card at random.
id=31786
auto=discard:1
name=Minotaur Explorer
rarity=U
type=Creature
mana={1}{R}
power=3
subtype=Minotaur Scout
toughness=3
[/card]
[card]
text=Mortivore's power and toughness are each equal to the number of creature cards in all graveyards. {B}: Regenerate Mortivore. (The next time this creature would be destroyed this turn, it isn't. Instead tap it, remove all damage from it, and remove it from combat.)
id=29946
name=Mortivore

View File

@@ -1144,17 +1144,6 @@ subtype=Dwarf
toughness=1
[/card]
[card]
text=When Minotaur Explorer comes into play, sacrifice it unless you discard a card at random.
id=31786
name=Minotaur Explorer
rarity=U
type=Creature
mana={1}{R}
power=3
subtype=Minotaur Scout
toughness=3
[/card]
[card]
text=Whenever you play an instant or sorcery spell, you may pay {3}. If you do, copy that spell. You may choose new targets for the copy.
id=31801
name=Mirari

View File

@@ -879,6 +879,18 @@ toughness=2
abilities=unblockable
[/card]
[card]
text=When Pillaging Horde comes into play, sacrifice it unless you discard a card at random.
id=4353
auto=discard:1
name=Pillaging Horde
rarity=R
type=Creature
mana={2}{R}{R}
power=5
subtype=Human Barbarian
toughness=5
[/card]
[card]
text={T}: Add {W} to your mana pool.
auto={T}: Add {W}
id=4425

View File

@@ -456,17 +456,6 @@ type=Sorcery
mana={U}
[/card]
[card]
text=When Pillaging Horde comes into play, sacrifice it unless you discard a card at random.
id=4353
name=Pillaging Horde
rarity=R
type=Creature
mana={2}{R}{R}
power=5
subtype=Human Barbarian
toughness=5
[/card]
[card]
text=When Plant Elemental comes into play, sacrifice it unless you sacrifice a Forest.
id=4313
name=Plant Elemental

View File

@@ -1613,7 +1613,6 @@ class AOldSchoolDeathtouch:public MTGAbility{
}
};
//Converts a card to a creature (Aura)
class AConvertToCreatureAura:public MTGAbility{
public:
@@ -3222,6 +3221,102 @@ class AStasis:public ActivatedAbility{
//--------------Addon Abra------------------
//Basilik
class ABasilik:public MTGAbility{
public:
MTGCardInstance * opponents[20];
int nbOpponents;
ABasilik (int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
nbOpponents = 0;
}
void Update(float dt){
if (newPhase != currentPhase){
if( newPhase == Constants::MTG_PHASE_COMBATDAMAGE){
nbOpponents = 0;
MTGCardInstance * opponent = source->getNextOpponent();
while (opponent){
opponents[nbOpponents] = opponent;
nbOpponents ++;
opponent = source->getNextOpponent(opponent);
}
}else if (newPhase == Constants::MTG_PHASE_COMBATEND){
for (int i = 0; i < nbOpponents ; i++){
game->mLayers->stackLayer()->addPutInGraveyard(opponents[i]);
}
}
}
}
int testDestroy(){
if(!game->isInPlay(source) && currentPhase != Constants::MTG_PHASE_UNTAP){
return 0;
}else{
return MTGAbility::testDestroy();
}
}
virtual ostream& toString(ostream& out) const
{
out << "ABasilik ::: opponents : " << opponents
<< " ; nbOpponents : " << nbOpponents
<< " (";
return MTGAbility::toString(out) << ")";
}
};
//Lavaborn - quick and very dirty ;) copy of ALifezonelink but without the multiplier.
class ALavaborn:public MTGAbility{
public:
int phase;
int condition;
int life;
int controller;
int nbcards;
MTGGameZone * zone;
ALavaborn(int _id ,MTGCardInstance * card, int _phase, int _condition, int _life, int _controller = 0, MTGGameZone * _zone = NULL):MTGAbility(_id, card){
phase = _phase;
condition = _condition;
controller = _controller;
life = _life;
zone = _zone;
if (zone == NULL){
if (controller){
zone = game->currentPlayer->game->hand;
}else{
zone = game->opponent()->game->hand;
}
}
}
void Update(float dt){
if (newPhase != currentPhase && newPhase == phase){
if ((controller && game->currentPlayer == source->controller()) ||(!controller && game->currentPlayer != source->controller()) ){
if ((condition < 0 && zone->nb_cards < - condition) ||(condition >0 && zone->nb_cards > condition)){
int diff = zone->nb_cards - condition;
if (condition < 0) diff = - condition - zone->nb_cards;
if (life > 0){
game->currentPlayer->life+=life;
}else{
game->mLayers->stackLayer()->addDamage(source,game->currentPlayer,-life);
}
}
}
}
}
virtual ostream& toString(ostream& out) const
{
out << "ALavaborn ::: phase : " << phase
<< " ; condition : " << condition
<< " ; life : " << life
<< " ; controller : " << controller
<< " ; nbcards : " << nbcards
<< " (";
return MTGAbility::toString(out) << ")";
}
};
//GenericMillstone
class ADeplete:public TargetAbility{
@@ -3241,6 +3336,9 @@ class ADeplete:public TargetAbility{
}
return 1;
}
const char * getMenuText(){
return "Deplete";
}
virtual ostream& toString(ostream& out) const
{
@@ -3330,34 +3428,6 @@ class AShieldOfTheAge: public TargetAbility{
}
};
// People of the Woods
class APeopleOfTheWoods:public ListMaintainerAbility{
public:
APeopleOfTheWoods(int _id, MTGCardInstance * _source):ListMaintainerAbility(_id, _source){
}
int canBeInList(MTGCardInstance * card){
if (source->controller()->game->inPlay->hasCard(card) && card->hasType("forest") ) return 1;
return 0;
}
int added(MTGCardInstance * card){
source->addToToughness(1);
return 1;
}
int removed(MTGCardInstance * card){
source->addToToughness(-1);
return 1;
}
virtual ostream& toString(ostream& out) const
{
out << "APeopleOfTheWoods ::: (";
return ListMaintainerAbility::toString(out) << ")";
}
};
//Abomination Kill blocking creature if white or green
class AAbomination :public MTGAbility{
public:
@@ -3577,8 +3647,10 @@ class ARampageAbility:public MTGAbility{
}
}
if( newPhase == Constants::MTG_PHASE_AFTER_EOT ){
for (int i = 0; i < nbOpponents; i++){
source->power-= PowerModifier;
source->addToToughness(-ToughnessModifier);
}
}
}
}

View File

@@ -91,14 +91,12 @@ class Constants
MOUNTAINHOME = 33,
SWAMPHOME = 34,
PLAINSHOME = 35,
FLANKING = 36,
RAMPAGE = 37,
CLOUD = 38,
CANTATTACK = 39,
MUSTATTACK = 40,
CANTBLOCK = 41,
CLOUD = 36,
CANTATTACK = 37,
MUSTATTACK = 38,
CANTBLOCK = 39,
NB_BASIC_ABILITIES = 42,
NB_BASIC_ABILITIES = 40,
RARITY_M = 'M',

View File

@@ -670,9 +670,13 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (tc){
game->addObserver (NEW ADeplete(id,card,cost,nbcards,tc,doTap));
}else{
//todo
Player * player = spell->getNextPlayerTarget();
MTGLibrary * library = player->game->library;
for (int i = 0; i < nbcards; i++){
if (library->nb_cards)
player->game->putInZone(library->cards[library->nb_cards-1],library, player->game->graveyard);
}
}
}
result++;
continue;
@@ -699,12 +703,19 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
if (tc){
game->addObserver (NEW ADiscard(id,card,cost,nbcards,tc,doTap));
}else{
for (int i = 0; i < nbcards; i++){
game->opponent()->game->discardRandom(game->opponent()->game->hand);
}
Player * player = spell->getNextPlayerTarget();
if(player){
for (int i=0; i<nbcards; i++){
player->game->discardRandom(player->game->hand);
}
}else{
for (int i=0; i<nbcards; i++){
game->currentlyActing()->game->discardRandom(game->currentlyActing()->game->hand);
}
}
}
}
result++;
result++;
continue;
}
@@ -728,7 +739,7 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
}
break;
}
int MaxOpponent = atoi(s.substr(found+1).c_str());
int MaxOpponent = atoi(s.substr(end+1,end+2).c_str());
if(tc){
//TODO??
}else{
@@ -1633,29 +1644,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
break;
}
//Addons The Dark
case 1797: //Inferno does 6 damage to all players and all creatures.
{
for (int i = 0; i < 2 ; i++){
game->mLayers->stackLayer()->addDamage(card, game->players[i], 6);
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, 6);
}
}
}
break;
}
case 1773 : //People of the Woods
{
game->addObserver(NEW APeopleOfTheWoods(_id, card));
break;
}
//Addons Legends
case 1427: //Abomination
{
@@ -1734,6 +1722,17 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
game->addObserver(NEW ATargetterPowerToughnessModifierUntilEOT(id, card, 1,2, NEW ManaCost(cost,1),tc));
break;
}
//---addon Alliance---
case 3194: // Exile
{
Player * p = card->target->controller();
p->game->putInZone(card->target,p->game->inPlay,card->owner->game->removedFromGame);
game->currentlyActing()->life+= card->target->toughness;
break;
}
//---addon Tempest---
case 4801: //Ancient Rune
{
@@ -1797,6 +1796,19 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
card->target->controller()->life-= 3;
break;
}
case 130373: //Lavaborn Muse
{
game->addObserver( NEW ALavaborn(_id ,card, Constants::MTG_PHASE_UPKEEP, -2,-3));
break;
}
case 135215: //Sylvan Basilisk
{
game->addObserver( NEW ABasilik (_id ,card));
break;
}
//--- addon shm---
case 146013: //Corrupt
{
@@ -1808,18 +1820,30 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
}
// --- addon Invasion---
case 23195: //Artifact Mutation (works fine but display is strange if you bury a target from opponent, need to wait your turn to have the token put in play)
case 23195: //Artifact Mutation (works fine but display is strange if you bury a target from opponent)
{
card->target->controller()->game->putInGraveyard(card->target);
int x = card->target->getManaCost()->getConvertedCost();
ATokenCreator * tok = NEW ATokenCreator(id,card,NEW ManaCost(),"Saproling token","creature",1,1,"green",0);
for (int i=0; i < x; i++){
tok->resolve();
}
delete tok;
}
break;
}
// --- addon Lorwynn---
case 139676: // Elvish Promenade
{
int x = card->controller()->game->inPlay->countByType("Elf");
ATokenCreator * tok = NEW ATokenCreator(id,card,NEW ManaCost(),"Elf Warrior token","creature",1,1,"green",0);
for (int i=0; i < x-1; i++){
tok->resolve();
}
break;
}
default:
break;
}
@@ -1863,12 +1887,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
game->addObserver(NEW AStrongLandLinkCreature(_id, card,"plains"));
}
// New Abilities Flanking and Rampage
if (card->basicAbilities [Constants::RAMPAGE]){
game->addObserver (NEW ARampageAbility(_id, card, 1, 1,1));
}
//Instants are put in the graveyard automatically if that's not already done
if (!putSourceInGraveyard){
if (card->hasType("instant") || card->hasType("sorcery")){

View File

@@ -44,8 +44,6 @@ const char* Constants::MTGBasicAbilities[] = {
"moutainhome",
"swamphome",
"plainshome",
"flanking",
"rampage",
"cloud",
"cantattack",
"mustattack",