source: abuse/trunk/data/lisp/ladder.lsp @ 589

Last change on this file since 589 was 589, checked in by Sam Hocevar, 10 years ago

data: remove exact duplicate Lisp files, merge all main space Lisp files,
and move most frabs addons to the main data directory.

File size: 1.3 KB
RevLine 
[54]1;; Copyright 1995 Crack dot Com,  All Rights reserved
2;; See licensing information for more details on usage rights
3
[589]4;; XXX: Mac Abuse reimplements this in C++
[54]5(defun latter_check_area (first)
6  (if first
7      (progn
8        (if (and (<= (x) (with_object first (x)))
9                 (<= (y) (with_object first (y)))
10                 (>= (with_object (get_object 0) (x)) (with_object first (x)))
11                 (>= (with_object (get_object 0) (y)) (with_object first (y))))
12            (let ((yd (- (with_object first (y)) (y))))
13              (if (eq (with_object first (state)) climbing)
14                  (let ((newx (/ (+ (x) (with_object (get_object 0) (x))) 2)))
15                    (with_object first (set_x newx))))
16              (with_object first (setq in_climbing_area yd))))
17        (latter_check_area (next_focus first)))))
18
[589]19;; XXX: Mac Abuse reimplements this in C++
[54]20(defun latter_ai ()
21  (if (> (total_objects) 0)
22      (latter_check_area (first_focus)))
23  T)
24
25(def_char LADDER
26  (funs (ai_fun   latter_ai)
27        (draw_fun dev_draw))
28  (range 50 800)
29  (states "art/misc.spe" (stopped "latter")))
30
31(defun step_ai ()
32  (if (or (eq (total_objects) 0)
33           (with_object (get_object 0) (not (eq (aistate) 0))))
34      (set_state stopped)
35    (set_state running))
36  T)
37
38(def_char STEP
39  (funs (ai_fun   step_ai))
40  (flags (can_block T))
41  (states "art/chars/step.spe"
42          (stopped "step")
43          (running "step_gone")))
[582]44
Note: See TracBrowser for help on using the repository browser.