-
Notifications
You must be signed in to change notification settings - Fork 46
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
base: master
Are you sure you want to change the base?
Changes from all commits
105bfcc
83d40a0
10fa5a1
2af46a5
4ead84a
a1210cc
bffd198
fe67c05
79aa317
9d00060
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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))) | ||
|
||
} |
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 }), | ||
) | ||
} |
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)), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WheneverThisAttacks -> When(AttackConfirmed, ....) if the my #315 PR will get approved first |
||
) | ||
|
||
} |
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))), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WheneverThisAttacks -> When(AttackConfirmed, ....) if the my #315 PR will get approved first |
||
) | ||
|
||
} |
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))), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WheneverThisAttacks -> When(AttackConfirmed, ....) if the my #315 PR will get approved first |
||
) | ||
|
||
} |
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)) | ||
}) | ||
|
||
} | ||
|
||
} | ||
|
||
}) | ||
} |
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) }) | ||
}) | ||
}), | ||
) | ||
|
||
} |
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) | ||
}), | ||
) | ||
|
||
} |
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 | ||
} | ||
|
||
} | ||
|
||
})) | ||
|
||
} |
There was a problem hiding this comment.
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