1 | ;; Copyright 1999 Profound Corp, All Rights reserved
|
---|
2 | ;; See licensing information for more details on usage rights
|
---|
3 |
|
---|
4 |
|
---|
5 | (make_ammo_icon 'DRAY_ICON4 "/cam/tmp/murray/amms0008.pcx" 4)
|
---|
6 | (make_ammo_icon 'DRAY_ICON8 "/cam/tmp/murray/ammb0008.pcx" 8)
|
---|
7 |
|
---|
8 | (defun ammo_type ()
|
---|
9 | (select (otype)
|
---|
10 | (GRENADE_TOP 2)
|
---|
11 | (MGUN_TOP 10)
|
---|
12 | (FIREBOMB_TOP 5)
|
---|
13 | (ROCKET_TOP 3)
|
---|
14 | (PGUN_TOP 4)
|
---|
15 | (LSABER_TOP 5)
|
---|
16 | (DFIRS_TOP 6)
|
---|
17 | (DRAY_TOP 8)
|
---|
18 | ))
|
---|
19 |
|
---|
20 | (defun top_cache (type)
|
---|
21 | (list
|
---|
22 | (select type
|
---|
23 | (MGUN_TOP (list SHOTGUN_BULLET))
|
---|
24 | (GRENADE_TOP (list GRENADE))
|
---|
25 | (ROCKET_TOP (list ROCKET))
|
---|
26 | (FIREBOMB_TOP (list FIREBOMB))
|
---|
27 | (PGUN_TOP (list PLASMAGUN_BULLET))
|
---|
28 | (LIGHT_SABER (list LSABER_BULLET))
|
---|
29 | (DFRIS_TOP (list DFRIS_BULLET))
|
---|
30 | (DRAY_TOP (list DEATH_RAY))
|
---|
31 | nil)))
|
---|
32 |
|
---|
33 |
|
---|
34 | ;; Introductory to the BFG7000 - The Death Ray
|
---|
35 | ;; BFG - Big Fraggin Gun
|
---|
36 |
|
---|
37 | ;; I finally got the Death Ray to do something cool!
|
---|
38 | ;; It will shoot rockets and if you keep holding,
|
---|
39 | ;; it will shoot out a burst of energy.
|
---|
40 |
|
---|
41 | ;; Try changing the top_ufun to
|
---|
42 | ;; player_rocket_ufun, laser_ufun or plaser_ufun
|
---|
43 |
|
---|
44 | (make_top_char 'DRAY_TOP "4gbf" 'dray_ufun 'top_draw)
|
---|
45 |
|
---|
46 | (defun dray_ufun () 0)
|
---|
47 |
|
---|
48 | (defun get_dray_angle ()
|
---|
49 | (let ((px (with_object (bg) (player_pointer_x)))
|
---|
50 | (py (with_object (bg) (player_pointer_y))))
|
---|
51 | (atan2 (- (y) py 4)
|
---|
52 | (- px (x)))))
|
---|
53 |
|
---|
54 |
|
---|
55 | (defun death_ray_ai ()
|
---|
56 | (next_picture)
|
---|
57 | (hurt_radius (x) (y) 30 20 (bg) 15)
|
---|
58 | (set_course (aistate) 6)
|
---|
59 | (if (not (eq (bmove (bg)) T))
|
---|
60 | (progn
|
---|
61 | (do_dray_explo 50 40)
|
---|
62 | nil))
|
---|
63 | (add_object QUICK_EXP_LIGHT (x) (- (y) 10) 100)
|
---|
64 | (if (<= (state_time) 20) (bmove (bg)) (do_drl_explo 50 40)
|
---|
65 | ))
|
---|
66 |
|
---|
67 |
|
---|
68 | (defun death_ray_draw () ;; Makes the bfg behaves like the bfg from quake2
|
---|
69 | (draw)
|
---|
70 | (let ((c1 (find_rgb 128 0 128))
|
---|
71 | (c2 (find_rgb 70 59 67))
|
---|
72 | (c3 (find_rgb 147 155 195)))
|
---|
73 | (let ((target (with_object (me) (find_object_in_area
|
---|
74 | (- (x) 50) (- (y) 50)
|
---|
75 | (+ (x) 50) (+ (y) 50) object_destroyable_list))))
|
---|
76 | (if target
|
---|
77 | (progn
|
---|
78 | (draw_line (with_object target (- (x) 1)) (with_object target (-(y)(/(picture_height)2))) (-(x)1) (-(y)10) 239)
|
---|
79 | (draw_line (with_object target (x)) (with_object target (-(y)(/(picture_height)2))) (x) (-(y)10) 187)
|
---|
80 | (draw_line (with_object target (+ (x) 1)) (with_object target (-(y)(/(picture_height)2))) (+(x)1) (-(y)10) 239)
|
---|
81 | (add_object EXPDRL (with_object target (-(+(x)10)(random 20))) (with_object target (- (+ (-(y)(/(picture_height)2)) 10) (random 20))) 1)
|
---|
82 | (hurt_radius (with_object target (x)) (with_object target (y)) 1 2 (bg) 15)
|
---|
83 | )
|
---|
84 | )
|
---|
85 | ))
|
---|
86 | )
|
---|
87 |
|
---|
88 | (defun death_ray_cons ()
|
---|
89 | (set_aistate (get_dray_angle)))
|
---|
90 |
|
---|
91 | (defun death_ray_cache (type)
|
---|
92 | (list (list EXPDRAY QUICK_EXP_LIGHT)
|
---|
93 | (list DEATH_RAY_SND)))
|
---|
94 |
|
---|
95 | (def_char DEATH_RAY
|
---|
96 | (funs (ai_fun death_ray_ai)
|
---|
97 | (constructor death_ray_cons)
|
---|
98 | (draw_fun death_ray_draw)
|
---|
99 | (get_cache_list_fun death_ray_cache))
|
---|
100 | (range 10000 10000)
|
---|
101 | (flags (unlistable T)(add_front T))
|
---|
102 | (states "addon/twist/art/dray.spe" (stopped (seqbmp "dray" 1 4))))
|
---|
103 |
|
---|
104 | (def_explo 'EXPDRAY "addon/twist/art/dray.spe" "dexp" 6)
|
---|
105 | (def_explo 'EXPDRL "addon/twist/art/dray.spe" "drl" 6)
|
---|
106 |
|
---|
107 | (defun do_dray_explo (radius amount)
|
---|
108 | (play_sound DEATH_RAY_SND 127 (x) (y))
|
---|
109 | (add_object EXPDRAY (x) (- (y) 10) 0)
|
---|
110 | (if (not (frame_panic))
|
---|
111 | (progn
|
---|
112 | (add_object EXP_LIGHT (x) (y) 100)))
|
---|
113 | (hurt_radius (x) (y) radius amount (bg) 20)
|
---|
114 | nil)
|
---|
115 |
|
---|
116 | (defun do_drl_explo (radius amount)
|
---|
117 | (play_sound DEATH_RAY_SND 127 (x) (y))
|
---|
118 | (add_object EXPDRL (x) (- (y) 10) 0)
|
---|
119 | (if (not (frame_panic))
|
---|
120 | (progn
|
---|
121 | (add_object EXP_LIGHT (x) (y) 100)))
|
---|
122 | (hurt_radius (x) (y) radius amount (bg) 20)
|
---|
123 | nil)
|
---|
124 |
|
---|
125 | ;; If the player dosent have the weapon, ammo dosen't add.
|
---|
126 | ;; Give weapon when taking ammo if custom abuse levels are loaded.
|
---|
127 |
|
---|
128 | (defun giver (type)
|
---|
129 | (let ((amount (get_ability start_hp)))
|
---|
130 | (with_object (bg)
|
---|
131 | (progn
|
---|
132 | (if (and (not (has_weapon type)) change_on_pickup)
|
---|
133 | (progn
|
---|
134 | (if (or (get_option "-f") (eq enableammoandweapons 1)) (give_weapon type))
|
---|
135 | (if (or (get_option "-f") (eq enableammoandweapons 1)) (set_current_weapon type))
|
---|
136 | )
|
---|
137 | (if (or (get_option "-f") (eq enableammoandweapons 1)) (give_weapon type))
|
---|
138 | )
|
---|
139 | (add_ammo type amount)))))
|
---|
140 |
|
---|
141 | (defun giverweap (type)
|
---|
142 | (let ((amount (get_ability start_hp)))
|
---|
143 | (with_object (bg)
|
---|
144 | (progn
|
---|
145 | (if (and (not (has_weapon type)) change_on_pickup)
|
---|
146 | (progn
|
---|
147 | (give_weapon type)
|
---|
148 | (set_current_weapon type))
|
---|
149 | (give_weapon type))
|
---|
150 | (add_ammo type amount)))))
|
---|
151 |
|
---|
152 |
|
---|
153 | (defun weapon_icon_ai ()
|
---|
154 | (if (eq0 (aistate))
|
---|
155 | (if (activated)
|
---|
156 | (progn
|
---|
157 | (try_move 0 10)
|
---|
158 | (if (eq (second (see_dist (x) (y) (x) (+ (y) 1))) (y)) ; if we are on the floor, don't check falling anymore
|
---|
159 | (set_aistate 1))
|
---|
160 |
|
---|
161 | (if (touching_bg)
|
---|
162 | (progn
|
---|
163 | (play_sound AMMO_SND 127 (x) (y))
|
---|
164 | (select (otype)
|
---|
165 | (MBULLET_ICON5 (giver 0));; these numbers correspond to status bar position
|
---|
166 | (MBULLET_ICON20 (giver 0))
|
---|
167 | (GRENADE_ICON2 (giver 1))
|
---|
168 | (GRENADE_ICON10 (giver 1))
|
---|
169 |
|
---|
170 | (ROCKET_ICON2 (giver 2))
|
---|
171 | (ROCKET_ICON5 (giver 2))
|
---|
172 |
|
---|
173 | (FBOMB_ICON1 (giver 3))
|
---|
174 | (FBOMB_ICON5 (giver 3))
|
---|
175 |
|
---|
176 | (PLASMA_ICON20 (giver 4))
|
---|
177 | (PLASMA_ICON50 (giver 4))
|
---|
178 |
|
---|
179 | (LSABER_ICON50 (giver 5))
|
---|
180 | (LSABER_ICON100 (giver 5))
|
---|
181 |
|
---|
182 | (DFRIS_ICON4 (giver 6))
|
---|
183 | (DFRIS_ICON10 (giver 6))
|
---|
184 |
|
---|
185 | (DRAY_ICON4 (giver 7))
|
---|
186 | (DRAY_ICON8 (giver 7))
|
---|
187 |
|
---|
188 | )
|
---|
189 |
|
---|
190 | nil)
|
---|
191 | T))
|
---|
192 | T)
|
---|
193 | (if (touching_bg)
|
---|
194 | (progn
|
---|
195 | (play_sound AMMO_SND 127 (x) (y))
|
---|
196 | (select (otype)
|
---|
197 | (MBULLET_ICON5 (giver 0));; these numbers correspond to status bar position
|
---|
198 | (MBULLET_ICON20 (giver 0))
|
---|
199 | (GRENADE_ICON2 (giver 1))
|
---|
200 | (GRENADE_ICON10 (giver 1))
|
---|
201 |
|
---|
202 | (ROCKET_ICON2 (giver 2))
|
---|
203 | (ROCKET_ICON5 (giver 2))
|
---|
204 |
|
---|
205 | (FBOMB_ICON1 (giver 3))
|
---|
206 | (FBOMB_ICON5 (giver 3))
|
---|
207 |
|
---|
208 | (PLASMA_ICON20 (giver 4))
|
---|
209 | (PLASMA_ICON50 (giver 4))
|
---|
210 |
|
---|
211 | (LSABER_ICON50 (giver 5))
|
---|
212 | (LSABER_ICON100 (giver 5))
|
---|
213 |
|
---|
214 | (DFRIS_ICON4 (giver 6))
|
---|
215 | (DFRIS_ICON10 (giver 6))
|
---|
216 |
|
---|
217 | (DRAY_ICON4 (giver 7))
|
---|
218 | (DRAY_ICON8 (giver 7))
|
---|
219 |
|
---|
220 | )
|
---|
221 | nil)
|
---|
222 | T)))
|
---|
223 |
|
---|
224 |
|
---|
225 |
|
---|
226 | (defun weapon_iconweap_ai ()
|
---|
227 | (if (eq0 (aistate))
|
---|
228 | (if (activated)
|
---|
229 | (progn
|
---|
230 | (try_move 0 10)
|
---|
231 | (if (eq (second (see_dist (x) (y) (x) (+ (y) 1))) (y)) ; if we are on the floor, don't check falling anymore
|
---|
232 | (set_aistate 1))
|
---|
233 |
|
---|
234 | (if (touching_bg)
|
---|
235 | (progn
|
---|
236 | (play_sound AMMO_SND 127 (x) (y))
|
---|
237 | (select (otype)
|
---|
238 | (WEAP_MBULLET (giverweap 0));; these numbers correspond to status bar position
|
---|
239 | (WEAP_GRENADE (giverweap 1))
|
---|
240 | (WEAP_ROCKET (giverweap 2))
|
---|
241 | (WEAP_FBOMB (giverweap 3))
|
---|
242 | (WEAP_PLASMA (giverweap 4))
|
---|
243 | (WEAP_LSABER (giverweap 5))
|
---|
244 | (WEAP_DFRIS (giverweap 6))
|
---|
245 | (WEAP_DRAY (giverweap 7))
|
---|
246 | )
|
---|
247 | nil)
|
---|
248 | T))
|
---|
249 | T)
|
---|
250 | (if (touching_bg)
|
---|
251 | (progn
|
---|
252 | (play_sound AMMO_SND 127 (x) (y))
|
---|
253 | (select (otype)
|
---|
254 | (WEAP_MBULLET (giverweap 0));; these numbers correspond to status bar position
|
---|
255 | (WEAP_GRENADE (giverweap 1))
|
---|
256 | (WEAP_ROCKET (giverweap 2))
|
---|
257 | (WEAP_FBOMB (giverweap 3))
|
---|
258 | (WEAP_PLASMA (giverweap 4))
|
---|
259 | (WEAP_LSABER (giverweap 5))
|
---|
260 | (WEAP_DFRIS (giverweap 6))
|
---|
261 | (WEAP_DRAY (giverweap 7))
|
---|
262 | )
|
---|
263 | nil)
|
---|
264 | T)))
|
---|
265 |
|
---|
266 |
|
---|
267 | (defun ammo_cache (type) ;; tells what other chars to load in with this character
|
---|
268 | (list
|
---|
269 | (select type
|
---|
270 | (GRENADE_ICON2 `(,GRENADE ,GRENADE_TOP))
|
---|
271 | (GRENADE_ICON10 `(,GRENADE ,GRENADE_TOP))
|
---|
272 | (MBULLET_ICON5 `(,SHOTGUN_BULLET ,MGUN_TOP))
|
---|
273 | (MBULLET_ICON20 `(,SHOTGUN_BULLET ,MGUN_TOP))
|
---|
274 | (ROCKET_ICON2 `(,ROCKET ,ROCKET_TOP))
|
---|
275 | (ROCKET_ICON5 `(,ROCKET ,ROCKET_TOP))
|
---|
276 | (FBOMB_ICON1 `(,FIREBOMB ,FIREBOMB_TOP))
|
---|
277 | (FBOMB_ICON5 `(,FIREBOMB ,FIREBOMB_TOP))
|
---|
278 |
|
---|
279 | (PLASMA_ICON20 `(,PLASMAGUN_BULLET))
|
---|
280 | (PLASMA_ICON50 `(,PLASMAGUN_BULLET))
|
---|
281 |
|
---|
282 | (LSABER_ICON50 `(,LSABER_BULLET ,PGUN_TOP))
|
---|
283 | (LSABER_ICON100 `(,LSABER_BULLET ,PGUN_TOP))
|
---|
284 |
|
---|
285 | (DFRIS_ICON4 `(,DFRIS_BULLET ,DFRIS_TOP))
|
---|
286 | (DFRIS_ICON10 `(,DFRIS_BULLET ,DFRIS_TOP))
|
---|
287 |
|
---|
288 | (DRAY_ICON4 `(,DEATH_RAY ,DRAY_TOP))
|
---|
289 | (DRAY_ICON8 `(,DEATH_RAY ,DRAY_TOP))
|
---|
290 | nil)))
|
---|
291 |
|
---|
292 |
|
---|
293 | (defun ammoweap_cache (type) ;; tells what other chars to load in with this character
|
---|
294 | (list
|
---|
295 | (select type
|
---|
296 | (WEAP_GRENADE `(,GRENADE ,GRENADE_TOP))
|
---|
297 | (WEAP_MBULLET `(,SHOTGUN_BULLET ,MGUN_TOP))
|
---|
298 | (WEAP_ROCKET `(,ROCKET ,ROCKET_TOP))
|
---|
299 | (WEAP_FBOMB `(,FIREBOMB ,FIREBOMB_TOP))
|
---|
300 | (WEAP_PLASMA `(,PLASMAGUN_BULLET))
|
---|
301 | (WEAP_LSABER `(,LSABER_BULLET ,PGUN_TOP))
|
---|
302 | (WEAP_DFRIS `(,DFRIS_BULLET ,DFRIS_TOP))
|
---|
303 | (WEAP_DRAY `(,DEATH_RAY ))
|
---|
304 | nil)))
|
---|
305 |
|
---|
306 | (defun make_ammo_icon (symbol icon_name increment)
|
---|
307 | (eval (list 'def_char symbol
|
---|
308 | '(funs (ai_fun weapon_icon_ai)
|
---|
309 | (get_cache_list_fun ammo_cache)
|
---|
310 | (draw_fun on_draw))
|
---|
311 | '(range 5 5)
|
---|
312 | '(flags (add_front T))
|
---|
313 | `(abilities (start_hp ,increment))
|
---|
314 | `(states "art/chars/ammo.spe" (stopped ,icon_name)))))
|
---|
315 |
|
---|
316 | (defun make_ammoweap_icon (symbol icon_name increment)
|
---|
317 | (eval (list 'def_char symbol
|
---|
318 | '(funs (ai_fun weapon_iconweap_ai)
|
---|
319 | (get_cache_list_fun ammoweap_cache)
|
---|
320 | (draw_fun on_draw))
|
---|
321 | '(range 5 5)
|
---|
322 | '(flags (add_front T))
|
---|
323 | `(abilities (start_hp ,increment))
|
---|
324 | `(states "addon/twist/art/weapons.spe" (stopped ,icon_name)))))
|
---|
325 |
|
---|
326 | (make_ammoweap_icon 'WEAP_GRENADE "weap2" 2)
|
---|
327 | (make_ammoweap_icon 'WEAP_MBULLET "weap1" 5)
|
---|
328 | (make_ammoweap_icon 'WEAP_FBOMB "weap4" 1)
|
---|
329 | (make_ammoweap_icon 'WEAP_ROCKET "weap3" 2)
|
---|
330 | (make_ammoweap_icon 'WEAP_PLASMA "weap5" 20)
|
---|
331 | (make_ammoweap_icon 'WEAP_LSABER "weap6" 50)
|
---|
332 | (make_ammoweap_icon 'WEAP_DFRIS "weap7" 4)
|
---|
333 | (make_ammoweap_icon 'WEAP_DRAY "weap8" 4)
|
---|
334 |
|
---|