diff --git a/cardobject/card.go b/cardobject/card.go index 6ce6ec9..23e2a82 100644 --- a/cardobject/card.go +++ b/cardobject/card.go @@ -19,6 +19,10 @@ func (c Card) ValidateTarget(t jsonschema.Targeting) error { return nil } +func (c Card) ValidateKeywordCount() error { + return nil +} + func (c Card) Validate() error { return c.ValidateType(c) } diff --git a/cardobject/class.go b/cardobject/class.go index cd03268..e835ec1 100644 --- a/cardobject/class.go +++ b/cardobject/class.go @@ -10,16 +10,16 @@ type ClassProvider interface { ClassRestriction() Class } -//CULTURE Class +// CULTURE Class const CULTURE jsonschema.Class = "CULTURE" -//NATURE Class +// NATURE Class const NATURE jsonschema.Class = "NATURE" -//MYSTICISM Class +// MYSTICISM Class const MYSTICISM jsonschema.Class = "MYSTICISM" -//TECHNOLOGY Class +// TECHNOLOGY Class const TECHNOLOGY jsonschema.Class = "TECHNOLOGY" type Class struct { diff --git a/cardobject/comparator.go b/cardobject/comparator.go index d83ae04..93b1aa0 100644 --- a/cardobject/comparator.go +++ b/cardobject/comparator.go @@ -7,22 +7,22 @@ import ( "github.com/DecentralCardGame/cardobject/jsonschema" ) -//Contains Comparator +// Contains Comparator const Contains = "CONTAINS" -//ContainsNot Comparator +// ContainsNot Comparator const ContainsNot = "CONTAINSNOT" -//Equal Comparator +// Equal Comparator const Equal = "EQUAL" -//Greater Comparator +// Greater Comparator const Greater = "GREATER" -//Lesser Comparator +// Lesser Comparator const Lesser = "LESSER" -//Uneaqual Comparator +// Uneaqual Comparator const Uneaqual = "UNEQUAL" var intComparators []string = []string{Equal, Greater, Lesser} diff --git a/cardobject/keyword.go b/cardobject/keyword.go index 519dd79..5a88db1 100644 --- a/cardobject/keyword.go +++ b/cardobject/keyword.go @@ -10,46 +10,46 @@ import ( const maxKeywordLength int = 10000 const minKeywordLength int = 0 -//Anthem Keyword +// Anthem Keyword const Anthem = "ANTHEM" -//Arm Keyword +// Arm Keyword const Arm = "ARM" -//Arrival Keyword +// Arrival Keyword const Arrival = "ARRIVAL" -//Battlecry Keyword +// Battlecry Keyword const Battlecry = "BATTLECRY" -//Harm Keyword +// Harm Keyword const Harm = "HARM" -//Kill Keyword +// Kill Keyword const Kill = "KILL" -//OnConstruction Keyword +// OnConstruction Keyword const OnConstruction = "ONCONSTRUCTION" -//OnDeath Keyword +// OnDeath Keyword const OnDeath = "ONDEATH" -//OnSpawn Keyword +// OnSpawn Keyword const OnSpawn = "ONSPAWN" -//Pay Keyword +// Pay Keyword const Pay = "PAY" -//Periodic Keyword +// Periodic Keyword const Periodic = "PERIODIC" -//Produce Keyword +// Produce Keyword const Produce = "PRODUCE" -//Repair Keyword +// Repair Keyword const Repair = "REPAIR" -//Tribute Keyword +// Tribute Keyword const Tribute = "TRIBUTE" type Keywords []Keyword diff --git a/cardobject/mode.go b/cardobject/mode.go index ad00a87..3bc153b 100644 --- a/cardobject/mode.go +++ b/cardobject/mode.go @@ -7,52 +7,52 @@ import ( "github.com/DecentralCardGame/cardobject/jsonschema" ) -//All Mode +// All Mode const All = "ALL" -//Changes Mode +// Changes Mode const Changes = "CHANGES" -//Chosen Action +// Chosen Action const ChosenAction = "CHOSENACTION" -//Chosen Entity +// Chosen Entity const ChosenEntity = "CHOSENENTITY" -//Chosen Place +// Chosen Place const ChosenPlace = "CHOSENPLACE" -//Decreases Mode +// Decreases Mode const Decreases = "DECREASES" -//Increases Mode +// Increases Mode const Increases = "INCREASES" -//Opponent Mode +// Opponent Mode const Opponent = "OPPONENT" -//Opponents Mode +// Opponents Mode const Opponents = "OPPONENTS" -//OpponentsChoice Mode +// OpponentsChoice Mode const OpponentsChoice = "OPPONENTSCHOICE" -//Owners Mode +// Owners Mode const Owners = "OWNERS" -//Random Mode +// Random Mode const Random = "RANDOM" -//Target Mode +// Target Mode const Target = "TARGET" -//This Mode +// This Mode const This = "THIS" -//You Mode +// You Mode const You = "YOU" -//Your Mode +// Your Mode const Your = "YOUR" var intChangeModes []string = []string{Increases, Decreases, Changes} diff --git a/cardobject/operator.go b/cardobject/operator.go index 2631445..32b27d9 100644 --- a/cardobject/operator.go +++ b/cardobject/operator.go @@ -7,19 +7,19 @@ import ( "github.com/DecentralCardGame/cardobject/jsonschema" ) -//Add Operator +// Add Operator const Add = "ADD" -//Gain Operator +// Gain Operator const Gain = "GAIN" -//Lose Operator +// Lose Operator const Lose = "LOSE" -//Set Operator +// Set Operator const Set = "SET" -//Subtract Operator +// Subtract Operator const Subtract = "SUBTRACT" var abilityEffectOperators []string = []string{Gain} diff --git a/cardobject/property.go b/cardobject/property.go index d5346ca..49af2af 100644 --- a/cardobject/property.go +++ b/cardobject/property.go @@ -7,28 +7,28 @@ import ( "github.com/DecentralCardGame/cardobject/jsonschema" ) -//BaseAttack Property +// BaseAttack Property const BaseAttack = "BASEATTACK" -//BaseCostSum Property +// BaseCostSum Property const BaseCostSum = "BASECOSTSUM" -//BaseHealth Property +// BaseHealth Property const BaseHealth = "BASEHEALTH" -//CurrentAttack Property +// CurrentAttack Property const CurrentAttack = "ATTACK" -//CurrentCostSum Property +// CurrentCostSum Property const CurrentCostSum = "COSTSUM" -//CurrentHealth Property +// CurrentHealth Property const CurrentHealth = "HEALTH" -//Name Property +// Name Property const Name = "NAME" -//Text Property +// Text Property const Text = "TEXT" var actionIntProperties []string = []string{BaseCostSum, CurrentCostSum} diff --git a/cardobject/timeEvent.go b/cardobject/timeEvent.go index 3a9a043..fb84a3b 100644 --- a/cardobject/timeEvent.go +++ b/cardobject/timeEvent.go @@ -7,10 +7,10 @@ import ( "github.com/DecentralCardGame/cardobject/jsonschema" ) -//Combat TimeEvent +// Combat TimeEvent const Combat = "COMBAT" -//Tickstart TimeEvent +// Tickstart TimeEvent const Tickstart = "TICKSTART" var timeEvents []string = []string{Combat, Tickstart} diff --git a/cardobject/token.go b/cardobject/token.go index af9fdfd..69b8fd4 100644 --- a/cardobject/token.go +++ b/cardobject/token.go @@ -7,13 +7,13 @@ import ( "github.com/DecentralCardGame/cardobject/jsonschema" ) -//Recruit Token +// Recruit Token const Recruit = "1/1 human Recruit" -//Bot Token +// Bot Token const Bot = "2/2 Bot" -//Beast Token +// Beast Token const Beast = "3/3 animal Beast" var tokenTypes []string = []string{Recruit, Bot, Beast} diff --git a/cardobject/variableNames.go b/cardobject/variableNames.go index 32fc4a5..ccc5231 100644 --- a/cardobject/variableNames.go +++ b/cardobject/variableNames.go @@ -7,28 +7,28 @@ import ( "github.com/DecentralCardGame/cardobject/jsonschema" ) -//XVar VariableName +// XVar VariableName const XVar = "X" -//YVar VariableName +// YVar VariableName const YVar = "Y" -//ZVar VariableName +// ZVar VariableName const ZVar = "Z" -//AVar VariableName +// AVar VariableName const AVar = "A" -//BVar VariableName +// BVar VariableName const BVar = "B" -//CVar VariableName +// CVar VariableName const CVar = "C" -//MVar VariableName +// MVar VariableName const MVar = "M" -//TVar VariableName +// TVar VariableName const TVar = "T" var intVariableNames []string = []string{XVar, YVar, ZVar} diff --git a/cardobject/zone.go b/cardobject/zone.go index 06e9bfd..fb488b1 100644 --- a/cardobject/zone.go +++ b/cardobject/zone.go @@ -7,25 +7,25 @@ import ( "github.com/DecentralCardGame/cardobject/jsonschema" ) -//AttackLane Zone +// AttackLane Zone const AttackLane = "ATTACKLANE" -//BlockLane Zone +// BlockLane Zone const BlockLane = "BLOCKLANE" -//Deck Zone +// Deck Zone const Deck = "DECK" -//Dustpile Zone +// Dustpile Zone const Dustpile = "DUSTPILE" -//Field Zone +// Field Zone const Field = "FIELD" -//Hand Zone +// Hand Zone const Hand = "HAND" -//Void Zone +// Void Zone const Void = "VOID" var dynamicZones []string = []string{Deck, Dustpile, Field, Hand} diff --git a/jsonschema/reflection_test.go b/jsonschema/reflection_test.go index a46304e..10dd22a 100644 --- a/jsonschema/reflection_test.go +++ b/jsonschema/reflection_test.go @@ -4,17 +4,19 @@ import ( "encoding/json" "errors" "io/ioutil" - "reflect" "testing" ) const Technology Class = "Technology" +type rootElem struct { +} + type cardObject struct { Action *action } -func (c cardObject) ValidateClasses(cb ClassBound) error { +func (r rootElem) ValidateClasses(cb ClassBound) error { s := cb.Classes() for _, v := range s { if v == Technology { @@ -24,22 +26,21 @@ func (c cardObject) ValidateClasses(cb ClassBound) error { return errors.New("Failed class validation") } -func (c cardObject) ValidateTarget(t Targeting) error { - ty, tm := t.Targets() - if tm == "THIS" { - for _, v := range ty { - if v == reflect.TypeOf(c).Name() { - return nil - } - } - return errors.New("Failed target validation") - } else { - return nil - } +func (r rootElem) ValidateKeywordCount() error { + return nil +} + +func (r rootElem) ValidateTarget(t Targeting) error { + return nil +} + +func (r rootElem) Validate() error { + return nil } func (c cardObject) Validate() error { - return c.ValidateType(c) + root := &rootElem{} + return c.ValidateType(root) } func (c cardObject) ValidateType(r RootElement) error { diff --git a/jsonschema/types.go b/jsonschema/types.go index dfe0ff5..e12e335 100644 --- a/jsonschema/types.go +++ b/jsonschema/types.go @@ -10,6 +10,7 @@ type RootElement interface { Validate() error ValidateClasses(ClassBound) error ValidateTarget(Targeting) error + ValidateKeywordCount() error } //ClassBound A Type that has a class restriction diff --git a/jsonschema/validation.go b/jsonschema/validation.go index 50c7439..77b95f1 100644 --- a/jsonschema/validation.go +++ b/jsonschema/validation.go @@ -43,7 +43,7 @@ func ValidateStruct(s structType, r RootElement) error { return CombineErrors(errorRange) } -//FindImplementer returns the non-nil field of a struct if it has exactly one +// FindImplementer returns the non-nil field of a struct if it has exactly one func FindImplementer(i interfaceType) (Validateable, error) { valueOfB := reflect.ValueOf(i) typeOfB := reflect.TypeOf(i) @@ -87,22 +87,22 @@ func ItemNameFromArray(array arrayType) string { return itemName } -//BasicEnum EnumTypes should be derived from BasicEnum +// BasicEnum EnumTypes should be derived from BasicEnum type BasicEnum string -//BasicString StringTypes should be derived from BasicString +// BasicString StringTypes should be derived from BasicString type BasicString string -//BasicInt IntTypes should be derived from BasicInt +// BasicInt IntTypes should be derived from BasicInt type BasicInt int -//BasicBool BoolTypes should be derived from BasicBool +// BasicBool BoolTypes should be derived from BasicBool type BasicBool bool -//Class ClassTypes should be derived from Class +// Class ClassTypes should be derived from Class type Class string -//TargetMode targeting modes should be derived from this class +// TargetMode targeting modes should be derived from this class type TargetMode BasicEnum func CombineErrors(errorRange []error) error { diff --git a/keywordedSchema.json b/keywordedSchema.json index 239f93e..475001b 100644 --- a/keywordedSchema.json +++ b/keywordedSchema.json @@ -1 +1 @@ -{"Card":{"$ref":"#/definitions/Card"},"definitions":{"AdditionalCost":{"type":"interface","name":"Additional Cost","description":"Choose a Additional Cost","children":{"SacrificeCost":{"$ref":"#/definitions/SacrificeCost"},"DiscardCost":{"$ref":"#/definitions/DiscardCost"},"VoidCost":{"$ref":"#/definitions/VoidCost"}}},"Attack":{"type":"int","name":"Attack","max":32},"BasicAmount":{"type":"int","name":"Basic Amount","max":32},"Card":{"type":"interface","name":"Card","description":"Choose a Card","children":{"Action":{"$ref":"#/definitions/action"},"Entity":{"$ref":"#/definitions/entity"},"Place":{"$ref":"#/definitions/place"},"Headquarter":{"$ref":"#/definitions/headquarter"}}},"CardMode":{"type":"enum","name":"Card Mode","enum":["ALL","THIS","RANDOM","TARGET"]},"CardName":{"type":"string","name":"Card Name","max":25,"min":1},"CardOppMode":{"type":"enum","name":"Card Opp Mode","enum":["ALL","RANDOM","TARGET"]},"CardType":{"type":"enum","name":"Card Type","enum":["ACTION","ENTITY","PLACE","HQ"]},"CastingCost":{"type":"int","name":"Casting Cost","max":64},"Class":{"type":"struct","name":"Class","description":"Build a Class","children":{"Nature":{"$ref":"#/definitions/Nature"},"Mysticism":{"$ref":"#/definitions/Mysticism"},"Technology":{"$ref":"#/definitions/Technology"},"Culture":{"$ref":"#/definitions/Culture"}},"required":["Nature","Mysticism","Technology","Culture"],"interactionText":"§Nature §Mysticism §Technology §Culture"},"Culture":{"type":"bool","name":"Culture"},"Delay":{"type":"int","name":"Delay","max":32,"min":1},"DiscardCost":{"type":"struct","name":"Discard Cost","description":"Build a Discard Cost","children":{"Amount":{"$ref":"#/definitions/BasicAmount"}},"required":["Amount"],"interactionText":"Discard §Amount card"},"DynamicZone":{"type":"enum","name":"Dynamic Zone","enum":["DECK","DUSTPILE","FIELD","HAND"]},"EntityMode":{"type":"enum","name":"Entity Mode","enum":["ALL","THIS","RANDOM","TARGET","CHOSENENTITY"]},"EntityOppMode":{"type":"enum","name":"Entity Opp Mode","enum":["ALL","RANDOM","TARGET","CHOSENENTITY"]},"FlavourText":{"type":"string","name":"Flavour Text","max":1000},"Health":{"type":"int","name":"Health","max":32},"IntValue":{"type":"interface","name":"Int Value","description":"Choose a Int Value","children":{"SimpleIntValue":{"$ref":"#/definitions/SimpleIntValue"},"IntVariable":{"$ref":"#/definitions/IntVariableName"}}},"IntVariableName":{"type":"enum","name":"Int Variable Name","enum":["X","Y","Z"]},"Keyword":{"type":"string","name":"Keyword","max":10000},"Keywords":{"type":"array","name":"Keywords","description":"Add some Keywords","children":{"Keyword":{"$ref":"#/definitions/Keyword"}},"max":3,"min":1},"Mysticism":{"type":"bool","name":"Mysticism"},"Nature":{"type":"bool","name":"Nature"},"PlaceMode":{"type":"enum","name":"Place Mode","enum":["ALL","THIS","RANDOM","TARGET","CHOSENPLACE"]},"PlaceOppMode":{"type":"enum","name":"Place Opp Mode","enum":["ALL","RANDOM","TARGET","CHOSENPLACE"]},"PlayerMode":{"type":"enum","name":"Player Mode","enum":["YOU","OPPONENT"]},"Rarity":{"type":"enum","name":"Rarity","enum":["COMMON","UNCOMMON","RARE"]},"SacrificeCost":{"type":"struct","name":"Sacrifice Cost","description":"Build a Sacrifice Cost","children":{"Amount":{"$ref":"#/definitions/BasicAmount"}},"required":["Amount"],"interactionText":"Sacrifice §Amount card"},"SimpleIntValue":{"type":"int","name":"Simple Int Value","max":32},"Tag":{"type":"enum","name":"Tag","enum":["AIR","ALCHEMIST","ANIMAL","ARTIFACT","ASSASSIN","BEAST","BELIEVER","BOT","BUILDING","COLOSSUS","DISASTER","DOMESTIC","DRAGON","EARTH","EPIC","EVENT","FACTORY","FIRE","HUMAN","KNOWLEDGE","LANDSCAPE","PLANT","REINFORCEMENT","WIZARD","SHRINE","SPIRIT","TACTIC","TECHNOCRAT","UNDEAD","VEHICLE","WARRIOR","WATER","WEAPON","WORKER"]},"Tags":{"type":"array","name":"Tags","description":"Add some Tags","children":{"Tag":{"$ref":"#/definitions/Tag"}},"max":3,"min":1},"Technology":{"type":"bool","name":"Technology"},"VoidCost":{"type":"struct","name":"Void Cost","description":"Build a Void Cost","children":{"Amount":{"$ref":"#/definitions/BasicAmount"}},"required":["Amount"],"interactionText":"Void §Amount card"},"abilities":{"type":"array","name":"Abilities","description":"Add some Abilities","children":{"Ability":{"$ref":"#/definitions/ability"}},"max":3},"ability":{"type":"interface","name":"Ability","description":"Choose a Ability","children":{"Arrival":{"$ref":"#/definitions/arrival"},"Avenge":{"$ref":"#/definitions/avenge"},"Battlecry":{"$ref":"#/definitions/battlecry"},"Channel":{"$ref":"#/definitions/channel"},"DiscardPay":{"$ref":"#/definitions/discardPay"},"Dismantle":{"$ref":"#/definitions/dismantle"},"Dissolve":{"$ref":"#/definitions/dissolve"},"Furious":{"$ref":"#/definitions/furious"},"Loot":{"$ref":"#/definitions/loot"},"OnConstruction":{"$ref":"#/definitions/onConstruction"},"OnDeath":{"$ref":"#/definitions/onDeath"},"OnSpawn":{"$ref":"#/definitions/onSpawn"},"Pay":{"$ref":"#/definitions/pay"},"Periodic":{"$ref":"#/definitions/periodic"},"Tribute":{"$ref":"#/definitions/tribute"}}},"action":{"type":"struct","name":"Action","description":"Build a Action","children":{"CardName":{"$ref":"#/definitions/CardName"},"CastingCost":{"$ref":"#/definitions/CastingCost"},"AdditionalCost":{"$ref":"#/definitions/AdditionalCost"},"Class":{"$ref":"#/definitions/Class"},"Effects":{"$ref":"#/definitions/effects"},"FlavourText":{"$ref":"#/definitions/FlavourText"},"Tags":{"$ref":"#/definitions/Tags"},"Keywords":{"$ref":"#/definitions/Keywords"},"Rarity":{"$ref":"#/definitions/Rarity"}},"required":["CardName","CastingCost","Class","Effects","FlavourText","Tags","Keywords"],"interactionText":"§CardName §CastingCost §AdditionalCost §Class §Effects §FlavourText §Tags §Keywords §RulesTexts §Rarity"},"anthem":{"type":"struct","name":"Anthem","description":"Anthem gives all friendly Entities with selected tag +1/+1.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"required":["Tag"],"interactionText":"Anthem §Tag."},"arm":{"type":"struct","name":"Arm","description":"Arm gives a friendly Entity +X/+X.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE","TECHNOLOGY"],"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Arm §Target §Amount."},"armor":{"type":"struct","name":"Armor","description":"Armor gives a friendly Entity +X Health permanently.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["NATURE","TECHNOLOGY"],"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Armor §Target §Amount."},"arrival":{"type":"struct","name":"Arrival","description":"When a friendly Entity is spawned, activate Effects","children":{"Effects":{"$ref":"#/definitions/effects"}},"classes":["CULTURE","NATURE"],"required":["Effects"],"interactionText":"Arrival: §Effects."},"avatar":{"type":"struct","name":"Avatar","description":"A X/X entity token.","children":{},"interactionText":"X/X avatar"},"avenge":{"type":"struct","name":"Avenge","description":"Whenever another of your Entity dies, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"Avenge: §Effects."},"battlecry":{"type":"struct","name":"Battlecry","description":"At the beginning of each Combat activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"Battlecry: §Effects."},"beast":{"type":"struct","name":"Beast","description":"A 3/3 entity token.","children":{},"classes":["NATURE"],"interactionText":"3/3 beast"},"bot":{"type":"struct","name":"Bot","description":"A 2/2 entity token.","children":{},"classes":["TECHNOLOGY"],"interactionText":"2/2 Bot"},"bounce":{"type":"struct","name":"Bounce","description":"Return selected Entities to your opponent's hand.","children":{"Target":{"$ref":"#/definitions/EntityOppMode"}},"classes":["TECHNOLOGY"],"required":["Target"],"interactionText":"Bounce §Target."},"burn":{"type":"struct","name":"Burn","description":"Deal X damage to the opposing HQ or an opposing Place.","children":{"Target":{"$ref":"#/definitions/PlaceOppMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"required":["Target","Amount"],"interactionText":"Burn §Target §Amount."},"channel":{"type":"struct","name":"Channel","description":"Whenever you play an Action, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"classes":["MYSTICISM","TECHNOLOGY"],"required":["Effects"],"interactionText":"Channel: §Effects."},"choose":{"type":"struct","name":"Choose","description":"Choose a card which is used for future effects.","children":{"Type":{"$ref":"#/definitions/CardType"},"Zone":{"$ref":"#/definitions/DynamicZone"}},"required":["Type","Zone"],"interactionText":"Choose a §Type in §Zone."},"count":{"type":"struct","name":"Count","description":"Count all cards on your board with a selected tag and save this number to X.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"required":["Tag"],"interactionText":"Count §Tag."},"countDust":{"type":"struct","name":"Count Dust","description":"Count all cards of a given type in your Dustpile.","children":{"CardType":{"$ref":"#/definitions/CardType"}},"classes":["MYSTICISM"],"interactionText":"Count §CardType."},"countPower":{"type":"struct","name":"Count Power","description":"Count the Attack of a friendly entity and save this number to X.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"classes":["NATURE"],"types":["ENTITY"],"required":["Target"],"interactionText":"CountPower of §Target."},"discard":{"type":"struct","name":"Discard","description":"You have to discard a card.","children":{},"classes":["MYSTICISM"],"interactionText":"Discard."},"discardPay":{"type":"struct","name":"Discard Pay","description":"Discard a card and pay Mana(optional) to activate Effects.","children":{"ManaAmount":{"$ref":"#/definitions/SimpleIntValue"},"Effects":{"$ref":"#/definitions/effects"}},"required":["ManaAmount","Effects"],"interactionText":"Discard, Pay §ManaAmount: §Effects."},"discountAction":{"type":"struct","name":"Discount Action","description":"Reduce Mana Cost of up to X Actions in your hand by 1.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["MYSTICISM"],"required":["Amount"],"interactionText":"Discount Action §Amount."},"discountEntity":{"type":"struct","name":"Discount Entity","description":"Reduce Mana Cost of up to X Entities in your hand by 1.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE"],"required":["Amount"],"interactionText":"Discount Entity §Amount."},"discountPlace":{"type":"struct","name":"Discount Place","description":"Reduce Mana Cost of up to X Places in your hand by 1.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["TECHNOLOGY"],"required":["Amount"],"interactionText":"Discount Place §Amount."},"dismantle":{"type":"struct","name":"Dismantle","description":"Sacrifice a friendly Place to activate Effects.","children":{"Target":{"$ref":"#/definitions/CardMode"},"Effects":{"$ref":"#/definitions/effects"}},"classes":["CULTURE","TECHNOLOGY"],"required":["Target","Effects"],"interactionText":"Dismantle §Target: §Effects."},"dissolve":{"type":"struct","name":"Dissolve","description":"Put cards from your Dustpile to the Void to activate Effects.","children":{"VoidAmount":{"$ref":"#/definitions/SimpleIntValue"},"Effects":{"$ref":"#/definitions/effects"}},"classes":["MYSTICISM","NATURE"],"required":["VoidAmount","Effects"],"interactionText":"Dissolve §VoidAmount: §Effects."},"drawAction":{"type":"struct","name":"Draw Action","description":"Draw an Action from your deck.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"classes":["MYSTICISM"],"interactionText":"Draw Action §Tag."},"drawEntity":{"type":"struct","name":"Draw Entity","description":"Draw an Entity from your deck.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"classes":["NATURE"],"interactionText":"Draw Entity §Tag."},"drawPlace":{"type":"struct","name":"Draw Place","description":"Draw a Place from your deck.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"classes":["TECHNOLOGY"],"interactionText":"Draw Place §Tag."},"effect":{"type":"interface","name":"Effect","description":"Choose a Effect","children":{"Anthem":{"$ref":"#/definitions/anthem"},"Arm":{"$ref":"#/definitions/arm"},"Armor":{"$ref":"#/definitions/armor"},"Bounce":{"$ref":"#/definitions/bounce"},"Burn":{"$ref":"#/definitions/burn"},"Choose":{"$ref":"#/definitions/choose"},"Count":{"$ref":"#/definitions/count"},"CountDust":{"$ref":"#/definitions/countDust"},"CountPower":{"$ref":"#/definitions/countPower"},"Discard":{"$ref":"#/definitions/discard"},"DiscountAction":{"$ref":"#/definitions/discountAction"},"DiscountEntity":{"$ref":"#/definitions/discountEntity"},"DiscountPlace":{"$ref":"#/definitions/discountPlace"},"DrawAction":{"$ref":"#/definitions/drawAction"},"DrawEntity":{"$ref":"#/definitions/drawEntity"},"DrawPlace":{"$ref":"#/definitions/drawPlace"},"Enrage":{"$ref":"#/definitions/enrage"},"Fortify":{"$ref":"#/definitions/fortify"},"Grind":{"$ref":"#/definitions/grind"},"Grow":{"$ref":"#/definitions/grow"},"Harm":{"$ref":"#/definitions/harm"},"Hasten":{"$ref":"#/definitions/hasten"},"Heal":{"$ref":"#/definitions/heal"},"Kill":{"$ref":"#/definitions/kill"},"Laneswap":{"$ref":"#/definitions/laneswap"},"Insight":{"$ref":"#/definitions/insight"},"Mill":{"$ref":"#/definitions/mill"},"Produce":{"$ref":"#/definitions/produce"},"Reassemble":{"$ref":"#/definitions/reassemble"},"RecoverAction":{"$ref":"#/definitions/recoverAction"},"RecoverEntity":{"$ref":"#/definitions/recoverEntity"},"RecoverPlace":{"$ref":"#/definitions/recoverPlace"},"Resurrect":{"$ref":"#/definitions/resurrect"},"Repair":{"$ref":"#/definitions/repair"},"Sacrifice":{"$ref":"#/definitions/sacrifice"},"Silence":{"$ref":"#/definitions/silence"},"Spawn":{"$ref":"#/definitions/spawn"},"Suffer":{"$ref":"#/definitions/suffer"},"Strengthen":{"$ref":"#/definitions/strengthen"},"Train":{"$ref":"#/definitions/train"},"Void":{"$ref":"#/definitions/void"},"Withdraw":{"$ref":"#/definitions/withdraw"}}},"effects":{"type":"array","name":"Effects","description":"Add some Effects","children":{"Effect":{"$ref":"#/definitions/effect"}},"max":3},"enrage":{"type":"struct","name":"Enrage","description":"Enraged Entity deals excess combat damage to places.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"required":["Target"],"interactionText":"Enrage §Target"},"entity":{"type":"struct","name":"Entity","description":"Build a Entity","children":{"CardName":{"$ref":"#/definitions/CardName"},"CastingCost":{"$ref":"#/definitions/CastingCost"},"AdditionalCost":{"$ref":"#/definitions/AdditionalCost"},"Class":{"$ref":"#/definitions/Class"},"Abilities":{"$ref":"#/definitions/abilities"},"Attack":{"$ref":"#/definitions/Attack"},"Health":{"$ref":"#/definitions/Health"},"FlavourText":{"$ref":"#/definitions/FlavourText"},"Tags":{"$ref":"#/definitions/Tags"},"Keywords":{"$ref":"#/definitions/Keywords"},"Rarity":{"$ref":"#/definitions/Rarity"}},"required":["CardName","CastingCost","Class","Abilities","Attack","Health","FlavourText","Tags","Keywords"],"interactionText":"§CardName §CastingCost §AdditionalCost §Class §Abilities §Attack §Health §FlavourText §Tags §Keywords §RulesTexts §Rarity"},"fortify":{"type":"struct","name":"Fortify","description":"Fortify adds X Health to friendly HQ.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["TECHNOLOGY","CULTURE"],"required":["Amount"],"interactionText":"Fortify §Amount."},"furious":{"type":"struct","name":"Furious","description":"Whenever this takes damage, activate effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"Furious: §Effects."},"grind":{"type":"struct","name":"Grind","description":"Deal X damage to a friendly place/HQ.","children":{"Target":{"$ref":"#/definitions/PlaceMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"types":["PLACE","HQ"],"required":["Target","Amount"],"interactionText":"Grind §Target §Amount."},"grow":{"type":"struct","name":"Grow","description":"Grow your HQ. 4 Growth increases its size by 1. The size of the HQ determines how much Mana you get at the beginning of a turn.","children":{"GrowthAmount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE","NATURE"],"required":["GrowthAmount"],"interactionText":"Grow §GrowthAmount."},"harm":{"type":"struct","name":"Harm","description":"Deal X damage to an opposing Entity.","children":{"Target":{"$ref":"#/definitions/EntityOppMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"required":["Target","Amount"],"interactionText":"Harm §Target §Amount."},"hasten":{"type":"struct","name":"Hasten","description":"Allow a friendly Entity's to attack the turn it is played.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"types":["ENTITY"],"required":["Target"],"interactionText":"Hasten §Target"},"headquarter":{"type":"struct","name":"Headquarter","description":"Build a Headquarter","children":{"CardName":{"$ref":"#/definitions/CardName"},"Class":{"$ref":"#/definitions/Class"},"Delay":{"$ref":"#/definitions/Delay"},"Abilities":{"$ref":"#/definitions/abilities"},"Health":{"$ref":"#/definitions/Health"},"FlavourText":{"$ref":"#/definitions/FlavourText"},"Tags":{"$ref":"#/definitions/Tags"},"Keywords":{"$ref":"#/definitions/Keywords"},"Rarity":{"$ref":"#/definitions/Rarity"}},"required":["CardName","Class","Delay","Abilities","Health","FlavourText","Tags","Keywords"],"interactionText":"§CardName §Class §Delay §Abilities §Health §Growth §StartingHandSize §Wisdom §FlavourText §Tags §Keywords §RulesTexts §Rarity"},"heal":{"type":"struct","name":"Heal","description":"Restore a friendly Entity's health to full life.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"classes":["MYSTICISM","NATURE"],"types":["ENTITY"],"required":["Target"],"interactionText":"Heal §Target"},"insight":{"type":"struct","name":"Insight","description":"Gain Wisdom. 4 Wisdom draws you a card.","children":{"WisdomAmount":{"$ref":"#/definitions/IntValue"}},"required":["WisdomAmount"],"interactionText":"Insight §WisdomAmount."},"kill":{"type":"struct","name":"Kill","description":"Put an opposing Entity from the Field in the Dustpile.","children":{"Target":{"$ref":"#/definitions/EntityOppMode"}},"classes":["MYSTICISM"],"required":["Target"],"interactionText":"Kill §Target"},"laneswap":{"type":"struct","name":"Laneswap","description":"Chosen Entities swap their lane.","children":{"Target":{"$ref":"#/definitions/EntityOppMode"}},"required":["Target"],"interactionText":"Laneswap §Target"},"loot":{"type":"struct","name":"Loot","description":"Whenever opposing place or HQ is damaged by 1 or more Entities in combat activate effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"classes":["CULTURE","NATURE"],"required":["Effects"],"interactionText":"Loot: §Effects."},"mill":{"type":"struct","name":"Mill","description":"Put cards from a player's Deck in the Dustpile.","children":{"Amount":{"$ref":"#/definitions/IntValue"},"Player":{"$ref":"#/definitions/PlayerMode"}},"classes":["MYSTICISM","TECHNOLOGY"],"required":["Amount","Player"],"interactionText":"Mill §Player §Amount."},"onConstruction":{"type":"struct","name":"On Construction","description":"Whenever another friendly Place is spawned, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"classes":["CULTURE","TECHNOLOGY"],"required":["Effects"],"interactionText":"OnConstruction: §Effects."},"onDeath":{"type":"struct","name":"On Death","description":"When this dies, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"OnDeath: §Effects."},"onSpawn":{"type":"struct","name":"On Spawn","description":"When this card is spawned, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"OnSpawn: §Effects."},"pay":{"type":"struct","name":"Pay","description":"Pay Mana to activate Effects.","children":{"ManaAmount":{"$ref":"#/definitions/IntValue"},"Effects":{"$ref":"#/definitions/effects"}},"required":["ManaAmount","Effects"],"interactionText":"Pay §ManaAmount: §Effects."},"periodic":{"type":"struct","name":"Periodic","description":"At the beginning of each round activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"Periodic: §Effects."},"place":{"type":"struct","name":"Place","description":"Build a Place","children":{"CardName":{"$ref":"#/definitions/CardName"},"CastingCost":{"$ref":"#/definitions/CastingCost"},"AdditionalCost":{"$ref":"#/definitions/AdditionalCost"},"Class":{"$ref":"#/definitions/Class"},"Abilities":{"$ref":"#/definitions/abilities"},"Health":{"$ref":"#/definitions/Health"},"FlavourText":{"$ref":"#/definitions/FlavourText"},"Tags":{"$ref":"#/definitions/Tags"},"Keywords":{"$ref":"#/definitions/Keywords"},"Rarity":{"$ref":"#/definitions/Rarity"}},"required":["CardName","CastingCost","Class","Abilities","Health","FlavourText","Tags","Keywords"],"interactionText":"§CardName §CastingCost §AdditionalCost §Class §Abilities §Health §FlavourText §Tags §Keywords §RulesTexts §Rarity"},"powerstone":{"type":"struct","name":"Powerstone","description":"A 1 health place token with Pay 2: Gain 4 Wisdom. Grind This 1. and Pay 1: Harm Target 1. Grind This 1.","children":{},"interactionText":"Powerstone"},"produce":{"type":"struct","name":"Produce","description":"Produce Mana.","children":{"ManaAmount":{"$ref":"#/definitions/IntValue"}},"classes":["NATURE","TECHNOLOGY"],"required":["ManaAmount"],"interactionText":"Produce §ManaAmount."},"reassemble":{"type":"struct","name":"Reassemble","description":"Return target Place from a Dustpile to your Field.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["TECHNOLOGY"],"required":["Amount"],"interactionText":"Reassemble lvl §Amount."},"recoverAction":{"type":"struct","name":"Recover Action","description":"Return target Action from your Dustpile to your Hand.","children":{},"classes":["MYSTICISM"],"interactionText":"Recover Action."},"recoverEntity":{"type":"struct","name":"Recover Entity","description":"Return target Entity from your Dustpile to your Hand.","children":{},"classes":["NATURE"],"interactionText":"Recover Entity."},"recoverPlace":{"type":"struct","name":"Recover Place","description":"Return target Place from your Dustpile to your Hand.","children":{},"classes":["TECHNOLOGY"],"interactionText":"Recover Place."},"recruit":{"type":"struct","name":"Recruit","description":"A 1/1 entity token.","children":{},"classes":["CULTURE"],"interactionText":"1/1 recruit"},"repair":{"type":"struct","name":"Repair","description":"Restore lost Health of a friendly Place or HQ.","children":{"Target":{"$ref":"#/definitions/PlaceMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE","TECHNOLOGY"],"types":["PLACE","HQ"],"required":["Target","Amount"],"interactionText":"Repair §Target §Amount."},"resurrect":{"type":"struct","name":"Resurrect","description":"Return target Entity from a Dustpile to your Field.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["MYSTICISM"],"required":["Amount"],"interactionText":"Resurrect lvl §Amount."},"sacrifice":{"type":"struct","name":"Sacrifice","description":"Put a friendly Entity from the Field in the Dustpile.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"types":["ENTITY"],"required":["Target"],"interactionText":"Sacrifice §Target"},"silence":{"type":"struct","name":"Silence","description":"Target Entity loses its abilities.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Player":{"$ref":"#/definitions/PlayerMode"}},"classes":["MYSTICISM"],"required":["Target","Player"],"interactionText":"Silence §Target §Player"},"spawn":{"type":"struct","name":"Spawn","description":"Spawns a number of selected Tokens.","children":{"Token":{"$ref":"#/definitions/token"},"Amount":{"$ref":"#/definitions/IntValue"}},"required":["Token","Amount"],"interactionText":"Spawn §Amount §Token."},"spirit":{"type":"struct","name":"Spirit","description":"A 1/1 entity token with OnDeath: Insight 1.","children":{},"classes":["MYSTICISM"],"interactionText":"1/1 spirit"},"strengthen":{"type":"struct","name":"Strengthen","description":"Strengthen gives a friendly Entity +X attack permanently.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["MYSTICISM","NATURE"],"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Strengthen §Target §Amount."},"suffer":{"type":"struct","name":"Suffer","description":"Deal X damage to a friendly Entity.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Suffer §Target §Amount."},"token":{"type":"interface","name":"Token","description":"Choose a Token","children":{"Avatar":{"$ref":"#/definitions/avatar"},"Beast":{"$ref":"#/definitions/beast"},"Bot":{"$ref":"#/definitions/bot"},"Powerstone":{"$ref":"#/definitions/powerstone"},"Recruit":{"$ref":"#/definitions/recruit"},"Spirit":{"$ref":"#/definitions/spirit"}}},"train":{"type":"struct","name":"Train","description":"Train gives a friendly Entity in your Hand +X/+X.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE"],"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Train §Target §Amount."},"tribute":{"type":"struct","name":"Tribute","description":"Sacrifice a friendly Entity to activate Effects.","children":{"Target":{"$ref":"#/definitions/CardMode"},"Effects":{"$ref":"#/definitions/effects"}},"required":["Target","Effects"],"interactionText":"Tribute §Target: §Effects."},"void":{"type":"struct","name":"Void","description":"Put opposing cards from the Dustpile in the Void.","children":{"Target":{"$ref":"#/definitions/CardOppMode"}},"classes":["MYSTICISM","NATURE"],"required":["Target"],"interactionText":"Void §Target"},"withdraw":{"type":"struct","name":"Withdraw","description":"Return Entities from the Field to your Hand.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"classes":["MYSTICISM","CULTURE"],"types":["ENTITY"],"required":["Target"],"interactionText":"Withdraw §Target."}}} \ No newline at end of file +{"Card":{"$ref":"#/definitions/Card"},"definitions":{"AdditionalCost":{"type":"interface","name":"Additional Cost","description":"Choose a Additional Cost","children":{"SacrificeCost":{"$ref":"#/definitions/SacrificeCost"},"DiscardCost":{"$ref":"#/definitions/DiscardCost"},"VoidCost":{"$ref":"#/definitions/VoidCost"}}},"Attack":{"type":"int","name":"Attack","max":32},"BasicAmount":{"type":"int","name":"Basic Amount","max":32},"Card":{"type":"interface","name":"Card","description":"Choose a Card","children":{"Action":{"$ref":"#/definitions/action"},"Entity":{"$ref":"#/definitions/entity"},"Place":{"$ref":"#/definitions/place"},"Headquarter":{"$ref":"#/definitions/headquarter"}}},"CardMode":{"type":"enum","name":"Card Mode","enum":["ALL","THIS","RANDOM","TARGET"]},"CardName":{"type":"string","name":"Card Name","max":25,"min":1},"CardOppMode":{"type":"enum","name":"Card Opp Mode","enum":["ALL","RANDOM","TARGET"]},"CardType":{"type":"enum","name":"Card Type","enum":["ACTION","ENTITY","PLACE","HQ"]},"CastingCost":{"type":"int","name":"Casting Cost","max":64},"Class":{"type":"struct","name":"Class","description":"Build a Class","children":{"Nature":{"$ref":"#/definitions/Nature"},"Mysticism":{"$ref":"#/definitions/Mysticism"},"Technology":{"$ref":"#/definitions/Technology"},"Culture":{"$ref":"#/definitions/Culture"}},"required":["Nature","Mysticism","Technology","Culture"],"interactionText":"§Nature §Mysticism §Technology §Culture"},"Culture":{"type":"bool","name":"Culture"},"Delay":{"type":"int","name":"Delay","max":32,"min":1},"DiscardCost":{"type":"struct","name":"Discard Cost","description":"Build a Discard Cost","children":{"Amount":{"$ref":"#/definitions/BasicAmount"}},"required":["Amount"],"interactionText":"Discard §Amount card"},"DynamicZone":{"type":"enum","name":"Dynamic Zone","enum":["DECK","DUSTPILE","FIELD","HAND"]},"EntityMode":{"type":"enum","name":"Entity Mode","enum":["ALL","THIS","RANDOM","TARGET","CHOSENENTITY"]},"EntityOppMode":{"type":"enum","name":"Entity Opp Mode","enum":["ALL","RANDOM","TARGET","CHOSENENTITY"]},"FlavourText":{"type":"string","name":"Flavour Text","max":1000},"Health":{"type":"int","name":"Health","max":32},"IntValue":{"type":"interface","name":"Int Value","description":"Choose a Int Value","children":{"SimpleIntValue":{"$ref":"#/definitions/SimpleIntValue"},"IntVariable":{"$ref":"#/definitions/IntVariableName"}}},"IntVariableName":{"type":"enum","name":"Int Variable Name","enum":["X","Y","Z"]},"Keyword":{"type":"string","name":"Keyword","max":10000},"Keywords":{"type":"array","name":"Keywords","description":"Add some Keywords","children":{"Keyword":{"$ref":"#/definitions/Keyword"}},"max":3,"min":1},"Mysticism":{"type":"bool","name":"Mysticism"},"Nature":{"type":"bool","name":"Nature"},"PlaceMode":{"type":"enum","name":"Place Mode","enum":["ALL","THIS","RANDOM","TARGET","CHOSENPLACE"]},"PlaceOppMode":{"type":"enum","name":"Place Opp Mode","enum":["ALL","RANDOM","TARGET","CHOSENPLACE"]},"PlayerMode":{"type":"enum","name":"Player Mode","enum":["YOU","OPPONENT"]},"Rarity":{"type":"enum","name":"Rarity","enum":["COMMON","UNCOMMON","RARE"]},"SacrificeCost":{"type":"struct","name":"Sacrifice Cost","description":"Build a Sacrifice Cost","children":{"Amount":{"$ref":"#/definitions/BasicAmount"}},"required":["Amount"],"interactionText":"Sacrifice §Amount card"},"SimpleIntValue":{"type":"int","name":"Simple Int Value","max":32},"Tag":{"type":"enum","name":"Tag","enum":["AIR","ALCHEMIST","ANIMAL","ARTIFACT","ASSASSIN","BEAST","BELIEVER","BOT","BUILDING","COLOSSUS","DISASTER","DOMESTIC","DRAGON","EARTH","EPIC","EVENT","FACTORY","FIRE","HUMAN","KNOWLEDGE","LANDSCAPE","PLANT","REINFORCEMENT","WIZARD","SHRINE","SPIRIT","TACTIC","TECHNOCRAT","UNDEAD","VEHICLE","WARRIOR","WATER","WEAPON","WORKER"]},"Tags":{"type":"array","name":"Tags","description":"Add some Tags","children":{"Tag":{"$ref":"#/definitions/Tag"}},"max":3,"min":1},"Technology":{"type":"bool","name":"Technology"},"VoidCost":{"type":"struct","name":"Void Cost","description":"Build a Void Cost","children":{"Amount":{"$ref":"#/definitions/BasicAmount"}},"required":["Amount"],"interactionText":"Void §Amount card"},"abilities":{"type":"array","name":"Abilities","description":"Add some Abilities","children":{"Ability":{"$ref":"#/definitions/ability"}},"max":3},"ability":{"type":"interface","name":"Ability","description":"Choose a Ability","children":{"Arrival":{"$ref":"#/definitions/arrival"},"Avenge":{"$ref":"#/definitions/avenge"},"Battlecry":{"$ref":"#/definitions/battlecry"},"Channel":{"$ref":"#/definitions/channel"},"DiscardPay":{"$ref":"#/definitions/discardPay"},"Dismantle":{"$ref":"#/definitions/dismantle"},"Dissolve":{"$ref":"#/definitions/dissolve"},"Furious":{"$ref":"#/definitions/furious"},"Loot":{"$ref":"#/definitions/loot"},"OnConstruction":{"$ref":"#/definitions/onConstruction"},"OnDeath":{"$ref":"#/definitions/onDeath"},"OnSpawn":{"$ref":"#/definitions/onSpawn"},"Pay":{"$ref":"#/definitions/pay"},"Periodic":{"$ref":"#/definitions/periodic"},"Tribute":{"$ref":"#/definitions/tribute"}}},"action":{"type":"struct","name":"Action","description":"Build a Action","children":{"CardName":{"$ref":"#/definitions/CardName"},"CastingCost":{"$ref":"#/definitions/CastingCost"},"AdditionalCost":{"$ref":"#/definitions/AdditionalCost"},"Class":{"$ref":"#/definitions/Class"},"Effects":{"$ref":"#/definitions/effects"},"FlavourText":{"$ref":"#/definitions/FlavourText"},"Tags":{"$ref":"#/definitions/Tags"},"Keywords":{"$ref":"#/definitions/Keywords"},"Rarity":{"$ref":"#/definitions/Rarity"}},"required":["CardName","CastingCost","Class","Effects","FlavourText","Tags","Keywords"],"interactionText":"§CardName §CastingCost §AdditionalCost §Class §Effects §FlavourText §Tags §Keywords §RulesTexts §Rarity"},"anthem":{"type":"struct","name":"Anthem","description":"Anthem gives all friendly Entities with selected tag +1/+1.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"required":["Tag"],"interactionText":"Anthem §Tag."},"arm":{"type":"struct","name":"Arm","description":"Arm gives a friendly Entity +X/+X.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE","TECHNOLOGY"],"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Arm §Target §Amount."},"armor":{"type":"struct","name":"Armor","description":"Armor gives a friendly Entity +X Health permanently.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["NATURE","TECHNOLOGY"],"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Armor §Target §Amount."},"arrival":{"type":"struct","name":"Arrival","description":"When a friendly Entity is spawned, activate Effects","children":{"Effects":{"$ref":"#/definitions/effects"}},"classes":["CULTURE","NATURE"],"required":["Effects"],"interactionText":"Arrival: §Effects."},"avatar":{"type":"struct","name":"Avatar","description":"A X/X entity token.","children":{},"interactionText":"X/X avatar"},"avenge":{"type":"struct","name":"Avenge","description":"Whenever another of your Entity dies, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"Avenge: §Effects."},"battlecry":{"type":"struct","name":"Battlecry","description":"At the beginning of each Combat activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"Battlecry: §Effects."},"beast":{"type":"struct","name":"Beast","description":"A 3/3 entity token.","children":{},"classes":["NATURE"],"interactionText":"3/3 beast"},"bot":{"type":"struct","name":"Bot","description":"A 2/2 entity token.","children":{},"classes":["TECHNOLOGY"],"interactionText":"2/2 Bot"},"bounce":{"type":"struct","name":"Bounce","description":"Return selected Entities to your opponent's hand.","children":{"Target":{"$ref":"#/definitions/EntityOppMode"}},"classes":["TECHNOLOGY"],"required":["Target"],"interactionText":"Bounce §Target."},"burn":{"type":"struct","name":"Burn","description":"Deal X damage to the opposing HQ or an opposing Place.","children":{"Target":{"$ref":"#/definitions/PlaceOppMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"required":["Target","Amount"],"interactionText":"Burn §Target §Amount."},"channel":{"type":"struct","name":"Channel","description":"Whenever you play an Action, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"classes":["MYSTICISM","TECHNOLOGY"],"required":["Effects"],"interactionText":"Channel: §Effects."},"choose":{"type":"struct","name":"Choose","description":"Choose a card which is used for future effects.","children":{"Type":{"$ref":"#/definitions/CardType"},"Zone":{"$ref":"#/definitions/DynamicZone"}},"required":["Type","Zone"],"interactionText":"Choose a §Type in §Zone."},"count":{"type":"struct","name":"Count","description":"Count all cards on your board with a selected tag and save this number to X.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"required":["Tag"],"interactionText":"Count §Tag."},"countDust":{"type":"struct","name":"Count Dust","description":"Count all cards of a given type in your Dustpile.","children":{"CardType":{"$ref":"#/definitions/CardType"}},"classes":["MYSTICISM"],"interactionText":"Count §CardType."},"countPower":{"type":"struct","name":"Count Power","description":"Count the Attack of a friendly entity and save this number to X.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"classes":["NATURE"],"types":["ENTITY"],"required":["Target"],"interactionText":"CountPower of §Target."},"discard":{"type":"struct","name":"Discard","description":"You have to discard a card.","children":{},"classes":["MYSTICISM"],"interactionText":"Discard."},"discardPay":{"type":"struct","name":"Discard Pay","description":"Discard a card and pay Mana(optional) to activate Effects.","children":{"ManaAmount":{"$ref":"#/definitions/SimpleIntValue"},"Effects":{"$ref":"#/definitions/effects"}},"required":["ManaAmount","Effects"],"interactionText":"Discard, Pay §ManaAmount: §Effects."},"discountAction":{"type":"struct","name":"Discount Action","description":"Reduce Mana Cost of up to X Actions in your hand by 1.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["MYSTICISM"],"required":["Amount"],"interactionText":"Discount Action §Amount."},"discountEntity":{"type":"struct","name":"Discount Entity","description":"Reduce Mana Cost of up to X Entities in your hand by 1.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE"],"required":["Amount"],"interactionText":"Discount Entity §Amount."},"discountPlace":{"type":"struct","name":"Discount Place","description":"Reduce Mana Cost of up to X Places in your hand by 1.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["TECHNOLOGY"],"required":["Amount"],"interactionText":"Discount Place §Amount."},"dismantle":{"type":"struct","name":"Dismantle","description":"Sacrifice a friendly Place to activate Effects.","children":{"Target":{"$ref":"#/definitions/CardMode"},"Effects":{"$ref":"#/definitions/effects"}},"classes":["CULTURE","TECHNOLOGY"],"required":["Target","Effects"],"interactionText":"Dismantle §Target: §Effects."},"dissolve":{"type":"struct","name":"Dissolve","description":"Put cards from your Dustpile to the Void to activate Effects.","children":{"VoidAmount":{"$ref":"#/definitions/SimpleIntValue"},"Effects":{"$ref":"#/definitions/effects"}},"classes":["MYSTICISM","NATURE"],"required":["VoidAmount","Effects"],"interactionText":"Dissolve §VoidAmount: §Effects."},"drawAction":{"type":"struct","name":"Draw Action","description":"Draw an Action from your deck.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"classes":["MYSTICISM"],"interactionText":"Draw Action §Tag."},"drawEntity":{"type":"struct","name":"Draw Entity","description":"Draw an Entity from your deck.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"classes":["NATURE"],"interactionText":"Draw Entity §Tag."},"drawPlace":{"type":"struct","name":"Draw Place","description":"Draw a Place from your deck.","children":{"Tag":{"$ref":"#/definitions/Tag"}},"classes":["TECHNOLOGY"],"interactionText":"Draw Place §Tag."},"effect":{"type":"interface","name":"Effect","description":"Choose a Effect","children":{"Anthem":{"$ref":"#/definitions/anthem"},"Arm":{"$ref":"#/definitions/arm"},"Armor":{"$ref":"#/definitions/armor"},"Bounce":{"$ref":"#/definitions/bounce"},"Burn":{"$ref":"#/definitions/burn"},"Choose":{"$ref":"#/definitions/choose"},"Count":{"$ref":"#/definitions/count"},"CountDust":{"$ref":"#/definitions/countDust"},"CountPower":{"$ref":"#/definitions/countPower"},"Discard":{"$ref":"#/definitions/discard"},"DiscountAction":{"$ref":"#/definitions/discountAction"},"DiscountEntity":{"$ref":"#/definitions/discountEntity"},"DiscountPlace":{"$ref":"#/definitions/discountPlace"},"DrawAction":{"$ref":"#/definitions/drawAction"},"DrawEntity":{"$ref":"#/definitions/drawEntity"},"DrawPlace":{"$ref":"#/definitions/drawPlace"},"Enrage":{"$ref":"#/definitions/enrage"},"Fortify":{"$ref":"#/definitions/fortify"},"Grind":{"$ref":"#/definitions/grind"},"Grow":{"$ref":"#/definitions/grow"},"Harm":{"$ref":"#/definitions/harm"},"Hasten":{"$ref":"#/definitions/hasten"},"Heal":{"$ref":"#/definitions/heal"},"Kill":{"$ref":"#/definitions/kill"},"Laneswap":{"$ref":"#/definitions/laneswap"},"Insight":{"$ref":"#/definitions/insight"},"Mill":{"$ref":"#/definitions/mill"},"Produce":{"$ref":"#/definitions/produce"},"Reassemble":{"$ref":"#/definitions/reassemble"},"RecoverAction":{"$ref":"#/definitions/recoverAction"},"RecoverEntity":{"$ref":"#/definitions/recoverEntity"},"RecoverPlace":{"$ref":"#/definitions/recoverPlace"},"Resurrect":{"$ref":"#/definitions/resurrect"},"Repair":{"$ref":"#/definitions/repair"},"Sacrifice":{"$ref":"#/definitions/sacrifice"},"Silence":{"$ref":"#/definitions/silence"},"Spawn":{"$ref":"#/definitions/spawn"},"Suffer":{"$ref":"#/definitions/suffer"},"Strengthen":{"$ref":"#/definitions/strengthen"},"Train":{"$ref":"#/definitions/train"},"Void":{"$ref":"#/definitions/void"},"Withdraw":{"$ref":"#/definitions/withdraw"}}},"effects":{"type":"array","name":"Effects","description":"Add some Effects","children":{"Effect":{"$ref":"#/definitions/effect"}},"max":8},"enrage":{"type":"struct","name":"Enrage","description":"Enraged Entity deals excess combat damage to places.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"required":["Target"],"interactionText":"Enrage §Target"},"entity":{"type":"struct","name":"Entity","description":"Build a Entity","children":{"CardName":{"$ref":"#/definitions/CardName"},"CastingCost":{"$ref":"#/definitions/CastingCost"},"AdditionalCost":{"$ref":"#/definitions/AdditionalCost"},"Class":{"$ref":"#/definitions/Class"},"Abilities":{"$ref":"#/definitions/abilities"},"Attack":{"$ref":"#/definitions/Attack"},"Health":{"$ref":"#/definitions/Health"},"FlavourText":{"$ref":"#/definitions/FlavourText"},"Tags":{"$ref":"#/definitions/Tags"},"Keywords":{"$ref":"#/definitions/Keywords"},"Rarity":{"$ref":"#/definitions/Rarity"}},"required":["CardName","CastingCost","Class","Abilities","Attack","Health","FlavourText","Tags","Keywords"],"interactionText":"§CardName §CastingCost §AdditionalCost §Class §Abilities §Attack §Health §FlavourText §Tags §Keywords §RulesTexts §Rarity"},"fortify":{"type":"struct","name":"Fortify","description":"Fortify adds X Health to friendly HQ.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["TECHNOLOGY","CULTURE"],"required":["Amount"],"interactionText":"Fortify §Amount."},"furious":{"type":"struct","name":"Furious","description":"Whenever this takes damage, activate effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"Furious: §Effects."},"grind":{"type":"struct","name":"Grind","description":"Deal X damage to a friendly place/HQ.","children":{"Target":{"$ref":"#/definitions/PlaceMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"types":["PLACE","HQ"],"required":["Target","Amount"],"interactionText":"Grind §Target §Amount."},"grow":{"type":"struct","name":"Grow","description":"Grow your HQ. 4 Growth increases its size by 1. The size of the HQ determines how much Mana you get at the beginning of a turn.","children":{"GrowthAmount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE","NATURE"],"required":["GrowthAmount"],"interactionText":"Grow §GrowthAmount."},"harm":{"type":"struct","name":"Harm","description":"Deal X damage to an opposing Entity.","children":{"Target":{"$ref":"#/definitions/EntityOppMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"required":["Target","Amount"],"interactionText":"Harm §Target §Amount."},"hasten":{"type":"struct","name":"Hasten","description":"Allow a friendly Entity's to attack the turn it is played.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"types":["ENTITY"],"required":["Target"],"interactionText":"Hasten §Target"},"headquarter":{"type":"struct","name":"Headquarter","description":"Build a Headquarter","children":{"CardName":{"$ref":"#/definitions/CardName"},"Class":{"$ref":"#/definitions/Class"},"Delay":{"$ref":"#/definitions/Delay"},"Abilities":{"$ref":"#/definitions/abilities"},"Health":{"$ref":"#/definitions/Health"},"FlavourText":{"$ref":"#/definitions/FlavourText"},"Tags":{"$ref":"#/definitions/Tags"},"Keywords":{"$ref":"#/definitions/Keywords"},"Rarity":{"$ref":"#/definitions/Rarity"}},"required":["CardName","Class","Delay","Abilities","Health","FlavourText","Tags","Keywords"],"interactionText":"§CardName §Class §Delay §Abilities §Health §Growth §StartingHandSize §Wisdom §FlavourText §Tags §Keywords §RulesTexts §Rarity"},"heal":{"type":"struct","name":"Heal","description":"Restore a friendly Entity's health to full life.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"classes":["MYSTICISM","NATURE"],"types":["ENTITY"],"required":["Target"],"interactionText":"Heal §Target"},"insight":{"type":"struct","name":"Insight","description":"Gain Wisdom. 4 Wisdom draws you a card.","children":{"WisdomAmount":{"$ref":"#/definitions/IntValue"}},"required":["WisdomAmount"],"interactionText":"Insight §WisdomAmount."},"kill":{"type":"struct","name":"Kill","description":"Put an opposing Entity from the Field in the Dustpile.","children":{"Target":{"$ref":"#/definitions/EntityOppMode"}},"classes":["MYSTICISM"],"required":["Target"],"interactionText":"Kill §Target"},"laneswap":{"type":"struct","name":"Laneswap","description":"Chosen Entities swap their lane.","children":{"Target":{"$ref":"#/definitions/EntityOppMode"}},"required":["Target"],"interactionText":"Laneswap §Target"},"loot":{"type":"struct","name":"Loot","description":"Whenever opposing place or HQ is damaged by 1 or more Entities in combat activate effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"classes":["CULTURE","NATURE"],"required":["Effects"],"interactionText":"Loot: §Effects."},"mill":{"type":"struct","name":"Mill","description":"Put cards from a player's Deck in the Dustpile.","children":{"Amount":{"$ref":"#/definitions/IntValue"},"Player":{"$ref":"#/definitions/PlayerMode"}},"classes":["MYSTICISM","TECHNOLOGY"],"required":["Amount","Player"],"interactionText":"Mill §Player §Amount."},"onConstruction":{"type":"struct","name":"On Construction","description":"Whenever another friendly Place is spawned, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"classes":["CULTURE","TECHNOLOGY"],"required":["Effects"],"interactionText":"OnConstruction: §Effects."},"onDeath":{"type":"struct","name":"On Death","description":"When this dies, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"OnDeath: §Effects."},"onSpawn":{"type":"struct","name":"On Spawn","description":"When this card is spawned, activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"OnSpawn: §Effects."},"pay":{"type":"struct","name":"Pay","description":"Pay Mana to activate Effects.","children":{"ManaAmount":{"$ref":"#/definitions/IntValue"},"Effects":{"$ref":"#/definitions/effects"}},"required":["ManaAmount","Effects"],"interactionText":"Pay §ManaAmount: §Effects."},"periodic":{"type":"struct","name":"Periodic","description":"At the beginning of each round activate Effects.","children":{"Effects":{"$ref":"#/definitions/effects"}},"required":["Effects"],"interactionText":"Periodic: §Effects."},"place":{"type":"struct","name":"Place","description":"Build a Place","children":{"CardName":{"$ref":"#/definitions/CardName"},"CastingCost":{"$ref":"#/definitions/CastingCost"},"AdditionalCost":{"$ref":"#/definitions/AdditionalCost"},"Class":{"$ref":"#/definitions/Class"},"Abilities":{"$ref":"#/definitions/abilities"},"Health":{"$ref":"#/definitions/Health"},"FlavourText":{"$ref":"#/definitions/FlavourText"},"Tags":{"$ref":"#/definitions/Tags"},"Keywords":{"$ref":"#/definitions/Keywords"},"Rarity":{"$ref":"#/definitions/Rarity"}},"required":["CardName","CastingCost","Class","Abilities","Health","FlavourText","Tags","Keywords"],"interactionText":"§CardName §CastingCost §AdditionalCost §Class §Abilities §Health §FlavourText §Tags §Keywords §RulesTexts §Rarity"},"powerstone":{"type":"struct","name":"Powerstone","description":"A 1 health place token with Pay 2: Gain 4 Wisdom. Grind This 1. and Pay 1: Harm Target 1. Grind This 1.","children":{},"interactionText":"Powerstone"},"produce":{"type":"struct","name":"Produce","description":"Produce Mana.","children":{"ManaAmount":{"$ref":"#/definitions/IntValue"}},"classes":["NATURE","TECHNOLOGY"],"required":["ManaAmount"],"interactionText":"Produce §ManaAmount."},"reassemble":{"type":"struct","name":"Reassemble","description":"Return target Place from a Dustpile to your Field.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["TECHNOLOGY"],"required":["Amount"],"interactionText":"Reassemble lvl §Amount."},"recoverAction":{"type":"struct","name":"Recover Action","description":"Return target Action from your Dustpile to your Hand.","children":{},"classes":["MYSTICISM"],"interactionText":"Recover Action."},"recoverEntity":{"type":"struct","name":"Recover Entity","description":"Return target Entity from your Dustpile to your Hand.","children":{},"classes":["NATURE"],"interactionText":"Recover Entity."},"recoverPlace":{"type":"struct","name":"Recover Place","description":"Return target Place from your Dustpile to your Hand.","children":{},"classes":["TECHNOLOGY"],"interactionText":"Recover Place."},"recruit":{"type":"struct","name":"Recruit","description":"A 1/1 entity token.","children":{},"classes":["CULTURE"],"interactionText":"1/1 recruit"},"repair":{"type":"struct","name":"Repair","description":"Restore lost Health of a friendly Place or HQ.","children":{"Target":{"$ref":"#/definitions/PlaceMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE","TECHNOLOGY"],"types":["PLACE","HQ"],"required":["Target","Amount"],"interactionText":"Repair §Target §Amount."},"resurrect":{"type":"struct","name":"Resurrect","description":"Return target Entity from a Dustpile to your Field.","children":{"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["MYSTICISM"],"required":["Amount"],"interactionText":"Resurrect lvl §Amount."},"sacrifice":{"type":"struct","name":"Sacrifice","description":"Put a friendly Entity from the Field in the Dustpile.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"types":["ENTITY"],"required":["Target"],"interactionText":"Sacrifice §Target"},"silence":{"type":"struct","name":"Silence","description":"Target Entity loses its abilities.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Player":{"$ref":"#/definitions/PlayerMode"}},"classes":["MYSTICISM"],"required":["Target","Player"],"interactionText":"Silence §Target §Player"},"spawn":{"type":"struct","name":"Spawn","description":"Spawns a number of selected Tokens.","children":{"Token":{"$ref":"#/definitions/token"},"Amount":{"$ref":"#/definitions/IntValue"}},"required":["Token","Amount"],"interactionText":"Spawn §Amount §Token."},"spirit":{"type":"struct","name":"Spirit","description":"A 1/1 entity token with OnDeath: Insight 1.","children":{},"classes":["MYSTICISM"],"interactionText":"1/1 spirit"},"strengthen":{"type":"struct","name":"Strengthen","description":"Strengthen gives a friendly Entity +X attack permanently.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["MYSTICISM","NATURE"],"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Strengthen §Target §Amount."},"suffer":{"type":"struct","name":"Suffer","description":"Deal X damage to a friendly Entity.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Suffer §Target §Amount."},"token":{"type":"interface","name":"Token","description":"Choose a Token","children":{"Avatar":{"$ref":"#/definitions/avatar"},"Beast":{"$ref":"#/definitions/beast"},"Bot":{"$ref":"#/definitions/bot"},"Powerstone":{"$ref":"#/definitions/powerstone"},"Recruit":{"$ref":"#/definitions/recruit"},"Spirit":{"$ref":"#/definitions/spirit"}}},"train":{"type":"struct","name":"Train","description":"Train gives a friendly Entity in your Hand +X/+X.","children":{"Target":{"$ref":"#/definitions/EntityMode"},"Amount":{"$ref":"#/definitions/IntValue"}},"classes":["CULTURE"],"types":["ENTITY"],"required":["Target","Amount"],"interactionText":"Train §Target §Amount."},"tribute":{"type":"struct","name":"Tribute","description":"Sacrifice a friendly Entity to activate Effects.","children":{"Target":{"$ref":"#/definitions/CardMode"},"Effects":{"$ref":"#/definitions/effects"}},"required":["Target","Effects"],"interactionText":"Tribute §Target: §Effects."},"void":{"type":"struct","name":"Void","description":"Put opposing cards from the Dustpile in the Void.","children":{"Target":{"$ref":"#/definitions/CardOppMode"}},"classes":["MYSTICISM","NATURE"],"required":["Target"],"interactionText":"Void §Target"},"withdraw":{"type":"struct","name":"Withdraw","description":"Return Entities from the Field to your Hand.","children":{"Target":{"$ref":"#/definitions/EntityMode"}},"classes":["MYSTICISM","CULTURE"],"types":["ENTITY"],"required":["Target"],"interactionText":"Withdraw §Target."}}} \ No newline at end of file diff --git a/keywords/ability.go b/keywords/ability.go index 8918fe0..0c1bd8e 100644 --- a/keywords/ability.go +++ b/keywords/ability.go @@ -48,6 +48,10 @@ func (a ability) ValidateType(r jsonschema.RootElement) error { if err != nil { return err } + err = r.ValidateKeywordCount() + if err != nil { + return err + } return implementer.ValidateType(r) } diff --git a/keywords/card.go b/keywords/card.go index c79893f..34059b9 100644 --- a/keywords/card.go +++ b/keywords/card.go @@ -29,8 +29,8 @@ func (c CardRootValidator) ValidateClasses(cb jsonschema.ClassBound) error { return errors.New("Classes are not covered by the cards classes") } -func (c CardRootValidator) ValidateKeywordCount() error { - c.Keywords++ +func (c *CardRootValidator) ValidateKeywordCount() error { + c.Keywords = c.Keywords + 1 if c.Keywords <= maxKeywords { return nil } @@ -64,7 +64,7 @@ type Card struct { func (c Card) Validate() error { classProvider, _ := c.FindImplementer() cardRoot := CardRootValidator{0, classProvider.(cardobject.ClassProvider), c.GetType()} - return c.ValidateType(cardRoot) + return c.ValidateType(&cardRoot) } // ValidateType Ensures that the type "Card" is build correctly in the context of the RootElement diff --git a/keywords/countDust.go b/keywords/countDust.go index aab501f..5a089fe 100644 --- a/keywords/countDust.go +++ b/keywords/countDust.go @@ -23,4 +23,4 @@ func (c countDust) Description() string { func (c countDust) Classes() []jsonschema.Class { return []jsonschema.Class{cardobject.MYSTICISM} -} \ No newline at end of file +} diff --git a/keywords/effect.go b/keywords/effect.go index c7737ea..e3ba784 100644 --- a/keywords/effect.go +++ b/keywords/effect.go @@ -18,7 +18,7 @@ func (e effects) ValidateType(r jsonschema.RootElement) error { } func (e effects) MinMaxItems() (int, int) { - return 0, 3 + return 0, maxKeywords } func (e effects) ItemName() string { @@ -33,7 +33,7 @@ type effect struct { Burn *burn `json:",omitempty"` Choose *choose `json:",omitempty"` Count *count `json:",omitempty"` - CountDust *countDust `json:",omitempty"` + CountDust *countDust `json:",omitempty"` CountPower *countPower `json:",omitempty"` Discard *discard `json:",omitempty"` DiscountAction *discountAction `json:",omitempty"` @@ -75,6 +75,10 @@ func (e effect) ValidateType(r jsonschema.RootElement) error { if err != nil { return err } + err = r.ValidateKeywordCount() + if err != nil { + return err + } return implementer.ValidateType(r) } diff --git a/keywords/testJsons/keywordedCard.json b/keywords/testJsons/keywordedCard.json index 2027125..a0e6e0f 100644 --- a/keywords/testJsons/keywordedCard.json +++ b/keywords/testJsons/keywordedCard.json @@ -1 +1 @@ -{"Entity":{"CardName":"Name","CastingCost":13,"Class":{"Nature":false,"Mysticism":false,"Technology":true,"Culture":true},"Abilities":[{"Pay":{"ManaAmount":{"SimpleIntValue":3},"Effects":[{"Arm":{"Target":"RANDOM","Amount":{"SimpleIntValue":3}}},{"Spawn":{"Token":{"Recruit":{}},"Amount":{"SimpleIntValue":2}}}]}}],"Attack":10,"Health":10,"FlavourText":"-.-","Tags":["SPIRIT"],"Keywords":["ARM","PAY"],"Rarity":"UNCOMMON"}} \ No newline at end of file +{"Entity":{"CardName":"Name","CastingCost":13,"Class":{"Nature":false,"Mysticism":false,"Technology":true,"Culture":true},"Abilities":[{"Pay":{"ManaAmount":{"SimpleIntValue":3},"Effects":[{"Arm":{"Target":"RANDOM","Amount":{"SimpleIntValue":3}}},{"Arm":{"Target":"RANDOM","Amount":{"SimpleIntValue":3}}},{"Arm":{"Target":"RANDOM","Amount":{"SimpleIntValue":3}}},{"Arm":{"Target":"RANDOM","Amount":{"SimpleIntValue":3}}},{"Arm":{"Target":"RANDOM","Amount":{"SimpleIntValue":3}}},{"Arm":{"Target":"RANDOM","Amount":{"SimpleIntValue":3}}},{"Spawn":{"Token":{"Recruit":{}},"Amount":{"SimpleIntValue":2}}}]}}],"Attack":10,"Health":10,"FlavourText":"-.-","Tags":["SPIRIT"],"Keywords":["ARM","PAY"],"Rarity":"UNCOMMON"}} \ No newline at end of file diff --git a/keywords/unmarshal_test.go b/keywords/unmarshal_test.go index dc9996b..a17f650 100644 --- a/keywords/unmarshal_test.go +++ b/keywords/unmarshal_test.go @@ -9,9 +9,9 @@ import ( "github.com/DecentralCardGame/cardobject/cardobject" ) -func allClassesTestCard() CardRootValidator { +func allClassesTestCard() *CardRootValidator { - return CardRootValidator{9, &action{ + return &CardRootValidator{9, &action{ CardName: "", CastingCost: 3, AdditionalCost: nil,