fixed bug causing AI never play a card there are one or more cards in graveyard or other zones, fixed and improved removemana ability, fixed/added primitives.

This commit is contained in:
Vittorio Alfieri
2020-12-30 17:52:06 +01:00
parent 1f98173197
commit 1444ed6b7c
6 changed files with 330 additions and 198 deletions
+5 -4
View File
@@ -5543,8 +5543,8 @@ AAMulligan * AAMulligan::clone() const
}
// Remove Mana From ManaPool
AARemoveMana::AARemoveMana(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, string manaDesc, int who) :
ActivatedAbilityTP(observer, _id, card, _target, NULL, who)
AARemoveMana::AARemoveMana(GameObserver* observer, int _id, MTGCardInstance * card, Targetable * _target, string manaDesc, int who, bool forceclean) :
ActivatedAbilityTP(observer, _id, card, _target, NULL, who), forceclean(forceclean)
{
if (!manaDesc.size())
{
@@ -5577,7 +5577,7 @@ int AARemoveMana::resolve()
}
else //Remove all mana
{
if(game->getCurrentGamePhase() != MTG_PHASE_ENDOFTURN)
if(game->getCurrentGamePhase() != MTG_PHASE_ENDOFTURN && !forceclean)
{
if (player->doesntEmpty->getConvertedCost() && !player->poolDoesntEmpty->getConvertedCost())
{
@@ -5624,7 +5624,8 @@ int AARemoveMana::resolve()
}
else //remove a "standard" mana Description
{
((ManaCost *)manaPool)->remove(mManaDesc); //why do I have to cast here?
manaPool->pay(mManaDesc); //Changed because the mana icons were not disappearing.
//((ManaCost *)manaPool)->remove(mManaDesc); //why do I have to cast here?
}
}
return 1;