Erwan
-fixed bug with elvish promenade (and various instants/sorceries) -Fixed bug with some auras that wouldn't go to graveyard in some conditions
This commit is contained in:
@@ -919,8 +919,8 @@ subtype=Merfolk
|
|||||||
power=2
|
power=2
|
||||||
toughness=2
|
toughness=2
|
||||||
text=Other Merfolk creatures you control get +1/+1. {T}: Target Merfolk creature is unblockable this turn.
|
text=Other Merfolk creatures you control get +1/+1. {T}: Target Merfolk creature is unblockable this turn.
|
||||||
auto=lord(merfolk|myBattlefield) 1/1
|
auto=lord(merfolk|myBattlefield) 1/1 other
|
||||||
auto={T}:unblockable target(merfolk)
|
auto={T}:unblockable target(merfolk) other
|
||||||
rarity=R
|
rarity=R
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
|||||||
@@ -591,7 +591,7 @@ rarity=R
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
text=Put a 1/1 green Saproling creature token into play.
|
text=Put a 1/1 green Saproling creature token into play.
|
||||||
auto={G}:token(Saproling,creature saproling, 1/1, green)
|
auto=token(Saproling,Creature Saproling,1/1,green)
|
||||||
id=122079
|
id=122079
|
||||||
name=Sprout
|
name=Sprout
|
||||||
rarity=C
|
rarity=C
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ dragon_fodder.txt
|
|||||||
drain_life.txt
|
drain_life.txt
|
||||||
drift_of_the_dead.txt
|
drift_of_the_dead.txt
|
||||||
elvish_piper.txt
|
elvish_piper.txt
|
||||||
|
elvish_promenade.txt
|
||||||
fastbond.txt
|
fastbond.txt
|
||||||
flare.txt
|
flare.txt
|
||||||
fledgling_imp.txt
|
fledgling_imp.txt
|
||||||
@@ -132,6 +133,7 @@ siege_gang_commander.txt
|
|||||||
shivan_hellkite.txt
|
shivan_hellkite.txt
|
||||||
shock.txt
|
shock.txt
|
||||||
slate_of_ancestry.txt
|
slate_of_ancestry.txt
|
||||||
|
soulblast.txt
|
||||||
sphinx_summoner.txt
|
sphinx_summoner.txt
|
||||||
spitting_earth.txt
|
spitting_earth.txt
|
||||||
spark_elemental.txt
|
spark_elemental.txt
|
||||||
|
|||||||
19
projects/mtg/bin/Res/test/elvish_promenade.txt
Normal file
19
projects/mtg/bin/Res/test/elvish_promenade.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
#Testing Elvish Promenade
|
||||||
|
#Put a 1/1 green Elf Warrior creature token onto the battlefield for each Elf you control.
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
hand:elvish promenade
|
||||||
|
inplay:elvish champion,llanowar elves
|
||||||
|
manapool:{3}{G}
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
elvish promenade
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
graveyard:elvish promenade
|
||||||
|
inplay:elvish champion,llanowar elves,*,*
|
||||||
|
manapool:{0}
|
||||||
|
[PLAYER2]
|
||||||
|
[END]
|
||||||
22
projects/mtg/bin/Res/test/soulblast.txt
Normal file
22
projects/mtg/bin/Res/test/soulblast.txt
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
#Testing Soulblast
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
hand:soulblast,Flowstone embrace
|
||||||
|
inplay:raging goblin,grizzly bears
|
||||||
|
manapool:{2}{R}{R}{R}{R}{R}{R}
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:dragon engine
|
||||||
|
[DO]
|
||||||
|
Flowstone embrace
|
||||||
|
grizzly bears
|
||||||
|
soulblast
|
||||||
|
dragon engine
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
graveyard:soulblast,Flowstone embrace,raging goblin,grizzly bears
|
||||||
|
manapool:{0}
|
||||||
|
[PLAYER2]
|
||||||
|
graveyard:dragon engine
|
||||||
|
[END]
|
||||||
@@ -206,6 +206,7 @@ class GenericActivatedAbility:public ActivatedAbility{
|
|||||||
int counters;
|
int counters;
|
||||||
GenericActivatedAbility(int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int _tap = 1, int limit = 0):ActivatedAbility(_id, card,_cost,0,_tap),ability(a),limitPerTurn(limit){
|
GenericActivatedAbility(int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int _tap = 1, int limit = 0):ActivatedAbility(_id, card,_cost,0,_tap),ability(a),limitPerTurn(limit){
|
||||||
counters = 0;
|
counters = 0;
|
||||||
|
target = ability->target;
|
||||||
}
|
}
|
||||||
|
|
||||||
int resolve(){
|
int resolve(){
|
||||||
|
|||||||
@@ -79,6 +79,7 @@ void AIPlayer::tapLandsForMana(ManaCost * potentialMana, ManaCost * cost){
|
|||||||
if (amp){
|
if (amp){
|
||||||
MTGCardInstance * card = amp->source;
|
MTGCardInstance * card = amp->source;
|
||||||
if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost()==1){
|
if (!used[card] && amp->isReactingToClick(card) && amp->output->getConvertedCost()==1){
|
||||||
|
used[card] = true;
|
||||||
int doTap = 1;
|
int doTap = 1;
|
||||||
for (int i=Constants::MTG_NB_COLORS-1; i>= 0; i--){
|
for (int i=Constants::MTG_NB_COLORS-1; i>= 0; i--){
|
||||||
if (diff->getCost(i) && amp->output->getCost(i) ){
|
if (diff->getCost(i) && amp->output->getCost(i) ){
|
||||||
@@ -90,7 +91,6 @@ void AIPlayer::tapLandsForMana(ManaCost * potentialMana, ManaCost * cost){
|
|||||||
if (doTap){
|
if (doTap){
|
||||||
AIAction * action = NEW AIAction(amp,card);
|
AIAction * action = NEW AIAction(amp,card);
|
||||||
clickstream.push(action);
|
clickstream.push(action);
|
||||||
used[card] = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -147,8 +147,8 @@ int AIAction::getEfficiency(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Can't handle sacrifice costs that require a target yet :(
|
//Can't handle sacrifice costs that require a target yet :(
|
||||||
if (a->cost){
|
if (ability->cost){
|
||||||
ExtraCosts * ec = a->cost->extraCosts;
|
ExtraCosts * ec = ability->cost->extraCosts;
|
||||||
if (ec){
|
if (ec){
|
||||||
for (size_t i = 0; i < ec->costs.size(); i++){
|
for (size_t i = 0; i < ec->costs.size(); i++){
|
||||||
if (ec->costs[i]->tc) return 0;
|
if (ec->costs[i]->tc) return 0;
|
||||||
|
|||||||
@@ -790,12 +790,19 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
|||||||
void AbilityFactory::addAbilities(int _id, Spell * spell){
|
void AbilityFactory::addAbilities(int _id, Spell * spell){
|
||||||
MTGCardInstance * card = spell->source;
|
MTGCardInstance * card = spell->source;
|
||||||
|
|
||||||
|
|
||||||
|
if (card->hasType("instant") || card->hasType("sorcery")){
|
||||||
|
MTGPlayerCards * zones = card->controller()->game;
|
||||||
|
zones->putInGraveyard(card);
|
||||||
|
}
|
||||||
|
|
||||||
if (spell->cursor==1) card->target = spell->getNextCardTarget();
|
if (spell->cursor==1) card->target = spell->getNextCardTarget();
|
||||||
_id = magicText(_id, spell);
|
_id = magicText(_id, spell);
|
||||||
int putSourceInGraveyard = 0; //For spells that are not already InstantAbilities;
|
|
||||||
|
|
||||||
|
|
||||||
GameObserver * game = GameObserver::GetInstance();
|
GameObserver * game = GameObserver::GetInstance();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int id = card->getId();
|
int id = card->getId();
|
||||||
if (card->alias) id = card->alias;
|
if (card->alias) id = card->alias;
|
||||||
switch (id){
|
switch (id){
|
||||||
@@ -1804,17 +1811,16 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
|
|
||||||
case 130369: // Soulblast
|
case 130369: // Soulblast
|
||||||
{
|
{
|
||||||
int damage = 0;
|
int damage = 0;
|
||||||
Damageable * target = spell->getNextDamageableTarget();
|
Damageable * target = spell->getNextDamageableTarget();
|
||||||
GameObserver * game = GameObserver::GetInstance();
|
for (int j = card->controller()->game->inPlay->nb_cards-1; j >=0 ; --j){
|
||||||
for (int j = 0; j < card->controller()->game->inPlay->nb_cards; j++){
|
MTGCardInstance * current = card->controller()->game->inPlay->cards[j];
|
||||||
MTGCardInstance * current = card->controller()->game->inPlay->cards[j];
|
if (current->hasType("Creature")){
|
||||||
if (current->hasType("Creature")){
|
card->controller()->game->putInGraveyard(current);
|
||||||
card->controller()->game->putInGraveyard(current);
|
damage+= current->power;
|
||||||
damage+= current->power;
|
}
|
||||||
}
|
}
|
||||||
}
|
game->mLayers->stackLayer()->addDamage(card, target, damage);
|
||||||
game->mLayers->stackLayer()->addDamage(card, target, damage);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1944,16 +1950,6 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
game->addObserver(NEW AStrongLandLinkCreature(_id, card,"plains"));
|
game->addObserver(NEW AStrongLandLinkCreature(_id, card,"plains"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//Instants are put in the graveyard automatically if that's not already done
|
|
||||||
if (!putSourceInGraveyard){
|
|
||||||
if (card->hasType("instant") || card->hasType("sorcery")){
|
|
||||||
putSourceInGraveyard = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (putSourceInGraveyard == 1){
|
|
||||||
MTGPlayerCards * zones = card->controller()->game;
|
|
||||||
card = zones->putInGraveyard(card);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MTGAbility::MTGAbility(int id, MTGCardInstance * card):ActionElement(id){
|
MTGAbility::MTGAbility(int id, MTGCardInstance * card):ActionElement(id){
|
||||||
|
|||||||
@@ -349,16 +349,15 @@ int HUDDisplay::receiveEvent(WEvent * event){
|
|||||||
|
|
||||||
WEventZoneChange * ezc = dynamic_cast<WEventZoneChange*>(event);
|
WEventZoneChange * ezc = dynamic_cast<WEventZoneChange*>(event);
|
||||||
if (ezc) {
|
if (ezc) {
|
||||||
int ok = 0;
|
|
||||||
for (int i = 0; i < 2 ; i++){
|
for (int i = 0; i < 2 ; i++){
|
||||||
Player * p = game->players[i];
|
Player * p = game->players[i];
|
||||||
if (ezc->from == p->game->graveyard || ezc->to == p->game->graveyard ) ok = 1;
|
if (ezc->to == p->game->graveyard ){
|
||||||
|
char buffer[512];
|
||||||
|
sprintf(buffer,_("%s goes to graveyard").c_str(), _(ezc->card->getName()).c_str());
|
||||||
|
string s = buffer;
|
||||||
|
return addEvent(s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (!ok) return 0;
|
|
||||||
char buffer[512];
|
|
||||||
sprintf(buffer,_("%s goes to graveyard").c_str(), _(ezc->card->getName()).c_str());
|
|
||||||
string s = buffer;
|
|
||||||
return addEvent(s);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WEventDamage * ed = dynamic_cast<WEventDamage*>(event);
|
WEventDamage * ed = dynamic_cast<WEventDamage*>(event);
|
||||||
|
|||||||
Reference in New Issue
Block a user