diff --git a/game/cards/dm08/fire_bird.go b/game/cards/dm08/fire_bird.go new file mode 100644 index 00000000..785328ab --- /dev/null +++ b/game/cards/dm08/fire_bird.go @@ -0,0 +1,46 @@ +package dm08 + +import ( + "duel-masters/game/civ" + "duel-masters/game/cnd" + "duel-masters/game/family" + "duel-masters/game/fx" + "duel-masters/game/match" +) + +// TottoPipicchi ... +func TottoPipicchi(c *match.Card) { + + c.Name = "Totto Pipicchi" + c.Power = 1000 + c.Civ = civ.Fire + c.Family = []string{family.FireBird} + c.ManaCost = 3 + c.ManaRequirement = []string{civ.Fire} + + c.Use(fx.Creature, + fx.When(fx.InTheBattlezone, func(card *match.Card, ctx *match.Context) { + ctx.Match.ApplyPersistentEffect(func(ctx2 *match.Context, exit func()) { + + if card.Zone != match.BATTLEZONE { + fx.Find( + card.Player, + match.BATTLEZONE, + ).Map(func(x *match.Card) { + x.RemoveConditionBySource(card.ID) + }) + + exit() + return + } + + fx.FindFilter( + card.Player, + match.BATTLEZONE, + func(creature *match.Card) bool { return creature.SharesAFamily(family.Dragons) }, + ).Map(func(x *match.Card) { x.AddUniqueSourceCondition(cnd.SpeedAttacker, true, card.ID) }) + }) + }), + ) + +} diff --git a/game/cards/repository.go b/game/cards/repository.go index 607d83d7..bd27f520 100644 --- a/game/cards/repository.go +++ b/game/cards/repository.go @@ -603,6 +603,7 @@ var DM08 = map[string]match.CardConstructor{ "cf000f38-660c-4ce0-aa24-2ecbb1e4dee2": dm08.MagmadragonJagalzor, "0abb1391-a69f-4839-aafa-222628d5dde8": dm08.SuperNecrodragonAbzoDolba, "85e9d177-69b3-4239-8b2b-ec97f74d5577": dm08.UberdragonBajula, + "2cf1ccb5-50d8-4a50-902e-85a8ee0a5a04": dm08.TottoPipicchi, } // Promo is a map with all the card id's in the game and corresponding CardConstructor for promotional exclusive cards diff --git a/game/family/families.go b/game/family/families.go index 65ee5d2c..0b3511a9 100644 --- a/game/family/families.go +++ b/game/family/families.go @@ -54,3 +54,5 @@ const ( EarthDragon = "Earth Dragon" ZombieDragon = "Zombie Dragon" ) + +var Dragons = []string{ArmoredDragon, VolcanoDragon, EarthDragon, ZombieDragon} diff --git a/game/fx/evolution.go b/game/fx/evolution.go index 6158b629..66009d2d 100644 --- a/game/fx/evolution.go +++ b/game/fx/evolution.go @@ -122,10 +122,8 @@ func Evolution(card *match.Card, ctx *match.Context) { // DragonEvolution has behaviour for dragon evolution cards func DragonEvolution(card *match.Card, ctx *match.Context) { - dragonRaces := []string{family.ArmoredDragon, family.VolcanoDragon, family.EarthDragon, family.ZombieDragon} - evolvableCreatureFilter := func(x *match.Card) bool { - return x.SharesAFamily(dragonRaces) || x.HasCondition(cnd.EvolveIntoAnyFamily) + return x.SharesAFamily(family.Dragons) || x.HasCondition(cnd.EvolveIntoAnyFamily) } if _, ok := ctx.Event.(*match.UntapStep); ok {