-
Notifications
You must be signed in to change notification settings - Fork 0
/
items.lisp
140 lines (113 loc) · 4.19 KB
/
items.lisp
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
(in-package :light-7drl)
(defnoun n-knife "a" "pocket knife" "pocket knives")
(defnoun n-sword-of-light "a" "glowing blade" "glowing blades")
(defnoun n-brazier "a" "brazier" "braziers")
(defnoun n-charmed-blade "a" "charmed smallsword" "charmed smallswords")
(defnoun n-tinderbox "a" "tinderbox" "tinderboxes")
(defnoun n-torch "a" "torch" "torches")
(defnoun n-healing-potion "a" "red potion" "red potions")
(defnoun n-strength-potion "a" "green potion" "green potions")
(defnoun n-antidote-potion "a" "blue potion" "blue potions")
(defnoun n-blanket "a" "fireproof blanket" "fireproof blankets")
(defparameter *fist-power* (list (make-chance-roll :success-chance 1/2)
(make-dice-roll :number-of-dice 1
:dice-size 6)))
(defparameter *knife-power* (list (make-chance-roll :success-chance 3/4)
(make-dice-roll :number-of-dice 2
:dice-size 6)))
(defparameter *dagger-power* (list (make-chance-roll :success-chance 3/4)
(make-dice-roll :number-of-dice 2
:dice-size 6
:constant 3)))
;; This glowing is not necessarily just an advantage
(defparameter *sol-power* (list (make-chance-roll :success-chance 4/5)
(make-dice-roll :number-of-dice 4
:dice-size 6
:constant 3)))
(defparameter *enchanted-sword-power* (list (make-chance-roll :success-chance 1)
(make-dice-roll :number-of-dice 2
:dice-size 6)))
(defparameter *slingshot-power* (list (make-chance-roll :success-chance 3/4)
(make-dice-roll :number-of-dice 2
:dice-size 4)))
;; The revolver is a "glass sword" -- six shots only. As such more or less
;; an instakill.
(defparameter *revolver-power* (list (make-chance-roll :success-chance 3/4)
(make-dice-roll :number-of-dice 6
:dice-size 24)))
(defun make-sword-of-light ()
(make-item :appearance (make-appearance :glyph (char-code #\/)
:foreground-colour '(255 255 255))
:type :melee-weapon
:attack-power *sol-power*
:name n-sword-of-light))
(defun make-knife ()
(make-item :appearance (make-appearance :glyph (char-code #\/)
:foreground-colour '(255 255 255))
:type :melee-weapon
:attack-power *knife-power*
:name n-knife))
(defun make-blanket ()
(make-item :appearance (make-appearance :glyph (char-code #\%)
:foreground-colour '(255 255 255))
:type :blanket
:name n-blanket))
(defun make-healing-potion ()
(make-item :appearance (make-appearance :glyph (char-code #\&)
:foreground-colour '(255 0 0))
:type :healing-potion
:name n-healing-potion))
(defun make-strength-potion ()
(make-item :appearance (make-appearance :glyph (char-code #\&)
:foreground-colour '(0 255 0))
:type :strength-potion
:name n-strength-potion))
(defun make-antidote-potion ()
(make-item :appearance (make-appearance :glyph (char-code #\&)
:foreground-colour '(0 0 255))
:type :antidote-potion
:name n-antidote-potion))
(defun make-tinderbox ()
(make-item :appearance (make-appearance :glyph (char-code #\+)
:foreground-colour '(200 150 20))
:type :tinderbox
:name n-tinderbox))
(defun make-torch ()
(make-item :appearance (make-appearance :glyph (char-code #\+)
:foreground-colour '(200 150 20))
:type :torch
:name n-torch
:ammo +torch-ammo+
:active nil
:light-source (make-light-source :x nil
:y nil
:intensity +torch-max-intensity+)))
(defun make-brazier (&key (status nil) (invisible nil))
(make-item :appearance (make-appearance :glyph (if invisible
(char-code #\ )
(char-code #\#))
:foreground-colour '(255 0 0))
:type :brazier
:name n-brazier
:heavy t
:active (case status
(:lit t)
(:unlit nil)
(nil (select-random '(t nil))))
:light-source (make-light-source :x nil
:y nil
:intensity +brazier-intensity+)))
(defparameter *default-item-constructors*
(list
#'make-torch
#'make-torch
#'make-torch
#'make-healing-potion
#'make-healing-potion
#'make-healing-potion
#'make-antidote-potion
#'make-antidote-potion
#'make-antidote-potion
#'make-knife
#'make-blanket
#'make-tinderbox))