Erwan
-new keyword "may" (right now used only for : "when ... comes into play, you may ... moveTo). See Gravedigger 10E
This commit is contained in:
@@ -774,6 +774,19 @@ subtype=Goblin Warrior
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
text=When Gravedigger comes into play, you may return target creature card from your graveyard to your hand.
|
||||
auto=may moveTo(myhand) target(creature|mygraveyard)
|
||||
id=129584
|
||||
name=Gravedigger
|
||||
rarity=C
|
||||
color=Black
|
||||
type=Creature
|
||||
mana={3}{B}
|
||||
power=2
|
||||
subtype=Zombie
|
||||
toughness=2
|
||||
[/card]
|
||||
[card]
|
||||
text=
|
||||
id=129586
|
||||
name=Grizzly Bears
|
||||
|
||||
@@ -662,18 +662,7 @@ power=3
|
||||
subtype=Zombie Spirit
|
||||
toughness=3
|
||||
[/card]
|
||||
[card]
|
||||
text=When Gravedigger comes into play, you may return target creature card from your graveyard to your hand.
|
||||
id=129584
|
||||
name=Gravedigger
|
||||
rarity=C
|
||||
color=Black
|
||||
type=Creature
|
||||
mana={3}{B}
|
||||
power=2
|
||||
subtype=Zombie
|
||||
toughness=2
|
||||
[/card]
|
||||
|
||||
[card]
|
||||
text=Guerrilla Tactics deals 2 damage to target creature or player. When a spell or ability an opponent controls causes you to discard Guerrilla Tactics, Guerrilla Tactics deals 4 damage to target creature or player.
|
||||
id=129588
|
||||
|
||||
@@ -54,6 +54,7 @@ giant_growth2.txt
|
||||
goblin_balloon_brigade.txt
|
||||
goblin_balloon_brigade2.txt
|
||||
goblin_king.txt
|
||||
gravedigger.txt
|
||||
hymn_of_rebirth.txt
|
||||
icatian_priest.txt
|
||||
keldon_warlord.txt
|
||||
@@ -87,4 +88,4 @@ tranquil_domain.txt
|
||||
volcanic_island.txt
|
||||
white_knight1.txt
|
||||
wrath_of_god.txt
|
||||
zombie_master.txt
|
||||
zombie_master.txt
|
||||
20
projects/mtg/bin/Res/test/gravedigger.txt
Normal file
20
projects/mtg/bin/Res/test/gravedigger.txt
Normal file
@@ -0,0 +1,20 @@
|
||||
# text=When Gravedigger comes into play, you may return target creature card from your graveyard to your hand.
|
||||
[INIT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
hand:129584
|
||||
manapool:{3}{B}
|
||||
graveyard:129586
|
||||
[PLAYER2]
|
||||
[DO]
|
||||
129584
|
||||
choice 0
|
||||
129586
|
||||
[ASSERT]
|
||||
FIRSTMAIN
|
||||
[PLAYER1]
|
||||
inplay:129584
|
||||
hand:129586
|
||||
manapool:{0}
|
||||
[PLAYER2]
|
||||
[END]
|
||||
@@ -23,6 +23,56 @@ using std::map;
|
||||
Generic classes
|
||||
*/
|
||||
|
||||
//MayAbility: May do something when comes into play (should be extended)
|
||||
class MayAbility:public MTGAbility{
|
||||
public:
|
||||
int triggered;
|
||||
MTGAbility * ability;
|
||||
int deleteAbility;
|
||||
MayAbility(int _id, MTGAbility * _ability, MTGCardInstance * _source):MTGAbility(_id,_source),ability(_ability){
|
||||
triggered = 0;
|
||||
deleteAbility = 1;
|
||||
}
|
||||
|
||||
void Update(float dt){
|
||||
MTGAbility::Update(dt);
|
||||
if (!triggered){
|
||||
triggered = 1;
|
||||
game->mLayers->actionLayer()->setMenuObject(source);
|
||||
OutputDebugString("SetMenuObject!\n");
|
||||
}
|
||||
}
|
||||
|
||||
const char * getMenuText(){
|
||||
return ability->getMenuText();
|
||||
}
|
||||
|
||||
int testDestroy(){
|
||||
if (triggered && !game->mLayers->actionLayer()->menuObject){
|
||||
OutputDebugString("Destroy!\n");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int isReactingToTargetClick(Targetable * card){
|
||||
OutputDebugString("IsReacting ???\n");
|
||||
if (card == source) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int reactToTargetClick(Targetable * object){
|
||||
OutputDebugString("ReactToTargetClick!\n");
|
||||
deleteAbility = 0;
|
||||
game->addObserver(ability);
|
||||
return ability->reactToTargetClick(object);
|
||||
}
|
||||
|
||||
~MayAbility(){
|
||||
if (deleteAbility) SAFE_DELETE(ability);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//MultiAbility : triggers several actions for a cost
|
||||
class MultiAbility:public ActivatedAbility{
|
||||
|
||||
@@ -97,8 +97,10 @@ class Constants
|
||||
FLANKING = 36,
|
||||
RAMPAGE1 = 37,
|
||||
CLOUD = 38,
|
||||
CANTATTACK = 39,
|
||||
MUSTATTACK = 40,
|
||||
|
||||
NB_BASIC_ABILITIES = 39,
|
||||
NB_BASIC_ABILITIES = 41,
|
||||
|
||||
|
||||
RARITY_M = 'M',
|
||||
|
||||
@@ -157,6 +157,10 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
OutputDebugString("Cost is null\n");
|
||||
SAFE_DELETE(cost);
|
||||
}
|
||||
|
||||
int may = 0;
|
||||
if (line.find("may ") != string::npos) may = 1;
|
||||
|
||||
int doTap = 0;
|
||||
//Tap in the cost ?
|
||||
if (line.find("{t}") != string::npos) doTap = 1;
|
||||
@@ -306,13 +310,20 @@ int AbilityFactory::magicText(int id, Spell * spell, MTGCardInstance * card){
|
||||
//MoveTo Move a card from a zone to another
|
||||
found = s.find("moveto(");
|
||||
if (found != string::npos){
|
||||
OutputDebugString("may!\n");
|
||||
if (dryMode) return BAKA_EFFECT_BAD; //TODO : depends on where from, where to...
|
||||
int end = s.find(")");
|
||||
string szone = s.substr(found + 7,end - found - 7);
|
||||
if (tc){
|
||||
if (cost){
|
||||
game->addObserver(NEW AZoneMover(id,card,tc,szone,cost,doTap));
|
||||
}
|
||||
//if (cost){
|
||||
AZoneMover * a = NEW AZoneMover(id,card,tc,szone,cost,doTap);
|
||||
if (may){
|
||||
game->addObserver(NEW MayAbility(id,a,card));
|
||||
OutputDebugString("may!\n");
|
||||
}else{
|
||||
game->addObserver(a);
|
||||
}
|
||||
// }
|
||||
}else{
|
||||
MTGGameZone * fromZone = target->getCurrentZone();//this is technically incorrect. The initial zone should be as described in the targetchooser
|
||||
MTGGameZone * destZone = MTGGameZone::stringToZone(szone, card, target);
|
||||
|
||||
@@ -47,6 +47,8 @@ const char* Constants::MTGBasicAbilities[] = {
|
||||
"flanking",
|
||||
"rampage",
|
||||
"cloud",
|
||||
"cantattack",
|
||||
"mustattack",
|
||||
};
|
||||
|
||||
const char* Constants::MTGPhaseNames[] =
|
||||
|
||||
Reference in New Issue
Block a user