Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dm 08 add turbo rush cards #308

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
2 changes: 1 addition & 1 deletion DuelMastersCards.json
Original file line number Diff line number Diff line change
Expand Up @@ -25107,7 +25107,7 @@
"Fire"
],
"cost": 7,
"name": "\u00c3\u0153berdragon Bajula",
"name": "Überdragon Bajula",
"power": "13000",
"printings": [
{
Expand Down
4 changes: 2 additions & 2 deletions game/cards/dm03/cyber_lord.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func Shtra(c *match.Card) {
false,
).Map(func(c *match.Card) {
c.Player.MoveCard(c.ID, match.MANAZONE, match.HAND, card.ID)
ctx.Match.ReportActionInChat(card.Player, fmt.Sprintf("%s was moved to %s's manazone from their hand by Shtra", c.Name, c.Player.Username()))
ctx.Match.ReportActionInChat(card.Player, fmt.Sprintf("%s was moved to %s's hand from their manazone by Shtra", c.Name, c.Player.Username()))
})

ctx.Match.Wait(card.Player, "Waiting for your opponent to make an action")
Expand All @@ -64,7 +64,7 @@ func Shtra(c *match.Card) {
false,
).Map(func(c *match.Card) {
c.Player.MoveCard(c.ID, match.MANAZONE, match.HAND, card.ID)
ctx.Match.ReportActionInChat(ctx.Match.Opponent(card.Player), fmt.Sprintf("%s was moved to %s's manazone from their hand by Shtra", c.Name, c.Player.Username()))
ctx.Match.ReportActionInChat(ctx.Match.Opponent(card.Player), fmt.Sprintf("%s was moved to %s's hand from their manazone by Shtra", c.Name, c.Player.Username()))
})

}))
Expand Down
22 changes: 22 additions & 0 deletions game/cards/dm08/armored_dragon.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package dm08

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

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

c.Name = "Überdragon Bajula"
c.Power = 13000
c.Civ = civ.Fire
c.Family = []string{family.ArmoredDragon}
c.ManaCost = 7
c.ManaRequirement = []string{civ.Fire}

c.Use(fx.Creature, fx.DragonEvolution, fx.Triplebreaker, fx.WheneverThisAttacks(fx.ManaBurnX(2)))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WheneverThisAttacks -> When(AttackConfirmed, ....) if the my #315 PR will get approved first


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

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

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

c.Name = "Quixotic Hero Swine Snout"
c.Power = 1000
c.Civ = civ.Nature
c.Family = []string{family.BeastFolk}
c.ManaCost = 2
c.ManaRequirement = []string{civ.Nature}

powerBoost := 0

c.PowerModifier = func(m *match.Match, attacking bool) int { return powerBoost }

c.Use(fx.Creature,
fx.When(fx.AnotherCreatureSummoned, func(card *match.Card, ctx *match.Context) { powerBoost += 3000 }),
fx.When(fx.EndOfTurn, func(card *match.Card, ctx *match.Context) { powerBoost = 0 }),
)
}
29 changes: 29 additions & 0 deletions game/cards/dm08/chimera.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package dm08

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

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

c.Name = "Gigaclaws"
c.Power = 2000
c.Civ = civ.Darkness
c.Family = []string{family.Chimera}
c.ManaCost = 5
c.ManaRequirement = []string{civ.Darkness}

turboRush := false

c.Use(
fx.Creature,
fx.When(fx.TurboRushCondition, func(card *match.Card, ctx *match.Context) { turboRush = true }),
fx.When(fx.EndOfMyTurn, func(card *match.Card, ctx *match.Context) { turboRush = false }),
fx.When(func(c *match.Card, ctx *match.Context) bool { return turboRush }, fx.WheneverThisAttacks(fx.OpponentDiscardsHand)),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WheneverThisAttacks -> When(AttackConfirmed, ....) if the my #315 PR will get approved first

)

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

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

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

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

turboRush := false

c.Use(
fx.Creature,
fx.When(fx.TurboRushCondition, func(card *match.Card, ctx *match.Context) { turboRush = true }),
fx.When(fx.EndOfMyTurn, func(card *match.Card, ctx *match.Context) { turboRush = false }),
fx.When(func(c *match.Card, ctx *match.Context) bool { return turboRush },
fx.When(fx.WheneverThisAttacksAndIsntBlocked, fx.DestroyOpponentCreature(true, match.DestroyedByMiscAbility))),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WheneverThisAttacks -> When(AttackConfirmed, ....) if the my #315 PR will get approved first

)

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

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

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

c.Name = "Missile Soldier Ultimo"
c.Power = 2000
c.Civ = civ.Fire
c.Family = []string{family.Dragonoid}
c.ManaCost = 3
c.ManaRequirement = []string{civ.Fire}

turboRush := false

