Created
July 10, 2021 15:07
-
-
Save BenLubar/6f43342c02c7d3a112aa93b1640abac1 to your computer and use it in GitHub Desktop.
to be clear, none of these compile, and not just because of the syntax errors
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
// cursor is here | |
}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Name: "effect-1", | |
Desc: "Effect 1", | |
Value: "value-1", | |
}, | |
{ | |
Name: "effect-2", | |
Desc: "Effect 2", | |
Value: "value-2", | |
}, | |
} | |
def.Properties = []*card.PropertyDef{ | |
{ | |
Name: "property-1", | |
Desc: "Property 1", | |
Value: "value-1", | |
}, | |
{ | |
Name: "property-2", | |
Desc: "Property 2", | |
Value: "value-2", | |
}, | |
} | |
def.Traits = []*card.TraitDef{ | |
{ | |
Name: "trait-1", | |
Desc: "Trait 1", | |
Value: "value-1", | |
}, | |
{ | |
Name: "trait-2", | |
Desc: "Trait 2", | |
Value: "value-2", | |
}, | |
} | |
def.Traits = append(def.Traits, &card.TraitDef{ | |
Name: "trait-3", | |
Desc: "Trait 3", | |
Value: "value-3", | |
}) | |
def.Traits = append(def.Traits, &card.TraitDef{ | |
Name: "trait-4", | |
Desc: "Trait 4", | |
Value: "value-4", | |
}) | |
def.Traits = append(def.Traits, &card.TraitDef{ | |
Name: "trait-5", | |
Desc: "Trait 5", | |
Value: "value-5", | |
}) | |
def.Traits = append(def.Traits, &card.TraitDef{ | |
Name: "trait-6", | |
Desc: " | |
}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Name: "Delilah", | |
Action: card.Action{Action: card.ActionAdd, Amount: 1}, | |
}, | |
} | |
def.Card = card.Card{ | |
Name: "Delilah", | |
Type: "Delilah", | |
Cost: 1, | |
Effects: []*card.Effect{ | |
{ | |
Name: "Delilah", | |
Action: card.Action{Action: card.ActionAdd, Amount: 1}, | |
}, | |
}, | |
} | |
def.Card.Name = "Delilah" | |
def.Card.Type = "Delilah" | |
def.Card.Cost = 1 | |
def.Card.Effects = []*card.Effect{ | |
{ | |
Name: "Delilah", | |
Action: card.Action{Action: card.ActionAdd, Amount: 1}, | |
}, | |
} | |
def.Card.Name = "Delilah" | |
def.Card.Type = "Delilah" | |
def.Card.Cost = 1 | |
def.Card.Effects = []*card.Effect{ | |
{ | |
Name: "Delilah", | |
Action: card.Action{Action: card.ActionAdd, Amount: 1}, | |
}, | |
} | |
def.Card.Name = "Delilah" | |
def.Card.Type = "Delilah" | |
def.Card.Cost = 1 | |
def.Card.Effects = []*card.Effect{ | |
{ | |
Name: "Delilah", | |
Action: card.Action{Action: card.ActionAdd, Amount: 1}, | |
}, | |
} | |
def.Card.Name = "Delilah" | |
def.Card.Type = "Delilah" | |
def.Card.Cost = 1 | |
def.Card.Effects = []*card.Effect{ | |
{ | |
Name: "Delilah", | |
Action: card.Action{Action: card.ActionAdd | |
}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Name: "Draw", | |
Func: "Draw", | |
Params: []string{ | |
"count", | |
}, | |
}, | |
{ | |
Name: "Discard", | |
Func: "Discard", | |
Params: []string{ | |
"count", | |
}, | |
}, | |
{ | |
Name: "Play", | |
Func: "Play", | |
Params: []string{ | |
"count", | |
}, | |
}, | |
{ | |
Name: "Play", | |
Func: "Play", | |
Params: []string{ | |
"count", | |
}, | |
}, | |
{ | |
Name: "Play", | |
Func: "Play", | |
Params: []string{ | |
"count", | |
}, | |
}, | |
{ | |
Name: "Play", | |
Func: "Play", | |
Params: []string{ | |
"count", | |
}, | |
}, | |
{ | |
Name: "Play", | |
Func: "Play", | |
Params: []string{ | |
"count", | |
}, | |
}, | |
{ | |
Name: "Play", | |
Func: "Play", | |
Params: []string{ | |
"count", | |
}, | |
}, | |
{ | |
Name: "Play", | |
Func: "Play", | |
Params: []string{ | |
"count", | |
}, | |
}, | |
{ | |
Name: "Play", | |
Func: "Play", | |
Params: []string{ | |
}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Name: "", | |
Target: []string{ | |
"all", | |
}, | |
Action: []string{ | |
"damage", | |
}, | |
Parameters: []*card.ParameterDef{ | |
{ | |
Name: "amount", | |
Type: "int", | |
Value: "1", | |
}, | |
}, | |
}, | |
} | |
def.Conditions = []*card.ConditionDef{ | |
{ | |
Name: "", | |
Target: []string{ | |
"all", | |
}, | |
Action: []string{ | |
"damage", | |
}, | |
Parameters: []*card.ParameterDef{ | |
{ | |
Name: "amount", | |
Type: "int", | |
Value: "1", | |
}, | |
}, | |
}, | |
} | |
def.Events = []*card.EventDef{ | |
{ | |
Name: "", | |
Target: []string{ | |
"all", | |
}, | |
Action: []string{ | |
"damage", | |
}, | |
Parameters: []*card.ParameterDef{ | |
{ | |
Name: "amount", | |
Type: "int", | |
Value: "1", | |
}, | |
}, | |
}, | |
} | |
def.Actions = []*card.ActionDef{ | |
{ | |
Name: "", | |
Target: []string{ | |
"all", | |
}, | |
Action: []string{ | |
"damage", | |
}, | |
Parameters: []*card.ParameterDef{ | |
{ | |
Name | |
}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Name: "Test effect", | |
Action: func(s *card.State) { | |
println("Test effect") | |
}, | |
}, | |
} | |
def.Cost = card.Cost{ | |
S: 0, | |
C: 0, | |
P: 0, | |
} | |
def.Description = "Test card" | |
def.Image = "test.png" | |
def.Name = "Test" | |
def.Type = card.Spell | |
def.Power = card.Power{ | |
S: 0, | |
C: 0, | |
P: 0, | |
} | |
def.Trait = card.Trait{ | |
S: 0, | |
C: 0, | |
P: 0, | |
} | |
def.Traits = []*card.Trait{ | |
{ | |
Name: "Test trait", | |
Power: card.Power{ | |
S: 0, | |
C: 0, | |
P: 0, | |
}, | |
}, | |
} | |
def.Traits = append(def.Traits, &card.Trait{ | |
Name: "Test trait 2", | |
Power: card.Power{ | |
S: 0, | |
C: 0, | |
P: 0, | |
}, | |
}) | |
def.Traits = append(def.Traits, &card.Trait{ | |
Name: "Test trait 3", | |
Power: card.Power{ | |
S: 0, | |
C: 0, | |
P: 0, | |
}, | |
}) | |
def.Traits = append(def.Traits, &card.Trait{ | |
Name: "Test trait 4", | |
Power: card.Power{ | |
S: 0, | |
C: 0, | |
P: 0, | |
}, | |
}) | |
def.Traits = append(def.Traits, &card.Trait{ | |
}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Type: card.EffectTypeAdd, | |
Amount: 1, | |
Target: card.EffectTargetSelf, | |
Effect: card.EffectDraw, | |
Condition: &card.Condition{ | |
Type: card.ConditionTypeInclude, | |
Value: "Delilah", | |
}, | |
}, | |
} | |
def.Name = "Delilah" | |
def.Description = "Draw a card." | |
def.Cards = []*card.Card{ | |
{ | |
ID: card.Delilah, | |
Name: "Delilah", | |
Cost: 0, | |
}, | |
} | |
def.Cards = append(def.Cards, card.Cards) | |
def.Effects = append(def.Effects, card.Effects...) | |
def.Actions = []*card.ActionDef{ | |
{ | |
Name: "Delilah", | |
Cost: 0, | |
Actions: []*card.Action{ | |
{ | |
Name: "Delilah", | |
Cost: 0, | |
Actions: []*card.Action{ | |
{ | |
Name: "Delilah", | |
Cost: 0, | |
Actions: []*card.Action{ | |
{ | |
Name: "Delilah", | |
Cost: 0, | |
Actions: []*card.Action{ | |
{ | |
Name: "Delilah", | |
Cost: 0, | |
Actions: []*card.Action{ | |
{ | |
}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Name: "Dummy Effect", | |
Func: func(p card.Player, c card.Card) { | |
p.AddMessage("Dummy Effect") | |
}, | |
}, | |
} | |
def.Name = "Test Card" | |
def.Description = "A test card" | |
def.SetImage("test.png") | |
def.SetCost(3) | |
def.SetAttack(2) | |
def.SetDefense(2) | |
def.SetHealth(2) | |
def.SetCardType(card.CardTypeSpell) | |
def.SetTargets([]string{"Player"}) | |
def.SetEffect(card.EffectDamage(2)) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 2")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 3")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 4")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 5")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 6")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 7")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 8")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 9")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 10")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 11")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 12")) | |
def.SetEffect(card.EffectAddCard(card.CardTypeSpell, "Dummy Card 13")) | |
def.SetEffect(card. | |
}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Name: "Dummy", | |
Text: "Dummy effect", | |
Trigger: []string{"Dummy"}, | |
}, | |
} | |
card.Register(def) | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Name: "Dummy", | |
Text: "Dummy effect", | |
Trigger: []string{"Dummy"}, | |
}, | |
} | |
card.Register(def) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
Name: "curse", | |
Desc: "The target player discards down to three cards.", | |
Value: 0, | |
Type: "curse", | |
}, | |
} | |
def.Conditions = []*card.ConditionDef{ | |
{ | |
Name: "curse", | |
Desc: "The target player discards down to three cards.", | |
Value: 0, | |
Type: "curse", | |
}, | |
} | |
def.Effects = append(def.Effects, &card.EffectDef{ | |
Name: "curse", | |
Desc: "The target player discards down to three cards.", | |
Value: 0, | |
Type: "curse", | |
}) | |
def.Conditions = append(def.Conditions, &card.ConditionDef{ | |
Name: "curse", | |
Desc: "The target player discards down to three cards.", | |
Value: 0, | |
Type: "curse", | |
}) | |
def.Effects = append(def.Effects, &card.EffectDef{ | |
Name: "curse", | |
Desc: "The target player discards down to three cards.", | |
Value: 0, | |
Type: "curse", | |
}) | |
def.Conditions = append(def.Conditions, &card.ConditionDef{ | |
Name: "curse", | |
Desc: "The target player discards down to three cards.", | |
Value: 0, | |
Type: "curse", | |
}) | |
def.Effects = append(def.Effects, &card.EffectDef{ | |
Name: "curse", | |
Desc: "The target player discards down to three cards.", | |
Value: 0, | |
Type: "curse", | |
}) | |
def.Conditions = append(def.Conditions, &card.ConditionDef{ | |
Name: "curse", | |
Desc: "The target player discards down to | |
}, | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "git.lubar.me/ben/spy-cards/card" | |
func main() { | |
var def card.Def | |
def.ID = card.Delilah | |
def.Effects = []*card.EffectDef{ | |
{ | |
ID: card.Delilah, | |
Name: "Delilah", | |
Description: `Delilah is a card that can be played to force a player to discard a card.`, | |
Target: card.TargetAny, | |
Action: card.ActDiscard, | |
Effect: card.EffectDiscard, | |
TargetValue: card.ValueAny, | |
Play: card.PlayDiscard, | |
}, | |
} | |
def.CanPlay = func(c card.Card, p card.Player, h card.CardHoster) bool { | |
return c.ID == card.Delilah | |
} | |
def.Play = func(c card.Card, p card.Player, h card.CardHoster) { | |
p.Discard(p.Hand[0]) | |
} | |
def.CanTarget = func(c card.Card, p card.Player, h card.CardHoster) bool { | |
return c.ID == card.Delilah | |
} | |
def.Target = func(c card.Card, p card.Player, h card.CardHoster) { | |
p.Discard(p.Hand[0]) | |
} | |
def.CanEffect = func(c card.Card, p card.Player, h card.CardHoster) bool { | |
return c.ID == card.Delilah | |
} | |
def.Effect = func(c card.Card, p card.Player, h card.CardHoster) { | |
p.Discard(p.Hand[0]) | |
} | |
def.CanPlayEffect = func(c card.Card, p card.Player, h card.CardHoster) bool { | |
return c.ID == card.Delilah | |
} | |
def.PlayEffect = func(c card.Card, p card.Player, h card.CardHoster) { | |
p.Discard(p.Hand[0]) | |
} | |
def.CanPlayTarget = func(c card.Card, p card.Player, h card.CardHoster) bool { | |
}, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment