summaryrefslogtreecommitdiff
path: root/internal/spells/spells.go
blob: 34eea17b12de67b5920dae075026c7cffb62ef62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
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})
}