Skip to content

Commit

Permalink
Add Bailas Gale
Browse files Browse the repository at this point in the history
  • Loading branch information
jyotiskaghosh committed Dec 7, 2024
1 parent a1210cc commit bffd198
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions game/cards/dm08/earth_dragon.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"duel-masters/game/family"
"duel-masters/game/fx"
"duel-masters/game/match"
"fmt"
)

// TerradragonRegarion ...
Expand All @@ -19,3 +20,46 @@ func TerradragonRegarion(c *match.Card) {

c.Use(fx.Creature, fx.Doublebreaker, fx.PowerAttacker3000)
}

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

c.Name = "Super Terradragon Bailas Gale"
c.Power = 9000
c.Civ = civ.Nature
c.Family = []string{family.EarthDragon}
c.ManaCost = 5
c.ManaRequirement = []string{civ.Nature}

c.Use(fx.Creature, fx.DragonEvolution, fx.Doublebreaker, func(card *match.Card, ctx *match.Context) {

if event, ok := ctx.Event.(*match.SpellCast); ok && c.Zone == match.BATTLEZONE && event.FromShield {

// check which player played the spell
var p *match.Player
if event.MatchPlayerID == 1 {
p = ctx.Match.Player1.Player
} else {
p = ctx.Match.Player2.Player
}

if p == c.Player {

spell, err := p.GetCard(event.CardID, match.HAND)
if err != nil {
return
}

// prevents card from being sent to grave
// uses the fact that cards in the battlezone are handled before ones in hand
ctx.ScheduleAfter(func() {
ctx.InterruptFlow()
ctx.Match.ReportActionInChat(card.Player, fmt.Sprintf("%s was returned to the hand by %s", spell.Name, c.Name))
})

}

}

})
}
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,
"44cbf9fd-3906-4032-939c-f702ffda7415": dm08.SuperTerradragonBailasGale,
"2cf1ccb5-50d8-4a50-902e-85a8ee0a5a04": dm08.TottoPipicchi,
}

Expand Down

0 comments on commit bffd198

Please sign in to comment.