implement [LCI] Market Gnome

This commit is contained in:
xenohedron 2023-11-09 21:38:28 -05:00
parent a5922457ad
commit 933d694b08
5 changed files with 191 additions and 8 deletions

View file

@ -18,6 +18,7 @@ import mage.filter.common.FilterOwnedCard;
import mage.filter.predicate.Predicate;
import mage.filter.predicate.mageobject.AnotherPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInGraveyardBattlefieldOrStack;
@ -131,6 +132,8 @@ class CraftCost extends CostImpl {
.map(uuid -> {
Permanent permanent = game.getPermanent(uuid);
if (permanent != null) {
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.EXILED_WHILE_CRAFTING,
permanent.getId(), source, player.getId()));
return permanent;
}
return game.getCard(uuid);

View file

@ -540,6 +540,12 @@ public class GameEvent implements Serializable {
flag not used for this event
*/
DISCOVERED,
/* Exiled while crafting (see Market Gnome)
targetId the permanent exiled
sourceId of the craft ability
playerId the player crafting
*/
EXILED_WHILE_CRAFTING,
//custom events
CUSTOM_EVENT
}