Updated an AI commander deck, improved damage and life and manaproduce ability to send the correct source card on triggers when they are used inside the "ability$!!$" keyword, fixed issue #1090 about filtering cards with add{c} instead of add{1} ability.
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
#NAME:Draconic Rage
|
#NAME:Vrondiss Commander 2023
|
||||||
#DESC:The First D&D Deck
|
#DESC:Forgotten Realms Commander Deck
|
||||||
|
#DESC:Draconic Rage
|
||||||
#HINT:castpriority(commander,*)
|
#HINT:castpriority(commander,*)
|
||||||
|
#HINT:alwaysattackwith(creature[Dragon Spirit])
|
||||||
Bogardan Hellkite (*) *1
|
Bogardan Hellkite (*) *1
|
||||||
Demanding Dragon (*) *1
|
Demanding Dragon (*) *1
|
||||||
Dragonmaster Outcast (*) *1
|
Dragonmaster Outcast (*) *1
|
||||||
|
|||||||
@@ -24,6 +24,9 @@ void Damage::init(MTGCardInstance * _source, Damageable * _target, int _damage,
|
|||||||
{
|
{
|
||||||
typeOfDamage = _typeOfDamage;
|
typeOfDamage = _typeOfDamage;
|
||||||
target = _target;
|
target = _target;
|
||||||
|
if(_source && _source->name.empty() && _source->storedSourceCard) // Fix for damage dealt inside ability$!!$ keyword.
|
||||||
|
source = _source->storedSourceCard;
|
||||||
|
else
|
||||||
source = _source;
|
source = _source;
|
||||||
|
|
||||||
if (_damage < 0)
|
if (_damage < 0)
|
||||||
|
|||||||
@@ -8064,10 +8064,19 @@ int AManaProducer::resolve()
|
|||||||
player->getManaPool()->add(output, source);
|
player->getManaPool()->add(output, source);
|
||||||
if(DoesntEmpty)
|
if(DoesntEmpty)
|
||||||
player->doesntEmpty->add(output);
|
player->doesntEmpty->add(output);
|
||||||
|
|
||||||
|
if(source->name.empty() && source->storedSourceCard){ // Fix for mana produced inside ability$!!$ keyword.
|
||||||
|
source->storedSourceCard->getProducedMana()->copy(output);
|
||||||
|
WEventCardManaProduced * ev = NEW WEventCardManaProduced(source->storedSourceCard);
|
||||||
|
if(ev)
|
||||||
|
source->storedSourceCard->getObserver()->receiveEvent(ev);
|
||||||
|
} else {
|
||||||
source->getProducedMana()->copy(output);
|
source->getProducedMana()->copy(output);
|
||||||
WEventCardManaProduced * ev = NEW WEventCardManaProduced(source);
|
WEventCardManaProduced * ev = NEW WEventCardManaProduced(source);
|
||||||
if(ev)
|
if(ev)
|
||||||
source->getObserver()->receiveEvent(ev);
|
source->getObserver()->receiveEvent(ev);
|
||||||
|
}
|
||||||
|
|
||||||
if(andAbility)
|
if(andAbility)
|
||||||
{
|
{
|
||||||
MTGAbility * andAbilityClone = andAbility->clone();
|
MTGAbility * andAbilityClone = andAbility->clone();
|
||||||
|
|||||||
@@ -190,7 +190,11 @@ int Player::gainOrLoseLife(int value, MTGCardInstance* source)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Send life event to listeners
|
//Send life event to listeners
|
||||||
WEvent * lifed = NEW WEventLife(this, value, source);
|
WEvent * lifed = NULL;
|
||||||
|
if(source && source->name.empty() && source->storedSourceCard) // Fix for life gained inside ability$!!$ keyword.
|
||||||
|
lifed = NEW WEventLife(this, value, source->storedSourceCard);
|
||||||
|
else
|
||||||
|
lifed = NEW WEventLife(this, value, source);
|
||||||
observer->receiveEvent(lifed);
|
observer->receiveEvent(lifed);
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
|
|||||||
@@ -340,8 +340,13 @@ bool WCFilterProducesColor::isMatch(MTGCard * c)
|
|||||||
while (t != string::npos)
|
while (t != string::npos)
|
||||||
{
|
{
|
||||||
s = s.substr(t + 3);
|
s = s.substr(t + 3);
|
||||||
|
size_t start_pos = 0;
|
||||||
|
while((start_pos = s.find("{c}", start_pos)) != std::string::npos) {
|
||||||
|
s.replace(start_pos, 3, "{1}"); // Fix while filtering cards for colorless mana {c} instead of {1} (http://code.google.com/p/wagic/issues/detail?id=1090).
|
||||||
|
start_pos += 3;
|
||||||
|
}
|
||||||
ManaCost * mc = ManaCost::parseManaCost(s);
|
ManaCost * mc = ManaCost::parseManaCost(s);
|
||||||
if (mc->hasColor(color) > 0)
|
if (mc && mc->hasColor(color) > 0)
|
||||||
{
|
{
|
||||||
bMatch = true;
|
bMatch = true;
|
||||||
SAFE_DELETE(mc);
|
SAFE_DELETE(mc);
|
||||||
|
|||||||
Reference in New Issue
Block a user