summaryrefslogtreecommitdiff
path: root/internal/spells
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-03-12 03:08:43 +0100
committerDimitri Sokolyuk <demon@dim13.org>2018-03-12 03:08:43 +0100
commite532c47753c112f8168de7354d255efb95f1f0b8 (patch)
tree5adc7b837d9bb06bafaaf5cfef27ae5bfede802c /internal/spells
parent3f3bc476993e9ca4e64404cef1fdc4bd1aed4d97 (diff)
split
Diffstat (limited to 'internal/spells')
-rw-r--r--internal/spells/spells.go77
1 files changed, 77 insertions, 0 deletions
diff --git a/internal/spells/spells.go b/internal/spells/spells.go
new file mode 100644
index 0000000..828c9e9
--- /dev/null
+++ b/internal/spells/spells.go
@@ -0,0 +1,77 @@
+package spells
+
+import "math/rand"
+
+var spells = []string{
+ `Slime Finger`,
+ `Rabbit Punch`,
+ `Hastiness`,
+ `Good Move`,
+ `Sadness`,
+ `Seasick`,
+ `Gyp`,
+ `Shoelaces`,
+ `Innoculate`,
+ `Cone of Annoyance`,
+ `Magnetic Orb`,
+ `Invisible Hands`,
+ `Revolting Cloud`,
+ `Aqueous Humor`,
+ `Spectral Miasma`,
+ `Clever Fellow`,
+ `Lockjaw`,
+ `History Lesson`,
+ `Hydrophobia`,
+ `Big Sister`,
+ `Cone of Paste`,
+ `Mulligan`,
+ `Nestor's Bright Idea`,
+ `Holy Batpole`,
+ `Tumor (Benign)`,
+ `Braingate`,
+ `Nonplus`,
+ `Animate Nightstand`,
+ `Eye of the Troglodyte`,
+ `Curse Name`,
+ `Dropsy`,
+ `Vitreous Humor`,
+ `Roger's Grand Illusion`,
+ `Covet`,
+ `Astral Miasma`,
+ `Spectral Oyster`,
+ `Acrid Hands`,
+ `Angioplasty`,
+ `Grognor's Big Day Off`,
+ `Tumor (Malignant)`,
+ `Animate Tunic`,
+ `Ursine Armor`,
+ `Holy Roller`,
+ `Tonsilectomy`,
+ `Curse Family`,
+ `Infinite Confusion`,
+}
+
+func Pick() string {
+ n := rand.Intn(len(spells))
+ return spells[n]
+}
+
+type SpellBook struct {
+ Spells []Spell
+}
+
+type Spell struct {
+ Title string
+ Level int
+}
+
+func (m *SpellBook) Add(title string) {
+ for i, v := range m.Spells {
+ if v.Title == title {
+ v.Level += 1
+ m.Spells[i] = v
+ return
+ }
+ }
+ m.Spells = append(m.Spells, Spell{Title: title, Level: 1})
+}