mirror of
https://github.com/open-goal/jak-project
synced 2026-08-08 10:34:30 -04:00
122de4ecf5
After spending the last month staring at and comparing Jak 3 and Jak 1 versions of a bunch of `target` code for my jetboard mod, I figured this would be a good opportunity to revive this ancient PR #1714 along with some other small misc fixes/improvements. Instead of directly replacing the old fields, I decided to opt for using overlay fields to maintain backwards compatibility with existing manual patches, files without ref tests and mods that might use these fields.
135 lines
4.7 KiB
Common Lisp
Vendored
Generated
135 lines
4.7 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; definition of type shover
|
|
(deftype shover (process-drawable)
|
|
((root collide-shape :override)
|
|
(shove-up float)
|
|
)
|
|
(:states
|
|
shover-idle
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type shover
|
|
(defmethod inspect ((this shover))
|
|
(let ((t9-0 (method-of-type process-drawable inspect)))
|
|
(t9-0 this)
|
|
)
|
|
(format #t "~T~Tshove-up: ~f~%" (-> this shove-up))
|
|
this
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *shover-sg* shover shover-lod0-jg shover-idle-ja
|
|
((shover-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 0 0 2)
|
|
)
|
|
|
|
;; failed to figure out what this is:
|
|
(defstate shover-idle (shover)
|
|
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
|
|
(case message
|
|
(('touch 'attack)
|
|
(when (= (-> proc type) target)
|
|
(when ((method-of-type touching-shapes-entry prims-touching-action?)
|
|
(the-as touching-shapes-entry (-> block param 0))
|
|
(-> *target* control)
|
|
(collide-action solid)
|
|
(collide-action)
|
|
)
|
|
(let ((s4-0 (new 'stack 'attack-info)))
|
|
(calc-shove-up (-> self root) s4-0 (-> self shove-up))
|
|
(level-hint-spawn (text-id sunken-hotpipes) "sksp0134" (the-as entity #f) *entity-pool* (game-task none))
|
|
(if (or (= (-> *target* control mod-surface mode) 'air)
|
|
(>= (+ (current-time) (seconds -0.2)) (-> *target* control last-time-on-surface))
|
|
(< 0.75 (-> *target* control poly-normal y))
|
|
)
|
|
(send-event
|
|
proc
|
|
'attack-or-shove
|
|
(-> block param 0)
|
|
(static-attack-info ((mode 'burn) (vector (-> s4-0 vector)) (shove-up (-> s4-0 shove-up))))
|
|
)
|
|
(send-event
|
|
proc
|
|
'attack-or-shove
|
|
(-> block param 0)
|
|
(static-attack-info ((mode 'burn)
|
|
(shove-up (meters 0))
|
|
(shove-back (meters 2))
|
|
(vector (-> *target* control poly-normal))
|
|
(angle 'shove)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
:code anim-loop
|
|
)
|
|
|
|
;; definition for method 11 of type shover
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defmethod init-from-entity! ((this shover) (arg0 entity-actor))
|
|
(set! (-> this shove-up) (res-lump-float arg0 'shove :default 12288.0))
|
|
(let ((s3-0 (res-lump-value arg0 'collision-mesh-id uint128))
|
|
(s4-0 (new 'process 'collide-shape this (collide-list-enum hit-by-player)))
|
|
)
|
|
(let ((s3-1 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint s3-0) (the-as uint 0))))
|
|
(set! (-> s3-1 prim-core collide-as) (collide-kind wall-object))
|
|
(set! (-> s3-1 collide-with) (collide-kind target))
|
|
(set! (-> s3-1 prim-core action) (collide-action solid))
|
|
(set! (-> s3-1 prim-core offense) (collide-offense indestructible))
|
|
(set! (-> s3-1 transform-index) 0)
|
|
(set-vector! (-> s3-1 local-sphere) 0.0 0.0 0.0 53248.0)
|
|
(set-root-prim! s4-0 s3-1)
|
|
)
|
|
(set! (-> s4-0 nav-radius) (* 0.75 (-> s4-0 root-prim local-sphere w)))
|
|
(backup-collide-with-as s4-0)
|
|
(set! (-> this root) s4-0)
|
|
)
|
|
(process-drawable-from-entity! this arg0)
|
|
(initialize-skeleton this *shover-sg* '())
|
|
(let ((v1-17 (new 'process 'path-control this 'path 0.0)))
|
|
(set! (-> this path) v1-17)
|
|
(logior! (-> v1-17 flags) (path-control-flag display draw-line draw-point draw-text))
|
|
(if (<= (-> v1-17 curve num-cverts) 0)
|
|
(go process-drawable-art-error "no path")
|
|
)
|
|
)
|
|
(let* ((sv-16 (new 'static 'res-tag))
|
|
(v1-23 (res-lump-data arg0 'trans-offset (pointer float) :tag-ptr (& sv-16)))
|
|
)
|
|
(when v1-23
|
|
(+! (-> this root trans x) (-> v1-23 0))
|
|
(+! (-> this root trans y) (-> v1-23 1))
|
|
(+! (-> this root trans z) (-> v1-23 2))
|
|
)
|
|
)
|
|
(let ((f0-13 (res-lump-float arg0 'rotoffset)))
|
|
(if (!= f0-13 0.0)
|
|
(quaternion-rotate-y! (-> this root quat) (-> this root quat) f0-13)
|
|
)
|
|
)
|
|
(ja-channel-set! 1)
|
|
(let ((s5-1 (-> this skel root-channel 0)))
|
|
(joint-control-channel-group-eval!
|
|
s5-1
|
|
(the-as art-joint-anim (-> this draw art-group data 2))
|
|
num-func-identity
|
|
)
|
|
(set! (-> s5-1 frame-num) 0.0)
|
|
)
|
|
(ja-post)
|
|
(update-transforms! (-> this root))
|
|
(set! *shover* this)
|
|
(go shover-idle)
|
|
(none)
|
|
)
|