Erwan
-fix issue 161 (brass man can untap outside of upkeep). Use "myUpkeepOnly" keyword. Other keywords such as "myDrawOnly" of course work. Haven't implemented "opponent" yet, is it needed ?
This commit is contained in:
@@ -79,7 +79,7 @@ rarity=U
|
|||||||
mana={1}
|
mana={1}
|
||||||
type=Artifact Creature
|
type=Artifact Creature
|
||||||
subtype=Construct
|
subtype=Construct
|
||||||
auto={1}:untap
|
auto={1}:untap myUpkeepOnly
|
||||||
power=1
|
power=1
|
||||||
toughness=3
|
toughness=3
|
||||||
abilities=doesnotuntap
|
abilities=doesnotuntap
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ type=Sorcery
|
|||||||
[card]
|
[card]
|
||||||
text=Brass Man doesn't untap during your untap step. At the beginning of your upkeep, you may pay {1}. If you do, untap Brass Man.
|
text=Brass Man doesn't untap during your untap step. At the beginning of your upkeep, you may pay {1}. If you do, untap Brass Man.
|
||||||
id=1099
|
id=1099
|
||||||
auto={1}:untap myTurnOnly
|
auto={1}:untap myUpkeepOnly
|
||||||
name=Brass Man
|
name=Brass Man
|
||||||
rarity=U
|
rarity=U
|
||||||
mana={1}
|
mana={1}
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ borderland_behemoth.txt
|
|||||||
bottle_gnomes.txt
|
bottle_gnomes.txt
|
||||||
bottle_gnomes2.txt
|
bottle_gnomes2.txt
|
||||||
brass_man.txt
|
brass_man.txt
|
||||||
|
brass_man_i161.txt
|
||||||
cage_of_hands.txt
|
cage_of_hands.txt
|
||||||
Call_to_Heel_1.txt
|
Call_to_Heel_1.txt
|
||||||
Call_to_Heel_2.txt
|
Call_to_Heel_2.txt
|
||||||
|
|||||||
+3
-9
@@ -1,13 +1,9 @@
|
|||||||
#NAME: Brass Man untapping
|
#NAME: Brass Man untapping
|
||||||
#DESC: Brass Man can untap outside of Upkeep.
|
#DESC: Brass Man can untap outside of Upkeep.
|
||||||
#DESC: To test this, we try to untap him in
|
|
||||||
#DESC: secondmain and then cast Assassinate
|
|
||||||
#DESC: on him (which should destroy him if
|
|
||||||
#DESC: he's still tapped, which he should be).
|
|
||||||
[INIT]
|
[INIT]
|
||||||
combatattackers
|
combatattackers
|
||||||
[PLAYER1]
|
[PLAYER1]
|
||||||
inplay:Brass Man,Island,Swamp,Plains,Forest
|
inplay:Brass Man,Swamp,Plains,Forest
|
||||||
hand:Assassinate
|
hand:Assassinate
|
||||||
[PLAYER2]
|
[PLAYER2]
|
||||||
life:20
|
life:20
|
||||||
@@ -17,10 +13,9 @@ next
|
|||||||
next
|
next
|
||||||
next
|
next
|
||||||
next
|
next
|
||||||
Island
|
Swamp
|
||||||
Brass Man
|
Brass Man
|
||||||
choice 0
|
choice 0
|
||||||
Swamp
|
|
||||||
Plains
|
Plains
|
||||||
Forest
|
Forest
|
||||||
Assassinate
|
Assassinate
|
||||||
@@ -28,8 +23,7 @@ Brass Man
|
|||||||
[ASSERT]
|
[ASSERT]
|
||||||
secondmain
|
secondmain
|
||||||
[PLAYER1]
|
[PLAYER1]
|
||||||
inplay:Island,Swamp,Plains,Forest
|
inplay:Swamp,Plains,Forest
|
||||||
hand:
|
|
||||||
graveyard:Brass Man,Assassinate
|
graveyard:Brass Man,Assassinate
|
||||||
[PLAYER2]
|
[PLAYER2]
|
||||||
life:19
|
life:19
|
||||||
@@ -103,7 +103,22 @@ class ActivatedAbility:public MTGAbility{
|
|||||||
enum {
|
enum {
|
||||||
NO_RESTRICTION = 0,
|
NO_RESTRICTION = 0,
|
||||||
PLAYER_TURN_ONLY = 1,
|
PLAYER_TURN_ONLY = 1,
|
||||||
AS_SORCERY = 2
|
AS_SORCERY = 2,
|
||||||
|
MY_BEFORE_BEGIN = 3,
|
||||||
|
MY_UNTAP = 4,
|
||||||
|
MY_UPKEEP = 5,
|
||||||
|
MY_DRAW = 6,
|
||||||
|
MY_FIRSTMAIN = 7,
|
||||||
|
MY_COMBATBEGIN = 8,
|
||||||
|
MY_COMBATATTACKERS = 9,
|
||||||
|
MY_COMBATBLOCKERS = 10,
|
||||||
|
MY_COMBATDAMAGE = 11,
|
||||||
|
MY_COMBATEND = 12,
|
||||||
|
MY_SECONDMAIN = 13,
|
||||||
|
MY_ENDOFTURN = 14,
|
||||||
|
MY_EOT = 15,
|
||||||
|
MY_CLEANUP = 16,
|
||||||
|
MY_AFTER_EOT = 17,
|
||||||
};
|
};
|
||||||
int restrictions;
|
int restrictions;
|
||||||
int needsTapping;
|
int needsTapping;
|
||||||
|
|||||||
@@ -146,6 +146,19 @@ TriggeredAbility * AbilityFactory::parseTrigger(string magicText, int id, Spell
|
|||||||
int AbilityFactory::parseRestriction(string s){
|
int AbilityFactory::parseRestriction(string s){
|
||||||
if (s.find("myturnonly") != string::npos) return ActivatedAbility::PLAYER_TURN_ONLY;
|
if (s.find("myturnonly") != string::npos) return ActivatedAbility::PLAYER_TURN_ONLY;
|
||||||
if (s.find("assorcery") != string::npos) return ActivatedAbility::AS_SORCERY;
|
if (s.find("assorcery") != string::npos) return ActivatedAbility::AS_SORCERY;
|
||||||
|
|
||||||
|
size_t found = s.find("my");
|
||||||
|
if (found !=string::npos){
|
||||||
|
for (int i = 0; i < Constants::NB_MTG_PHASES; i++){
|
||||||
|
string toFind = "my";
|
||||||
|
toFind.append(Constants::MTGPhaseCodeNames[i]).append("only");
|
||||||
|
found = s.find(toFind);
|
||||||
|
if (found != string::npos){
|
||||||
|
return ActivatedAbility::MY_BEFORE_BEGIN + i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ActivatedAbility::NO_RESTRICTION;
|
return ActivatedAbility::NO_RESTRICTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1722,6 +1735,10 @@ int ActivatedAbility::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
|
|||||||
if (cPhase != Constants::MTG_PHASE_FIRSTMAIN && cPhase != Constants::MTG_PHASE_SECONDMAIN) return 0;
|
if (cPhase != Constants::MTG_PHASE_FIRSTMAIN && cPhase != Constants::MTG_PHASE_SECONDMAIN) return 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
if (restrictions>= MY_BEFORE_BEGIN && restrictions <= MY_AFTER_EOT){
|
||||||
|
if (player != game->currentPlayer) return 0;
|
||||||
|
if (cPhase != restrictions - MY_BEFORE_BEGIN + Constants::MTG_PHASE_BEFORE_BEGIN) return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (card == source && source->controller()==player && (!needsTapping || (!source->isTapped() && !source->hasSummoningSickness()))){
|
if (card == source && source->controller()==player && (!needsTapping || (!source->isTapped() && !source->hasSummoningSickness()))){
|
||||||
if (!cost) return 1;
|
if (!cost) return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user