Skip to content

Commit

Permalink
New card: Logic Cube
Browse files Browse the repository at this point in the history
  • Loading branch information
sindreslungaard committed Jun 7, 2020
1 parent f9c5ab0 commit 015cb13
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
31 changes: 31 additions & 0 deletions game/cards/dm02/spells.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package dm02

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

// BurstShot ...
Expand Down Expand Up @@ -47,3 +49,32 @@ func BurstShot(c *match.Card) {
})

}

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

c.Name = "Logic Cube"
c.Civ = civ.Light
c.ManaCost = 3
c.ManaRequirement = []string{civ.Light}

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

if match.AmICasted(card, ctx) {

creatures := match.Filter(card.Player, ctx.Match, card.Player, match.DECK, "Select 1 spell from your deck that will be shown to your opponent and sent to your hand", 1, 1, false, func(x *match.Card) bool { return x.HasCondition(cnd.Spell) })

for _, creature := range creatures {

card.Player.MoveCard(creature.ID, match.DECK, match.HAND)
ctx.Match.Chat("Server", fmt.Sprintf("%s retrieved %s from the deck to their hand", card.Player.Username(), creature.Name))

}

card.Player.ShuffleDeck()

}

})

}
1 change: 1 addition & 0 deletions game/cards/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,5 @@ var DM02 = map[string]match.CardConstructor{
"5d095b28-262e-454d-96c7-9174ed83e3f6": dm02.LadiaBaleTheInspirational,
"6e381955-231b-4e4e-a14b-82509a5e193b": dm02.RumblingTerahorn,
"9fed2257-362f-43c7-b50e-5526ccf799aa": dm02.MiniTitanGett,
"17ee5046-c3fd-4422-af14-c54a4be8d9a2": dm02.LogicCube,
}

0 comments on commit 015cb13

Please sign in to comment.