mirror of
https://github.com/open-goal/jak-project
synced 2026-07-01 20:20:35 -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.
1323 lines
54 KiB
Common Lisp
Vendored
Generated
1323 lines
54 KiB
Common Lisp
Vendored
Generated
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; failed to figure out what this is:
|
|
(defskelgroup *jchar-sg* eichar eichar-lod0-jg -1
|
|
((eichar-lod0-mg (meters 999999)))
|
|
:bounds (static-spherem 0 2 0 3)
|
|
:longest-edge (meters 1)
|
|
:shadow eichar-shadow-mg
|
|
:texture-level 2
|
|
:sort 1
|
|
)
|
|
|
|
;; definition for symbol *target-shadow-control*, type shadow-control
|
|
(define *target-shadow-control*
|
|
(new 'static 'shadow-control :settings (new 'static 'shadow-settings
|
|
:flags (shadow-flags disable-fade)
|
|
:shadow-dir (new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0)
|
|
:bot-plane (new 'static 'plane :y 1.0 :w 37683.2)
|
|
:top-plane (new 'static 'plane :y 1.0 :w 4096.0)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition of type target-bank
|
|
(deftype target-bank (basic)
|
|
((jump-collide-offset meters)
|
|
(jump-height-min meters)
|
|
(jump-height-max meters)
|
|
(double-jump-height-min meters)
|
|
(double-jump-height-max meters)
|
|
(flip-jump-height-min meters)
|
|
(flip-jump-height-max meters)
|
|
(duck-jump-height-min meters)
|
|
(duck-jump-height-max meters)
|
|
(flop-jump-height-min meters)
|
|
(flop-jump-height-max meters)
|
|
(attack-jump-height-min meters)
|
|
(attack-jump-height-max meters)
|
|
(edge-grab-jump-height-min meters)
|
|
(edge-grab-jump-height-max meters)
|
|
(swim-jump-height-min meters)
|
|
(swim-jump-height-max meters)
|
|
(tube-jump-height-min meters)
|
|
(tube-jump-height-max meters)
|
|
(wheel-duration time-frame)
|
|
(wheel-jump-pre-window time-frame)
|
|
(wheel-jump-post-window time-frame)
|
|
(wheel-timeout time-frame)
|
|
(wheel-speed-min meters)
|
|
(wheel-speed-inc meters)
|
|
(wheel-flip-duration time-frame)
|
|
(wheel-flip-height meters)
|
|
(wheel-flip-dist meters)
|
|
(wheel-flip-art-height meters)
|
|
(wheel-flip-art-dist meters)
|
|
(duck-slide-distance meters)
|
|
(fall-far meters)
|
|
(fall-far-inc meters)
|
|
(attack-timeout time-frame)
|
|
(ground-timeout time-frame)
|
|
(slide-down-timeout time-frame)
|
|
(fall-timeout time-frame)
|
|
(fall-stumble-threshold meters)
|
|
(yellow-projectile-speed meters)
|
|
(hit-invulnerable-timeout time-frame)
|
|
(run-cycle-length float)
|
|
(walk-cycle-dist meters)
|
|
(walk-up-cycle-dist meters)
|
|
(walk-down-cycle-dist meters)
|
|
(walk-side-cycle-dist meters)
|
|
(run-cycle-dist meters)
|
|
(run-up-cycle-dist meters)
|
|
(run-down-cycle-dist meters)
|
|
(run-side-cycle-dist meters)
|
|
(run-wall-cycle-dist meters)
|
|
(duck-walk-cycle-dist meters)
|
|
(wade-shallow-walk-cycle-dist meters)
|
|
(wade-deep-walk-cycle-dist meters)
|
|
(smack-surface-dist meters)
|
|
(smack-surface-height meters)
|
|
(min-dive-depth meters)
|
|
(root-radius meters)
|
|
(root-offset vector :inline)
|
|
(body-radius meters)
|
|
(edge-radius meters)
|
|
(edge-offset vector :inline)
|
|
(head-radius meters)
|
|
(head-height meters)
|
|
(head-offset vector :inline)
|
|
(spin-radius meters)
|
|
(spin-offset vector :inline)
|
|
(duck-spin-radius meters)
|
|
(duck-spin-offset vector :inline)
|
|
(punch-radius meters)
|
|
(punch-offset vector :inline)
|
|
(uppercut-radius meters)
|
|
(uppercut0-offset vector :inline)
|
|
(uppercut1-offset vector :inline)
|
|
(flop-radius meters)
|
|
(flop0-offset vector :inline)
|
|
(flop1-offset vector :inline)
|
|
(stuck-time seconds)
|
|
(stuck-timeout seconds)
|
|
(stuck-distance meters)
|
|
(tongue-pull-speed-min float)
|
|
(tongue-pull-speed-max float)
|
|
(yellow-attack-timeout time-frame)
|
|
)
|
|
)
|
|
|
|
;; definition for method 3 of type target-bank
|
|
(defmethod inspect ((this target-bank))
|
|
(format #t "[~8x] ~A~%" this (-> this type))
|
|
(format #t "~Tjump-collide-offset: (meters ~m)~%" (-> this jump-collide-offset))
|
|
(format #t "~Tjump-height-min: (meters ~m)~%" (-> this jump-height-min))
|
|
(format #t "~Tjump-height-max: (meters ~m)~%" (-> this jump-height-max))
|
|
(format #t "~Tdouble-jump-height-min: (meters ~m)~%" (-> this double-jump-height-min))
|
|
(format #t "~Tdouble-jump-height-max: (meters ~m)~%" (-> this double-jump-height-max))
|
|
(format #t "~Tflip-jump-height-min: (meters ~m)~%" (-> this flip-jump-height-min))
|
|
(format #t "~Tflip-jump-height-max: (meters ~m)~%" (-> this flip-jump-height-max))
|
|
(format #t "~Tduck-jump-height-min: (meters ~m)~%" (-> this duck-jump-height-min))
|
|
(format #t "~Tduck-jump-height-max: (meters ~m)~%" (-> this duck-jump-height-max))
|
|
(format #t "~Tflop-jump-height-min: (meters ~m)~%" (-> this flop-jump-height-min))
|
|
(format #t "~Tflop-jump-height-max: (meters ~m)~%" (-> this flop-jump-height-max))
|
|
(format #t "~Tattack-jump-height-min: (meters ~m)~%" (-> this attack-jump-height-min))
|
|
(format #t "~Tattack-jump-height-max: (meters ~m)~%" (-> this attack-jump-height-max))
|
|
(format #t "~Tedge-grab-jump-height-min: (meters ~m)~%" (-> this edge-grab-jump-height-min))
|
|
(format #t "~Tedge-grab-jump-height-max: (meters ~m)~%" (-> this edge-grab-jump-height-max))
|
|
(format #t "~Tswim-jump-height-min: (meters ~m)~%" (-> this swim-jump-height-min))
|
|
(format #t "~Tswim-jump-height-max: (meters ~m)~%" (-> this swim-jump-height-max))
|
|
(format #t "~Ttube-jump-height-min: (meters ~m)~%" (-> this tube-jump-height-min))
|
|
(format #t "~Ttube-jump-height-max: (meters ~m)~%" (-> this tube-jump-height-max))
|
|
(format #t "~Twheel-duration: ~D~%" (-> this wheel-duration))
|
|
(format #t "~Twheel-jump-pre-window: ~D~%" (-> this wheel-jump-pre-window))
|
|
(format #t "~Twheel-jump-post-window: ~D~%" (-> this wheel-jump-post-window))
|
|
(format #t "~Twheel-timeout: ~D~%" (-> this wheel-timeout))
|
|
(format #t "~Twheel-speed-min: (meters ~m)~%" (-> this wheel-speed-min))
|
|
(format #t "~Twheel-speed-inc: (meters ~m)~%" (-> this wheel-speed-inc))
|
|
(format #t "~Twheel-flip-duration: ~D~%" (-> this wheel-flip-duration))
|
|
(format #t "~Twheel-flip-height: (meters ~m)~%" (-> this wheel-flip-height))
|
|
(format #t "~Twheel-flip-dist: (meters ~m)~%" (-> this wheel-flip-dist))
|
|
(format #t "~Twheel-flip-art-height: (meters ~m)~%" (-> this wheel-flip-art-height))
|
|
(format #t "~Twheel-flip-art-dist: (meters ~m)~%" (-> this wheel-flip-art-dist))
|
|
(format #t "~Tduck-slide-distance: (meters ~m)~%" (-> this duck-slide-distance))
|
|
(format #t "~Tfall-far: (meters ~m)~%" (-> this fall-far))
|
|
(format #t "~Tfall-far-inc: (meters ~m)~%" (-> this fall-far-inc))
|
|
(format #t "~Tattack-timeout: ~D~%" (-> this attack-timeout))
|
|
(format #t "~Tground-timeout: ~D~%" (-> this ground-timeout))
|
|
(format #t "~Tslide-down-timeout: ~D~%" (-> this slide-down-timeout))
|
|
(format #t "~Tfall-timeout: ~D~%" (-> this fall-timeout))
|
|
(format #t "~Tfall-stumble-threshold: (meters ~m)~%" (-> this fall-stumble-threshold))
|
|
(format #t "~Tyellow-projectile-speed: (meters ~m)~%" (-> this yellow-projectile-speed))
|
|
(format #t "~Thit-invulnerable-timeout: ~D~%" (-> this hit-invulnerable-timeout))
|
|
(format #t "~Trun-cycle-length: ~f~%" (-> this run-cycle-length))
|
|
(format #t "~Twalk-cycle-dist: (meters ~m)~%" (-> this walk-cycle-dist))
|
|
(format #t "~Twalk-up-cycle-dist: (meters ~m)~%" (-> this walk-up-cycle-dist))
|
|
(format #t "~Twalk-down-cycle-dist: (meters ~m)~%" (-> this walk-down-cycle-dist))
|
|
(format #t "~Twalk-side-cycle-dist: (meters ~m)~%" (-> this walk-side-cycle-dist))
|
|
(format #t "~Trun-cycle-dist: (meters ~m)~%" (-> this run-cycle-dist))
|
|
(format #t "~Trun-up-cycle-dist: (meters ~m)~%" (-> this run-up-cycle-dist))
|
|
(format #t "~Trun-down-cycle-dist: (meters ~m)~%" (-> this run-down-cycle-dist))
|
|
(format #t "~Trun-side-cycle-dist: (meters ~m)~%" (-> this run-side-cycle-dist))
|
|
(format #t "~Trun-wall-cycle-dist: (meters ~m)~%" (-> this run-wall-cycle-dist))
|
|
(format #t "~Tduck-walk-cycle-dist: (meters ~m)~%" (-> this duck-walk-cycle-dist))
|
|
(format #t "~Twade-shallow-walk-cycle-dist: (meters ~m)~%" (-> this wade-shallow-walk-cycle-dist))
|
|
(format #t "~Twade-deep-walk-cycle-dist: (meters ~m)~%" (-> this wade-deep-walk-cycle-dist))
|
|
(format #t "~Tsmack-surface-dist: (meters ~m)~%" (-> this smack-surface-dist))
|
|
(format #t "~Tsmack-surface-height: (meters ~m)~%" (-> this smack-surface-height))
|
|
(format #t "~Tmin-dive-depth: (meters ~m)~%" (-> this min-dive-depth))
|
|
(format #t "~Troot-radius: (meters ~m)~%" (-> this root-radius))
|
|
(format #t "~Troot-offset: ~`vector`P~%" (-> this root-offset))
|
|
(format #t "~Tbody-radius: (meters ~m)~%" (-> this body-radius))
|
|
(format #t "~Tedge-radius: (meters ~m)~%" (-> this edge-radius))
|
|
(format #t "~Tedge-offset: ~`vector`P~%" (-> this edge-offset))
|
|
(format #t "~Thead-radius: (meters ~m)~%" (-> this head-radius))
|
|
(format #t "~Thead-height: (meters ~m)~%" (-> this head-height))
|
|
(format #t "~Thead-offset: ~`vector`P~%" (-> this head-offset))
|
|
(format #t "~Tspin-radius: (meters ~m)~%" (-> this spin-radius))
|
|
(format #t "~Tspin-offset: ~`vector`P~%" (-> this spin-offset))
|
|
(format #t "~Tduck-spin-radius: (meters ~m)~%" (-> this duck-spin-radius))
|
|
(format #t "~Tduck-spin-offset: ~`vector`P~%" (-> this duck-spin-offset))
|
|
(format #t "~Tpunch-radius: (meters ~m)~%" (-> this punch-radius))
|
|
(format #t "~Tpunch-offset: ~`vector`P~%" (-> this punch-offset))
|
|
(format #t "~Tuppercut-radius: (meters ~m)~%" (-> this uppercut-radius))
|
|
(format #t "~Tuppercut0-offset: ~`vector`P~%" (-> this uppercut0-offset))
|
|
(format #t "~Tuppercut1-offset: ~`vector`P~%" (-> this uppercut1-offset))
|
|
(format #t "~Tflop-radius: (meters ~m)~%" (-> this flop-radius))
|
|
(format #t "~Tflop0-offset: ~`vector`P~%" (-> this flop0-offset))
|
|
(format #t "~Tflop1-offset: ~`vector`P~%" (-> this flop1-offset))
|
|
(format #t "~Tstuck-time: (seconds ~e)~%" (-> this stuck-time))
|
|
(format #t "~Tstuck-timeout: (seconds ~e)~%" (-> this stuck-timeout))
|
|
(format #t "~Tstuck-distance: (meters ~m)~%" (-> this stuck-distance))
|
|
(format #t "~Ttongue-pull-speed-min: ~f~%" (-> this tongue-pull-speed-min))
|
|
(format #t "~Ttongue-pull-speed-max: ~f~%" (-> this tongue-pull-speed-max))
|
|
(format #t "~Tyellow-attack-timeout: ~D~%" (-> this yellow-attack-timeout))
|
|
this
|
|
)
|
|
|
|
;; definition for symbol *TARGET-bank*, type target-bank
|
|
(define *TARGET-bank* (new 'static 'target-bank
|
|
:jump-collide-offset (meters 0.7)
|
|
:jump-height-min (meters 1.01)
|
|
:jump-height-max (meters 3.5)
|
|
:double-jump-height-min (meters 1)
|
|
:double-jump-height-max (meters 2.5)
|
|
:flip-jump-height-min (meters 5)
|
|
:flip-jump-height-max (meters 7)
|
|
:duck-jump-height-min (meters 5)
|
|
:duck-jump-height-max (meters 7)
|
|
:flop-jump-height-min (meters 5)
|
|
:flop-jump-height-max (meters 7)
|
|
:attack-jump-height-min (meters 4)
|
|
:attack-jump-height-max (meters 5.5)
|
|
:edge-grab-jump-height-min (meters 1.7)
|
|
:edge-grab-jump-height-max (meters 1.7)
|
|
:swim-jump-height-min (meters 5)
|
|
:swim-jump-height-max (meters 5)
|
|
:tube-jump-height-min (meters 1.75)
|
|
:tube-jump-height-max (meters 2.5)
|
|
:wheel-duration (seconds 0.5)
|
|
:wheel-jump-pre-window (seconds 1)
|
|
:wheel-jump-post-window (seconds 0.1)
|
|
:wheel-speed-min (meters 11.5)
|
|
:wheel-speed-inc (meters 1.5)
|
|
:wheel-flip-duration (seconds 0.7)
|
|
:wheel-flip-height (meters 3.52)
|
|
:wheel-flip-dist (meters 17.3)
|
|
:wheel-flip-art-height (meters 3.2969)
|
|
:wheel-flip-art-dist (meters 12.5)
|
|
:duck-slide-distance (meters 5.75)
|
|
:fall-far (meters 30)
|
|
:fall-far-inc (meters 20)
|
|
:attack-timeout (seconds 0.3)
|
|
:ground-timeout (seconds 0.2)
|
|
:slide-down-timeout (seconds 0.2)
|
|
:fall-timeout (seconds 1)
|
|
:fall-stumble-threshold (meters 39.9)
|
|
:yellow-projectile-speed (meters 60)
|
|
:hit-invulnerable-timeout (seconds 3)
|
|
:run-cycle-length 60.0
|
|
:walk-cycle-dist (meters 2.8)
|
|
:walk-up-cycle-dist (meters 2.8)
|
|
:walk-down-cycle-dist (meters 2.8)
|
|
:walk-side-cycle-dist (meters 2.8)
|
|
:run-cycle-dist (meters 6.25)
|
|
:run-up-cycle-dist (meters 5)
|
|
:run-down-cycle-dist (meters 5)
|
|
:run-side-cycle-dist (meters 6.25)
|
|
:run-wall-cycle-dist (meters 2.8)
|
|
:duck-walk-cycle-dist (meters 3.25)
|
|
:wade-shallow-walk-cycle-dist (meters 6)
|
|
:wade-deep-walk-cycle-dist (meters 6)
|
|
:smack-surface-dist (meters 1.25)
|
|
:min-dive-depth (meters 2)
|
|
:root-radius (meters 2.2)
|
|
:root-offset (new 'static 'vector :y 4915.2 :w 1.0)
|
|
:body-radius (meters 0.7)
|
|
:edge-radius (meters 0.35)
|
|
:edge-offset (new 'static 'vector :y 4915.2 :z 4096.0 :w 1.0)
|
|
:head-radius (meters 0.7)
|
|
:head-height (meters 1.4)
|
|
:head-offset (new 'static 'vector :y 4915.2 :w 1.0)
|
|
:spin-radius (meters 2.2)
|
|
:spin-offset (new 'static 'vector :y 6553.6 :w 1.0)
|
|
:duck-spin-radius (meters 1.2)
|
|
:duck-spin-offset (new 'static 'vector :y 4096.0 :w 1.0)
|
|
:punch-radius (meters 1.3)
|
|
:punch-offset (new 'static 'vector :y 5324.8 :w 1.0)
|
|
:uppercut-radius (meters 1)
|
|
:uppercut0-offset (new 'static 'vector :y 3276.8 :w 1.0)
|
|
:uppercut1-offset (new 'static 'vector :y 9011.2 :w 1.0)
|
|
:flop-radius (meters 1.4)
|
|
:flop0-offset (new 'static 'vector :y 3276.8 :w 1.0)
|
|
:flop1-offset (new 'static 'vector :y 9011.2 :w 1.0)
|
|
:stuck-time (seconds 0.3)
|
|
:stuck-timeout (seconds 2)
|
|
:stuck-distance (meters 0.05)
|
|
:tongue-pull-speed-min 0.15
|
|
:tongue-pull-speed-max 0.22
|
|
:yellow-attack-timeout (seconds 0.2)
|
|
)
|
|
)
|
|
|
|
;; definition for function target-start-attack
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defbehavior target-start-attack target ()
|
|
(+! (-> self control target-attack-id) 1)
|
|
(set! (-> self control attack-count) 0)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-danger-set!
|
|
(defbehavior target-danger-set! target ((arg0 symbol) (arg1 symbol))
|
|
(let ((s4-0 (-> self control unknown-sphere00))
|
|
(s5-0 (-> self control unknown-sphere01))
|
|
(gp-0 (-> self control unknown-sphere02))
|
|
(f30-0 (if arg1
|
|
2.0
|
|
1.0
|
|
)
|
|
)
|
|
)
|
|
(dotimes (v1-4 3)
|
|
(set! (-> self control unknown-sphere-array00 v1-4 prim-core offense) (collide-offense normal-attack))
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> self control root-prim local-sphere))
|
|
(-> *TARGET-bank* root-offset)
|
|
(-> *TARGET-bank* root-radius)
|
|
)
|
|
(set! (-> self control danger-mode) arg0)
|
|
(logclear! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 transform-index) -2)
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind))
|
|
(set! (-> s4-0 collide-with) (collide-kind))
|
|
(set! (-> s4-0 local-sphere w) 0.0)
|
|
(set! (-> s4-0 prim-core offense) (collide-offense no-offense))
|
|
(set! (-> s5-0 transform-index) -2)
|
|
(set! (-> s5-0 prim-core collide-as) (collide-kind))
|
|
(set! (-> s5-0 collide-with) (collide-kind))
|
|
(set! (-> s5-0 local-sphere w) 0.0)
|
|
(set! (-> s5-0 prim-core offense) (collide-offense no-offense))
|
|
(set! (-> gp-0 transform-index) -2)
|
|
(set! (-> gp-0 prim-core collide-as) (collide-kind))
|
|
(set! (-> gp-0 collide-with) (collide-kind))
|
|
(set! (-> gp-0 local-sphere w) 0.0)
|
|
(set! (-> gp-0 prim-core offense) (collide-offense no-offense))
|
|
(case arg0
|
|
(('harmless #f)
|
|
(set! (-> self control danger-mode) #f)
|
|
(target-collide-set! (-> self control unknown-symbol00) (-> self control unknown-float90))
|
|
)
|
|
(('spin 'spin-air)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> self control root-prim local-sphere))
|
|
(new 'static 'vector :y 6553.6 :w 1.0)
|
|
9830.4
|
|
)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* spin-offset)
|
|
(-> *TARGET-bank* spin-radius)
|
|
)
|
|
)
|
|
(('duck-spin)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> self control root-prim local-sphere))
|
|
(new 'static 'vector :y 6553.6 :w 1.0)
|
|
10649.6
|
|
)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* duck-spin-offset)
|
|
(-> *TARGET-bank* duck-spin-radius)
|
|
)
|
|
(set! (-> s5-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s5-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius))
|
|
(set! (-> s5-0 transform-index) 32)
|
|
)
|
|
(('duck-slide)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* duck-spin-offset)
|
|
(-> *TARGET-bank* duck-spin-radius)
|
|
)
|
|
(set! (-> s5-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s5-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius))
|
|
(set! (-> s5-0 transform-index) 28)
|
|
)
|
|
(('wheel-solid)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(dotimes (v1-57 3)
|
|
(set! (-> self control unknown-sphere-array00 v1-57 prim-core offense) (collide-offense touch))
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* duck-spin-offset)
|
|
(+ 819.2 (-> *TARGET-bank* duck-spin-radius))
|
|
)
|
|
(set! (-> s5-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s5-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius))
|
|
(set! (-> s5-0 transform-index) 7)
|
|
(set! (-> self control danger-mode) 'roll)
|
|
)
|
|
(('flip)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(dotimes (v1-71 3)
|
|
(set! (-> self control unknown-sphere-array00 v1-71 prim-core offense) (collide-offense touch))
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* duck-spin-offset)
|
|
(+ 819.2 (-> *TARGET-bank* duck-spin-radius))
|
|
)
|
|
(set! (-> s5-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s5-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* duck-spin-radius))
|
|
(set! (-> s5-0 transform-index) 7)
|
|
(set! (-> self control danger-mode) 'flip)
|
|
)
|
|
(('punch)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> self control root-prim local-sphere))
|
|
(new 'static 'vector :y 6553.6 :w 1.0)
|
|
11878.4
|
|
)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* punch-offset)
|
|
(-> *TARGET-bank* punch-radius)
|
|
)
|
|
(set! (-> s5-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s5-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* punch-radius))
|
|
(set! (-> s5-0 transform-index) 22)
|
|
)
|
|
(('uppercut)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> self control root-prim local-sphere))
|
|
(new 'static 'vector :y 6553.6 :w 1.0)
|
|
11878.4
|
|
)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* uppercut0-offset)
|
|
(-> *TARGET-bank* uppercut-radius)
|
|
)
|
|
(set! (-> s5-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s5-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r! (the-as sphere (-> s5-0 local-sphere)) *null-vector* (-> *TARGET-bank* uppercut-radius))
|
|
(set! (-> s5-0 transform-index) 22)
|
|
(set! (-> gp-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> gp-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> gp-0 local-sphere))
|
|
(-> *TARGET-bank* uppercut1-offset)
|
|
(-> *TARGET-bank* uppercut-radius)
|
|
)
|
|
)
|
|
(('flop)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(dotimes (v1-114 3)
|
|
(set! (-> self control unknown-sphere-array00 v1-114 prim-core offense) (collide-offense strong-attack))
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* flop0-offset)
|
|
(-> *TARGET-bank* flop-radius)
|
|
)
|
|
(set! f30-0 1.0)
|
|
(set! (-> self control danger-mode) 'flop)
|
|
)
|
|
(('flop-down)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(dotimes (v1-124 3)
|
|
(set! (-> self control unknown-sphere-array00 v1-124 prim-core offense) (collide-offense strong-attack))
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* flop0-offset)
|
|
(-> *TARGET-bank* flop-radius)
|
|
)
|
|
(set! (-> s5-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s5-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s5-0 local-sphere))
|
|
(-> *TARGET-bank* flop1-offset)
|
|
(-> *TARGET-bank* flop-radius)
|
|
)
|
|
(if (!= f30-0 1.0)
|
|
(set! f30-0 2.1)
|
|
)
|
|
(set! (-> self control danger-mode) 'flop)
|
|
)
|
|
(('flut-attack)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> self control root-prim local-sphere))
|
|
(new 'static 'vector :y 6553.6 :w 1.0)
|
|
12288.0
|
|
)
|
|
(logior! (-> self state-flags) (state-flags dangerous))
|
|
(set! (-> s4-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s4-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s4-0 local-sphere))
|
|
(-> *TARGET-bank* spin-offset)
|
|
(+ 2048.0 (-> *TARGET-bank* punch-radius))
|
|
)
|
|
(set! (-> s5-0 prim-core collide-as) (collide-kind target target-attack))
|
|
(set! (-> s5-0 collide-with)
|
|
(collide-kind cak-1 cak-2 cak-3 powerup crate enemy wall-object ground-object mother-spider)
|
|
)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> s5-0 local-sphere))
|
|
*null-vector*
|
|
(+ 1228.8 (-> *TARGET-bank* punch-radius))
|
|
)
|
|
(set! (-> s5-0 transform-index) 37)
|
|
(dotimes (v1-148 3)
|
|
(set! (-> self control unknown-sphere-array00 v1-148 prim-core offense) (collide-offense strong-attack))
|
|
)
|
|
)
|
|
(else
|
|
(format 0 "ERROR: ~A unknown danger mode ~A" self arg0)
|
|
)
|
|
)
|
|
(when (and (!= f30-0 1.0) (not (or (= arg0 'harmless) (= arg0 #f))))
|
|
(set! (-> self control root-prim local-sphere w) (* (-> self control root-prim local-sphere w) f30-0))
|
|
(set! (-> s4-0 local-sphere w) (* (-> s4-0 local-sphere w) f30-0))
|
|
(set! (-> s5-0 local-sphere w) (* (-> s5-0 local-sphere w) f30-0))
|
|
(set! (-> gp-0 local-sphere w) (* (-> gp-0 local-sphere w) f30-0))
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function target-collide-set!
|
|
(defbehavior target-collide-set! target ((arg0 symbol) (arg1 float))
|
|
(let ((gp-0 (-> self control)))
|
|
(set! (-> self control unknown-symbol00) arg0)
|
|
(set! (-> self control unknown-float90) arg1)
|
|
(dotimes (v1-2 3)
|
|
(set! (-> gp-0 unknown-sphere-array00 v1-2 prim-core offense) (collide-offense touch))
|
|
(set! (-> gp-0 unknown-sphere-array00 v1-2 transform-index) -2)
|
|
)
|
|
(case arg0
|
|
(('pole)
|
|
(set-vector! (-> gp-0 unknown-sphere-array00 0 local-sphere) 0.0 0.0 0.0 (-> *TARGET-bank* body-radius))
|
|
(set-vector! (-> gp-0 unknown-sphere-array00 1 local-sphere) 0.0 0.0 0.0 (-> *TARGET-bank* body-radius))
|
|
(set-vector! (-> gp-0 unknown-sphere-array00 2 local-sphere) 0.0 0.0 0.0 (-> *TARGET-bank* body-radius))
|
|
(set! (-> gp-0 unknown-sphere-array00 0 transform-index) 28)
|
|
(set! (-> gp-0 unknown-sphere-array00 1 transform-index) 26)
|
|
(set! (-> gp-0 unknown-sphere-array00 2 transform-index) 7)
|
|
)
|
|
(('racer)
|
|
(set! (-> gp-0 draw-offset y) 4096.0)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> gp-0 root-prim local-sphere))
|
|
(new 'static 'vector :y 8192.0 :w 1.0)
|
|
16384.0
|
|
)
|
|
(set-vector! (-> gp-0 unknown-sphere-array00 0 local-sphere) 0.0 6553.6 0.0 6553.6)
|
|
(set-vector! (-> gp-0 unknown-sphere-array00 1 local-sphere) 0.0 9420.8 0.0 6553.6)
|
|
(set-vector! (-> gp-0 unknown-sphere-array00 2 local-sphere) 0.0 12288.0 0.0 6553.6)
|
|
(dotimes (v1-22 3)
|
|
(set! (-> gp-0 unknown-sphere-array00 v1-22 prim-core offense) (collide-offense strong-attack))
|
|
)
|
|
)
|
|
(('flut)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> gp-0 root-prim local-sphere))
|
|
(new 'static 'vector :y 8192.0 :w 1.0)
|
|
12288.0
|
|
)
|
|
(set-vector! (-> gp-0 unknown-sphere-array00 0 local-sphere) 0.0 4915.2 0.0 4915.2)
|
|
(set-vector! (-> gp-0 unknown-sphere-array00 1 local-sphere) 0.0 7782.4004 0.0 4915.2)
|
|
(set-vector! (-> gp-0 unknown-sphere-array00 2 local-sphere) 0.0 10649.6 0.0 4915.2)
|
|
)
|
|
(('duck)
|
|
(set! (-> self control unknown-float91) arg1)
|
|
(let ((f30-0 (- 1.0 arg1)))
|
|
(set! (-> gp-0 draw-offset y) 0.0)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> gp-0 root-prim local-sphere))
|
|
(-> *TARGET-bank* root-offset)
|
|
(-> *TARGET-bank* root-radius)
|
|
)
|
|
(set-vector!
|
|
(-> gp-0 unknown-sphere-array00 0 local-sphere)
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
(* 0.0 f30-0)
|
|
(-> *TARGET-bank* body-radius)
|
|
)
|
|
(set-vector!
|
|
(-> gp-0 unknown-sphere-array00 1 local-sphere)
|
|
0.0
|
|
(+ (-> *TARGET-bank* body-radius) (* 2867.2 f30-0))
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
)
|
|
(set-vector!
|
|
(-> gp-0 unknown-sphere-array00 2 local-sphere)
|
|
0.0
|
|
(+ (-> *TARGET-bank* body-radius) (* 5734.4 f30-0))
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
)
|
|
)
|
|
)
|
|
(('tube)
|
|
(set! (-> self control unknown-float91) arg1)
|
|
(let ((f30-1 (- 1.0 arg1)))
|
|
(set! (-> gp-0 draw-offset y) 0.0)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> gp-0 root-prim local-sphere))
|
|
(-> *TARGET-bank* root-offset)
|
|
(-> *TARGET-bank* root-radius)
|
|
)
|
|
(set-vector!
|
|
(-> gp-0 unknown-sphere-array00 0 local-sphere)
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
(* 0.0 f30-1)
|
|
(-> *TARGET-bank* body-radius)
|
|
)
|
|
(set-vector!
|
|
(-> gp-0 unknown-sphere-array00 1 local-sphere)
|
|
0.0
|
|
(+ (-> *TARGET-bank* body-radius) (* 2867.2 f30-1))
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
)
|
|
(set-vector!
|
|
(-> gp-0 unknown-sphere-array00 2 local-sphere)
|
|
0.0
|
|
(+ (-> *TARGET-bank* body-radius) (* 5734.4 f30-1))
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
)
|
|
)
|
|
(dotimes (v1-52 3)
|
|
(set! (-> gp-0 unknown-sphere-array00 v1-52 prim-core offense) (collide-offense strong-attack))
|
|
)
|
|
)
|
|
(else
|
|
(set! (-> self control unknown-float91) 0.0)
|
|
(set! (-> gp-0 draw-offset y) 0.0)
|
|
(sphere<-vector+r!
|
|
(the-as sphere (-> gp-0 root-prim local-sphere))
|
|
(-> *TARGET-bank* root-offset)
|
|
(-> *TARGET-bank* root-radius)
|
|
)
|
|
(set-vector!
|
|
(-> gp-0 unknown-sphere-array00 0 local-sphere)
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
)
|
|
(set-vector!
|
|
(-> gp-0 unknown-sphere-array00 1 local-sphere)
|
|
0.0
|
|
(+ 2867.2 (-> *TARGET-bank* body-radius))
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
)
|
|
(set-vector!
|
|
(-> gp-0 unknown-sphere-array00 2 local-sphere)
|
|
0.0
|
|
(+ 5734.4 (-> *TARGET-bank* body-radius))
|
|
0.0
|
|
(-> *TARGET-bank* body-radius)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
)
|
|
|
|
;; definition for method 27 of type control-info
|
|
(defmethod get-quaternion ((this control-info))
|
|
(-> this quat-for-control)
|
|
)
|
|
|
|
;; definition for function target-align-vel-z-adjust
|
|
(defbehavior target-align-vel-z-adjust target ((arg0 float))
|
|
(let ((f1-0 (-> self control local-slope-z)))
|
|
(* arg0 (if (< 0.0 f1-0)
|
|
(* (- 1.0 f1-0) (-> self control current-surface alignv))
|
|
(-> self control current-surface alignv)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for method 16 of type target
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch control-info vs collide-shape.
|
|
(defmethod apply-alignment ((this target) (arg0 align-opts) (arg1 transformq) (arg2 vector))
|
|
(let ((s2-0 (new 'stack-no-clear 'vector)))
|
|
(set! (-> s2-0 quad) (-> arg2 quad))
|
|
(set! (-> s2-0 z) (target-align-vel-z-adjust (-> s2-0 z)))
|
|
(when (logtest? arg0 (align-opts adjust-x-vel adjust-y-vel adjust-xz-vel))
|
|
(let* ((s3-0 (-> this control c-R-w))
|
|
(s0-0 (-> this control w-R-c))
|
|
(s1-0 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control dynam gravity) s0-0))
|
|
(a1-3 (vector-matrix*! (new 'stack-no-clear 'vector) (-> this control transv) s0-0))
|
|
)
|
|
(if (logtest? arg0 (align-opts no-gravity))
|
|
(set-vector! s1-0 0.0 0.0 0.0 1.0)
|
|
)
|
|
(when (logtest? arg0 (align-opts adjust-x-vel))
|
|
(set! (-> a1-3 x)
|
|
(+ (* (-> arg1 trans x) (-> s2-0 x) (-> *display* frames-per-second)) (* (-> s1-0 x) (seconds-per-frame)))
|
|
)
|
|
(if (not (logtest? arg0 (align-opts adjust-xz-vel keep-other-velocities)))
|
|
(set! (-> a1-3 z) 0.0)
|
|
)
|
|
)
|
|
(if (and (logtest? arg0 (align-opts adjust-y-vel))
|
|
(not (and (logtest? arg0 (align-opts ignore-y-if-zero)) (= (-> arg1 trans y) 0.0)))
|
|
)
|
|
(set! (-> a1-3 y)
|
|
(+ (* (-> arg1 trans y) (-> s2-0 y) (-> *display* frames-per-second)) (* (-> s1-0 y) (seconds-per-frame)))
|
|
)
|
|
)
|
|
(when (logtest? arg0 (align-opts adjust-xz-vel))
|
|
(set! (-> a1-3 z)
|
|
(+ (* (-> arg1 trans z) (-> s2-0 z) (-> *display* frames-per-second)) (* (-> s1-0 z) (seconds-per-frame)))
|
|
)
|
|
(if (not (logtest? arg0 (align-opts adjust-x-vel keep-other-velocities)))
|
|
(set! (-> a1-3 x) 0.0)
|
|
)
|
|
)
|
|
(vector-matrix*! (-> this control transv) a1-3 s3-0)
|
|
)
|
|
)
|
|
)
|
|
(if (logtest? arg0 (align-opts adjust-quat))
|
|
(quaternion-normalize!
|
|
(quaternion*! (-> this control quat-for-control) (-> this control quat-for-control) (-> arg1 quat))
|
|
)
|
|
)
|
|
(the-as collide-shape (-> this control))
|
|
)
|
|
|
|
;; definition for function average-turn-angle
|
|
(defun average-turn-angle ((arg0 target))
|
|
(let ((f30-0 0.0))
|
|
(dotimes (s5-0 8)
|
|
(+! f30-0
|
|
(fabs
|
|
(deg-diff
|
|
(atan (-> arg0 control unknown-vector-array00 s5-0 x) (-> arg0 control unknown-vector-array00 s5-0 z))
|
|
0.0
|
|
)
|
|
)
|
|
)
|
|
)
|
|
(/ f30-0 8)
|
|
)
|
|
)
|
|
|
|
;; definition for function can-play-stance-amibent?
|
|
(defbehavior can-play-stance-amibent? target ()
|
|
(and (time-elapsed? (-> self state-time) (seconds 30))
|
|
(not (-> *setting-control* current talking))
|
|
(not (-> *setting-control* current spooling))
|
|
(not (-> *setting-control* current movie))
|
|
(not (-> *setting-control* current hint))
|
|
(not (logtest? (-> self control status) (cshape-moving-flags t-act)))
|
|
(not (logtest? (-> self water flag) (water-flag touch-water)))
|
|
)
|
|
)
|
|
|
|
;; definition for function can-jump?
|
|
(defbehavior can-jump? target ((arg0 symbol))
|
|
(and (or (logtest? (-> self control status) (cshape-moving-flags onsurf))
|
|
(not (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)))
|
|
(and (logtest? (-> self control status) (cshape-moving-flags onsurf))
|
|
(< 0.866 (-> self control surface-angle))
|
|
)
|
|
)
|
|
(and (not (logtest? (-> self control current-surface flags) (surface-flags prevent-jump)))
|
|
(not (logtest? (-> self state-flags) (state-flags prevent-jump)))
|
|
(case arg0
|
|
(('target-wheel-flip)
|
|
(>= 0.5 (-> self control local-slope-z))
|
|
)
|
|
(else
|
|
#t
|
|
)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function move-legs?
|
|
(defbehavior move-legs? target ()
|
|
(!= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)
|
|
)
|
|
|
|
;; definition for function target-height-above-ground
|
|
(defbehavior target-height-above-ground target ()
|
|
(- (-> self control trans y) (-> self control shadow-pos y))
|
|
)
|
|
|
|
;; definition for function fall-test
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defbehavior fall-test target ()
|
|
(when (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf)))
|
|
(time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout))
|
|
(>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
|
|
(let ((v1-15 (ja-group)))
|
|
(or (not (or (= v1-15 eichar-attack-punch-ja)
|
|
(= v1-15 eichar-attack-punch-end-ja)
|
|
(= v1-15 eichar-attack-punch-alt-end-ja)
|
|
)
|
|
)
|
|
(< 4096.0 (target-height-above-ground))
|
|
)
|
|
)
|
|
)
|
|
(when (and (not (time-elapsed? (-> self control rider-time) (-> *TARGET-bank* ground-timeout)))
|
|
(logtest? (-> self control current-surface flags) (surface-flags moving-ground))
|
|
)
|
|
(+! (-> self control transv x) (-> self control rider-last-move x))
|
|
(+! (-> self control transv z) (-> self control rider-last-move z))
|
|
)
|
|
(go target-falling #f)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function slide-down-test
|
|
;; INFO: Return type mismatch object vs none.
|
|
(defbehavior slide-down-test target ()
|
|
(if (and (not (logtest? (-> self control status) (cshape-moving-flags onsurf csmf07)))
|
|
(time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout))
|
|
(logtest? (-> self control status) (cshape-moving-flags tsurf))
|
|
(< 0.5 (-> self control surface-angle))
|
|
)
|
|
(go target-slide-down)
|
|
)
|
|
(none)
|
|
)
|
|
|
|
;; definition for function smack-surface?
|
|
(defbehavior smack-surface? target ((arg0 symbol))
|
|
(and (< 0.7 (-> self control touch-angle))
|
|
(and (< (-> self control surface-angle) 0.3)
|
|
(logtest? (-> self control status) (cshape-moving-flags twall))
|
|
(or arg0 (not (logtest? (-> self control status) (cshape-moving-flags t-act))))
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function can-wheel?
|
|
(defbehavior can-wheel? target ()
|
|
(and (logtest? (-> self control status) (cshape-moving-flags onsurf))
|
|
(or (not (logtest? (-> self control status) (cshape-moving-flags twall)))
|
|
(>= 0.7 (-> self control touch-angle))
|
|
)
|
|
(and (< (-> self control local-slope-z) 0.7)
|
|
(not (logtest? (-> self state-flags) (state-flags prevent-duck)))
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function can-duck?
|
|
(defbehavior can-duck? target ()
|
|
(and (logtest? (-> self control status) (cshape-moving-flags onsurf))
|
|
(>= (-> self control ground-local-norm-dot-grav) 0.7)
|
|
(not (logtest? (-> self water flag) (water-flag swimming under-water)))
|
|
(not (logtest? (-> self state-flags) (state-flags prevent-duck)))
|
|
(or (not (logtest? (-> self water flag) (water-flag wading)))
|
|
(< (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function can-exit-duck?
|
|
;; INFO: Used lq/sq
|
|
(defbehavior can-exit-duck? target ()
|
|
(let ((gp-0 (new 'stack-no-clear 'collide-using-spheres-params)))
|
|
(let ((s5-0 (new 'stack-no-clear 'inline-array 'sphere 2)))
|
|
(dotimes (s4-0 2)
|
|
((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere)
|
|
)
|
|
(set! (-> s5-0 0 quad) (-> self control trans quad))
|
|
(set! (-> s5-0 0 y) (+ 5734.4 (-> *TARGET-bank* body-radius) (-> s5-0 0 y)))
|
|
(set! (-> s5-0 0 w) (-> *TARGET-bank* body-radius))
|
|
(set! (-> s5-0 1 quad) (-> self control trans quad))
|
|
(set! (-> s5-0 1 y) (+ 2867.2 (-> *TARGET-bank* body-radius) (-> s5-0 1 y)))
|
|
(set! (-> s5-0 1 w) (-> *TARGET-bank* body-radius))
|
|
(set! (-> gp-0 spheres) s5-0)
|
|
)
|
|
(set! (-> gp-0 num-spheres) (the-as uint 2))
|
|
(set! (-> gp-0 collide-with) (-> self control root-prim collide-with))
|
|
(set! (-> gp-0 proc) #f)
|
|
(set! (-> gp-0 ignore-pat) (new 'static 'pat-surface :noentity #x1))
|
|
(set! (-> gp-0 solid-only) #t)
|
|
(if (fill-and-probe-using-spheres *collide-cache* gp-0)
|
|
#f
|
|
#t
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function can-hands?
|
|
(defbehavior can-hands? target ((arg0 symbol))
|
|
(cond
|
|
((or (not (cpad-pressed? (-> self control cpad number) square))
|
|
(or (and (logtest? (-> self state-flags) (state-flags prevent-attack))
|
|
(or (not (logtest? (-> self state-flags) (state-flags remove-prevents)))
|
|
(not (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0)))
|
|
)
|
|
)
|
|
(logtest? (-> self control current-surface flags) (surface-flags prevent-attacks-during-launch-jump surf08))
|
|
)
|
|
)
|
|
#f
|
|
)
|
|
((and (or (not arg0)
|
|
(and (not (time-elapsed? (-> self control last-time-on-surface) (-> *TARGET-bank* ground-timeout)))
|
|
(< (-> self control local-slope-z) 0.7)
|
|
)
|
|
)
|
|
(time-elapsed?
|
|
(if (and (= (-> self fact eco-type) (pickup-type eco-yellow)) (>= (-> self fact eco-level) 1.0))
|
|
(-> *TARGET-bank* yellow-attack-timeout)
|
|
(-> *TARGET-bank* attack-timeout)
|
|
)
|
|
(-> self control unknown-dword31)
|
|
)
|
|
)
|
|
#t
|
|
)
|
|
(else
|
|
(set-time! (-> self control unknown-dword32))
|
|
#f
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function can-feet?
|
|
(defbehavior can-feet? target ()
|
|
(cond
|
|
((or (logtest? (-> self state-flags) (state-flags prevent-attack))
|
|
(logtest? (-> self control current-surface flags) (surface-flags prevent-attacks-during-launch-jump surf09))
|
|
)
|
|
#f
|
|
)
|
|
((time-elapsed? (-> *TARGET-bank* attack-timeout) (-> self control last-attack-end-time))
|
|
#t
|
|
)
|
|
(else
|
|
(set-time! (-> self control unknown-dword34))
|
|
#f
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function vector-local+!
|
|
;; INFO: Used lq/sq
|
|
(defbehavior vector-local+! target ((arg0 vector) (arg1 vector))
|
|
(let ((s5-0 (new-stack-vector0)))
|
|
(vector-matrix*! s5-0 arg1 (-> self control c-R-w))
|
|
(vector+! arg0 arg0 s5-0)
|
|
)
|
|
)
|
|
|
|
;; definition for function move-forward
|
|
;; INFO: Used lq/sq
|
|
(defbehavior move-forward target ((arg0 float))
|
|
(let ((a1-0 (new-stack-vector0))
|
|
(gp-0 (new-stack-vector0))
|
|
)
|
|
(set-vector! a1-0 0.0 0.0 arg0 1.0)
|
|
(vector-matrix*! gp-0 a1-0 (-> self control c-R-w))
|
|
(vector+! (-> self control transv) (-> self control transv) gp-0)
|
|
)
|
|
)
|
|
|
|
;; definition for function set-forward-vel
|
|
;; INFO: Used lq/sq
|
|
(defbehavior set-forward-vel target ((arg0 float))
|
|
(let ((gp-0 (new-stack-vector0)))
|
|
(vector-matrix*! gp-0 (-> self control transv) (-> self control w-R-c))
|
|
(set! (-> gp-0 z) arg0)
|
|
(set! (-> gp-0 x) 0.0)
|
|
(vector-matrix*! (-> self control transv) gp-0 (-> self control c-R-w))
|
|
)
|
|
)
|
|
|
|
;; definition for function delete-back-vel
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defbehavior delete-back-vel target ()
|
|
(let ((s5-0 (new-stack-vector0)))
|
|
(vector-z-quaternion! s5-0 (-> self control dir-targ))
|
|
(let ((gp-0 (new-stack-vector0))
|
|
(f30-0 (vector-dot s5-0 (-> self control transv)))
|
|
)
|
|
0.0
|
|
(vector-! gp-0 (-> self control transv) (vector-float*! gp-0 s5-0 f30-0))
|
|
(let* ((f0-3 (vector-length gp-0))
|
|
(f1-0 f0-3)
|
|
)
|
|
(if (< f30-0 0.0)
|
|
(set! f30-0 0.0)
|
|
)
|
|
(vector+!
|
|
(-> self control transv)
|
|
(vector-float*! (-> self control transv) s5-0 f30-0)
|
|
(vector-float*! gp-0 gp-0 (/ f0-3 f1-0))
|
|
)
|
|
)
|
|
)
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function set-side-vel
|
|
;; INFO: Used lq/sq
|
|
(defbehavior set-side-vel target ((arg0 float))
|
|
(let ((gp-0 (new-stack-vector0)))
|
|
(vector-matrix*! gp-0 (-> self control transv) (-> self control w-R-c))
|
|
(set! (-> gp-0 x) arg0)
|
|
(set! (-> gp-0 z) 0.0)
|
|
(vector-matrix*! (-> self control transv) gp-0 (-> self control c-R-w))
|
|
)
|
|
)
|
|
|
|
;; definition for function target-timed-invulnerable
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defun target-timed-invulnerable ((arg0 time-frame) (arg1 target))
|
|
(logior! (-> arg1 state-flags) (state-flags timed-invulnerable))
|
|
(set-time! (-> arg1 control unknown-dword80))
|
|
(set! (-> arg1 control unknown-dword81) arg0)
|
|
(set-collide-kinds (-> arg1 control) 2 (collide-kind target-attack) (collide-kind))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-timed-invulnerable-off
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defun target-timed-invulnerable-off ((arg0 target))
|
|
(logclear! (-> arg0 draw status) (draw-status hidden))
|
|
(logclear! (-> arg0 state-flags) (state-flags timed-invulnerable))
|
|
(set-collide-kinds (-> arg0 control) 2 (collide-kind) (collide-kind target-attack))
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for method 9 of type attack-info
|
|
;; INFO: Used lq/sq
|
|
;; INFO: Return type mismatch attack-info vs none.
|
|
(defmethod combine! ((this attack-info) (arg0 attack-info))
|
|
(with-pp
|
|
(let ((s4-0 (-> arg0 mask)))
|
|
(set! (-> this mask) (-> arg0 mask))
|
|
(if (logtest? s4-0 (attack-mask attacker))
|
|
(set! (-> this attacker) (-> arg0 attacker))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask mode))
|
|
(set! (-> this mode) (-> arg0 mode))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask angle))
|
|
(set! (-> this angle) (-> arg0 angle))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask dist))
|
|
(set! (-> this dist) (-> arg0 dist))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask control))
|
|
(set! (-> this control) (-> arg0 control))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask speed))
|
|
(set! (-> this speed) (-> arg0 speed))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask shove-back))
|
|
(set! (-> this shove-back) (-> arg0 shove-back))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask shove-up))
|
|
(set! (-> this shove-up) (-> arg0 shove-up))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask invinc-time))
|
|
(set! (-> this invinc-time) (-> arg0 invinc-time))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask rotate-to))
|
|
(set! (-> this rotate-to) (-> arg0 rotate-to))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask intersection))
|
|
(set! (-> this intersection quad) (-> arg0 intersection quad))
|
|
)
|
|
(cond
|
|
((not (logtest? s4-0 (attack-mask vector)))
|
|
(let* ((s3-0 pp)
|
|
(s2-0 (handle->process (-> this attacker)))
|
|
(v1-39 (if (and (nonzero? s2-0) (type-type? (-> s2-0 type) process-drawable))
|
|
s2-0
|
|
)
|
|
)
|
|
)
|
|
(when v1-39
|
|
(set! (-> this trans quad) (-> (the-as process-drawable v1-39) root trans quad))
|
|
(vector-!
|
|
(-> this vector)
|
|
(-> (the-as process-drawable s3-0) root trans)
|
|
(-> (the-as process-drawable v1-39) root trans)
|
|
)
|
|
(logior! (-> this mask) (attack-mask vector))
|
|
)
|
|
)
|
|
)
|
|
(else
|
|
(let* ((s3-1 (handle->process (-> this attacker)))
|
|
(a0-16 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) process-drawable))
|
|
s3-1
|
|
)
|
|
)
|
|
)
|
|
(if a0-16
|
|
(set! (-> this trans quad) (-> (the-as process-drawable a0-16) root trans quad))
|
|
)
|
|
)
|
|
(set! (-> this vector quad) (-> arg0 vector quad))
|
|
(if (not (logtest? s4-0 (attack-mask shove-back)))
|
|
(set! (-> this shove-back) (vector-xz-length (-> this vector)))
|
|
)
|
|
(if (not (logtest? s4-0 (attack-mask shove-up)))
|
|
(set! (-> this shove-up) (-> this vector y))
|
|
)
|
|
)
|
|
)
|
|
(if (not (logtest? (-> this mask) (attack-mask dist)))
|
|
(set! (-> this dist) (fabs (-> this shove-back)))
|
|
)
|
|
(if (logtest? s4-0 (attack-mask trans))
|
|
(set! (-> this trans quad) (-> arg0 trans quad))
|
|
)
|
|
)
|
|
(none)
|
|
)
|
|
)
|
|
|
|
;; definition for function ground-tween-initialize
|
|
(defbehavior ground-tween-initialize target ((arg0 ground-tween-info) (arg1 uint) (arg2 uint) (arg3 uint) (arg4 uint) (arg5 uint) (arg6 uint))
|
|
(set! (-> arg0 group 0) arg2)
|
|
(set! (-> arg0 group 1) arg3)
|
|
(set! (-> arg0 group 2) arg4)
|
|
(set! (-> arg0 group 3) arg5)
|
|
(set! (-> arg0 group 4) arg6)
|
|
(dotimes (s3-0 3)
|
|
(set! (-> arg0 chan s3-0) (+ arg1 s3-0))
|
|
(ja :chan (-> arg0 chan s3-0) :group! arg2 :num! min :frame-interp (fabs (-> arg0 blend s3-0)))
|
|
)
|
|
arg0
|
|
)
|
|
|
|
;; definition for function ground-tween-update
|
|
;; INFO: Return type mismatch int vs none.
|
|
(defbehavior ground-tween-update target ((arg0 ground-tween-info) (arg1 float) (arg2 float))
|
|
(let ((f0-1 (fmax -1.0 (fmin 1.0 (* 2.0 arg1))))
|
|
(f30-0 (fmax -1.0 (fmin 1.0 (* 1.6 arg2))))
|
|
)
|
|
(let ((f1-5 (fabs (- f0-1 (the-as float (-> arg0 blend 1))))))
|
|
(set! (-> arg0 blend 1) (seek (the-as float (-> arg0 blend 1)) f0-1 (fmax 0.05 (fmin 0.2 (/ f1-5 4)))))
|
|
)
|
|
(let ((f0-7 (fabs (- f30-0 (the-as float (-> arg0 blend 2))))))
|
|
(set! (-> arg0 blend 2) (seek (the-as float (-> arg0 blend 2)) f30-0 (fmax 0.05 (fmin 0.2 (/ f0-7 4)))))
|
|
)
|
|
)
|
|
(if (>= (-> arg0 blend 1) 0.0)
|
|
(ja :chan (-> arg0 chan 1) :group! (-> arg0 group 1) :frame-interp (fabs (-> arg0 blend 1)))
|
|
(ja :chan (-> arg0 chan 1) :group! (-> arg0 group 2) :frame-interp (fabs (-> arg0 blend 1)))
|
|
)
|
|
(if (>= (-> arg0 blend 2) 0.0)
|
|
(ja :chan (-> arg0 chan 2) :group! (-> arg0 group 4) :frame-interp (fabs (-> arg0 blend 2)))
|
|
(ja :chan (-> arg0 chan 2) :group! (-> arg0 group 3) :frame-interp (fabs (-> arg0 blend 2)))
|
|
)
|
|
0
|
|
(none)
|
|
)
|
|
|
|
;; definition for function target-pos
|
|
(defun target-pos ((arg0 int))
|
|
(let ((a1-0 *target*))
|
|
(cond
|
|
(a1-0
|
|
(if (zero? arg0)
|
|
(-> a1-0 control trans)
|
|
(vector<-cspace! (new 'static 'vector) (-> a1-0 node-list data arg0))
|
|
)
|
|
)
|
|
(else
|
|
(camera-pos)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function target-cam-pos
|
|
;; INFO: Used lq/sq
|
|
(defun target-cam-pos ()
|
|
(let ((gp-0 *target*))
|
|
(cond
|
|
((not gp-0)
|
|
(camera-pos)
|
|
)
|
|
((logtest? (-> gp-0 state-flags) (state-flags use-alt-cam-pos))
|
|
(add-debug-sphere
|
|
*display-camera-marks*
|
|
(bucket-id debug-no-zbuf)
|
|
(-> gp-0 alt-cam-pos)
|
|
819.2
|
|
(new 'static 'rgba :r #xff :a #x80)
|
|
)
|
|
(-> gp-0 alt-cam-pos)
|
|
)
|
|
((logtest? (state-flags has-saved-position) (-> gp-0 state-flags))
|
|
(add-debug-sphere
|
|
*display-camera-marks*
|
|
(bucket-id debug-no-zbuf)
|
|
(-> gp-0 alt-cam-pos)
|
|
819.2
|
|
(new 'static 'rgba :r #xff :a #x80)
|
|
)
|
|
(-> gp-0 alt-cam-pos)
|
|
)
|
|
((logtest? (state-flags falling-into-pool-of-bad) (-> gp-0 state-flags))
|
|
(let ((s5-0 (new 'static 'vector)))
|
|
(set! (-> s5-0 quad) (-> gp-0 control camera-pos quad))
|
|
(set! (-> s5-0 y) (fmax (-> s5-0 y) (-> gp-0 alt-cam-pos y)))
|
|
(add-debug-sphere
|
|
*display-camera-marks*
|
|
(bucket-id debug-no-zbuf)
|
|
s5-0
|
|
819.2
|
|
(new 'static 'rgba :r #xff :a #x80)
|
|
)
|
|
s5-0
|
|
)
|
|
)
|
|
(else
|
|
(add-debug-sphere
|
|
*display-camera-marks*
|
|
(bucket-id debug-no-zbuf)
|
|
(-> gp-0 control camera-pos)
|
|
819.2
|
|
(new 'static 'rgba :r #xff :a #x80)
|
|
)
|
|
(-> gp-0 control camera-pos)
|
|
)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function target-joint-pos
|
|
(defun target-joint-pos ()
|
|
(let ((v1-0 *target*))
|
|
(if v1-0
|
|
(vector<-cspace! (new 'static 'vector) (-> v1-0 node-list data (-> v1-0 draw origin-joint-index)))
|
|
(camera-pos)
|
|
)
|
|
)
|
|
)
|
|
|
|
;; definition for function target-rot
|
|
(defun target-rot ()
|
|
(let ((v1-0 *target*))
|
|
(if v1-0
|
|
(-> v1-0 control quat-for-control)
|
|
*unity-quaternion*
|
|
)
|
|
)
|
|
)
|