Skip to content

Commit

Permalink
New card: Xeno Mantis
Browse files Browse the repository at this point in the history
  • Loading branch information
sindreslungaard committed Jun 9, 2020
1 parent d1659b7 commit e855c6c
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
68 changes: 68 additions & 0 deletions game/cards/dm02/giant_insect.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
package dm02

import (
"duel-masters/game/civ"
"duel-masters/game/family"
"duel-masters/game/fx"
"duel-masters/game/match"
)

// XenoMantis ...
func XenoMantis(c *match.Card) {

c.Name = "Xeno Mantis"
c.Power = 6000
c.Civ = civ.Nature
c.Family = family.GiantInsect
c.ManaCost = 7
c.ManaRequirement = []string{civ.Nature}

c.Use(func(card *match.Card, ctx *match.Context) {

if event, ok := ctx.Event.(*match.AttackPlayer); ok {

if event.CardID != card.ID {
return
}

ctx.ScheduleAfter(func() {

blockers := make([]*match.Card, 0)

for _, blocker := range event.Blockers {
if blocker.Power > 5000 {
blockers = append(blockers, blocker)
}
}

event.Blockers = blockers

})

}

if event, ok := ctx.Event.(*match.AttackCreature); ok {

if event.CardID != card.ID {
return
}

ctx.ScheduleAfter(func() {

blockers := make([]*match.Card, 0)

for _, blocker := range event.Blockers {
if blocker.Power > 5000 {
blockers = append(blockers, blocker)
}
}

event.Blockers = blockers

})

}

}, fx.Creature, fx.Doublebreaker)

}
1 change: 1 addition & 0 deletions game/cards/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,4 +173,5 @@ var DM02 = map[string]match.CardConstructor{
"99791f19-21ee-4ee3-a6b0-e26702c2a380": dm02.CriticalBlade,
"5781986a-4ca8-48e1-a5a1-95e820455bce": dm02.HypersquidWalter,
"6406411f-e9ae-4b55-8213-7e18c4cd9aee": dm02.StainedGlass,
"9275747d-f2bb-4298-9b70-7075b17d1e0d": dm02.XenoMantis,
}

0 comments on commit e855c6c

Please sign in to comment.