Added/fixed primitives, improved "anytypeofmana" ability for both player and AI and implemented "anytypeofmanaability" keyword to allow the user and the AI to spend mana of any color to activate abilities.
This commit is contained in:
@@ -84,8 +84,8 @@ class AIPlayerBaka: public AIPlayer{
|
||||
//Tries to play an ability recommended by the deck creator
|
||||
virtual int selectHintAbility();
|
||||
|
||||
virtual vector<MTGAbility*> canPayMana(MTGCardInstance * card = NULL, ManaCost * mCost = NULL);
|
||||
virtual vector<MTGAbility*> canPayMana(MTGCardInstance * card, ManaCost * mCost, map<MTGCardInstance*, bool> &usedCards, bool searchingAgain = false);
|
||||
virtual vector<MTGAbility*> canPayMana(MTGCardInstance * card, ManaCost * mCost, int anytypeofmana);
|
||||
virtual vector<MTGAbility*> canPayMana(MTGCardInstance * card, ManaCost * mCost, int anytypeofmana, map<MTGCardInstance*, bool> &usedCards, bool searchingAgain = false);
|
||||
virtual vector<MTGAbility*> canPaySunBurst(ManaCost * mCost = NULL);
|
||||
|
||||
virtual MTGCardInstance * chooseCard(TargetChooser * tc, MTGCardInstance * source, int random = 0);
|
||||
@@ -106,7 +106,7 @@ class AIPlayerBaka: public AIPlayer{
|
||||
//used by MomirPlayer, hence protected instead of private
|
||||
virtual int getEfficiency(OrderedAIAction * action);
|
||||
virtual int getEfficiency(MTGAbility * ability);
|
||||
virtual bool payTheManaCost(ManaCost * cost, MTGCardInstance * card = NULL,vector<MTGAbility*> gotPayment = vector<MTGAbility*>());
|
||||
virtual bool payTheManaCost(ManaCost * cost, int anytypeofmana, MTGCardInstance * card = NULL,vector<MTGAbility*> gotPayment = vector<MTGAbility*>());
|
||||
virtual int getCreaturesInfo(Player * player, int neededInfo = INFO_NBCREATURES , int untapMode = 0, int canAttack = 0);
|
||||
virtual ManaCost * getPotentialMana(MTGCardInstance * card = NULL);
|
||||
virtual int selectAbility();
|
||||
@@ -134,7 +134,7 @@ class AIPlayerBaka: public AIPlayer{
|
||||
virtual int affectCombatDamages(CombatStep step);
|
||||
virtual int canHandleCost(MTGAbility * ability);
|
||||
virtual int chooseTarget(TargetChooser * tc = NULL, Player * forceTarget = NULL,MTGCardInstance * Chosencard = NULL,bool checkonly = false);
|
||||
virtual vector<MTGAbility*> canPayManaCost(MTGCardInstance * card = NULL, ManaCost * mCost = NULL){ return canPayMana(card, mCost);};
|
||||
virtual vector<MTGAbility*> canPayManaCost(MTGCardInstance * card = NULL, ManaCost * mCost = NULL, int anytypeofmana = 0){ return canPayMana(card, mCost, anytypeofmana);};
|
||||
|
||||
//used by AIHInts, therefore public instead of private :/
|
||||
virtual int createAbilityTargets(MTGAbility * a, MTGCardInstance * c, RankingContainer& ranking);
|
||||
|
||||
@@ -36,7 +36,7 @@ protected:
|
||||
|
||||
MTGCardInstance * FindCardToPlay(ManaCost * potentialMana, const char * type);
|
||||
|
||||
bool payTheManaCost(ManaCost * cost, MTGCardInstance * card = NULL,vector<MTGAbility*> gotPayment = vector<MTGAbility*>());
|
||||
bool payTheManaCost(ManaCost * cost, int anytypeofmana, MTGCardInstance * card = NULL,vector<MTGAbility*> gotPayment = vector<MTGAbility*>());
|
||||
int getCreaturesInfo(Player * player, int neededInfo = INFO_NBCREATURES , int untapMode = 0, int canAttack = 0);
|
||||
ManaCost * getPotentialMana(MTGCardInstance * card = NULL);
|
||||
int selectAbility();
|
||||
|
||||
@@ -2921,7 +2921,7 @@ public:
|
||||
{
|
||||
if (_card == source && game->currentlyActing()->game->inPlay->hasCard(source))
|
||||
{
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(cost))
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(cost,_card->has(Constants::ANYTYPEOFMANAABILITY)))
|
||||
{
|
||||
Interruptible * laststackitem = game->mLayers->stackLayer()->getAt(-1);
|
||||
if (laststackitem && laststackitem->type == ACTION_SPELL)
|
||||
@@ -2982,7 +2982,7 @@ public:
|
||||
{
|
||||
if (_card == target && game->currentlyActing()->game->inPlay->hasCard(source) && _card->isTapped())
|
||||
{
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(cost))
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(cost,_card->has(Constants::ANYTYPEOFMANAABILITY)))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -6231,7 +6231,7 @@ public:
|
||||
{
|
||||
if (counters > 0 && _card == source && currentPhase == MTG_PHASE_UPKEEP)
|
||||
{
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(&cost))
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(&cost,_card->has(Constants::ANYTYPEOFMANAABILITY)))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -6327,7 +6327,7 @@ public:
|
||||
{
|
||||
if (_card == source && game->currentlyActing()->game->inPlay->hasCard(source) && !_card->isTapped())
|
||||
{
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(&cost))
|
||||
if (game->currentlyActing()->getManaPool()->canAfford(&cost,_card->has(Constants::ANYTYPEOFMANAABILITY)))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
@@ -6642,7 +6642,7 @@ public:
|
||||
if (damagesToDealThisTurn && currentPhase == MTG_PHASE_UPKEEP && card == source && _target->controller()
|
||||
== game->currentPlayer)
|
||||
{
|
||||
if (game->currentPlayer->getManaPool()->canAfford(&cost)) return 1;
|
||||
if (game->currentPlayer->getManaPool()->canAfford(&cost,card->has(Constants::ANYTYPEOFMANAABILITY))) return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -299,7 +299,8 @@ class Constants
|
||||
GAINEDHANDDEATH = 172,
|
||||
CYCLING = 173,
|
||||
FORETELL = 174,
|
||||
NB_BASIC_ABILITIES = 175,
|
||||
ANYTYPEOFMANAABILITY = 175,
|
||||
NB_BASIC_ABILITIES = 176,
|
||||
|
||||
RARITY_S = 'S', //Special Rarity
|
||||
RARITY_M = 'M', //Mythics
|
||||
|
||||
@@ -137,7 +137,7 @@ public:
|
||||
int pay (ManaCost * _cost);
|
||||
|
||||
//return 1 if _cost can be paid with current data, 0 otherwise
|
||||
int canAfford(ManaCost * _cost);
|
||||
int canAfford(ManaCost * _cost, int anytypeofmana);
|
||||
|
||||
int isPositive();
|
||||
ManaCost * Diff(ManaCost * _cost);
|
||||
|
||||
Reference in New Issue
Block a user