added card equipped event
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -5611,6 +5611,8 @@ int AEquip::equip(MTGCardInstance * equipped)
|
||||
//we equip...
|
||||
a->addToGame();
|
||||
}
|
||||
WEvent * e = NEW WEventCardEquipped(source);
|
||||
game->receiveEvent(e);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user