added card equipped event

This commit is contained in:
Anthony Calosa
2015-10-25 17:55:45 +08:00
parent 46d1e2e703
commit 0594822872
5 changed files with 22 additions and 2 deletions
+1 -2
View File
@@ -73407,8 +73407,7 @@ toughness=*
[/card] [/card]
[card] [card]
name=Plague Sliver name=Plague Sliver
auto=@each my upkeep:life:-type:sliver:mybattlefield controller auto=lord(sliver) transforms((,newabililty[@each my upkeep:damage:1 controller]))
auto=@each opponent upkeep:life:-type:sliver:opponentbattlefield opponent
text=All Slivers have "At the beginning of your upkeep, this permanent deals 1 damage to you." text=All Slivers have "At the beginning of your upkeep, this permanent deals 1 damage to you."
mana={2}{B}{B} mana={2}{B}{B}
type=Creature type=Creature
+6
View File
@@ -279,6 +279,12 @@ struct WEventCardUnattached : public WEventCardUpdate {
virtual Targetable * getTarget(int target); virtual Targetable * getTarget(int target);
}; };
//event when card-equipment attached/equipped
struct WEventCardEquipped : public WEventCardUpdate {
WEventCardEquipped(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
//event when card moves from player/opponent battlefield to player/opponent battlefield //event when card moves from player/opponent battlefield to player/opponent battlefield
struct WEventCardControllerChange : public WEventCardUpdate { struct WEventCardControllerChange : public WEventCardUpdate {
WEventCardControllerChange(MTGCardInstance * card); WEventCardControllerChange(MTGCardInstance * card);
+2
View File
@@ -5611,6 +5611,8 @@ int AEquip::equip(MTGCardInstance * equipped)
//we equip... //we equip...
a->addToGame(); a->addToGame();
} }
WEvent * e = NEW WEventCardEquipped(source);
game->receiveEvent(e);
return 1; return 1;
} }
+2
View File
@@ -412,6 +412,8 @@ int GuiPlay::receiveEventPlus(WEvent * e)
Replace(); Replace();
else if (dynamic_cast<WEventCardUnattached*> (e)) else if (dynamic_cast<WEventCardUnattached*> (e))
Replace(); Replace();
else if (dynamic_cast<WEventCardEquipped*> (e))
Replace();
else if (dynamic_cast<WEventCardControllerChange*> (e)) else if (dynamic_cast<WEventCardControllerChange*> (e))
Replace(); Replace();
Replace(); Replace();
+11
View File
@@ -165,6 +165,11 @@ WEventCardUnattached::WEventCardUnattached(MTGCardInstance * card) :
{ {
} }
WEventCardEquipped::WEventCardEquipped(MTGCardInstance * card) :
WEventCardUpdate(card)
{
}
WEventCardControllerChange::WEventCardControllerChange(MTGCardInstance * card) : WEventCardControllerChange::WEventCardControllerChange(MTGCardInstance * card) :
WEventCardUpdate(card) WEventCardUpdate(card)
{ {
@@ -324,6 +329,12 @@ Targetable * WEventCardUnattached::getTarget(int target)
return NULL; return NULL;
} }
Targetable * WEventCardEquipped::getTarget(int target)
{
if (target) return card;
return NULL;
}
Targetable * WEventCardControllerChange::getTarget(int target) Targetable * WEventCardControllerChange::getTarget(int target)
{ {
if (target) return card; if (target) return card;