Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sindreslungaard committed Sep 29, 2024
2 parents e9e7114 + 65131ac commit 13bbec3
Show file tree
Hide file tree
Showing 31 changed files with 524 additions and 186 deletions.
2 changes: 1 addition & 1 deletion game/cards/dm01/angel_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ func UrthPurifyingElemental(c *match.Card) {
c.ManaCost = 6
c.ManaRequirement = []string{civ.Light}

c.Use(fx.Creature, fx.Doublebreaker, fx.Untap)
c.Use(fx.Creature, fx.Doublebreaker, fx.When(fx.EndOfMyTurnCreatureBZ, fx.MayUntapSelf))

}
2 changes: 1 addition & 1 deletion game/cards/dm01/initiate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func FreiVizierOfAir(c *match.Card) {
c.ManaCost = 4
c.ManaRequirement = []string{civ.Light}

c.Use(fx.Creature, fx.Untap)
c.Use(fx.Creature, fx.When(fx.EndOfMyTurnCreatureBZ, fx.MayUntapSelf))

}

Expand Down
2 changes: 1 addition & 1 deletion game/cards/dm01/light_bringer.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func ChiliasTheOracle(c *match.Card) {
c.ManaCost = 4
c.ManaRequirement = []string{civ.Light}

c.Use(fx.Creature, fx.ReturnToHand)
c.Use(fx.Creature, fx.When(fx.WouldBeDestroyed, fx.ReturnToHand))

}

Expand Down
4 changes: 2 additions & 2 deletions game/cards/dm01/liquid_people.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func AquaKnight(c *match.Card) {
c.ManaCost = 5
c.ManaRequirement = []string{civ.Water}

c.Use(fx.Creature, fx.ReturnToHand)
c.Use(fx.Creature, fx.When(fx.WouldBeDestroyed, fx.ReturnToHand))

}

Expand Down Expand Up @@ -121,7 +121,7 @@ func AquaSoldier(c *match.Card) {
c.ManaCost = 3
c.ManaRequirement = []string{civ.Water}

c.Use(fx.Creature, fx.ReturnToHand)
c.Use(fx.Creature, fx.When(fx.WouldBeDestroyed, fx.ReturnToHand))

}

Expand Down
2 changes: 1 addition & 1 deletion game/cards/dm01/starlight_tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func RubyGrass(c *match.Card) {
c.ManaCost = 3
c.ManaRequirement = []string{civ.Light}

c.Use(fx.Creature, fx.Blocker, fx.CantAttackPlayers, fx.Untap)
c.Use(fx.Creature, fx.Blocker, fx.CantAttackPlayers, fx.When(fx.EndOfMyTurnCreatureBZ, fx.MayUntapSelf))

}

Expand Down
64 changes: 1 addition & 63 deletions game/cards/dm02/machine_eater.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"duel-masters/game/family"
"duel-masters/game/fx"
"duel-masters/game/match"
"fmt"
)

// EngineerKipo ...
Expand All @@ -18,67 +17,6 @@ func EngineerKipo(c *match.Card) {
c.ManaCost = 2
c.ManaRequirement = []string{civ.Fire}

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

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

if event.Card == card {

players := make([]*match.Player, 0)
players = append(players, card.Player)
players = append(players, ctx.Match.Opponent(card.Player))

for _, p := range players {

manazone, err := p.Container(match.MANAZONE)

if err != nil {
continue
}

toSelect := 1

if len(manazone) < toSelect {
toSelect = len(manazone)
}

if toSelect < 1 {
continue
}

ctx.Match.Wait(ctx.Match.Opponent(p), "Waiting for your opponent to make an action")
ctx.Match.NewAction(p, manazone, toSelect, toSelect, fmt.Sprintf("Engineer Kipo: Select %v card(s) from your manazone that will be sent to your graveyard", toSelect), false)

for {

action := <-p.Action

if len(action.Cards) != toSelect || !match.AssertCardsIn(manazone, action.Cards...) {
ctx.Match.DefaultActionWarning(p)
continue
}

for _, id := range action.Cards {

p.MoveCard(id, match.MANAZONE, match.GRAVEYARD, card.ID)

ctx.Match.ReportActionInChat(p, fmt.Sprintf("Engineer Kipo destroyed %v of %s's mana", toSelect, p.Username()))

}

break

}

ctx.Match.EndWait(ctx.Match.Opponent(p))
ctx.Match.CloseAction(p)

}

}

}

})
c.Use(fx.Creature, fx.When(fx.Destroyed, fx.EachPlayerDestroys1Mana))

}
66 changes: 3 additions & 63 deletions game/cards/dm02/rock_beast.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"duel-masters/game/family"
"duel-masters/game/fx"
"duel-masters/game/match"
"fmt"
)

