Improved explores ability, added new trigger to handle the explores event from a card, added/fixed primitives from older sets, fixed RIX dat file.

This commit is contained in:
Vittorio Alfieri
2020-12-20 23:14:44 +01:00
parent e67078355a
commit a801069a3a
10 changed files with 735 additions and 80 deletions
+6 -1
View File
@@ -2,9 +2,14 @@
author=Wagic Team author=Wagic Team
name=Rivals of Ixalan name=Rivals of Ixalan
year=2018-01-19 year=2018-01-19
total=205 total=213
[/meta] [/meta]
[card] [card]
primitive=Elemental Phoenix
id=-439768
rarity=T
[/card]
[card]
primitive=Baffling End primitive=Baffling End
id=439658 id=439658
rarity=U rarity=U
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -41124,7 +41124,7 @@ toughness=4
[card] [card]
name=Flameblast Dragon name=Flameblast Dragon
abilities=flying abilities=flying
auto=this(attacking) {X}{R}:thisforeach(X) damage:1 target(creature,player) limit:1 auto=@combat(attacking) source(this):may pay({X}{R}) name(Deals X damages) damage:x target(creature,player)
text=Flying -- Whenever Flameblast Dragon attacks, you may pay {X}{R}. If you do, Flameblast Dragon deals X damage to target creature or player. text=Flying -- Whenever Flameblast Dragon attacks, you may pay {X}{R}. If you do, Flameblast Dragon deals X damage to target creature or player.
mana={4}{R}{R} mana={4}{R}{R}
type=Creature type=Creature
@@ -278,6 +278,15 @@ mana={3}{B}{R}
type=Sorcery type=Sorcery
[/card] [/card]
[card] [card]
name=Alms Collector
text=Flash -- If an opponent would draw two or more cards, instead you and that player each draw a card.
mana={3}{W}
type=Creature
subtype=Cat Cleric
power=3
toughness=4
[/card]
[card]
name=Alpha Brawl name=Alpha Brawl
text=Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those creatures deals damage equal to its power to that creature. text=Target creature an opponent controls deals damage equal to its power to each other creature that player controls, then each of those creatures deals damage equal to its power to that creature.
mana={6}{R}{R} mana={6}{R}{R}
@@ -5672,7 +5681,6 @@ power=2
toughness=2 toughness=2
[/card] [/card]
[card] [card]
[card]
name=Haunting Wind name=Haunting Wind
text=Whenever an artifact becomes tapped or a player activates an artifact's ability without {T} in its activation cost, Haunting Wind deals 1 damage to that artifact's controller. text=Whenever an artifact becomes tapped or a player activates an artifact's ability without {T} in its activation cost, Haunting Wind deals 1 damage to that artifact's controller.
mana={3}{B} mana={3}{B}
@@ -7777,6 +7785,15 @@ power=1
toughness=1 toughness=1
[/card] [/card]
[card] [card]
name=Mairsil, the Pretender
text=When Mairsil, the Pretender enters the battlefield, you may exile an artifact or creature card from your hand or graveyard and put a cage counter on it. -- Mairsil, the Pretender has all activated abilities of all cards you own in exile with cage counters on them. You may activate each of those abilities only once each turn.
mana={1}{U}{B}{R}
type=Legendary Creature
subtype=Human Wizard
power=4
toughness=4
[/card]
[card]
name=Malignus name=Malignus
text=Malignus's power and toughness are each equal to half the highest life total among your opponents, rounded up. -- Damage that would be dealt by Malignus can't be prevented. text=Malignus's power and toughness are each equal to half the highest life total among your opponents, rounded up. -- Damage that would be dealt by Malignus can't be prevented.
mana={3}{R}{R} mana={3}{R}{R}
@@ -9470,7 +9487,7 @@ name=Panharmonicon
text=If an artifact or creature entering the battlefield causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time. text=If an artifact or creature entering the battlefield causes a triggered ability of a permanent you control to trigger, that ability triggers an additional time.
mana={4} mana={4}
type=Artifact type=Artifact
[/card [/card]
[card] [card]
name=Panopticon name=Panopticon
text=When you planeswalk to Panopticon, draw a card. -- At the beginning of your draw step, draw an additional card. -- Whenever you roll {C}, draw a card. text=When you planeswalk to Panopticon, draw a card. -- At the beginning of your draw step, draw an additional card. -- Whenever you roll {C}, draw a card.
@@ -13013,6 +13030,13 @@ power=2
toughness=1 toughness=1
[/card] [/card]
[card] [card]
name=Teferi's Protection
abilities=exiledeath
text=Until your next turn, your life total can't change and you gain protection from everything. All permanents you control phase out. (While they're phased out, they're treated as though they don't exist. They phase in before you untap during your untap step.) -- Exile Teferi's Protection.
mana={2}{W}
type=Instant
[/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}
@@ -13047,6 +13071,15 @@ power=3
toughness=3 toughness=3
[/card] [/card]
[card] [card]
name=Temple Altisaur
text=If a source would deal damage to another Dinosaur you control, prevent all but 1 of that damage.
mana={4}{W}
type=Creature
subtype=Dinosaur
power=3
toughness=4
[/card]
[card]
name=Tempt with Discovery name=Tempt with Discovery
text=Tempting offer — Search your library for a land card and put it onto the battlefield. Each opponent may search his or her library for a land card and put it onto the battlefield. For each opponent who searches a library this way, search your library for a land card and put it onto the battlefield. Then each player who searched a library this way shuffles it. text=Tempting offer — Search your library for a land card and put it onto the battlefield. Each opponent may search his or her library for a land card and put it onto the battlefield. For each opponent who searches a library this way, search your library for a land card and put it onto the battlefield. Then each player who searched a library this way shuffles it.
mana={3}{G} mana={3}{G}
+40
View File
@@ -1764,6 +1764,33 @@ public:
} }
}; };
class TrCardExplored: public Trigger
{
public:
bool limitOnceATurn;
int triggeredTurn;
TrCardExplored(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc,bool once = false,bool limitOnceATurn = false) :
Trigger(observer, id, source,once, tc),limitOnceATurn(limitOnceATurn)
{
}
int triggerOnEventImpl(WEvent * event)
{
WEventCardExplored * e = dynamic_cast<WEventCardExplored *> (event);
if (!e) return 0;
if (limitOnceATurn && triggeredTurn == game->turn)
return 0;
if (!tc->canTarget(e->card)) return 0;
triggeredTurn = game->turn;
return 1;
}
TrCardExplored * clone() const
{
return NEW TrCardExplored(*this);
}
};
class TrCardSurveiled: public Trigger class TrCardSurveiled: public Trigger
{ {
public: public:
@@ -5020,6 +5047,19 @@ public:
AASurveilEvent * clone() const; AASurveilEvent * clone() const;
~AASurveilEvent(); ~AASurveilEvent();
}; };
//Explores Event
class AAExploresEvent: public ActivatedAbilityTP
{
public:
MTGCardInstance * card;
AAExploresEvent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost = NULL,
int who = TargetChooser::UNSET);
int resolve();
const string getMenuText();
AAExploresEvent * clone() const;
~AAExploresEvent();
};
//Yidaro Counter //Yidaro Counter
class AAAlterYidaroCount: public ActivatedAbilityTP class AAAlterYidaroCount: public ActivatedAbilityTP
{ {
+6
View File
@@ -366,6 +366,12 @@ struct WEventCardSurveiled : public WEventCardUpdate {
virtual Targetable * getTarget(int target); virtual Targetable * getTarget(int target);
}; };
//explores event
struct WEventCardExplored : public WEventCardUpdate {
WEventCardExplored(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//roll die event //roll die event
struct WEventCardRollDie : public WEventCardUpdate { struct WEventCardRollDie : public WEventCardUpdate {
string playerName; string playerName;
+36
View File
@@ -1023,6 +1023,42 @@ AAAlterPoison::~AAAlterPoison()
{ {
} }
//AA Explores Event
AAExploresEvent::AAExploresEvent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost,
int who) :
ActivatedAbilityTP(observer, _id, _source, _target, _cost, who), card(_source)
{
}
int AAExploresEvent::resolve()
{
Damageable * _target = (Damageable *) getTarget();
if (_target)
{
Player * pTarget = (Player*)_target;
if(pTarget)
{
WEvent * e = NEW WEventCardExplored(card);
game->receiveEvent(e);
}
}
return 0;
}
const string AAExploresEvent::getMenuText()
{
return "Explores event called";
}
AAExploresEvent * AAExploresEvent::clone() const
{
return NEW AAExploresEvent(*this);
}
AAExploresEvent::~AAExploresEvent()
{
}
//AA Surveil Event //AA Surveil Event
AASurveilEvent::AASurveilEvent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost, AASurveilEvent::AASurveilEvent(GameObserver* observer, int _id, MTGCardInstance * _source, Targetable * _target, ManaCost * _cost,
int who) : int who) :
+14
View File
@@ -1222,6 +1222,10 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "surveiled", card)) if (TargetChooser * tc = parseSimpleTC(s, "surveiled", card))
return NEW TrCardSurveiled(observer, id, card, tc, once, limitOnceATurn); return NEW TrCardSurveiled(observer, id, card, tc, once, limitOnceATurn);
//Esplores has been performed from controller
if (TargetChooser * tc = parseSimpleTC(s, "explored", card))
return NEW TrCardExplored(observer, id, card, tc, once, limitOnceATurn);
//Roll die has been performed from a card //Roll die has been performed from a card
if (TargetChooser * tc = parseSimpleTC(s, "dierolled", card)){ if (TargetChooser * tc = parseSimpleTC(s, "dierolled", card)){
int rollresult = 0; int rollresult = 0;
@@ -3474,6 +3478,16 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return a; return a;
} }
//perform explores
found = s.find("explores");
if (found != string::npos)
{
Targetable * t = spell ? spell->getNextTarget() : NULL;
MTGAbility * a = NEW AAExploresEvent(observer, id, card, t, NULL, who);
a->oneShot = 1;
return a;
}
//set surveil offset controller (eg. Enhanced Surveillance) //set surveil offset controller (eg. Enhanced Surveillance)
vector<string> splitSurveilOffset = parseBetween(s, "altersurvoffset:", " ", false); vector<string> splitSurveilOffset = parseBetween(s, "altersurvoffset:", " ", false);
if (splitSurveilOffset.size()) if (splitSurveilOffset.size())
+11
View File
@@ -297,6 +297,11 @@ WEventCardSurveiled::WEventCardSurveiled(MTGCardInstance * card) :
{ {
} }
WEventCardExplored::WEventCardExplored(MTGCardInstance * card) :
WEventCardUpdate(card)
{
}
WEventCardRollDie::WEventCardRollDie(MTGCardInstance * card, string playerName) : WEventCardRollDie::WEventCardRollDie(MTGCardInstance * card, string playerName) :
WEventCardUpdate(card), playerName(playerName) WEventCardUpdate(card), playerName(playerName)
{ {
@@ -526,6 +531,12 @@ Targetable * WEventCardSurveiled::getTarget(int target)
return NULL; return NULL;
} }
Targetable * WEventCardExplored::getTarget(int target)
{
if (target) return card;
return NULL;
}
Targetable * WEventCardRollDie::getTarget(int target) Targetable * WEventCardRollDie::getTarget(int target)
{ {
if (target) return card; if (target) return card;