source: abuse/trunk/data-abuse/lisp/sfx.lsp @ 586

Last change on this file since 586 was 582, checked in by Sam Hocevar, 12 years ago

data: remove \r and trailing spaces and tabs from all Lisp sources.

File size: 8.1 KB
Line 
1;; Copyright 1995 Crack dot Com,  All Rights reserved
2;; See licensing information for more details on usage rights
3
4;; Bobby,  samples should be 8 bit mono playing 11025 Hz
5
6(defun sfxdir (filename) (concatenate 'string "sfx/" filename))
7
8;; steel ball bounce
9(def_sound 'SBALL_SND      (sfxdir "ball01.wav"))
10
11;; flying sound
12(def_sound 'FLY_SND        (sfxdir "fly03.wav"))
13
14;; speed sound
15(def_sound 'SPEED_SND      (sfxdir "speed02.wav"))
16
17(setq LOW_HEALTH_SND SPEED_SND)
18
19;; laser hitting somehting it can't kill
20(def_sound 'LPING_SND      (sfxdir "lasrmis2.wav"))
21
22;; light saber - should be short
23(def_sound 'LSABER_SND     (sfxdir "plasma02.wav"))
24
25;; when you save at a console
26(def_sound 'SAVE_SND       (sfxdir "save05.wav"))
27
28;; end level
29(def_sound 'END_LEV_SND    (sfxdir "endlvl02.wav"))
30
31;; plasma weapon
32(def_sound 'PLASMA_SND     (sfxdir "plasma03.wav"))
33
34;; spring
35(def_sound 'SPRING_SOUND   (sfxdir "spring03.wav"))
36
37;; health up sound
38(def_sound 'HEALTH_UP_SND  (sfxdir "health01.wav"))
39
40;; door sliding up
41(def_sound 'DOOR_UP        (sfxdir "doorup01.wav"))
42
43;; door sliding up
44(def_sound 'DOOR_DOWN      (sfxdir "doorup02.wav"))
45
46;; bomb count-down tick
47(def_sound 'TICK_SND       (sfxdir "timerfst.wav"))
48
49(setq PLAYER_PAIN (make-array 4 :initial-contents
50                              (list (def_sound (sfxdir "plpain01.wav"))
51                                    (def_sound (sfxdir "plpain02.wav"))
52                                    (def_sound (sfxdir "plpain04.wav"))
53                                    (def_sound (sfxdir "plpain10.wav")))))
54
55(setq PLAYER_DEATH (make-array 4 :initial-contents
56                             (list (def_sound (sfxdir "pldeth02.wav"))
57                                   (def_sound (sfxdir "pldeth04.wav"))
58                                   (def_sound (sfxdir "pldeth05.wav"))
59                                   (def_sound (sfxdir "pldeth07.wav")))))
60
61
62;; jugger stomp
63(def_sound 'JSTOMP_SND    (sfxdir "blkfoot4.wav"))
64
65;; hiding wall disappear sound
66(def_sound 'HWALL_SND     (sfxdir "blkfoot4.wav"))
67
68;; firebomb sound
69(def_sound 'FIREBOMB_SND  (sfxdir "firebmb1.wav"))
70
71
72;; force field
73(def_sound 'FF_SND        (sfxdir "force01.wav"))
74
75;; flying robot sound
76(def_sound 'FLYER_SND     (sfxdir "robot02.wav"))
77
78;; cleaner sound
79(def_sound 'CLEANER_SND   (sfxdir "cleaner.wav"))
80
81;; shotgun/laser taking from the lava sample
82(def_sound 'ZAP_SND       (sfxdir "zap2.wav"))
83
84;; rocket launch sound
85(def_sound 'ROCKET_LAUNCH_SND (sfxdir "rocket02.wav"))
86
87;; platform de-acel
88(def_sound 'PLAT_D_SND     (sfxdir "eledec01.wav"))
89
90;; platform acel
91(def_sound 'PLAT_A_SND     (sfxdir "eleacc01.wav"))
92
93
94;; machine gun hitting the floor, sounds 1 & 2, played randomly
95(def_sound    'MG_HIT_SND1 (sfxdir "mghit01.wav"))
96(def_sound    'MG_HIT_SND2 (sfxdir "mghit02.wav"))
97
98;; enemy mounted gun firing
99(def_sound 'MGUN_SND       (sfxdir "ammo02.wav"))
100
101;; planet explode sound
102(def_sound 'P_EXPLODE_SND  (sfxdir "poof06.wav"))
103
104;; space ship zipping by
105(def_sound 'SHIP_ZIP_SND   (sfxdir "zap3.wav"))
106
107;; grenade explosion
108(def_sound 'GRENADE_SND    (sfxdir "grenad01.wav"))
109
110;; opening door
111(def_sound 'SWISH          (sfxdir "swish01.wav"))
112
113;; sound of player going through a teleporter, not grinding
114(def_sound 'TELEPORTER_SND (sfxdir "telept01.wav"))
115
116;; blowing something up
117(def_sound 'BLOWN_UP       (sfxdir "grenad01.wav"))
118
119;; get a "treasure"/ammo noise
120(def_sound 'AMMO_SND       (sfxdir "ammo01.wav"))
121
122;; lava shooting up sound
123(def_sound 'LAVA_SND       (sfxdir "lava01.wav"))
124
125;; sound of a switch being flipped
126(def_sound 'SWITCH_SND     (sfxdir "switch01.wav"))
127
128;; sound of grenade being thrown
129(def_sound 'GRENADE_THROW  (sfxdir "throw01.wav"))
130
131;; electricity shooting up from the ground
132(def_sound 'ELECTRIC_SND   (sfxdir "elect02.wav"))
133
134;; rocket being fired
135(def_sound 'ROCKET_SND     (sfxdir "rocket02.wav"))
136
137;; alien landing on the ground
138(def_sound 'ALAND_SND      (sfxdir "aland01.wav"))
139
140;; alien slash/bite noise
141(def_sound 'ASLASH_SND     (sfxdir "aslash01.wav"))
142
143;; light fading on
144(def_sound 'FADEON_SND     (sfxdir "fadeon01.wav"))
145
146;; block crumbling
147(def_sound 'CRUMBLE_SND    (sfxdir "crmble01.wav"))
148
149;; aliean screaming
150(def_sound 'ASCREAM_SND    (sfxdir "alien01.wav"))
151
152;; alien pain sound
153(def_sound 'APAIN_SND      (sfxdir "ahit01.wav"))
154
155;; small alien death
156(setq ASML_DEATH (make-array 2 :initial-contents
157                             (list (def_sound (sfxdir "adie05.wav"))
158                                   (def_sound (sfxdir "poof05.wav")))))
159
160;; large alien death
161(setq ALRG_DEATH (make-array 3 :initial-contents
162                             (list (def_sound (sfxdir "adie02.wav"))
163                                   (def_sound (sfxdir "adie03.wav"))
164                                   (def_sound (sfxdir "poof05.wav")))))
165
166
167
168(setq APPEAR_SND (def_sound (sfxdir "amb16.wav")))    ;; 14
169(setq TAUNT_SND (def_sound (sfxdir "amb07.wav")))     ;; 15
170(setq SPACE_SND (def_sound (sfxdir "ambcave1.wav")))  ;; 3
171(setq SCARE_SND (def_sound (sfxdir "amb10.wav")))     ;; 16
172
173(setq A_SCREAMS (make-array 3 :initial-contents (list
174                                                 (def_sound (sfxdir "scream02.wav"))  ;; 8
175                                                 (def_sound (sfxdir "scream03.wav"))  ;; 9
176                                                 (def_sound (sfxdir "scream08.wav")))))  ;; 10
177
178
179;; out side of game sounds
180
181(setq BUTTON_PRESS_SND (def_sound (sfxdir "button02.wav")))
182(setq LOGO_SND (def_sound (sfxdir "logo09.wav")))
183(setq DEL_OBJECT_SND (def_sound (sfxdir "delobj01.wav")))
184(setq LINK_OBJECT_SND (def_sound (sfxdir "link01.wav")))
185
186
187(setq AMB_SOUNDS (make-array 17 :initial-contents (list
188                               (def_sound (sfxdir "ambtech1.wav"))   ;; 0
189                               (def_sound (sfxdir "ambtech2.wav"))  ;; 1
190                               (def_sound (sfxdir "ambtech3.wav"))  ;; 2
191                               SPACE_SND                            ;; 3
192                               (def_sound (sfxdir "ambcave2.wav"))  ;; 4
193                               (def_sound (sfxdir "ambcave3.wav"))  ;; 5
194                               (def_sound (sfxdir "ambcave4.wav"))  ;; 6
195                               (def_sound (sfxdir "ambfrst2.wav"))  ;; 7
196                               (aref A_SCREAMS 0)                   ;; 8
197                               (aref A_SCREAMS 1)                   ;; 9
198                               (aref A_SCREAMS 2)                   ;; 10
199                               (def_sound (sfxdir "adie03.wav"))    ;; 11
200                               (def_sound (sfxdir "amb11.wav"))     ;; 12
201                               (def_sound (sfxdir "amb13.wav"))     ;; 13
202                               APPEAR_SND                           ;; 14
203                               TAUNT_SND                            ;; 15
204                               SCARE_SND                            ;; 16
205                               )))
206
207(defun amb_sound_ct ()
208  (if (> (aitype) 16)
209      (set_aitype 0)
210    (play_sound (aref AMB_SOUNDS (aitype)))))
211
212(defun amb_sound_ai ()
213  (if (activated)
214      (if (eq (aistate) 0)
215          (progn
216            (play_sound (aref AMB_SOUNDS (aitype)) (yvel) (x) (y))
217            (set_aistate (+ (xvel) (random (+ 1 (xacel)))))
218            (> (xvel) 0))
219        (progn
220          (set_aistate (- (aistate) 1))
221          T))
222    (progn
223      (set_aistate 0)
224      T)))
225
226
227(defun ambs_cons ()
228  (set_xvel 100)  ;; delay time to 100
229  (set_yvel 127)) ;; set volume default to 127
230
231(def_char AMBIENT_SOUND
232  (funs (ai_fun          amb_sound_ai)
233        (draw_fun        dev_draw)
234        (constructor     ambs_cons)
235        (type_change_fun amb_sound_ct))
236  (range 500 500)
237  (fields ("aitype" amb_num)
238          ("yvel"   amb_vol)
239          ("xvel"   amb_rep)
240          ("xacel"  amb_rand))
241  (states "art/misc.spe"
242          (stopped "sfx_player")))
243
244(setq song_list '("music/abuse01.hmi" "music/abuse02.hmi"))
245(setq current_song song_list)
246
247(defun next_song ()
248  (if current_song
249      (progn
250        (play_song (car current_song))
251        (break)
252        (setq current_song (cdr current_song))
253        (if (not current_song)
254            (setq current_song song_list))
255        (break)
256        )))
257
258
259(defun level_loaded (name)
260  (trace)
261  (if (search "levels/level" name)  ; is this one of the regular levels?
262      (progn
263        (stop_song)                 ; stop playing the old song
264        (select (substr 12 13 name)
265                ("00" (play_song "music/abuse01.hmi"))
266                ("01" (play_song "music/abuse02.hmi"))
267                ("02" (play_song "music/abuse04.hmi"))
268                ("03" (play_song "music/abuse07.hmi"))
269                ("04" (play_song "music/abuse08.hmi"))
270                ("05" (play_song "music/abuse10.hmi"))
271                ("06" (play_song "music/indst1.hmi"))
272                ("07" (play_song "music/indst2.hmi"))
273                ("08" (play_song "music/indst3.hmi"))
274                ("09" (play_song "music/indst4.hmi"))
275                ("10" (play_song "music/indst5.hmi"))
276                ("11" (play_song "music/abuse07.hmi"))
277                ("12" (play_song "music/abuse08.hmi"))
278                ("13" (play_song "music/abuse10.hmi"))
279                ("14" (play_song "music/indst1.hmi"))
280                ("15" (play_song "music/indst2.hmi"))
281                ("16" (play_song "music/indst3.hmi"))
282                ("17" (play_song "music/indst4.hmi"))
283                ("18" (play_song "music/indst5.hmi")))))
284  (untrace)
285  (break))
286
287
288
Note: See TracBrowser for help on using the repository browser.