produceextra, lki(last known information) for power, toughness and basic abilities

This commit is contained in:
Anthony Calosa
2015-09-30 23:45:54 +08:00
parent 956d21d431
commit e1c02c8bf5
10 changed files with 80 additions and 20 deletions

View File

@@ -654,11 +654,11 @@ private:
}
else if (s == "p" || s == "power")
{
intValue = target->getPower();
intValue = target->getCurrentPower();
}
else if (s == "t" || s == "toughness")
{
intValue = target->getToughness();
intValue = target->getCurrentToughness();
}
else if (s == "kicked")
{
@@ -5966,6 +5966,37 @@ public:
}
};
//ProduceExtra Mana when tapped for mana
class AProduceExtraAbility: public MTGAbility
{
public:
string ManaDescription;
AProduceExtraAbility(GameObserver* observer, int _id, MTGCardInstance * _source, string _ManaDescription) :
MTGAbility(observer, _id, _source)
{
ManaDescription = _ManaDescription;
}
int receiveEvent(WEvent * event)
{
if(WEventCardTappedForMana * isTappedForMana = dynamic_cast<WEventCardTappedForMana *> (event))
{
if ((isTappedForMana->card == source) && (isTappedForMana->card->controller() == source->controller()))
{
AManaProducer *amp = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(ManaDescription,NULL,source), NULL, 0,"",false);
amp->resolve();
SAFE_DELETE(amp);
}
}
return 1;
}
AProduceExtraAbility * clone() const
{
return NEW AProduceExtraAbility(*this);
}
};
//flanking ability
class AFlankerAbility: public MTGAbility
{