Added / fixed primitives from NEO set, added "mytgtforced" target for equipments and auras, added "numofactivation" keyword to give PT according to how many time an ability has triggred (e.g. "Bronze Cudgels").
This commit is contained in:
@@ -8056,21 +8056,29 @@ ATransformerInstant::~ATransformerInstant()
|
||||
}
|
||||
|
||||
//P/t ueot
|
||||
PTInstant::PTInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, WParsedPT * wppt,string s,bool nonstatic) :
|
||||
InstantAbility(observer, id, source, target), wppt(wppt),s(s),nonstatic(nonstatic)
|
||||
PTInstant::PTInstant(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target, WParsedPT * wppt, string s, bool nonstatic) :
|
||||
InstantAbility(observer, id, source, target), wppt(wppt), s(s), nonstatic(nonstatic)
|
||||
{
|
||||
ability = NEW APowerToughnessModifier(game, id, source, target, wppt,s,nonstatic);
|
||||
ability = NEW APowerToughnessModifier(game, id, source, target, wppt, s, nonstatic);
|
||||
aType = MTGAbility::STANDARD_PUMP;
|
||||
lastTriggeredTurn = source->getObserver()->turn;
|
||||
}
|
||||
|
||||
int PTInstant::resolve()
|
||||
{
|
||||
if(lastTriggeredTurn == source->getObserver()->turn)
|
||||
ability->triggers++;
|
||||
else
|
||||
ability->triggers = 1;
|
||||
lastTriggeredTurn = source->getObserver()->turn;
|
||||
APowerToughnessModifier * a = ability->clone();
|
||||
a->triggers = ability->triggers;
|
||||
GenericInstantAbility * wrapper = NEW GenericInstantAbility(game, 1, source, (Damageable *) (this->target), a);
|
||||
wrapper->addToGame();
|
||||
((Damageable *) (this->target))->afterDamage();//additional check the negative pt after resolving..
|
||||
return 1;
|
||||
}
|
||||
|
||||
const string PTInstant::getMenuText()
|
||||
{
|
||||
return ability->getMenuText();
|
||||
@@ -8087,6 +8095,7 @@ PTInstant::~PTInstant()
|
||||
{
|
||||
SAFE_DELETE(ability);
|
||||
}
|
||||
|
||||
// ASwapPTUEOT
|
||||
ASwapPTUEOT::ASwapPTUEOT(GameObserver* observer, int id, MTGCardInstance * source, MTGCardInstance * target) :
|
||||
InstantAbility(observer, id, source, target)
|
||||
|
||||
@@ -65,7 +65,9 @@ TargetChooser * TargetChooserFactory::createTargetChooser(string s, MTGCardInsta
|
||||
if (found == 0)
|
||||
{
|
||||
MTGCardInstance * target = card->target;
|
||||
if (ability) target = (MTGCardInstance *) (ability->target);
|
||||
bool forced = (s.find("forced") != string::npos);
|
||||
if (ability && !forced)
|
||||
target = (MTGCardInstance *) (ability->target);
|
||||
return NEW CardTargetChooser(observer, target, card);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user