Merge pull request #937 from kevlahnota/master

update some cards
This commit is contained in:
Anthony Calosa
2017-02-22 22:06:31 +08:00
committed by GitHub
15 changed files with 554 additions and 383 deletions
File diff suppressed because it is too large Load Diff
@@ -4718,12 +4718,6 @@ mana={1}{R}{R}
type=Sorcery
[/card]
[card]
name=Extraplanar Lens
text=Imprint — When Extraplanar Lens enters the battlefield, you may exile target land you control. -- Whenever a land with the same name as the exiled card is tapped for mana, its controller adds one mana to his or her mana pool of any type that land produced.
mana={3}
type=Artifact
[/card]
[card]
name=Eye of the Storm
text=Whenever a player casts an instant or sorcery card, exile it. Then that player copies each instant or sorcery card exiled with Eye of the Storm. For each copy, the player may cast the copy without paying its mana cost.
mana={5}{U}{U}
@@ -16065,15 +16059,6 @@ type=Planeswalker
subtype=Teferi
[/card]
[card]
name=Teferi's Imp
text=Flying -- Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.) -- Whenever Teferi's Imp phases out, discard a card. -- Whenever Teferi's Imp phases in, draw a card.
mana={2}{U}
type=Creature
subtype=Imp
power=1
toughness=1
[/card]
[card]
name=Teferi's Response
text=Counter target spell or ability an opponent controls that targets a land you control. If a permanent's ability is countered this way, destroy that permanent. -- -- Draw two cards.
mana={1}{U}
@@ -17716,15 +17701,6 @@ mana={1}{C}
type=Instant
[/card]
[card]
name=Warping Wurm
text=Phasing (This phases in or out before you untap during each of your untap steps. While it's phased out, it's treated as though it doesn't exist.) -- At the beginning of your upkeep, Warping Wurm phases out unless you pay {2}{G}{U}. -- When Warping Wurm phases in, put a +1/+1 counter on it.
mana={2}{G}{U}
type=Creature
subtype=Wurm
power=1
toughness=1
[/card]
[card]
name=Warrior en-Kor
text={0}: The next 1 damage that would be dealt to Warrior en-Kor this turn is dealt to target creature you control instead.
mana={W}{W}
-22
View File
@@ -1332,28 +1332,6 @@ public:
}
};
class TrCardPhasesOut: public Trigger
{
public:
TrCardPhasesOut(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, bool once = false) :
Trigger(observer, id, source, once, tc)
{
}
int triggerOnEventImpl(WEvent * event)
{
WEventCardPhasesOut * e = dynamic_cast<WEventCardPhasesOut *> (event);
if (!e) return 0;
if (!tc->canTarget(e->card)) return 0;
return 1;
}
TrCardPhasesOut * clone() const
{
return NEW TrCardPhasesOut(*this);
}
};
class TrCardPhasesIn: public Trigger
{
public:
+3
View File
@@ -77,6 +77,9 @@ public:
string CrewAbility;
void setCrewAbility(const string& value);
const string& getCrewAbility() const;
string PhasedOutAbility;
void setPhasedOutAbility(const string& value);
const string& getPhasedOutAbility() const;
vector<int>types;
CardPrimitive();
+1 -1
View File
@@ -307,7 +307,7 @@ struct WEventCardControllerChange : public WEventCardUpdate {
//event when card phases out
struct WEventCardPhasesOut : public WEventCardUpdate {
WEventCardPhasesOut(MTGCardInstance * card);
WEventCardPhasesOut(MTGCardInstance * card, int turn);
virtual Targetable * getTarget(int target);
};
+1 -1
View File
@@ -619,7 +619,7 @@ int OrderedAIAction::getEfficiency()
}
else if (GenericRevealAbility * grA = dynamic_cast<GenericRevealAbility *>(a))
{
if(grA->source->getAICustomCode().size())
if(grA->source->getAICustomCode().size() && grA->source->alias != 185709)//Sphinx of Jwar Isle so the ai will ignore it
efficiency = 45 + (owner->getRandomGenerator()->random() % 50);
else
efficiency = 0;
+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;
+6 -6
View File
@@ -276,11 +276,7 @@ void DeckMenu::Render()
RenderBackground();//background deck menu
mScroller->Render();
#else
mScroller->Render();
RenderBackground();//background deck menu
#endif
#if !defined (PSP)
if (menuholder.get() && inDeckMenu)//menuholder
renderer->RenderQuad(menuholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / menuholder.get()->mWidth, SCREEN_HEIGHT_F / menuholder.get()->mHeight);
#endif
@@ -373,7 +369,11 @@ void DeckMenu::Render()
currentMenuItem->RenderWithOffset(-DeckMenuConst::kLineHeight * startId);
}
}
//psp
#if defined (PSP)
mScroller->Render();
RenderBackground();//background deck menu
#endif
RenderDeckManaColors();
if (!title.empty())
+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);
+13 -2
View File
@@ -545,8 +545,19 @@ MTGGameZone::~MTGGameZone()
for (size_t i = 0; i < cards.size(); i++)
{
cards[i]->stillNeeded = false;
SAFE_DELETE(cards[i]->previous);
SAFE_DELETE( cards[i] );
//SAFE_DELETE(cards[i]->previous);
//SAFE_DELETE( cards[i] );
//cause crashes for generated cards using castcard named card...??? test fix for now
if(cards[i]->previous)
{
cards[i]->previous = NULL;
delete cards[i]->previous;
}
if(cards[i])
{
cards[i] = NULL;
delete cards[i];
}
}
cards.clear();
cardsMap.clear();
+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) :