Added new primitives from LTR set, added notrigger option for special tokens such as "The Monarch" and "The Ring" and "The Initiative", fixed LTR dat file, updated missing cards by sets list, added "untp" option for "rehook" and "retarget" ability to untap the equipped creature, added new restriction "oppoattacked" to check if your opponent has attacked during the current turn.

This commit is contained in:
Vittorio Alfieri
2023-06-28 17:07:09 +02:00
parent 9760ab39b7
commit 1ab4e4ebfd
7 changed files with 760 additions and 12 deletions
@@ -352,4 +352,3 @@ Myojin of Cryptic Dreams
Lithoform Engine Lithoform Engine
Reality Spasm Reality Spasm
Suffer the Past Suffer the Past
Grishnákh, Brash Instigator
+1 -1
View File
@@ -1200,7 +1200,7 @@ id=112176
rarity=U rarity=U
[/card] [/card]
[card] [card]
primitive=Grishnákh, Brash Instigator primitive=Grishnakh, Brash Instigator
id=112178 id=112178
rarity=U rarity=U
[/card] [/card]
@@ -130,15 +130,15 @@
#AUTO_DEFINE _CITY'S_BLESSING_ aslongas(City's Blessing|mybattlefield)>0 #AUTO_DEFINE _CITY'S_BLESSING_ aslongas(City's Blessing|mybattlefield)>0
# Monarch # Monarch
#AUTO_DEFINE _MONARCH_CONTROLLER_ if type(The Monarch|battlefield)~lessthan~1 then token(The Monarch) else all(The Monarch|battlefield) moveto(mybattlefield) and!( transforms((,newability[becomesmonarch controller])) forever )! #AUTO_DEFINE _MONARCH_CONTROLLER_ if type(The Monarch|battlefield)~lessthan~1 then token(The Monarch^notrigger) else all(The Monarch|battlefield) moveto(mybattlefield) and!( transforms((,newability[becomesmonarch controller])) forever )!
#AUTO_DEFINE _MONARCH_OPPONENT_ if type(The Monarch|battlefield)~lessthan~1 then token(The Monarch) opponent else all(The Monarch|battlefield) moveto(opponentbattlefield) and!( transforms((,newability[becomesmonarch controller])) forever )! #AUTO_DEFINE _MONARCH_OPPONENT_ if type(The Monarch|battlefield)~lessthan~1 then token(The Monarch^notrigger) opponent else all(The Monarch|battlefield) moveto(opponentbattlefield) and!( transforms((,newability[becomesmonarch controller])) forever )!
# Initiative # Initiative
#AUTO_DEFINE _INITIATIVE_CONTROLLER_ if type(The Initiative|battlefield)~lessthan~1 then token(The Initiative) else all(The Initiative|battlefield) moveto(mybattlefield) and!( transforms((,newability[takesinitiative controller])) forever )! #AUTO_DEFINE _INITIATIVE_CONTROLLER_ if type(The Initiative|battlefield)~lessthan~1 then token(The Initiative^notrigger) else all(The Initiative|battlefield) moveto(mybattlefield) and!( transforms((,newability[takesinitiative controller])) forever )!
#AUTO_DEFINE _INITIATIVE_OPPONENT_ if type(The Initiative|battlefield)~lessthan~1 then token(The Initiative) opponent else all(The Initiative|battlefield) moveto(opponentbattlefield) and!( transforms((,newability[takesinitiative controller])) forever )! #AUTO_DEFINE _INITIATIVE_OPPONENT_ if type(The Initiative|battlefield)~lessthan~1 then token(The Initiative^notrigger) opponent else all(The Initiative|battlefield) moveto(opponentbattlefield) and!( transforms((,newability[takesinitiative controller])) forever )!
# The Ring Tempts # The Ring Tempts
#AUTO_DEFINE _RINGTEMPTS_ if type(The Ring|mybattlefield)~morethan~0 then all(The Ring|mybattlefield) transforms((,newability[theringtempts:1 controller],newability[name(Chose a ring bearer) target(creature|mybattlefield) becomesringbearer])) oneshot else token(The Ring) and!( theringtempts:1 controller and!( name(Choose a ring bearer) target(creature|myBattlefield) becomesringbearer )! )! #AUTO_DEFINE _RINGTEMPTS_ if type(The Ring|mybattlefield)~morethan~0 then all(The Ring|mybattlefield) transforms((,newability[theringtempts:1 controller],newability[name(Chose a ring bearer) target(creature|mybattlefield) becomesringbearer])) oneshot else token(The Ring^notrigger) and!( theringtempts:1 controller and!( name(Choose a ring bearer) target(creature|myBattlefield) becomesringbearer )! )!
# Explore, not implemented # Explore, not implemented
#AUTO_DEFINE _EXPLORE_ reveal:1 optionone if type(land|reveal)~lessthan~1 then transforms((,newability[counter(1/1)])) optiononeend optiontwo if type(land|reveal)~morethan~0 then name(move to Hand) target(<1>*|reveal) moveto(myHand) else transforms((,newability[Choice name(back to library) target(<1>*|reveal) moveto(mylibrary)],newability[Choice name(put into Graveyard) target(<1>*|reveal) moveto(myGraveyard)])) optiontwoend revealend limit:1 #AUTO_DEFINE _EXPLORE_ reveal:1 optionone if type(land|reveal)~lessthan~1 then transforms((,newability[counter(1/1)])) optiononeend optiontwo if type(land|reveal)~morethan~0 then name(move to Hand) target(<1>*|reveal) moveto(myHand) else transforms((,newability[Choice name(back to library) target(<1>*|reveal) moveto(mylibrary)],newability[Choice name(put into Graveyard) target(<1>*|reveal) moveto(myGraveyard)])) optiontwoend revealend limit:1
File diff suppressed because it is too large Load Diff
+2 -1
View File
@@ -4960,7 +4960,8 @@ public:
bool newhook; bool newhook;
int mutation; int mutation;
bool fromplay; bool fromplay;
AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL, bool retarget = false, bool reequip = false, bool newhook = false, int mutation = 0, bool fromplay = false); bool untap;
AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost = NULL, bool retarget = false, bool reequip = false, bool newhook = false, int mutation = 0, bool fromplay = false, bool untap = false);
int resolve(); int resolve();
const string getMenuText(); const string getMenuText();
AANewTarget * clone() const; AANewTarget * clone() const;
+6 -3
View File
@@ -4612,8 +4612,8 @@ AAFrozen * AAFrozen::clone() const
} }
// chose a new target for an aura or enchantment and equip it note: VERY basic right now. // chose a new target for an aura or enchantment and equip it note: VERY basic right now.
AANewTarget::AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost, bool retarget, bool reequip, bool newhook, int mutation, bool fromplay) : AANewTarget::AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target, ManaCost * _cost, bool retarget, bool reequip, bool newhook, int mutation, bool fromplay, bool untap) :
ActivatedAbility(observer, id, card, _cost, 0),retarget(retarget),reequip(reequip),newhook(newhook),mutation(mutation),fromplay(fromplay) ActivatedAbility(observer, id, card, _cost, 0), retarget(retarget), reequip(reequip), newhook(newhook), mutation(mutation), fromplay(fromplay), untap(untap)
{ {
target = _target; target = _target;
} }
@@ -4653,6 +4653,8 @@ int AANewTarget::resolve()
{ {
((AEquip*)a)->unequip(); ((AEquip*)a)->unequip();
((AEquip*)a)->equip(source); ((AEquip*)a)->equip(source);
if(untap)
source->untap();
} }
} }
} }
@@ -4662,7 +4664,6 @@ int AANewTarget::resolve()
target = source; target = source;
source = _target; source = _target;
} }
} }
if (_target && _target->currentZone == _target->controller()->game->battlefield && reequip && !mutation) if (_target && _target->currentZone == _target->controller()->game->battlefield && reequip && !mutation)
{ {
@@ -4690,6 +4691,8 @@ int AANewTarget::resolve()
{ {
((AEquip*)a)->unequip(); ((AEquip*)a)->unequip();
((AEquip*)a)->equip(source); ((AEquip*)a)->equip(source);
if(untap)
source->untap();
} }
} }
} }
+10
View File
@@ -775,6 +775,12 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
return 0; return 0;
} }
check = restriction[i].find("oppoattacked");
if(check != string::npos)
{
if(card->controller()->opponent()->raidcount < 1)
return 0;
}
check = restriction[i].find("opponentdamagedbycombat"); check = restriction[i].find("opponentdamagedbycombat");
if(check != string::npos) if(check != string::npos)
@@ -5491,6 +5497,8 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
{ {
MTGAbility * a = NEW AANewTarget(observer, id, card, target, NULL, (s.find("retarget") != string::npos), false, false, 0, (s.find("fromplay") != string::npos)); MTGAbility * a = NEW AANewTarget(observer, id, card, target, NULL, (s.find("retarget") != string::npos), false, false, 0, (s.find("fromplay") != string::npos));
a->oneShot = 1; a->oneShot = 1;
if(s.find("untp") != string::npos)
((AANewTarget*)a)->untap = true;
return a; return a;
} }
@@ -5499,6 +5507,8 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
{ {
MTGAbility * a = NEW AANewTarget(observer, id, card,target, NULL, false, true, (s.find("newhook") != string::npos)); MTGAbility * a = NEW AANewTarget(observer, id, card,target, NULL, false, true, (s.find("newhook") != string::npos));
a->oneShot = 1; a->oneShot = 1;
if(s.find("untp") != string::npos)
((AANewTarget*)a)->untap = true;
return a; return a;
} }