source: abuse-mac/trunk/lisp/explo.lsp @ 102

Last change on this file since 102 was 102, checked in by Sam Hocevar, 11 years ago
File size: 2.9 KB
Line 
1;; Copyright 1995 Crack dot Com,  All Rights reserved
2;; See licensing information for more details on usage rights
3
4(defun explo_light ()
5  (select (aistate)
6          (0 (progn (link_light (add_light 0 (x) (y) 1 (aitype) 0 0))
7                    (go_state 1)))
8          (1 (if (> (state_time) 3)
9                 (let ((l (get_light 0)))
10                   (delete_light l)
11                   nil)
12
13               T))))
14
15(defun do_small_explo (radius amount) 
16  (add_object EXPLODE3 (+ (x) (random 5)) (+ (y) (random 5)) 0)
17  (add_object EXPLODE2 (+ (x) (random 5)) (+ (y) (random 5)) 2)
18  (add_object EXPLODE3 (- (x) (random 5)) (- (y) (random 5)) 1)
19  (add_object EXPLODE3 (- (x) (random 5)) (- (y) (random 5)) 2)
20  (hurt_radius (x) (y) radius amount (if (> (total_objects) 0)
21                                         (get_object 0)
22                                       nil) 20)
23  nil)
24
25(defun do_explo (radius amount)
26      (play_sound GRENADE_SND 127 (x) (y))
27      (add_object EXPLODE1 (+ (x) (random 10)) (+ (+ (random 10) (y)) -20)     0)
28      (if (not (frame_panic))
29          (progn
30            (add_object EXPLODE1 (- (x) (random 10)) (+ (- (y) (random 10)) -20) 2)
31            (add_object EXP_LIGHT (x) (y) 100)))         ; add cool light if not too slow
32      (hurt_radius (x) (y) radius amount (if (> (total_objects) 0)
33                                             (get_object 0)
34                                           nil) 20)
35      nil)
36
37
38
39(defun do_white_explo (radius amount)
40      (play_sound GRENADE_SND 127 (x) (y))
41      (add_object EXPLODE8 (+ (x) (random 10)) (+ (+ (random 10) (y)) -20)     0)
42      (if (not (frame_panic))
43          (add_object EXP_LIGHT (x) (y) 100))        ; add cool light if not too slow
44      (hurt_radius (x) (y) radius amount (if (> (total_objects) 0)
45                                             (get_object 0)
46                                           nil) 20)
47      nil)
48
49
50
51(def_char EXP_LIGHT
52  (funs (ai_fun   explo_light) 
53        (draw_fun dev_draw))
54  (flags (unlistable T))
55  (range 10000 10000)
56  (states "art/misc.spe"
57          (stopped           "lhold")))
58
59/* written in C
60(defun exp_ai ()
61  (if (eq (aitype) 0) (next_picture)
62    (progn (set_aitype (- (aitype) 1))
63           T)))
64
65
66(defun exp_draw ()
67  (if (eq (aitype) 0)
68      (middle_draw)))
69*/
70
71
72(defun def_explo (symbol file seq_name last_frame)
73  (eval (list 'def_char symbol
74              '(funs (ai_fun   exp_ai)
75                     (draw_fun exp_draw))
76              '(range 10000 10000)
77              '(flags (add_front T)
78                      (unlistable T))
79              `(states file (stopped (quote ,(seq seq_name 1 last_frame)))))))
80
81
82(def_explo 'EXPLODE1 "art/exp1.spe"    "fire"         7)
83
84(def_explo 'EXPLODE2 "art/blowups.spe" "b1"           7)
85(def_explo 'EXPLODE3 "art/blowups.spe" "b2"           7)
86(def_explo 'EXPLODE4 "art/blowups.spe" "b3"           7)
87(def_explo 'EXPLODE5 "art/blowups.spe" "b4"           5)
88(def_explo 'EXPLODE6 "art/exp1.spe"    "small_fire"   7)
89(def_explo 'EXPLODE7 "art/exp1.spe"    "small_wite"   8)
90(def_explo 'EXPLODE8 "art/exp1.spe"    "wite"         8)
91
92(def_explo 'CLOUD "art/cloud.spe" "cloud"             5)
93(def_explo 'SMALL_DARK_CLOUD "art/cloud.spe" "smo2"   5)
94(def_explo 'SMALL_LIGHT_CLOUD "art/cloud.spe" "smo1"  5)
95
96
97
98
99
100
101
102
103
Note: See TracBrowser for help on using the repository browser.