update some cards
removed phasedout trigger add phasedoutbonus - ability
This commit is contained in:
@@ -1709,7 +1709,7 @@ int AAPhaseOut::resolve()
|
||||
_target->view->alpha = 50;
|
||||
_target->initAttackersDefensers();
|
||||
//add event phases out here
|
||||
WEvent * e = NEW WEventCardPhasesOut(_target);
|
||||
WEvent * e = NEW WEventCardPhasesOut(_target,game->turn);
|
||||
game->receiveEvent(e);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ CardPrimitive::CardPrimitive(CardPrimitive * source)
|
||||
setdoubleFaced(source->doubleFaced);
|
||||
setAICustomCode(source->AICustomCode);
|
||||
setCrewAbility(source->CrewAbility);
|
||||
setPhasedOutAbility(source->PhasedOutAbility);
|
||||
power = source->power;
|
||||
toughness = source->toughness;
|
||||
restrictions = source->restrictions ? source->restrictions->clone() : NULL;
|
||||
@@ -365,6 +366,17 @@ const string& CardPrimitive::getCrewAbility() const
|
||||
return CrewAbility;
|
||||
}
|
||||
|
||||
void CardPrimitive::setPhasedOutAbility(const string& value)
|
||||
{
|
||||
PhasedOutAbility = value;
|
||||
std::transform(PhasedOutAbility.begin(), PhasedOutAbility.end(), PhasedOutAbility.begin(), ::tolower);
|
||||
}
|
||||
|
||||
const string& CardPrimitive::getPhasedOutAbility() const
|
||||
{
|
||||
return PhasedOutAbility;
|
||||
}
|
||||
|
||||
void CardPrimitive::setName(const string& value)
|
||||
{
|
||||
name = value;
|
||||
|
||||
@@ -856,7 +856,7 @@ void GameObserver::gameStateBasedEffects()
|
||||
card->view->alpha = 50;
|
||||
card->initAttackersDefensers();
|
||||
//add event phases out here
|
||||
WEvent * evphaseout = NEW WEventCardPhasesOut(card);
|
||||
WEvent * evphaseout = NEW WEventCardPhasesOut(card, turn);
|
||||
receiveEvent(evphaseout);
|
||||
}
|
||||
else if((card->has(Constants::PHASING) || card->isPhased)&& mCurrentGamePhase == MTG_PHASE_UNTAP && currentPlayer == card->controller() && card->phasedTurn != turn)
|
||||
|
||||
@@ -1044,10 +1044,6 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
|
||||
if (TargetChooser *tc = parseSimpleTC(s,"phasedin", card))
|
||||
return NEW TrCardPhasesIn(observer, id, card, tc,once);
|
||||
|
||||
//Card Phases Out
|
||||
if (TargetChooser *tc = parseSimpleTC(s,"phasedout", card))
|
||||
return NEW TrCardPhasesOut(observer, id, card, tc,once);
|
||||
|
||||
//CombatTrigger
|
||||
//Card card attacked and is blocked
|
||||
found = s.find("combat(");
|
||||
|
||||
@@ -152,6 +152,7 @@ void MTGCardInstance::copy(MTGCardInstance * card)
|
||||
doubleFaced = data->doubleFaced;
|
||||
AICustomCode = data->AICustomCode;
|
||||
CrewAbility = data->CrewAbility;
|
||||
PhasedOutAbility = data->PhasedOutAbility;
|
||||
origpower = card->origpower;//for flip
|
||||
origtoughness = card->origtoughness;//for flip
|
||||
TokenAndAbility = card->TokenAndAbility;//token andAbility
|
||||
|
||||
@@ -264,7 +264,15 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
||||
break;
|
||||
|
||||
case 'p':
|
||||
if (key[1] == 'r')
|
||||
if (key == "phasedoutbonus")
|
||||
{
|
||||
if (!primitive) primitive = NEW CardPrimitive();
|
||||
{
|
||||
primitive->setPhasedOutAbility(val);
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (key[1] == 'r')
|
||||
{ // primitive
|
||||
if (!card) card = NEW MTGCard();
|
||||
map<string, CardPrimitive*>::iterator it = primitives.find(val);
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "MTGGameZones.h"
|
||||
#include "Damage.h"
|
||||
#include "PhaseRing.h"
|
||||
#include "AllAbilities.h"
|
||||
|
||||
WEvent::WEvent(int type) :
|
||||
type(type)
|
||||
@@ -236,9 +237,22 @@ WEventCardControllerChange::WEventCardControllerChange(MTGCardInstance * card) :
|
||||
{
|
||||
}
|
||||
|
||||
WEventCardPhasesOut::WEventCardPhasesOut(MTGCardInstance * card) :
|
||||
WEventCardPhasesOut::WEventCardPhasesOut(MTGCardInstance * card, int turn) :
|
||||
WEventCardUpdate(card)
|
||||
{
|
||||
if(card->getPhasedOutAbility().size())
|
||||
{
|
||||
AbilityFactory af(card->getObserver());
|
||||
MTGAbility * a = af.parseMagicLine(card->getPhasedOutAbility(), card->getObserver()->mLayers->actionLayer()->getMaxId(), NULL, card->clone());
|
||||
MTGAbility * poA = a->clone();
|
||||
SAFE_DELETE(a);
|
||||
poA->oneShot = true;
|
||||
poA->canBeInterrupted = false;
|
||||
MTGAbility *gatg = NEW GenericAddToGame(card->getObserver(), card->getObserver()->mLayers->actionLayer()->getMaxId(), card,NULL,poA->clone());
|
||||
SAFE_DELETE(poA);
|
||||
gatg->fireAbility();
|
||||
//SAFE_DELETE(gatg);
|
||||
}
|
||||
}
|
||||
|
||||
WEventCardPhasesIn::WEventCardPhasesIn(MTGCardInstance * card) :
|
||||
|
||||
Reference in New Issue
Block a user