Skip to content

Commit

Permalink
Merge pull request #273 from DanieloV/add-HeadlongGiant-dm07
Browse files Browse the repository at this point in the history
Add headlong giant dm07
  • Loading branch information
sindreslungaard authored Oct 5, 2024
2 parents 13bbec3 + 7026a96 commit 68b7b2d
Show file tree
Hide file tree
Showing 21 changed files with 231 additions and 446 deletions.
48 changes: 1 addition & 47 deletions game/cards/dm01/colony_beetle.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,52 +90,6 @@ func TowerShell(c *match.Card) {
c.ManaCost = 6
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 ctx.Match.GetPower(blocker, false) >= 4000 {
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 ctx.Match.GetPower(blocker, false) >= 4000 {
blockers = append(blockers, blocker)
}
}

event.Blockers = blockers

})

}

}, fx.Creature)
c.Use(fx.Creature, fx.When(fx.Attacking, fx.CantBeBlockedByPowerUpTo4000))

}
48 changes: 1 addition & 47 deletions game/cards/dm01/horned_beast.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,53 +31,7 @@ func StampedingLonghorn(c *match.Card) {
c.ManaCost = 5
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 ctx.Match.GetPower(blocker, false) >= 3000 {
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 ctx.Match.GetPower(blocker, false) >= 3000 {
blockers = append(blockers, blocker)
}
}

event.Blockers = blockers

})

}

}, fx.Creature)
c.Use(fx.Creature, fx.When(fx.Attacking, fx.CantBeBlockedByPowerUpTo3000))

}

