Skip to content

Commit

Permalink
added loot
Browse files Browse the repository at this point in the history
  • Loading branch information
nlsui committed Apr 27, 2021
1 parent be03410 commit 89ddbbc
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion keywordedSchema.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions keywords/ability.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type ability struct {
DiscardPay *discardPay `json:",omitempty"`
Dismantle *dismantle `json:",omitempty"`
Dissolve *dissolve `json:",omitempty"`
Loot *loot `json:",omitempty"`
OnConstruction *onConstruction `json:",omitempty"`
OnDeath *onDeath `json:",omitempty"`
OnSpawn *onSpawn `json:",omitempty"`
Expand Down
25 changes: 25 additions & 0 deletions keywords/loot.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package keywords

import (
"github.com/DecentralCardGame/cardobject/jsonschema"
)

type loot struct {
Effects effects
}

func (l loot) Validate() error {
return l.ValidateStruct()
}

func (l loot) ValidateStruct() error {
return jsonschema.ValidateStruct(l)
}

func (l loot) InteractionText() string {
return "Loot: §Effects."
}

func (l loot) Description() string {
return "When an opposing place is destroyed activate Effects."
}
13 changes: 13 additions & 0 deletions keywords/loot_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package keywords

import (
"testing"
)

func TestLoot(t *testing.T) {
loot := loot{nil}
err := loot.Validate()
if err != nil {
t.Error(err)
}
}

0 comments on commit 89ddbbc

Please sign in to comment.