Skip to content

Commit

Permalink
Add Totto Pipicchi
Browse files Browse the repository at this point in the history
  • Loading branch information
jyotiskaghosh committed Dec 6, 2024
1 parent 4ead84a commit a1210cc
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 3 deletions.
46 changes: 46 additions & 0 deletions game/cards/dm08/fire_bird.go
Original file line number Diff line number Diff line change
@@ -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) })
})
}),
)

}
1 change: 1 addition & 0 deletions game/cards/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions game/family/families.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ const (
EarthDragon = "Earth Dragon"
ZombieDragon = "Zombie Dragon"
)

var Dragons = []string{ArmoredDragon, VolcanoDragon, EarthDragon, ZombieDragon}
4 changes: 1 addition & 3 deletions game/fx/evolution.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit a1210cc

Please sign in to comment.