Skip to content

Commit

Permalink
Fix a bug in deity holy symbol generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Overmyer committed Sep 27, 2019
1 parent 9be6046 commit 8b9a63b
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 16 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Change Log

## 0.8.3 (2019-09-27)

Fix a bug in deity holy symbol generation.

### Change List

- Add a check for no domain holy symbols in deity holy symbol generation

## 0.8.2 (2019-09-26)

Allow for configuring the domain name static assets are saved to.
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.8.2
0.8.3
32 changes: 21 additions & 11 deletions pkg/pantheon/deity/deity.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,35 @@ func (deity Deity) getRandomHolyItem() (string, error) {
return holyItem, nil
}

func getGenericHolySymbols() []string {
options := []string{
"circle divided in three",
"closed eye",
"open eye",
"pair of circles",
"pair of triangles",
"square",
"triangle mirrored",
"triangle",
"trio of slanted lines",
}

return options
}

func (deity Deity) getRandomHolySymbol() (string, error) {
options := []string{}
genericOptions := getGenericHolySymbols()

if len(deity.Domains) == 0 {
options = []string{
"circle divided in three",
"closed eye",
"open eye",
"pair of circles",
"pair of triangles",
"square",
"triangle mirrored",
"triangle",
"trio of slanted lines",
}
options = genericOptions
} else {
for _, d := range deity.Domains {
options = append(options, d.HolySymbols...)
}
if len(options) == 0 {
options = genericOptions
}
}

holySymbol, err := random.String(options)
Expand Down
16 changes: 12 additions & 4 deletions pkg/pantheon/domain/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ func All() []Domain {
},
HolySymbols: []string{
"cloud",
"circle with three squiggly lines in parallel",
},
PersonalityTraits: []string{
"mercurial",
Expand Down Expand Up @@ -568,7 +569,9 @@ func All() []Domain {
"pretty",
"unabashedly naked",
},
HolyItems: []string{},
HolyItems: []string{
"red string",
},
HolySymbols: []string{
"heart",
},
Expand Down Expand Up @@ -753,7 +756,9 @@ func All() []Domain {
"bald",
"reed-thin",
},
HolyItems: []string{},
HolyItems: []string{
"broken dagger",
},
HolySymbols: []string{
"evil eye",
"broken circle",
Expand All @@ -770,7 +775,10 @@ func All() []Domain {
AppearanceTraits: []string{
"sitting on a cloud",
},
HolyItems: []string{},
HolyItems: []string{
"flute",
"kite",
},
HolySymbols: []string{
"cloud",
},
Expand Down Expand Up @@ -1073,4 +1081,4 @@ func All() []Domain {
}

return domains
}
}

0 comments on commit 8b9a63b

Please sign in to comment.