Changeset 590 for abuse/trunk/data/lisp/ant.lsp
- Timestamp:
- May 7, 2011, 5:12:10 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/data/lisp/ant.lsp
r589 r590 616 616 617 617 618 (setq load_warn nil) 619 (if (not (load "register/ant.lsp")) 620 (setq BOSS_ANT ANT_ROOF)) 621 (setq load_warn T) 622 623 624 618 619 (defun boss_damage (amount from hitx hity push_xvel push_yvel) 620 (if (and (eq (fade_count) 0) (not (eq (aistate) 0)) (< (aitype) 6)) 621 (progn 622 (damage_fun amount from hitx hity push_xvel push_yvel) 623 (if (eq (hp) 0) 624 (progn 625 (set_hp 1) 626 (set_aitype (+ (aitype) 1)) 627 (if (eq (aitype) 6) ;; go to next alien type 628 (set_aistate 10) ;; end game 629 (set_aistate 5))))))) ;; fade out 630 631 (defun boss_cons () 632 (set_hp 1) 633 (setq taunt_time 20)) 634 635 (defun boss_fire () 636 (let ((firex (+ (x) (* (direction) 17)) ) 637 (firey (- (y) 25)) 638 (playerx (+ (with_object (bg) (x)) (with_object (bg) (* (xvel) 8)))) 639 (playery (+ (- (with_object (bg) (y)) 15) (with_object (bg) (* (yvel) 2))))) 640 641 (if (and (can_see (x) (y) firex firey nil) (can_see firex firey playerx playery nil)) 642 (progn 643 (let ((angle (atan2 (- firey playery) 644 (- playerx firex)))) 645 (fire_object (me) (aitype) firex firey angle (bg)) 646 (set_state weapon_fire)) 647 648 )))) 649 650 651 (defun boss_ai () 652 (if (total_objects) 653 654 (if (eq (aistate) 11) 655 nil 656 (progn 657 (select (aistate) 658 (0;; wait for turn on 659 (set_state hiding);; can't see us 660 (set_targetable nil) 661 (if (activated) 662 (set_aistate 1))) 663 (1;; taunt for a while 664 (set_targetable nil) 665 (if (eq taunt_time 0) 666 (progn 667 (set_fade_count 14) 668 (set_state stopped) 669 (play_sound APPEAR_SND 127 (x) (y)) 670 (set_aistate 2)));; fade in 671 (progn 672 (setq taunt_time (- taunt_time 1)) 673 (if (eq (mod taunt_time 25) 0) 674 (play_sound TAUNT_SND 127 (x) (y))))) 675 676 (2;; fade in 677 (set_direction (toward)) 678 (if (eq (fade_count) 0) 679 (progn 680 (set_state weapon_fire) 681 (go_state 3)) 682 (set_fade_count (- (fade_count) 2)))) 683 684 (3;; wait to fire 685 (set_targetable T) 686 (if (next_picture) T 687 (go_state 4))) 688 689 (4;; fire1 690 (boss_fire) 691 (set_aistate 5) 692 (set_state weapon_fire)) 693 694 (5;; wait to fire 695 (set_targetable T) 696 (if (next_picture) T 697 (go_state 6))) 698 699 (6;; fire1 700 (boss_fire) 701 (set_aistate 7) 702 (set_state stopped)) 703 704 (7;; fade out 705 (set_targetable nil) 706 (set_fade_count (+ (fade_count) 2)) 707 (if (eq (fade_count) 14) 708 (progn 709 (set_state hiding) 710 (let ((to_object (get_object (random (total_objects))))) 711 (set_x (with_object to_object (x))) 712 (set_y (with_object to_object (y)))) 713 (setq taunt_time (- 30 (* (aitype) 2))) 714 (go_state 0)))) 715 716 (10;; game over 717 (set_state hiding) 718 (set_targetable nil) 719 (if (eq (state_time) 60) 720 (go_state 11)) 721 (if (not (eq (state_time) 0)) 722 (progn 723 (if (eq (mod (state_time) 8) 0) 724 (play_sound GRENADE_SND 127 (x) (y))) 725 (add_object EXPLODE1 (+ (x) (random (* (state_time) 2))) (+ (random (state_time)) (y))) 726 (add_object EXPLODE1 (- (x) (random (* (state_time) 2))) (- (y) (random (state_time))))))) 727 ) 728 729 T)))) 730 731 732 733 (def_char BOSS_ANT 734 (funs (ai_fun boss_ai) 735 (draw_fun ant_draw) 736 (damage_fun boss_damage)) 737 (vars taunt_time) 738 (flags (hurtable T) 739 (unlistable T)) 740 (fields ("taunt_time" "taunt_tint") 741 ("aistate" "aistate")) 742 (states "art/boss.spe" 743 (stopped "awlk0001.pcx") 744 (hiding "hidden") 745 (weapon_fire (seq "asht" 2 5)))) 746
Note: See TracChangeset
for help on using the changeset viewer.