// Galsaur ...
Expand Down Expand Up @@ -49,67 +48,8 @@ func Bombersaur(c *match.Card) {
c.ManaCost = 5
c.ManaRequirement = []string{civ.Fire}

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

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

if event.Card == card {

players := make([]*match.Player, 0)
players = append(players, card.Player)
players = append(players, ctx.Match.Opponent(card.Player))

for _, p := range players {

manazone, err := p.Container(match.MANAZONE)

if err != nil {
continue
}

toSelect := 2

if len(manazone) < toSelect {
toSelect = len(manazone)
}

if toSelect < 1 {
continue
}

ctx.Match.Wait(ctx.Match.Opponent(p), "Waiting for your opponent to make an action")
ctx.Match.NewAction(p, manazone, toSelect, toSelect, fmt.Sprintf("Bombersaur: Select %v card(s) from your manazone that will be sent to your graveyard", toSelect), false)

for {

action := <-p.Action

if len(action.Cards) != toSelect || !match.AssertCardsIn(manazone, action.Cards...) {
ctx.Match.DefaultActionWarning(p)
continue
}

for _, id := range action.Cards {

p.MoveCard(id, match.MANAZONE, match.GRAVEYARD, card.ID)

ctx.Match.ReportActionInChat(p, fmt.Sprintf("Bombersaur destroyed %v of %s's mana", toSelect, p.Username()))

}

break

}

ctx.Match.EndWait(ctx.Match.Opponent(p))
ctx.Match.CloseAction(p)

}

}

}

})
c.Use(fx.Creature, fx.When(fx.Destroyed, func(card *match.Card, ctx *match.Context) {
fx.EachPlayerDestroysMana(card, ctx, 2)
}))

}
2 changes: 1 addition & 1 deletion game/cards/dm06/liquid_people.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func CrystalJouster(c *match.Card) {
c.ManaCost = 7
c.ManaRequirement = []string{civ.Water}

c.Use(fx.Creature, fx.Evolution, fx.Doublebreaker, fx.ReturnToHand)
c.Use(fx.Creature, fx.Evolution, fx.Doublebreaker, fx.When(fx.WouldBeDestroyed, fx.ReturnToHand))

}

Expand Down
2 changes: 1 addition & 1 deletion game/cards/dm06/mecha_thunder.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func LaveilSeekerOfCatastrophe(c *match.Card) {
c.ManaCost = 8
c.ManaRequirement = []string{civ.Light}

c.Use(fx.Creature, fx.Blocker, fx.Doublebreaker, fx.Untap)
c.Use(fx.Creature, fx.Blocker, fx.Doublebreaker, fx.When(fx.EndOfMyTurnCreatureBZ, fx.MayUntapSelf))

}

Expand Down
24 changes: 24 additions & 0 deletions game/cards/dm07/angel_command.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package dm07

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

func SiriGloryElemental(c *match.Card) {

c.Name = "Siri, Glory Elemental"
c.Power = 7000
c.Civ = civ.Light
c.Family = []string{family.AngelCommand}
c.ManaCost = 6
c.ManaRequirement = []string{civ.Light}

c.Use(fx.Creature, fx.Doublebreaker,
fx.WhenAll([]func(*match.Card, *match.Context) bool{fx.EndOfMyTurnCreatureBZ, fx.IDontHaveShields}, fx.MayUntapSelf),
fx.When(fx.InTheBattlezone, fx.BlockerWhenNoShields),
)

}
25 changes: 25 additions & 0 deletions game/cards/dm07/armored_dragon.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package dm07

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

