update some cards

removed phasedout trigger
add phasedoutbonus - ability
This commit is contained in:
Anthony Calosa
2017-02-22 18:25:39 +08:00
parent bb9d98cc0c
commit ff4911116c
12 changed files with 534 additions and 374 deletions
+1 -1
View File
@@ -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;
}
+12
View File
@@ -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;
+1 -1
View File
@@ -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)
-4
View File
@@ -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(");
+1
View File
@@ -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
+9 -1
View File
@@ -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);
+15 -1
View File
@@ -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) :