;;-*-Lisp-*- (in-package goal) ;; definition of type blocking-plane (deftype blocking-plane (process-drawable) ((root collide-shape :override) (current-attack-mode symbol) ) (:state-methods idle ) (:methods (init! (_type_ (inline-array vector) float) none) ) ) ;; definition for method 3 of type blocking-plane (defmethod inspect ((this blocking-plane)) (when (not this) (set! this this) (goto cfg-4) ) (let ((t9-0 (method-of-type process-drawable inspect))) (t9-0 this) ) (format #t "~2Tcurrent-attack-mode: ~A~%" (-> this current-attack-mode)) (label cfg-4) this ) ;; failed to figure out what this is: (defskelgroup skel-blocking-plane blocking-plane blocking-plane-lod0-jg blocking-plane-idle-ja ((blocking-plane-lod0-mg (meters 999999))) :bounds (static-spherem 0 0 0 100.1) :texture-level 10 ) ;; failed to figure out what this is: (defstate idle (blocking-plane) :virtual #t :event (behavior ((proc process) (argc int) (message symbol) (block event-message-block)) (local-vars (v0-0 object)) (case message (('on) (cond ((nonzero? (-> self root)) (let ((v1-3 (-> self root root-prim))) (set! (-> v1-3 prim-core collide-as) (-> self root backup-collide-as)) (set! v0-0 (-> self root backup-collide-with)) (set! (-> v1-3 prim-core collide-with) (the-as collide-spec v0-0)) ) v0-0 ) (else (let ((gp-1 (-> self child))) (while gp-1 (let ((s5-0 (ppointer->process gp-1))) (set! gp-1 (-> gp-1 0 brother)) (if (type? s5-0 blocking-plane) (send-event s5-0 'on) ) ) ) ) #f ) ) ) (('off) (cond ((nonzero? (-> self root)) (let ((v1-13 (-> self root root-prim))) (set! (-> v1-13 prim-core collide-as) (collide-spec)) (set! (-> v1-13 prim-core collide-with) (collide-spec)) ) 0 ) (else (let ((gp-2 (-> self child))) (while gp-2 (let ((s5-1 (ppointer->process gp-2))) (set! gp-2 (-> gp-2 0 brother)) (if (type? s5-1 blocking-plane) (send-event s5-1 'off) ) ) ) ) #f ) ) ) (('collide-as) (set! v0-0 (-> block param 0)) (set! (-> self root root-prim prim-core collide-as) (the-as collide-spec v0-0)) v0-0 ) (('attack-mode) (set! v0-0 (-> block param 0)) (set! (-> self current-attack-mode) (the-as symbol v0-0)) v0-0 ) (('touch 'bonk 'attack) (when (-> self current-attack-mode) (let ((v1-25 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))) (if (< (vector-dot (vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable proc) root trans) (-> self root trans)) v1-25 ) 0.0 ) (vector-float*! v1-25 v1-25 -1.0) ) (send-event proc 'attack #f (static-attack-info :mask (vehicle-impulse-factor) ((id (new-attack-id)) (damage 2.0) (vehicle-damage-factor 1.0) (vehicle-impulse-factor 1.0) (mode (-> self current-attack-mode)) (vector v1-25) (shove-up (meters 2)) (shove-back (meters 4)) ) ) ) ) ) ) (('impact-impulse) (send-event (ppointer->process (-> self parent)) 'blocking-plane-hit (-> block param 0)) ) ) ) :code sleep-code ) ;; definition for method 21 of type blocking-plane ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defmethod init! ((this blocking-plane) (arg0 (inline-array vector)) (arg1 float)) (let ((s3-0 (-> arg0 0)) (s4-0 (-> arg0 1)) ) 0.0 (* 0.5 (vector-vector-distance s3-0 s4-0)) (let ((s2-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player)))) (let ((v1-3 (new 'process 'collide-shape-prim-mesh s2-0 (the-as uint 0) (the-as uint 0)))) (set! (-> v1-3 prim-core collide-as) (collide-spec obstacle blocking-plane)) (set! (-> v1-3 prim-core collide-with) (collide-spec jak vehicle-sphere hit-by-others-list player-list)) (set! (-> v1-3 prim-core action) (collide-action solid)) (set! (-> v1-3 transform-index) 3) (set! (-> s2-0 total-prims) (the-as uint 1)) (set! (-> s2-0 root-prim) v1-3) ) (set! (-> s2-0 nav-radius) (* 0.75 (-> s2-0 root-prim local-sphere w))) (let ((v1-6 (-> s2-0 root-prim))) (set! (-> s2-0 backup-collide-as) (-> v1-6 prim-core collide-as)) (set! (-> s2-0 backup-collide-with) (-> v1-6 prim-core collide-with)) ) (set! (-> this root) s2-0) ) (let ((s1-0 (new 'stack-no-clear 'matrix)) (s2-1 (-> this root)) ) (vector+! (-> s2-1 trans) s3-0 s4-0) (vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5) (+! (-> s2-1 trans y) (/ arg1 2)) (vector-! (-> s1-0 rvec) s4-0 s3-0) (let ((f30-1 (vector-normalize-ret-len! (-> s1-0 rvec) 1.0))) (set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH)) (set! (-> s2-1 scale y) (/ arg1 METER_LENGTH)) (set! (-> s2-1 scale z) 0.0) (vector-copy! (-> s1-0 uvec) (new 'static 'vector :y 1.0 :w 1.0)) (vector-cross! (-> s1-0 fvec) (-> s1-0 rvec) (-> s1-0 uvec)) (vector-normalize! (-> s1-0 fvec) 1.0) (matrix->quaternion (-> s2-1 quat) s1-0) (set-vector! (-> this root root-prim local-sphere) 0.0 (* 0.00024414062 (/ arg1 2)) 0.0 (* 0.5 (sqrtf (+ (square f30-1) (square arg1)))) ) ) ) ) (initialize-skeleton this (the-as skeleton-group (art-group-get-by-name *level* "skel-blocking-plane" (the-as (pointer level) #f))) (the-as pair 0) ) (logior! (-> this draw status) (draw-control-status no-draw-bounds)) (transform-post) (none) ) ;; definition for function blocking-plane-init-by-other (defbehavior blocking-plane-init-by-other blocking-plane ((arg0 (inline-array vector)) (arg1 float)) (if (not arg0) (deactivate self) ) (init! self arg0 arg1) (set! (-> self current-attack-mode) #f) (set! (-> self event-hook) (-> (method-of-object self idle) event)) (go-virtual idle) ) ;; definition for method 11 of type blocking-plane ;; INFO: Used lq/sq (defmethod init-from-entity! ((this blocking-plane) (arg0 entity-actor)) "Set up a newly created process from the entity that created it." (logclear! (-> this mask) (process-mask actor-pause)) (set! (-> this current-attack-mode) #f) (let ((s5-0 (new 'process 'path-control this 'path 0.0 (the-as entity #f) #f)) (f30-0 (res-lump-float (-> this entity) 'height :default 122880.0)) ) (set! (-> this path) s5-0) (if (or (not s5-0) (< (-> s5-0 curve num-cverts) 2)) (go process-drawable-art-error "bad path") ) (logior! (-> s5-0 flags) (path-control-flag display draw-line draw-point draw-text)) (let ((s4-0 (+ (-> s5-0 curve num-cverts) -1)) (s3-0 (new 'stack-no-clear 'inline-array 'vector 2)) ) (dotimes (v1-14 2) (set! (-> s3-0 v1-14 quad) (the-as uint128 0)) ) (dotimes (s2-0 s4-0) (get-point-in-path! s5-0 (-> s3-0 0) (the float s2-0) 'interp) (get-point-in-path! s5-0 (-> s3-0 1) (the float (+ s2-0 1)) 'interp) (process-spawn blocking-plane s3-0 f30-0 :name "blocking-plane" :to this) ) ) ) (go (method-of-object this idle)) ) ;; definition for function blocking-plane-spawn ;; INFO: Used lq/sq ;; WARN: Return type mismatch int vs none. (defbehavior blocking-plane-spawn process ((arg0 curve-control) (arg1 (inline-array vector)) (arg2 float)) (cond ((and arg1 (or (not arg0) (logtest? (-> arg0 flags) (path-control-flag not-found)))) (process-spawn blocking-plane arg1 arg2 :name "blocking-plane" :to self) ) (else (let ((s4-1 (the int (get-num-segments arg0))) (s3-0 0) (s2-0 (new 'stack-no-clear 'inline-array 'vector 2)) ) (dotimes (v1-8 2) (set! (-> s2-0 v1-8 quad) (the-as uint128 0)) ) (while (< s3-0 s4-1) (get-point-in-path! arg0 (-> s2-0 0) (the float s3-0) 'interp) (get-point-in-path! arg0 (-> s2-0 1) (the float (+ s3-0 1)) 'interp) (process-spawn blocking-plane s2-0 arg2 :name "blocking-plane" :to self) (+! s3-0 2) ) ) ) ) 0 (none) ) ;; definition for function blocking-plane-destroy ;; WARN: Return type mismatch int vs none. (defbehavior blocking-plane-destroy blocking-plane () (let ((gp-0 (-> self child))) (while gp-0 (let ((s5-0 (ppointer->process gp-0))) (set! gp-0 (-> gp-0 0 brother)) (if (type? s5-0 blocking-plane) (deactivate s5-0) ) ) ) ) 0 (none) )