c.Use(
fx.Creature,
fx.When(fx.TurboRushCondition, func(card *match.Card, ctx *match.Context) { turboRush = true }),
fx.When(fx.EndOfMyTurn, func(card *match.Card, ctx *match.Context) { turboRush = false }),
fx.When(func(c *match.Card, ctx *match.Context) bool { return turboRush }, func(card *match.Card, ctx *match.Context) {
c.AddUniqueSourceCondition(cnd.PowerAttacker, 4000, card.ID)
c.AddUniqueSourceCondition(cnd.AttackUntapped, nil, card.ID)
}),
)

}

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

c.Name = "Slaphappy Soldier Galback"
c.Power = 3000
c.Civ = civ.Fire
c.Family = []string{family.Dragonoid}
c.ManaCost = 4
c.ManaRequirement = []string{civ.Fire}

turboRush := false

c.Use(
fx.Creature,
fx.When(fx.TurboRushCondition, func(card *match.Card, ctx *match.Context) { turboRush = true }),
fx.When(fx.EndOfMyTurn, func(card *match.Card, ctx *match.Context) { turboRush = false }),
fx.When(func(c *match.Card, ctx *match.Context) bool { return turboRush }, fx.WheneverThisAttacks(fx.DestroyOpCreatureXPowerOrLess(4000, match.DestroyedByMiscAbility))),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WheneverThisAttacks -> When(AttackConfirmed, ....) if the my #315 PR will get approved first

)

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

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

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

c.Name = "Terradragon Regarion"
c.Power = 4000
c.Civ = civ.Nature
c.Family = []string{family.EarthDragon}
c.ManaCost = 5
c.ManaRequirement = []string{civ.Nature}

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))
})

}

}

})
}
46 changes: 46 additions & 0 deletions game/cards/dm08/fire_bird.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package dm08

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

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

c.Name = "Totto Pipicchi"
c.Power = 1000
c.Civ = civ.Fire
c.Family = []string{family.FireBird}
c.ManaCost = 3
c.ManaRequirement = []string{civ.Fire}

c.Use(fx.Creature,
fx.When(fx.InTheBattlezone, func(card *match.Card, ctx *match.Context) {
ctx.Match.ApplyPersistentEffect(func(ctx2 *match.Context, exit func()) {

if card.Zone != match.BATTLEZONE {
fx.Find(
card.Player,
match.BATTLEZONE,
).Map(func(x *match.Card) {
x.RemoveConditionBySource(card.ID)
})

exit()
return
}

fx.FindFilter(
card.Player,
match.BATTLEZONE,
func(creature *match.Card) bool { return creature.SharesAFamily(family.Dragons) },
).Map(func(x *match.Card) { x.AddUniqueSourceCondition(cnd.SpeedAttacker, true, card.ID) })
})
}),
)

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

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

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

c.Name = "Illusion Fish"
c.Power = 3000
c.Civ = civ.Water
c.Family = []string{family.GelFish}
c.ManaCost = 4
c.ManaRequirement = []string{civ.Water}

turboRush := false

c.Use(
fx.Creature,
fx.When(fx.TurboRushCondition, func(card *match.Card, ctx *match.Context) { turboRush = true }),
fx.When(fx.EndOfMyTurn, func(card *match.Card, ctx *match.Context) { turboRush = false }),
fx.When(func(c *match.Card, ctx *match.Context) bool { return turboRush }, func(card *match.Card, ctx *match.Context) {
c.AddUniqueSourceCondition(cnd.CantBeBlocked, nil, card.ID)
}),
)

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

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

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

c.Name = "Carbonite Scarab"
c.Power = 3000
c.Civ = civ.Nature
c.Family = []string{family.GiantInsect}
c.ManaCost = 4
c.ManaRequirement = []string{civ.Nature}

turboRush := false

attackingOpponent := false

c.Use(
fx.Creature,
fx.When(fx.TurboRushCondition, func(card *match.Card, ctx *match.Context) { turboRush = true }),
func(card *match.Card, ctx *match.Context) {
// NOTE: currently bugged as attack can be cancelled
// need to refactor Battle so that AttackConfirmed can tell if a creature was blocked while attacking a player
if event, ok := ctx.Event.(*match.AttackPlayer); ok && event.CardID == c.ID {
attackingOpponent = true
}
},
fx.When(fx.EndOfMyTurn, func(card *match.Card, ctx *match.Context) {
turboRush = false
}),
fx.When(func(card *match.Card, ctx *match.Context) bool { return turboRush }, func(card *match.Card, ctx *match.Context) {
if event, ok := ctx.Event.(*match.Battle); ok {

if event.Attacker == c && event.Blocked && attackingOpponent {
fx.DestoryOpShield(card, ctx)
attackingOpponent = false
}

}

}))

}
Loading
Loading