Expand Down
8 changes: 4 additions & 4 deletions game/cards/dm02/armored_wyvern.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ func MetalwingSkyterror(c *match.Card) {
c.ManaCost = 7
c.ManaRequirement = []string{civ.Fire}

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

fx.SelectFilterSelectablesOnly(
c.Use(fx.Creature, fx.Doublebreaker, fx.WheneverThisAttacks(func(card *match.Card, ctx *match.Context) {
fx.SelectFilter(
card.Player,
ctx.Match,
ctx.Match.Opponent(card.Player),
Expand All @@ -30,10 +29,11 @@ func MetalwingSkyterror(c *match.Card) {
1,
true,
func(x *match.Card) bool { return x.HasCondition(cnd.Blocker) },
false,
).Map(func(x *match.Card) {
ctx.Match.Destroy(x, card, match.DestroyedByMiscAbility)
fx.RemoveBlockerFromList(x, ctx)
})

}))

}
36 changes: 17 additions & 19 deletions game/cards/dm02/cyber_virus.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,25 +18,23 @@ func StainedGlass(c *match.Card) {
c.ManaCost = 3
c.ManaRequirement = []string{civ.Water}

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

ctx.ScheduleAfter(func() {

fx.SelectFilterSelectablesOnly(
card.Player,
ctx.Match,
ctx.Match.Opponent(card.Player),
match.BATTLEZONE,
"Stained Glass: Select 1 of your opponent's fire or nature creatures that will be returned to their hand",
1,
1,
true,
func(x *match.Card) bool { return x.Civ == civ.Fire || x.Civ == civ.Nature },
).Map(func(x *match.Card) {
x.Player.MoveCard(x.ID, match.BATTLEZONE, match.HAND, card.ID)
ctx.Match.ReportActionInChat(ctx.Match.Opponent(card.Player), fmt.Sprintf("%s was sent to %s's hand from the battle zone by Stained Glass", x.Name, x.Player.Username()))
})

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

fx.SelectFilter(
card.Player,
ctx.Match,
ctx.Match.Opponent(card.Player),
match.BATTLEZONE,
"Stained Glass: Select 1 of your opponent's fire or nature creatures that will be returned to their hand",
1,
1,
true,
func(x *match.Card) bool { return x.Civ == civ.Fire || x.Civ == civ.Nature },
false,
).Map(func(x *match.Card) {
x.Player.MoveCard(x.ID, match.BATTLEZONE, match.HAND, card.ID)
ctx.Match.ReportActionInChat(ctx.Match.Opponent(card.Player), fmt.Sprintf("%s was sent to %s's hand from the battle zone by Stained Glass", x.Name, x.Player.Username()))
fx.RemoveBlockerFromList(x, ctx)
})

}))
Expand Down
48 changes: 1 addition & 47 deletions game/cards/dm02/giant_insect.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,52 +17,6 @@ func XenoMantis(c *match.Card) {
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 ctx.Match.GetPower(blocker, false) > 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 ctx.Match.GetPower(blocker, false) > 5000 {
blockers = append(blockers, blocker)
}
}

event.Blockers = blockers

})

}

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

}
79 changes: 39 additions & 40 deletions game/cards/dm03/armorloid.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,46 +18,45 @@ func ArmoredWarriorQuelos(c *match.Card) {
c.ManaCost = 5
c.ManaRequirement = []string{civ.Fire}

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

ctx.ScheduleAfter(func() {
creatures := match.Filter(
card.Player,
ctx.Match,
card.Player,
match.MANAZONE,
"Armored Warrior Quelos: Select 1 of your non-fire cards from mana zone and move it to graveyard.",
1,
1,
false,
func(x *match.Card) bool { return x.Civ != civ.Fire },
)

for _, creature := range creatures {
card.Player.MoveCard(creature.ID, match.MANAZONE, match.GRAVEYARD, card.ID)
ctx.Match.ReportActionInChat(card.Player, fmt.Sprintf("%s was sent to graveyard from %s's mana zone", creature.Name, card.Player.Username()))
}

ctx.Match.Wait(card.Player, "Waiting for your opponent to make an action")
defer ctx.Match.EndWait(card.Player)

opponentCreatures := match.Filter(
ctx.Match.Opponent(card.Player),
ctx.Match,
ctx.Match.Opponent(card.Player),
match.MANAZONE,
"Armored Warrior Quelos: Select 1 of your non-fire cards from mana zone and move it to graveyard.",
1,
1,
false,
func(x *match.Card) bool { return x.Civ != civ.Fire },
)

for _, creature := range opponentCreatures {
ctx.Match.Opponent(card.Player).MoveCard(creature.ID, match.MANAZONE, match.GRAVEYARD, card.ID)
ctx.Match.ReportActionInChat(ctx.Match.Opponent(card.Player), fmt.Sprintf("%s was sent to graveyard from %s's mana zone", creature.Name, ctx.Match.Opponent(card.Player).Username()))
}
})
c.Use(fx.Creature, fx.WheneverThisAttacks(func(card *match.Card, ctx *match.Context) {

creatures := match.Filter(
card.Player,
ctx.Match,
card.Player,
match.MANAZONE,
"Armored Warrior Quelos: Select 1 of your non-fire cards from mana zone and move it to graveyard.",
1,
1,
false,
func(x *match.Card) bool { return x.Civ != civ.Fire },
)

for _, creature := range creatures {
card.Player.MoveCard(creature.ID, match.MANAZONE, match.GRAVEYARD, card.ID)
ctx.Match.ReportActionInChat(card.Player, fmt.Sprintf("%s was sent to graveyard from %s's mana zone", creature.Name, card.Player.Username()))
}

ctx.Match.Wait(card.Player, "Waiting for your opponent to make an action")
defer ctx.Match.EndWait(card.Player)

opponentCreatures := match.Filter(
ctx.Match.Opponent(card.Player),
ctx.Match,
ctx.Match.Opponent(card.Player),
match.MANAZONE,
"Armored Warrior Quelos: Select 1 of your non-fire cards from mana zone and move it to graveyard.",
1,
1,
false,
func(x *match.Card) bool { return x.Civ != civ.Fire },
)

for _, creature := range opponentCreatures {
ctx.Match.Opponent(card.Player).MoveCard(creature.ID, match.MANAZONE, match.GRAVEYARD, card.ID)
ctx.Match.ReportActionInChat(ctx.Match.Opponent(card.Player), fmt.Sprintf("%s was sent to graveyard from %s's mana zone", creature.Name, ctx.Match.Opponent(card.Player).Username()))
}

}))

}
14 changes: 7 additions & 7 deletions game/cards/dm03/human.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ func MuramasaDukeOfBlades(c *match.Card) {
c.ManaCost = 6
c.ManaRequirement = []string{civ.Fire}

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

creatures := match.Filter(
fx.SelectFilter(
card.Player,
ctx.Match,
ctx.Match.Opponent(card.Player),
Expand All @@ -43,11 +43,11 @@ func MuramasaDukeOfBlades(c *match.Card) {
1,
true,
func(x *match.Card) bool { return ctx.Match.GetPower(x, false) <= 2000 },
)

for _, creature := range creatures {
ctx.Match.Destroy(creature, card, match.DestroyedByMiscAbility)
}
false,
).Map(func(x *match.Card) {
ctx.Match.Destroy(x, card, match.DestroyedByMiscAbility)
fx.RemoveBlockerFromList(x, ctx)
})
}))

}
Loading

0 comments on commit 68b7b2d

Please sign in to comment.