func GazariasDragon(c *match.Card) {
c.Name = "Gazarias Dragon"
c.Power = 4000
c.Civ = civ.Fire
c.Family = []string{family.ArmoredDragon}
c.ManaCost = 5
c.ManaRequirement = []string{civ.Fire}

c.Use(fx.Creature, fx.When(fx.InTheBattlezone, func(card *match.Card, ctx *match.Context) {
condition1 := &match.Condition{ID: cnd.DoubleBreaker, Val: true, Src: nil}
condition2 := &match.Condition{ID: cnd.PowerAmplifier, Val: 4000, Src: nil}
fx.HaveSelfConditionsWhenNoShields(card, ctx, []*match.Condition{condition1, condition2})
}))

}
33 changes: 33 additions & 0 deletions game/cards/dm07/armorloid.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package dm07

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

func ArmoredTransportGaliacruse(c *match.Card) {

c.Name = "Armored Transport Galiacruse"
c.Power = 5000
c.Civ = civ.Fire
c.Family = []string{family.Armorloid}
c.ManaCost = 6
c.ManaRequirement = []string{civ.Fire}
c.TapAbility = func(card *match.Card, ctx *match.Context) {
fx.FindFilter(
card.Player,
match.BATTLEZONE,
func(card *match.Card) bool { return card.Civ == civ.Fire },
).Map(func(x *match.Card) {
x.AddCondition(cnd.AttackUntapped, nil, card)
ctx.Match.ReportActionInChat(x.Player, fmt.Sprintf("%s can attack untapped creatures this turn", x.Name))
})
}

c.Use(fx.Creature, fx.TapAbility)

}
20 changes: 20 additions & 0 deletions game/cards/dm07/chimera.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package dm07

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

func PhantasmalHorrorGigazabal(c *match.Card) {

c.Name = "Phantasmal Horror Gigazabal"
c.Power = 9000
c.Civ = civ.Darkness
c.Family = []string{family.Chimera}
c.ManaCost = 5
c.ManaRequirement = []string{civ.Darkness}

c.Use(fx.Creature, fx.Evolution, fx.Doublebreaker, fx.LightStealth)
}
20 changes: 20 additions & 0 deletions game/cards/dm07/death_puppet.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package dm07

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

func GezaryUndercoverDoll(c *match.Card) {

c.Name = "Gezary, Undercover Doll"
c.Power = 2000
c.Civ = civ.Darkness
c.Family = []string{family.DeathPuppet}
c.ManaCost = 3
c.ManaRequirement = []string{civ.Darkness}

c.Use(fx.Creature, fx.NatureStealth)
}
21 changes: 21 additions & 0 deletions game/cards/dm07/dragonoid.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package dm07

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

func SkyCrushertheAgitator(c *match.Card) {

c.Name = "Sky Crusher, the Agitator"
c.Power = 4000
c.Civ = civ.Fire
c.Family = []string{family.Dragonoid}
c.ManaCost = 7
c.ManaRequirement = []string{civ.Fire}
c.TapAbility = fx.EachPlayerDestroys1Mana

c.Use(fx.Creature, fx.TapAbility)
}
20 changes: 20 additions & 0 deletions game/cards/dm07/guardian.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package dm07

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

func RodiGaleNightGuardian(c *match.Card) {

c.Name = "Rodi Gale, Night Guardian"
c.Power = 3500
c.Civ = civ.Light
c.Family = []string{family.Guardian}
c.ManaCost = 4
c.ManaRequirement = []string{civ.Light}

c.Use(fx.Creature, fx.DarknessStealth)
}
Loading

0 comments on commit 13bbec3

Please sign in to comment.