Erwan
- bug fixes (civic wayfinder, fault line) - target's quad is displayed for generictargetabilities - added menutext for powertoughnessmodifier
This commit is contained in:
@@ -427,7 +427,7 @@ rarity=R
|
|||||||
text={T}: Target Elf or Soldier gets +2/+2 until end of turn.
|
text={T}: Target Elf or Soldier gets +2/+2 until end of turn.
|
||||||
id=39715
|
id=39715
|
||||||
name=Grassland Crusader
|
name=Grassland Crusader
|
||||||
auto={T}:2/2 target(creature[Elf;Soldier])
|
auto={T}:2/2 target(elf,soldier)
|
||||||
mana={5}{W}
|
mana={5}{W}
|
||||||
type=Creature
|
type=Creature
|
||||||
subtype=Cleric Soldier
|
subtype=Cleric Soldier
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ castle.txt
|
|||||||
cathodion.txt
|
cathodion.txt
|
||||||
celestial_purge.txt
|
celestial_purge.txt
|
||||||
circle_of_protection.txt
|
circle_of_protection.txt
|
||||||
|
civic_wayfinder.txt
|
||||||
clone.txt
|
clone.txt
|
||||||
clone2.txt
|
clone2.txt
|
||||||
composite_golem.txt
|
composite_golem.txt
|
||||||
@@ -76,6 +77,7 @@ dross_harvester.txt
|
|||||||
elvish_piper.txt
|
elvish_piper.txt
|
||||||
elvish_promenade.txt
|
elvish_promenade.txt
|
||||||
fastbond.txt
|
fastbond.txt
|
||||||
|
fault_line.txt
|
||||||
flare.txt
|
flare.txt
|
||||||
fledgling_imp.txt
|
fledgling_imp.txt
|
||||||
fledgling_imp2.txt
|
fledgling_imp2.txt
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
#Bug: Civic wayfinder finds more than basic lands
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
hand:civic wayfinder
|
||||||
|
manapool:{2}{G}
|
||||||
|
library:forest,adarkar wastes
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
civic wayfinder
|
||||||
|
choice 0
|
||||||
|
adarkar wastes
|
||||||
|
forest
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:civic wayfinder
|
||||||
|
hand:forest
|
||||||
|
library:adarkar wastes
|
||||||
|
[PLAYER2]
|
||||||
|
[END]
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#Bug: fault line has the same effect as earthquale (error in X cost)
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
hand:fault line
|
||||||
|
manapool:{1}{R}{R}
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:grizzly bears
|
||||||
|
[DO]
|
||||||
|
fault line
|
||||||
|
[ASSERT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
graveyard:fault line
|
||||||
|
manapool:{0}
|
||||||
|
life:19
|
||||||
|
[PLAYER2]
|
||||||
|
inplay:grizzly bears
|
||||||
|
life:19
|
||||||
|
[END]
|
||||||
@@ -1062,6 +1062,12 @@ class AInstantPowerToughnessModifierUntilEOT: public InstantAbility{
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char * getMenuText(){
|
||||||
|
char buffer[4096];
|
||||||
|
sprintf(buffer, "%i/%i",power,toughness);
|
||||||
|
return buffer;
|
||||||
|
}
|
||||||
|
|
||||||
virtual ostream& toString(ostream& out) const
|
virtual ostream& toString(ostream& out) const
|
||||||
{
|
{
|
||||||
out << "APowerToughnessModifierUntilEndOfTurn ::: power : " << power
|
out << "APowerToughnessModifierUntilEndOfTurn ::: power : " << power
|
||||||
@@ -1101,6 +1107,10 @@ class APowerToughnessModifierUntilEndOfTurn: public ActivatedAbility{
|
|||||||
return resolve();
|
return resolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char * getMenuText(){
|
||||||
|
return ability->getMenuText();
|
||||||
|
}
|
||||||
|
|
||||||
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL){
|
int isReactingToClick(MTGCardInstance * card, ManaCost * mana = NULL){
|
||||||
if (!ActivatedAbility::isReactingToClick(card,mana)) return 0;
|
if (!ActivatedAbility::isReactingToClick(card,mana)) return 0;
|
||||||
return (!maxcounters || (counters < maxcounters));
|
return (!maxcounters || (counters < maxcounters));
|
||||||
|
|||||||
@@ -205,6 +205,7 @@ class AbilityFactory{
|
|||||||
int abilityEfficiency(MTGAbility * a, Player * p, int mode = MODE_ABILITY);
|
int abilityEfficiency(MTGAbility * a, Player * p, int mode = MODE_ABILITY);
|
||||||
public:
|
public:
|
||||||
int magicText(int id, Spell * spell, MTGCardInstance * card = NULL);
|
int magicText(int id, Spell * spell, MTGCardInstance * card = NULL);
|
||||||
|
static int computeX(Spell * spell, MTGCardInstance * card);
|
||||||
int destroyAllInPlay(TargetChooser * tc, int bury = 0);
|
int destroyAllInPlay(TargetChooser * tc, int bury = 0);
|
||||||
int moveAll(TargetChooser * tc, string destinationZone);
|
int moveAll(TargetChooser * tc, string destinationZone);
|
||||||
int damageAll(TargetChooser * tc, int damage);
|
int damageAll(TargetChooser * tc, int damage);
|
||||||
|
|||||||
@@ -64,6 +64,27 @@ void StackAbility::Render(){
|
|||||||
}else{
|
}else{
|
||||||
mFont->DrawString(_(ability->source->getName()).c_str(),x,y-15);
|
mFont->DrawString(_(ability->source->getName()).c_str(),x,y-15);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Targetable * _target = ability->target;
|
||||||
|
if (ability->tc){
|
||||||
|
Targetable * t = ability->tc->getNextTarget();
|
||||||
|
if(t) _target = t;
|
||||||
|
}
|
||||||
|
Damageable * target = NULL;
|
||||||
|
if (_target!= ability->source && (_target->typeAsTarget() == TARGET_CARD || _target->typeAsTarget() == TARGET_PLAYER)){
|
||||||
|
target = (Damageable *) _target;
|
||||||
|
}
|
||||||
|
if (target){
|
||||||
|
quad = target->getIcon();
|
||||||
|
if (quad){
|
||||||
|
quad->SetColor(ARGB(255,255,255,255));
|
||||||
|
float scale = 30 / quad->mHeight;
|
||||||
|
renderer->RenderQuad(quad, x + 150 , y , 0,scale,scale);
|
||||||
|
}else{
|
||||||
|
if (target->type_as_damageable == DAMAGEABLE_MTGCARDINSTANCE)
|
||||||
|
mFont->DrawString(_(((MTGCardInstance *)target)->name).c_str(),x+120,y);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
StackAbility::StackAbility(int id,MTGAbility * _ability): Interruptible(id),ability(_ability){
|
StackAbility::StackAbility(int id,MTGAbility * _ability): Interruptible(id),ability(_ability){
|
||||||
type=ACTION_ABILITY;
|
type=ACTION_ABILITY;
|
||||||
|
|||||||
@@ -757,6 +757,14 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode){
|
|||||||
return BAKA_EFFECT_DONTKNOW;
|
return BAKA_EFFECT_DONTKNOW;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Returns the "X" cost that was paid for a spell
|
||||||
|
int AbilityFactory::computeX(Spell * spell, MTGCardInstance * card){
|
||||||
|
ManaCost * c = spell->cost->Diff(card->getManaCost());
|
||||||
|
int x = c->getCost(Constants::MTG_NB_COLORS);
|
||||||
|
delete c;
|
||||||
|
return x;
|
||||||
|
}
|
||||||
|
|
||||||
//Some basic functionalities that can be added automatically in the text file
|
//Some basic functionalities that can be added automatically in the text file
|
||||||
/*
|
/*
|
||||||
* Several objects are computed from the text string, and have a direct influence on what action we should take
|
* Several objects are computed from the text string, and have a direct influence on what action we should take
|
||||||
@@ -981,7 +989,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
}
|
}
|
||||||
case 1291: //Fireball
|
case 1291: //Fireball
|
||||||
{
|
{
|
||||||
int x = spell->cost->getConvertedCost() - 1; //TODO BETTER
|
int x = computeX(spell,card);
|
||||||
game->addObserver(NEW AFireball(_id, card,spell, x));
|
game->addObserver(NEW AFireball(_id, card,spell, x));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1153,7 +1161,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
}
|
}
|
||||||
case 1164: //Howl from beyond
|
case 1164: //Howl from beyond
|
||||||
{
|
{
|
||||||
int x = spell->cost->getConvertedCost() - 1; //TODO, this is not enough, Spells shouls have a function like "xCost" because the spell might cost more than expected to launch
|
int x = computeX(spell,card);
|
||||||
AInstantPowerToughnessModifierUntilEOT * ability = NEW AInstantPowerToughnessModifierUntilEOT( _id, card, card->target, x, 0);
|
AInstantPowerToughnessModifierUntilEOT * ability = NEW AInstantPowerToughnessModifierUntilEOT( _id, card, card->target, x, 0);
|
||||||
game->addObserver(ability);
|
game->addObserver(ability);
|
||||||
break;
|
break;
|
||||||
@@ -1204,7 +1212,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
}
|
}
|
||||||
case 1167: //Mind Twist
|
case 1167: //Mind Twist
|
||||||
{
|
{
|
||||||
int xCost = spell->cost->getConvertedCost() - 1;
|
int xCost = computeX(spell,card);
|
||||||
for (int i = 0; i < xCost; i++){
|
for (int i = 0; i < xCost; i++){
|
||||||
game->opponent()->game->discardRandom(game->opponent()->game->hand);
|
game->opponent()->game->discardRandom(game->opponent()->game->hand);
|
||||||
}
|
}
|
||||||
@@ -1231,7 +1239,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
}
|
}
|
||||||
case 1224: //Spell Blast
|
case 1224: //Spell Blast
|
||||||
{
|
{
|
||||||
int x = spell->cost->getConvertedCost() - 1;
|
int x = computeX(spell,card);
|
||||||
Spell * starget = spell->getNextSpellTarget();
|
Spell * starget = spell->getNextSpellTarget();
|
||||||
if (starget){
|
if (starget){
|
||||||
if (starget->cost->getConvertedCost() <= x) game->mLayers->stackLayer()->Fizzle(starget);
|
if (starget->cost->getConvertedCost() <= x) game->mLayers->stackLayer()->Fizzle(starget);
|
||||||
@@ -1326,7 +1334,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
|
|
||||||
case 1266: //stream of life
|
case 1266: //stream of life
|
||||||
{
|
{
|
||||||
int x = spell->cost->getConvertedCost() - 1; //TODO Improve that !
|
int x = computeX(spell,card);
|
||||||
spell->getNextPlayerTarget()->life += x;
|
spell->getNextPlayerTarget()->life += x;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1334,7 +1342,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
|
|
||||||
case 1231: //Volcanic Eruption
|
case 1231: //Volcanic Eruption
|
||||||
{
|
{
|
||||||
int x = spell->cost->getConvertedCost() - 3;
|
int x = computeX(spell,card);
|
||||||
int _x = x;
|
int _x = x;
|
||||||
MTGCardInstance * target = spell->getNextCardTarget();
|
MTGCardInstance * target = spell->getNextCardTarget();
|
||||||
while(target && _x){
|
while(target && _x){
|
||||||
@@ -1369,15 +1377,15 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
}
|
}
|
||||||
case 1289: //earthquake
|
case 1289: //earthquake
|
||||||
{
|
{
|
||||||
int x = spell->cost->getConvertedCost() - 1;
|
int x = computeX(spell,card);
|
||||||
for (int i = 0; i < 2 ; i++){
|
for (int i = 0; i < 2 ; i++){
|
||||||
game->mLayers->stackLayer()->addDamage(card, game->players[i], x);
|
game->mLayers->stackLayer()->addDamage(card, game->players[i], x);
|
||||||
for (int j = 0; j < game->players[i]->game->inPlay->nb_cards; j++){
|
for (int j = 0; j < game->players[i]->game->inPlay->nb_cards; j++){
|
||||||
MTGCardInstance * current = game->players[i]->game->inPlay->cards[j];
|
MTGCardInstance * current = game->players[i]->game->inPlay->cards[j];
|
||||||
if (!current->basicAbilities[Constants::FLYING] && current->isACreature()){
|
if (!current->basicAbilities[Constants::FLYING] && current->isACreature()){
|
||||||
game->mLayers->stackLayer()->addDamage(card, current, x);
|
game->mLayers->stackLayer()->addDamage(card, current, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1613,7 +1621,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
//-- addon Urza Saga---
|
//-- addon Urza Saga---
|
||||||
case 8818: //Goblin Offensive
|
case 8818: //Goblin Offensive
|
||||||
{
|
{
|
||||||
int x = spell->cost->getConvertedCost() - 3;
|
int x = computeX(spell,card);
|
||||||
ATokenCreator * tok = NEW ATokenCreator(id,card,NEW ManaCost(),"Goblin","creature Goblin",1,1,"Red",0);
|
ATokenCreator * tok = NEW ATokenCreator(id,card,NEW ManaCost(),"Goblin","creature Goblin",1,1,"Red",0);
|
||||||
for (int i=0; i < x; i++){
|
for (int i=0; i < x; i++){
|
||||||
tok->resolve();
|
tok->resolve();
|
||||||
@@ -1646,7 +1654,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
case 130542: //Flowstone Slide
|
case 130542: //Flowstone Slide
|
||||||
{
|
{
|
||||||
TargetChooser * lordTargets = NULL;
|
TargetChooser * lordTargets = NULL;
|
||||||
int x = spell->cost->getConvertedCost() - 4;
|
int x = computeX(spell,card);
|
||||||
TargetChooserFactory tcf;
|
TargetChooserFactory tcf;
|
||||||
lordTargets = tcf.createTargetChooser("creature", card);
|
lordTargets = tcf.createTargetChooser("creature", card);
|
||||||
break;
|
break;
|
||||||
@@ -1803,7 +1811,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
|
|
||||||
case 151114: //Rise of the Hobgoblins
|
case 151114: //Rise of the Hobgoblins
|
||||||
{
|
{
|
||||||
int x = spell->cost->getConvertedCost() - 2;
|
int x = computeX(spell,card);
|
||||||
ATokenCreator * tok = NEW ATokenCreator(id,card,NEW ManaCost(),"Goblin Soldier","creature Goblin Soldier",1,1,"red white",0);
|
ATokenCreator * tok = NEW ATokenCreator(id,card,NEW ManaCost(),"Goblin Soldier","creature Goblin Soldier",1,1,"red white",0);
|
||||||
for (int i=0; i < x; i++){
|
for (int i=0; i < x; i++){
|
||||||
tok->resolve();
|
tok->resolve();
|
||||||
@@ -1817,7 +1825,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell){
|
|||||||
{
|
{
|
||||||
Player * player = spell->getNextPlayerTarget();
|
Player * player = spell->getNextPlayerTarget();
|
||||||
MTGLibrary * library = player->game->library;
|
MTGLibrary * library = player->game->library;
|
||||||
int x = spell->cost->getConvertedCost() - 2;
|
int x = computeX(spell,card);
|
||||||
for (int i = 0; i < x; i++){
|
for (int i = 0; i < x; i++){
|
||||||
if (library->nb_cards)
|
if (library->nb_cards)
|
||||||
player->game->putInZone(library->cards[library->nb_cards-1],library, player->game->graveyard);
|
player->game->putInZone(library->cards[library->nb_cards-1],library, player->game->graveyard);
|
||||||
@@ -2108,6 +2116,7 @@ void TargetAbility::Render(){
|
|||||||
//TODO ?
|
//TODO ?
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int TargetAbility::resolve(){
|
int TargetAbility::resolve(){
|
||||||
Targetable * t = tc->getNextTarget();
|
Targetable * t = tc->getNextTarget();
|
||||||
if (t && ability){
|
if (t && ability){
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
unsigned int found2 = attributes.find(";");
|
unsigned int found2 = attributes.find(";");
|
||||||
string attribute;
|
string attribute;
|
||||||
if (found2 != string::npos){
|
if (found2 != string::npos){
|
||||||
|
cd->mode = CD_OR;
|
||||||
attribute = attributes.substr(0,found2);
|
attribute = attributes.substr(0,found2);
|
||||||
attributes = attributes.substr(found2+1);
|
attributes = attributes.substr(found2+1);
|
||||||
}else{
|
}else{
|
||||||
@@ -179,7 +180,7 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nbminuses == 0) cd->mode = CD_OR;
|
if (nbminuses) cd->mode = CD_AND;
|
||||||
typeName = typeName.substr(0,found);
|
typeName = typeName.substr(0,found);
|
||||||
}
|
}
|
||||||
//X targets allowed ?
|
//X targets allowed ?
|
||||||
|
|||||||
Reference in New Issue
Block a user