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

View File

@@ -73407,8 +73407,7 @@ toughness=*
[/card]
[card]
name=Plague Sliver
auto=@each my upkeep:life:-type:sliver:mybattlefield controller
auto=@each opponent upkeep:life:-type:sliver:opponentbattlefield opponent
auto=lord(sliver) transforms((,newabililty[@each my upkeep:damage:1 controller]))
text=All Slivers have "At the beginning of your upkeep, this permanent deals 1 damage to you."
mana={2}{B}{B}
type=Creature

View File

@@ -279,6 +279,12 @@ struct WEventCardUnattached : public WEventCardUpdate {
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
struct WEventCardControllerChange : public WEventCardUpdate {
WEventCardControllerChange(MTGCardInstance * card);

View File

@@ -5611,6 +5611,8 @@ int AEquip::equip(MTGCardInstance * equipped)
//we equip...
a->addToGame();
}
WEvent * e = NEW WEventCardEquipped(source);
game->receiveEvent(e);
return 1;
}

View File

@@ -412,6 +412,8 @@ int GuiPlay::receiveEventPlus(WEvent * e)
Replace();
else if (dynamic_cast<WEventCardUnattached*> (e))
Replace();
else if (dynamic_cast<WEventCardEquipped*> (e))
Replace();
else if (dynamic_cast<WEventCardControllerChange*> (e))
Replace();
Replace();

View File

@@ -165,6 +165,11 @@ WEventCardUnattached::WEventCardUnattached(MTGCardInstance * card) :
{
}
WEventCardEquipped::WEventCardEquipped(MTGCardInstance * card) :
WEventCardUpdate(card)
{
}
WEventCardControllerChange::WEventCardControllerChange(MTGCardInstance * card) :
WEventCardUpdate(card)
{
@@ -324,6 +329,12 @@ Targetable * WEventCardUnattached::getTarget(int target)
return NULL;
}
Targetable * WEventCardEquipped::getTarget(int target)
{
if (target) return card;
return NULL;
}
Targetable * WEventCardControllerChange::getTarget(int target)
{
if (target) return card;