- Bug fixes for Kird ape(RV), Dingus Egg(RV), Ankh of Mishra(RV), Ancient Tomb(TMP), Wooded Bastion (SHM)
- Added tests in the test suite to confirm/infirm  some bug reports
This commit is contained in:
wagic.the.homebrew
2009-02-15 05:32:12 +00:00
parent 6d1d5d751a
commit f7a887db2a
14 changed files with 221 additions and 115 deletions

View File

@@ -767,7 +767,7 @@ text={T}: Add {1} to your mana pool. {GW}, {T}: Add {G}{G}, {G}{W}, or {W}{W
auto={T}:Add{1}
auto={GW}{T}:Add{G}{G}
auto={GW}{T}:Add{G}{W}
auto={GW}{T}:Add{G}{W}
auto={GW}{T}:Add{W}{W}
id=146747
name=Wooded Bastion
rarity=R

View File

@@ -28,7 +28,7 @@ type=Sorcery
[/card]
[card]
text={T}: Add {2} to your mana pool. Ancient Tomb deals 2 damage to you.
auto={T}: Add {2} && Damage 1 controller
auto={T}: Add {2} && Damage 2 controller
id=4636
name=Ancient Tomb
rarity=U

View File

@@ -6,6 +6,7 @@ generic/first_strike2.txt
generic/first_strike3.txt
generic/hybrid_mana.txt
generic/hybrid_mana_2.txt
generic/hybrid_mana_3.txt
generic/legendary.txt
generic/persist.txt
generic/wither.txt
@@ -16,6 +17,7 @@ afflict.txt
anarchy.txt
animate_dead.txt
animate_dead2.txt
ankh_of_mishra.txt
ardakar_wastes.txt
ascendant_evincar.txt
ascendant_evincar2.txt
@@ -32,7 +34,9 @@ counsel_of_the_soratami.txt
counterspell.txt
counterspell2.txt
creature_bond.txt
dingus_egg.txt
doomed_necromancer.txt
dragon_fodder.txt
drain_life.txt
flare.txt
force_of_nature.txt
@@ -45,6 +49,7 @@ goblin_balloon_brigade2.txt
goblin_king.txt
hymn_of_rebirth.txt
keldon_warlord.txt
kird_ape.txt
kudzu.txt
kudzu2.txt
lifeforce.txt

View File

@@ -0,0 +1,24 @@
# bug : Ankh of Mishra : Doesn<73>ft deal damage if a land was destroyed then a new one is put into play
# Ankh of Mishra : (RV) 1094
# text=Whenever a land comes into play, Ankh of Mishra deals 2 damage to that land's controller.
# Will destroy a land with stone rain, then put a plains into play
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:1397,1094
hand:1396,1321
manapool:{R}{2}
[PLAYER2]
[DO]
1321
1397
1396
[ASSERT]
FIRSTMAIN
[PLAYER1]
graveyard:1397,1321
inplay:1094,1396
manapool:{0}
life:18
[PLAYER2]
[END]

View File

@@ -0,0 +1,26 @@
# bug : Dingus Egg can be put into play but does not deal damage when a player loses a land
# Dingus Egg : (RV) 1105
#text=Whenever a land is put into a graveyard from play, Dingus Egg deals 2 damage to that land's controller.
# Will destroy 2 lands with stone rains
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:1397,1105
hand:1321,1321,1396
manapool:{R}{2}{R}{2}
[PLAYER2]
[DO]
1321
1397
1396
1321
1396
[ASSERT]
FIRSTMAIN
[PLAYER1]
graveyard:1397,1321,1396,1321
inplay:1105
manapool:{0}
life:16
[PLAYER2]
[END]

View File

@@ -0,0 +1,19 @@
#Testing Tokens
# Dragon Fodder (ALA) 174936
# text=Put two 1/1 red Goblin creature tokens into play.
[INIT]
FIRSTMAIN
[PLAYER1]
hand:174936
manapool:{R}{1}
[PLAYER2]
[DO]
174936
[ASSERT]
FIRSTMAIN
[PLAYER1]
graveyard:174936
inplay:-174936,-174936
manapool:{0}
[PLAYER2]
[END]

View File

@@ -0,0 +1,18 @@
#Testing Hybrid Mana
# Spectral possession: text=({2W} can be paid with any two mana or with {W}. This card's converted mana cost is 6.) Put three 1/1 white Spirit creature tokens with flying into play.
[INIT]
FIRSTMAIN
[PLAYER1]
hand:152070
manapool:{R}{R}{G}{G}{W}{W}
[PLAYER2]
[DO]
152070
[ASSERT]
FIRSTMAIN
[PLAYER1]
graveyard:152070
inplay:-152070,-152070,-152070
manapool:{0}
[PLAYER2]
[END]

View File

@@ -0,0 +1,43 @@
# bug : Kird Ape : keeps his power/toughness bonus when unsummoned. This allows to cheat and bost the Kird ape like crazy.
# Kird Ape : (RV) 1302
# text=Kird Ape gets +1/+2 as long as you control a Forest.
# Will unsummon and reput into play
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:1386,1302
hand:1229
manapool:{R}{U}
[PLAYER2]
[DO]
1229
1302
1302
eot
eot
next
#upkeep
next
#draw
next
#firstmain
next
#combatbegins
next
#attackers
1302
next
#blockers
next
#damage
next
#combatend
[ASSERT]
COMBATEND
[PLAYER1]
graveyard:1229
inplay:1386,1302
manapool:{0}
[PLAYER2]
life:18
[END]

View File

@@ -1217,23 +1217,31 @@ class AAladdinsLamp: public TargetAbility{
//Ankh of Mishra
class AAnkhOfMishra: public MTGAbility{
class AAnkhOfMishra: public ListMaintainerAbility{
public:
int playerLands[2];
AAnkhOfMishra(int id, MTGCardInstance * _source):MTGAbility(id, _source){
for (int i=0; i< 2; i++){
playerLands[i] = GameObserver::GetInstance()->players[i]->game->inPlay->countByType("land");
}
int init;
AAnkhOfMishra(int id, MTGCardInstance * _source):ListMaintainerAbility(id, _source){
init = 0;
}
void Update(float dt){
for (int i=0; i < 2; i++){
int lands = GameObserver::GetInstance()->players[i]->game->inPlay->countByType("land");
while (lands > playerLands[i]){
GameObserver::GetInstance()->mLayers->stackLayer()->addDamage(source,GameObserver::GetInstance()->players[i], 2);
playerLands[i]++;
}
}
ListMaintainerAbility::Update(dt);
init = 1;
}
int canBeInList(MTGCardInstance * card){
if (card->hasType("land")) return 1;
return 0;
}
int added(MTGCardInstance * card){
if (!init) return 0;
game->mLayers->stackLayer()->addDamage(source,card->controller(), 2);
return 1;
}
int removed(MTGCardInstance * card){
return 1;
}
};
@@ -1472,23 +1480,23 @@ class ACreatureBond:public TriggeredAbility{
};
//1105: Dingus Egg
class ADingusEgg: public MTGAbility{
class ADingusEgg: public ListMaintainerAbility{
public:
int playerLands[2];
ADingusEgg(int id, MTGCardInstance * _source):MTGAbility(id, _source){
for (int i=0; i< 2; i++){
playerLands[i] = GameObserver::GetInstance()->players[i]->game->inPlay->countByType("land");
}
ADingusEgg(int id, MTGCardInstance * _source):ListMaintainerAbility(id, _source){
}
void Update(float dt){
for (int i=0; i < 2; i++){
int lands = GameObserver::GetInstance()->players[i]->game->inPlay->countByType("land");
while (lands < playerLands[i]){
GameObserver::GetInstance()->mLayers->stackLayer()->addDamage(source,GameObserver::GetInstance()->players[i], 2);
playerLands[i]--;
}
}
int canBeInList(MTGCardInstance * card){
if (card->hasType("land")) return 1;
return 0;
}
int added(MTGCardInstance * card){
return 1;
}
int removed(MTGCardInstance * card){
game->mLayers->stackLayer()->addDamage(source,card->controller(), 2);
return 1;
}
};
@@ -1908,15 +1916,6 @@ class AKudzu: public TargetAbility{
return 0;
}
/*
int reactToClick(MTGCardInstance * card){
if (!waitingForAnswer) {
}else{
tc->toggleTarget(card);
}
return 1;
}
*/
int resolve(){
target = tc->getNextCardTarget();
@@ -2423,30 +2422,7 @@ class AKeldonWarlord:public ListMaintainerAbility{
};
//1302 : Kird Ape
class AKirdApe:public MTGAbility{
public:
int init;
AKirdApe(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
init = 0;
}
void Update(float dt){
if (source->controller()->game->inPlay->hasType("forest")){
if(!init){
init = 1;
source->power+=1;
source->addToToughness(2);
}
}else{
if (init){
init = 0;
source->power-=1;
source->addToToughness(-2);
}
}
}
};
//1309 Orcish Artilery
class AOrcishArtillery: public ADamager{
@@ -2589,30 +2565,6 @@ class ANorthernPaladin:public TargetAbility{
};
//Sedge Troll
class ASedgeTroll:public MTGAbility{
public:
int init;
ASedgeTroll(int _id, MTGCardInstance * _source):MTGAbility(_id, _source){
init = 0;
}
void Update(float dt){
if (source->controller()->game->inPlay->hasType("swamp")){
if(!init){
init = 1;
source->power+=1;
source->addToToughness(1);
}
}else{
if (init){
init = 0;
source->power-=1;
source->addToToughness(-1);
}
}
}
};
//Soul Net
class ASoulNet:public ActivatedAbility{
@@ -2883,33 +2835,45 @@ class ACreaturePowerToughnessModifierForAllTypeControlled:public ListMaintainerA
};
//GenericKirdApe
//Erwan 2008/11/15 : this cannot work as type is never initialized...
class AGenericKirdApe:public MTGAbility{
//Generic Kird Ape
class AKirdApe:public ListMaintainerAbility{
public:
int init;
char type [20];
TargetChooser * tc;
int power;
int toughness;
AGenericKirdApe(int _id, MTGCardInstance * _source, const char * _type, int _power, int _toughness):MTGAbility(_id, _source){
init = 0;
}
AKirdApe(int _id, MTGCardInstance * _source, TargetChooser * _tc, int _power, int _toughness):ListMaintainerAbility(_id, _source){
power = _power;
toughness = _toughness;
tc = _tc;
}
int canBeInList(MTGCardInstance * card){
if (card->controller() == source->controller() && tc->canTarget(card)) return 1;
return 0;
}
int added(MTGCardInstance * card){
if (cards.size()== 1){
source->power+=power;
source->addToToughness(toughness);
return 1;
}
return 0;
}
int removed(MTGCardInstance * card){
if (cards.size()== 0){
source->power-=power;
source->addToToughness(-toughness);
return 1;
}
return 0;
}
~AKirdApe(){
delete tc;
}
void Update(float dt){
if (source->controller()->game->inPlay->hasType(type)){
if(!init){
init = 1;
source->power+=power;
source->addToToughness(toughness);
}
}else{
if (init){
init = 0;
source->power-=power;
source->addToToughness(-toughness);
}
}
}
};

View File

@@ -39,6 +39,7 @@ class MTGCardInstance: public MTGCard, public Damageable, public Targetable {
public:
bool isToken;
MTGGameZone * getCurrentZone();
MTGGameZone * previousZone;
int doDamageTest;
int summoningSickness;
// The recommended method to test for summoning Sickness !

View File

@@ -53,7 +53,7 @@ class TestSuite{
TestSuiteState initState;
TestSuiteState endState;
TestSuiteActions actions;
string files[128];
string files[1024];
int nbfiles;
int currentfile;
void load(const char * filename);

View File

@@ -1122,7 +1122,8 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
}
case 1315: //Sedge Troll
{
game->addObserver( NEW ASedgeTroll(_id, card));
TargetChooser * tc = NEW TypeTargetChooser("swamp",card);
game->addObserver(NEW AKirdApe(_id, card,tc,1,1));
break;
}
case 1221: //Serendib Efreet
@@ -1281,7 +1282,8 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
}
case 1302: //Kird Ape
{
game->addObserver(NEW AKirdApe(_id, card));
TargetChooser * tc = NEW TypeTargetChooser("forest",card);
game->addObserver(NEW AKirdApe(_id, card,tc,1,2));
break;
}
case 1309: //Orcish Artillery
@@ -1862,12 +1864,14 @@ void ListMaintainerAbility::Update(float dt){
//Destroy the spell -> remove all targets
int ListMaintainerAbility::destroy(){
map<MTGCardInstance *,bool>::iterator it;
map<MTGCardInstance *,bool>::iterator it = cards.begin();
for ( it=cards.begin() ; it != cards.end(); it++ ){
removed((*it).first);
while ( it!=cards.end()){
MTGCardInstance * card = (*it).first;
cards.erase(card);
removed(card);
it = cards.begin();
}
cards.clear();
return 1;
}

View File

@@ -52,6 +52,7 @@ void MTGCardInstance::initMTGCI(){
owner = NULL;
changedZoneRecently = 0;
counters = NEW Counters(this);
previousZone = NULL;
}

View File

@@ -160,6 +160,7 @@ MTGCardInstance * MTGGameZone::removeCard(MTGCardInstance * card){
if (cards[i] == card){
cards[i] = cards[nb_cards -1];
nb_cards--;
card->previousZone = this;
return card;
}
}