couple changes, first i re-added my fancy getMenuText for becomes/transforms abilities, somewhere in the refactor these were forgotten. Fix "Swap" ueot menutext display, it was returning "ability".
fixed a Ai related bug, taught Ai not to mill itself to death basically. played a few matches which Ai was just destroying himself with a creature that allowed him to draw cards for each(whatever) in play. Ai will be a little more careful not to kill himself by Mill, also not to draw 30 cards in a turn when it clearly cant play them.
This commit is contained in:
@@ -3212,6 +3212,7 @@ public:
|
|||||||
list<int> oldcolors;
|
list<int> oldcolors;
|
||||||
list<int> oldtypes;
|
list<int> oldtypes;
|
||||||
bool remove;
|
bool remove;
|
||||||
|
string menu;
|
||||||
|
|
||||||
ATransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities);
|
ATransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities);
|
||||||
int addToGame();
|
int addToGame();
|
||||||
@@ -3228,6 +3229,7 @@ public:
|
|||||||
list<int> abilities;
|
list<int> abilities;
|
||||||
list<int> types;
|
list<int> types;
|
||||||
list<int> colors;
|
list<int> colors;
|
||||||
|
string menu;
|
||||||
|
|
||||||
AForeverTransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities);
|
AForeverTransformer(int id, MTGCardInstance * source, MTGCardInstance * target, string stypes, string sabilities);
|
||||||
int addToGame();
|
int addToGame();
|
||||||
@@ -3266,11 +3268,12 @@ public:
|
|||||||
class ASwapPTUEOT: public InstantAbility
|
class ASwapPTUEOT: public InstantAbility
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ASwapPT * ability;
|
ASwapPT * ability;
|
||||||
ASwapPTUEOT(int id, MTGCardInstance * source, MTGCardInstance * target);
|
ASwapPTUEOT(int id, MTGCardInstance * source, MTGCardInstance * target);
|
||||||
int resolve();
|
int resolve();
|
||||||
ASwapPTUEOT * clone() const;
|
const char * getMenuText();
|
||||||
~ASwapPTUEOT();
|
ASwapPTUEOT * clone() const;
|
||||||
|
~ASwapPTUEOT();
|
||||||
};
|
};
|
||||||
|
|
||||||
//becomes ability
|
//becomes ability
|
||||||
|
|||||||
@@ -105,6 +105,7 @@ class MTGAbility: public ActionElement{
|
|||||||
UNTAPPER = 22,
|
UNTAPPER = 22,
|
||||||
TAPPER = 23,
|
TAPPER = 23,
|
||||||
LIFER = 24,
|
LIFER = 24,
|
||||||
|
CLONING = 25,
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -499,6 +499,33 @@ int AIAction::getEfficiency()
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case MTGAbility::STANDARD_DRAW:
|
||||||
|
{
|
||||||
|
//adding this case since i played a few games where Ai litterally decided to mill himself to death. fastest and easiest win ever.
|
||||||
|
//this should help a little, tho ultimately it will be decided later what the best course of action is.
|
||||||
|
efficiency = 0;
|
||||||
|
//eff of drawing ability is calculated by base 20 + the amount of cards in library minus the amount of cards in hand times 7.
|
||||||
|
//drawing is never going to return a hundred eff because later eff is multiplied by 1.3 if no cards in hand.
|
||||||
|
efficiency = int(20 + p->game->library->nb_cards) - int(p->game->hand->nb_cards * 7);
|
||||||
|
if(p->game->hand->nb_cards > 8)//reduce by 20 if cards in hand are over 8, high chance ai cant play them.
|
||||||
|
{
|
||||||
|
efficiency -= 20;
|
||||||
|
}
|
||||||
|
if(a->nbcardAmount >= p->game->library->nb_cards)//if the amount im drawing will mill me to death, eff is 0;
|
||||||
|
{
|
||||||
|
efficiency = 0;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case MTGAbility::CLONING:
|
||||||
|
{
|
||||||
|
efficiency = 0;
|
||||||
|
if (p == target->controller())
|
||||||
|
{
|
||||||
|
efficiency = 20 * target->DangerRanking();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case MTGAbility::MANA_PRODUCER:
|
case MTGAbility::MANA_PRODUCER:
|
||||||
efficiency = 0;
|
efficiency = 0;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -630,6 +630,7 @@ AACloner::AACloner(int _id, MTGCardInstance * _source, MTGCardInstance * _target
|
|||||||
string abilitiesStringList) :
|
string abilitiesStringList) :
|
||||||
ActivatedAbility(_id, _source, _cost, 0, 0), who(who)
|
ActivatedAbility(_id, _source, _cost, 0, 0), who(who)
|
||||||
{
|
{
|
||||||
|
aType = MTGAbility::CLONING;
|
||||||
target = _target;
|
target = _target;
|
||||||
source = _source;
|
source = _source;
|
||||||
if ( abilitiesStringList.size() > 0 )
|
if ( abilitiesStringList.size() > 0 )
|
||||||
@@ -1459,6 +1460,8 @@ ATransformer::ATransformer(int id, MTGCardInstance * source, MTGCardInstance * t
|
|||||||
{
|
{
|
||||||
PopulateSubtypesIndexVector(types, stypes);
|
PopulateSubtypesIndexVector(types, stypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menu = stypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
int ATransformer::addToGame()
|
int ATransformer::addToGame()
|
||||||
@@ -1551,7 +1554,9 @@ int ATransformer::destroy()
|
|||||||
|
|
||||||
const char * ATransformer::getMenuText()
|
const char * ATransformer::getMenuText()
|
||||||
{
|
{
|
||||||
return "Transform";
|
string s = menu;
|
||||||
|
sprintf(menuText, "Becomes %s", s.c_str());
|
||||||
|
return menuText;
|
||||||
}
|
}
|
||||||
|
|
||||||
ATransformer * ATransformer::clone() const
|
ATransformer * ATransformer::clone() const
|
||||||
@@ -1576,6 +1581,7 @@ AForeverTransformer::AForeverTransformer(int id, MTGCardInstance * source, MTGCa
|
|||||||
PopulateAbilityIndexVector(abilities, sabilities);
|
PopulateAbilityIndexVector(abilities, sabilities);
|
||||||
PopulateColorIndexVector(colors, sabilities);
|
PopulateColorIndexVector(colors, sabilities);
|
||||||
PopulateSubtypesIndexVector(types, stypes);
|
PopulateSubtypesIndexVector(types, stypes);
|
||||||
|
menu = stypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
int AForeverTransformer::addToGame()
|
int AForeverTransformer::addToGame()
|
||||||
@@ -1608,7 +1614,9 @@ int AForeverTransformer::addToGame()
|
|||||||
|
|
||||||
const char * AForeverTransformer::getMenuText()
|
const char * AForeverTransformer::getMenuText()
|
||||||
{
|
{
|
||||||
return "Transform";
|
string s = menu;
|
||||||
|
sprintf(menuText, "Becomes %s", s.c_str());
|
||||||
|
return menuText;
|
||||||
}
|
}
|
||||||
|
|
||||||
AForeverTransformer * AForeverTransformer::clone() const
|
AForeverTransformer * AForeverTransformer::clone() const
|
||||||
@@ -1638,7 +1646,7 @@ int ATransformerUEOT::resolve()
|
|||||||
}
|
}
|
||||||
const char * ATransformerUEOT::getMenuText()
|
const char * ATransformerUEOT::getMenuText()
|
||||||
{
|
{
|
||||||
return "Transform";
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
|
|
||||||
ATransformerUEOT * ATransformerUEOT::clone() const
|
ATransformerUEOT * ATransformerUEOT::clone() const
|
||||||
@@ -1672,7 +1680,7 @@ int ATransformerFOREVER::resolve()
|
|||||||
|
|
||||||
const char * ATransformerFOREVER::getMenuText()
|
const char * ATransformerFOREVER::getMenuText()
|
||||||
{
|
{
|
||||||
return "Transform";
|
return ability->getMenuText();
|
||||||
}
|
}
|
||||||
|
|
||||||
ATransformerFOREVER * ATransformerFOREVER::clone() const
|
ATransformerFOREVER * ATransformerFOREVER::clone() const
|
||||||
@@ -1703,6 +1711,11 @@ int ASwapPTUEOT::resolve()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char * ASwapPTUEOT::getMenuText()
|
||||||
|
{
|
||||||
|
return ability->getMenuText();
|
||||||
|
}
|
||||||
|
|
||||||
ASwapPTUEOT * ASwapPTUEOT::clone() const
|
ASwapPTUEOT * ASwapPTUEOT::clone() const
|
||||||
{
|
{
|
||||||
ASwapPTUEOT * a = NEW ASwapPTUEOT(*this);
|
ASwapPTUEOT * a = NEW ASwapPTUEOT(*this);
|
||||||
@@ -1726,6 +1739,7 @@ ABecomes::ABecomes(int id, MTGCardInstance * source, MTGCardInstance * target, s
|
|||||||
PopulateAbilityIndexVector(abilities, sabilities);
|
PopulateAbilityIndexVector(abilities, sabilities);
|
||||||
PopulateColorIndexVector(colors, sabilities);
|
PopulateColorIndexVector(colors, sabilities);
|
||||||
PopulateSubtypesIndexVector(types, stypes);
|
PopulateSubtypesIndexVector(types, stypes);
|
||||||
|
menu = stypes;
|
||||||
|
|
||||||
}
|
}
|
||||||
int ABecomes::addToGame()
|
int ABecomes::addToGame()
|
||||||
|
|||||||
Reference in New Issue
Block a user