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 type=Sorcery
[/card] [/card]
[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 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. 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} mana={5}{U}{U}
@@ -16065,15 +16059,6 @@ type=Planeswalker
subtype=Teferi subtype=Teferi
[/card] [/card]
[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 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. 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} mana={1}{U}
@@ -17716,15 +17701,6 @@ mana={1}{C}
type=Instant type=Instant
[/card] [/card]
[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 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. 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} 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 class TrCardPhasesIn: public Trigger
{ {
public: public:
+3
View File
@@ -77,6 +77,9 @@ public:
string CrewAbility; string CrewAbility;
void setCrewAbility(const string& value); void setCrewAbility(const string& value);
const string& getCrewAbility() const; const string& getCrewAbility() const;
string PhasedOutAbility;
void setPhasedOutAbility(const string& value);
const string& getPhasedOutAbility() const;
vector<int>types; vector<int>types;
CardPrimitive(); CardPrimitive();
+1 -1
View File
@@ -307,7 +307,7 @@ struct WEventCardControllerChange : public WEventCardUpdate {
//event when card phases out //event when card phases out
struct WEventCardPhasesOut : public WEventCardUpdate { struct WEventCardPhasesOut : public WEventCardUpdate {
WEventCardPhasesOut(MTGCardInstance * card); WEventCardPhasesOut(MTGCardInstance * card, int turn);
virtual Targetable * getTarget(int target); virtual Targetable * getTarget(int target);
}; };
+1 -1
View File
@@ -619,7 +619,7 @@ int OrderedAIAction::getEfficiency()
} }
else if (GenericRevealAbility * grA = dynamic_cast<GenericRevealAbility *>(a)) 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); efficiency = 45 + (owner->getRandomGenerator()->random() % 50);
else else
efficiency = 0; efficiency = 0;
+1 -1
View File
@@ -1709,7 +1709,7 @@ int AAPhaseOut::resolve()
_target->view->alpha = 50; _target->view->alpha = 50;
_target->initAttackersDefensers(); _target->initAttackersDefensers();
//add event phases out here //add event phases out here
WEvent * e = NEW WEventCardPhasesOut(_target); WEvent * e = NEW WEventCardPhasesOut(_target,game->turn);
game->receiveEvent(e); game->receiveEvent(e);
return 1; return 1;
} }
+12
View File
@@ -59,6 +59,7 @@ CardPrimitive::CardPrimitive(CardPrimitive * source)
setdoubleFaced(source->doubleFaced); setdoubleFaced(source->doubleFaced);
setAICustomCode(source->AICustomCode); setAICustomCode(source->AICustomCode);
setCrewAbility(source->CrewAbility); setCrewAbility(source->CrewAbility);
setPhasedOutAbility(source->PhasedOutAbility);
power = source->power; power = source->power;
toughness = source->toughness; toughness = source->toughness;
restrictions = source->restrictions ? source->restrictions->clone() : NULL; restrictions = source->restrictions ? source->restrictions->clone() : NULL;
@@ -365,6 +366,17 @@ const string& CardPrimitive::getCrewAbility() const
return CrewAbility; 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) void CardPrimitive::setName(const string& value)
{ {
name = value; name = value;
+6 -6
View File
@@ -276,11 +276,7 @@ void DeckMenu::Render()
RenderBackground();//background deck menu RenderBackground();//background deck menu
mScroller->Render(); mScroller->Render();
#else
mScroller->Render();
RenderBackground();//background deck menu
#endif
#if !defined (PSP)
if (menuholder.get() && inDeckMenu)//menuholder if (menuholder.get() && inDeckMenu)//menuholder
renderer->RenderQuad(menuholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / menuholder.get()->mWidth, SCREEN_HEIGHT_F / menuholder.get()->mHeight); renderer->RenderQuad(menuholder.get(), 0, 0, 0 ,SCREEN_WIDTH_F / menuholder.get()->mWidth, SCREEN_HEIGHT_F / menuholder.get()->mHeight);
#endif #endif
@@ -373,7 +369,11 @@ void DeckMenu::Render()
currentMenuItem->RenderWithOffset(-DeckMenuConst::kLineHeight * startId); currentMenuItem->RenderWithOffset(-DeckMenuConst::kLineHeight * startId);
} }
} }
//psp
#if defined (PSP)
mScroller->Render();
RenderBackground();//background deck menu
#endif
RenderDeckManaColors(); RenderDeckManaColors();
if (!title.empty()) if (!title.empty())
+1 -1
View File
@@ -856,7 +856,7 @@ void GameObserver::gameStateBasedEffects()
card->view->alpha = 50; card->view->alpha = 50;
card->initAttackersDefensers(); card->initAttackersDefensers();
//add event phases out here //add event phases out here
WEvent * evphaseout = NEW WEventCardPhasesOut(card); WEvent * evphaseout = NEW WEventCardPhasesOut(card, turn);
receiveEvent(evphaseout); receiveEvent(evphaseout);
} }
else if((card->has(Constants::PHASING) || card->isPhased)&& mCurrentGamePhase == MTG_PHASE_UNTAP && currentPlayer == card->controller() && card->phasedTurn != turn) 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)) if (TargetChooser *tc = parseSimpleTC(s,"phasedin", card))
return NEW TrCardPhasesIn(observer, id, card, tc,once); 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 //CombatTrigger
//Card card attacked and is blocked //Card card attacked and is blocked
found = s.find("combat("); found = s.find("combat(");
+1
View File
@@ -152,6 +152,7 @@ void MTGCardInstance::copy(MTGCardInstance * card)
doubleFaced = data->doubleFaced; doubleFaced = data->doubleFaced;
AICustomCode = data->AICustomCode; AICustomCode = data->AICustomCode;
CrewAbility = data->CrewAbility; CrewAbility = data->CrewAbility;
PhasedOutAbility = data->PhasedOutAbility;
origpower = card->origpower;//for flip origpower = card->origpower;//for flip
origtoughness = card->origtoughness;//for flip origtoughness = card->origtoughness;//for flip
TokenAndAbility = card->TokenAndAbility;//token andAbility TokenAndAbility = card->TokenAndAbility;//token andAbility
+9 -1
View File
@@ -264,7 +264,15 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
break; break;
case 'p': case 'p':
if (key[1] == 'r') if (key == "phasedoutbonus")
{
if (!primitive) primitive = NEW CardPrimitive();
{
primitive->setPhasedOutAbility(val);
break;
}
}
else if (key[1] == 'r')
{ // primitive { // primitive
if (!card) card = NEW MTGCard(); if (!card) card = NEW MTGCard();
map<string, CardPrimitive*>::iterator it = primitives.find(val); 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++) for (size_t i = 0; i < cards.size(); i++)
{ {
cards[i]->stillNeeded = false; cards[i]->stillNeeded = false;
SAFE_DELETE(cards[i]->previous); //SAFE_DELETE(cards[i]->previous);
SAFE_DELETE( cards[i] ); //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(); cards.clear();
cardsMap.clear(); cardsMap.clear();
+15 -1
View File
@@ -5,6 +5,7 @@
#include "MTGGameZones.h" #include "MTGGameZones.h"
#include "Damage.h" #include "Damage.h"
#include "PhaseRing.h" #include "PhaseRing.h"
#include "AllAbilities.h"
WEvent::WEvent(int type) : WEvent::WEvent(int type) :
type(type) type(type)
@@ -236,9 +237,22 @@ WEventCardControllerChange::WEventCardControllerChange(MTGCardInstance * card) :
{ {
} }
WEventCardPhasesOut::WEventCardPhasesOut(MTGCardInstance * card) : WEventCardPhasesOut::WEventCardPhasesOut(MTGCardInstance * card, int turn) :
WEventCardUpdate(card) 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) : WEventCardPhasesIn::WEventCardPhasesIn(MTGCardInstance * card) :