source: abuse/trunk/data-frabs/lisp/explo.lsp @ 581

Last change on this file since 581 was 44, checked in by Sam Hocevar, 12 years ago
  • Importing abuse-frabs 2.10.
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
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(defun def_explo (symbol file seq_name last_frame)
71  (eval (list 'def_char symbol
72              '(funs (ai_fun   exp_ai)
73                     (draw_fun exp_draw))
74              '(range 10000 10000)
75              '(flags (add_front T)
76                      (unlistable T))
77              `(states file (stopped (quote ,(seq seq_name 1 last_frame)))))))
78
79
80(def_explo 'EXPLODE1 "art/exp1.spe"    "fire"         7)
81
82(def_explo 'EXPLODE2 "art/blowups.spe" "b1"           7)
83(def_explo 'EXPLODE3 "art/blowups.spe" "b2"           7)
84(def_explo 'EXPLODE4 "art/blowups.spe" "b3"           7)
85(def_explo 'EXPLODE5 "art/blowups.spe" "b4"           5)
86(def_explo 'EXPLODE6 "art/exp1.spe"    "small_fire"   7)
87(def_explo 'EXPLODE7 "art/exp1.spe"    "small_wite"   8)
88(def_explo 'EXPLODE8 "art/exp1.spe"    "wite"         8)
89
90(def_explo 'CLOUD "art/cloud.spe" "cloud"             5)
91(def_explo 'SMALL_DARK_CLOUD "art/cloud.spe" "smo2"   5)
92(def_explo 'SMALL_LIGHT_CLOUD "art/cloud.spe" "smo1"  5)
93
94
95
96
97
98
99
100
101
Note: See TracBrowser for help on using the repository browser.