Skip to content

Commit

Permalink
jak3 gsrc
Browse files Browse the repository at this point in the history
  • Loading branch information
Hat-Kid committed Dec 7, 2024
1 parent 8ce3d26 commit e5b9c64
Show file tree
Hide file tree
Showing 206 changed files with 906 additions and 790 deletions.
2 changes: 1 addition & 1 deletion goal_src/jak3/engine/camera/cam-layout.gc
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@
(defun fov->maya ((arg0 float))
(if (= arg0 0.0)
0.0
(/ 12.700255 (tan (* 0.5 arg0)))
(/ 12.700255 (tan (/ arg0 2)))
)
)

Expand Down
12 changes: 4 additions & 8 deletions goal_src/jak3/engine/camera/cam-master.gc
Original file line number Diff line number Diff line change
Expand Up @@ -231,10 +231,10 @@
(let ((f30-0 (vector-dot s5-7 (-> self local-down))))
(vector--float*! s5-7 s5-7 (-> self local-down) f30-0)
(if (< 0.0 f30-0)
(set! (-> self upspeed) (* 0.5 (-> self upspeed)))
(set! (-> self upspeed) (/ (-> self upspeed) 2))
)
(vector+! (-> self tpos-tgt) (-> self tpos-tgt) s5-7)
(let ((f0-26 (* 0.05 f30-0)))
(let ((f0-26 (/ f30-0 20)))
(vector+float*! (-> self tpos-tgt) (-> self tpos-tgt) (-> self local-down) f0-26)
)
)
Expand Down Expand Up @@ -995,9 +995,7 @@
(-> self local-down)
(vector-normalize-copy! (-> self local-down) (-> *standard-dynamics* gravity) 1.0)
)
(when (nonzero? cam-master-effect) ;; og:preserve-this not-yet-implemented check
(cam-master-effect)
)
(cam-master-effect)
)
)
:code (behavior ()
Expand Down Expand Up @@ -1059,9 +1057,7 @@
(let ((a1-4 (new-stack-vector0)))
(tracking-spline-method-10 (-> self target-spline) a1-4)
)
(when (nonzero? group-rain-screend-drop) ;; og:preserve-this not-yet-implemented check
(set! (-> self water-drip) (create-launch-control group-rain-screend-drop self))
)
(set! (-> self water-drip) (create-launch-control group-rain-screend-drop self))
(set! (-> self water-drip-time) (seconds -60))
(go cam-master-active)
0
Expand Down
16 changes: 8 additions & 8 deletions goal_src/jak3/engine/camera/cam-states-dbg.gc
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
)
(cond
((cpad-hold? (-> *CAMERA-bank* joypad) r2)
(set! (-> s5-0 y) (- (-> s5-0 y) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0))))
(set! (-> s5-0 x) (- (-> s5-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f0-0))))
(+! (-> gp-0 x) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f28-0))
(+! (-> gp-0 z) (* 0.2 (-> *CAM_POINT_WATCH-bank* speed) f30-0))
(set! (-> s5-0 y) (- (-> s5-0 y) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f26-0))))
(set! (-> s5-0 x) (- (-> s5-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* rot-speed) 5) (- f0-0))))
(+! (-> gp-0 x) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f28-0))
(+! (-> gp-0 z) (* (/ (-> *CAM_POINT_WATCH-bank* speed) 5) f30-0))
)
(else
(set! (-> s5-0 y) (- (-> s5-0 y) (* 2.0 (-> *CAM_POINT_WATCH-bank* rot-speed) (- f26-0))))
Expand Down Expand Up @@ -293,16 +293,16 @@
((logtest? (-> (the-as cpad-list (+ (* arg4 4) (the-as int *cpad-list*))) cpads 0 button0-abs 0)
(pad-buttons l2)
)
(set! (-> arg1 y) (- (-> arg1 y) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f24-0))))
(set! (-> arg1 x) (- (-> arg1 x) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f0-19))))
(set! (-> arg1 y) (- (-> arg1 y) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f24-0))))
(set! (-> arg1 x) (- (-> arg1 x) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f0-19))))
)
(else
(set! (-> arg1 y) (- (-> arg1 y) (* (- f24-0) (-> *CAM_FREE-bank* rot-speed))))
(set! (-> arg1 x) (- (-> arg1 x) (* (- f0-19) (-> *CAM_FREE-bank* rot-speed))))
)
)
(+! (-> arg2 x) (* 0.2 f30-0 f26-2))
(+! (-> arg2 z) (* 0.2 f30-0 f28-4))
(+! (-> arg2 x) (* (/ f30-0 5) f26-2))
(+! (-> arg2 z) (* (/ f30-0 5) f28-4))
)
((and (not s3-0) (cpad-hold? arg4 l2))
(+! (-> arg2 x) (* f26-2 f30-0))
Expand Down
4 changes: 2 additions & 2 deletions goal_src/jak3/engine/camera/cam-states.gc
Original file line number Diff line number Diff line change
Expand Up @@ -2443,7 +2443,7 @@
(set! f28-0 0.0)
)
(if (-> self have-phony-joystick)
(set! f28-0 (* 0.05 (-> self phony-joystick-y)))
(set! f28-0 (/ (-> self phony-joystick-y) 20))
)
(if (and (-> *camera* being-attacked) (not (time-elapsed? (-> *camera* attack-start) (seconds 0.25))))
(set! f28-0 0.05)
Expand All @@ -2466,7 +2466,7 @@
(let ((f0-23 f26-0))
(when (and (< f26-0 0.0) (not (logtest? (cam-slave-options BOMBBOT) (-> *camera* settings slave-options))))
(let ((f0-26
(/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (* 0.5 (-> self string-min-val z)))
(/ (- (-> self string-min-val z) (vector-length (-> self view-flat))) (/ (-> self string-min-val z) 2))
)
)
(set! f0-23 (fmin 0.75 f0-26))
Expand Down
18 changes: 9 additions & 9 deletions goal_src/jak3/engine/camera/camera.gc
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
0.0
)
((>= 0.25 arg0)
(* 0.5 arg0)
(/ arg0 2)
)
((>= arg0 0.75)
(- 1.0 (* 0.5 (- 1.0 arg0)))
Expand Down Expand Up @@ -788,7 +788,7 @@
(the-as vector (-> this point (-> this end-point)))
)
(let* ((f0-0 (vector-length s3-0))
(f1-1 (* 0.33333334 (- 1.5 (* 0.00024414062 f0-0))))
(f1-1 (* 0.33333334 (- 1.5 (/ f0-0 METER_LENGTH))))
)
0.0
(let* ((f1-2 (fmax 0.0 f1-1))
Expand Down Expand Up @@ -818,7 +818,7 @@
(the-as vector (+ (the-as uint (-> this point 0 direction)) (* 48 v1-18)))
)
(let* ((f0-5 (vector-normalize-ret-len! s2-0 1.0))
(f0-6 (* 0.5 f0-5))
(f0-6 (/ f0-5 2))
(f26-0 (* (fmin 1.0 f0-6) f30-0 (vector-dot arg0 s2-0)))
)
(let ((f1-14 (vector-dot s2-0 s3-0)))
Expand Down Expand Up @@ -894,7 +894,7 @@
(tracking-spline-method-19 this (* (-> this max-move) (-> pp clock time-adjust-ratio)) arg0 arg5 s3-0)
(tracking-spline-method-14 this s3-0)
(dotimes (s2-0 63)
(tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 arg5 s3-0)
(tracking-spline-method-18 this (/ (-> this sample-len) 64) arg0 arg5 s3-0)
)
(vector-float*! arg0 arg0 0.015625)
(vector-float*! arg5 arg5 0.015625)
Expand Down Expand Up @@ -1283,7 +1283,7 @@
(vector-! s2-0 s2-0 (-> arg0 follow-off))
(vector-float*! s2-0 s2-0 f0-23)
)
(+! (-> arg0 follow-blend) (* 0.016666668 (-> pp clock time-adjust-ratio)))
(+! (-> arg0 follow-blend) (/ (-> pp clock time-adjust-ratio) 60))
(vector+! (-> arg0 follow-off) (-> arg0 follow-off) s2-0)
)
(else
Expand Down Expand Up @@ -1518,7 +1518,7 @@
(let ((f28-0 (vector-dot s3-0 (-> arg0 rvec))))
(set! sv-128 s2-0)
(set! sv-112 (-> arg0 rvec))
(let ((f0-7 (* 0.8 (tan (* 0.5 arg2)))))
(let ((f0-7 (* 0.8 (tan (/ arg2 2)))))
(.lvf vf1 (&-> sv-112 quad))
(let ((v1-11 f0-7))
(.mov vf2 v1-11)
Expand Down Expand Up @@ -1551,7 +1551,7 @@
(let ((f28-1 (vector-dot s3-0 (-> arg0 uvec))))
(set! sv-160 s2-0)
(set! sv-144 (-> arg0 uvec))
(let ((f0-16 (* 0.525 (tan (* 0.5 arg2)))))
(let ((f0-16 (* 0.525 (tan (/ arg2 2)))))
(.lvf vf1 (&-> sv-144 quad))
(let ((v1-32 f0-16))
(.mov vf2 v1-32)
Expand All @@ -1577,7 +1577,7 @@
(let ((f28-2 (vector-dot s3-0 (-> arg0 uvec))))
(let ((s0-1 s2-0))
(set! sv-176 (-> arg0 uvec))
(let ((f0-26 (* 0.525 (tan (* 0.5 arg2)))))
(let ((f0-26 (* 0.525 (tan (/ arg2 2)))))
(vector-float*! s0-1 sv-176 f0-26)
)
)
Expand Down Expand Up @@ -1741,7 +1741,7 @@
(set! sv-256 vector-into-frustum-nosmooth!)
(set! sv-272 s1-0)
(set! sv-288 arg1)
(let ((a2-5 (lerp-clamp arg3 (* 0.25 arg3) (-> arg0 underwater-blend value))))
(let ((a2-5 (lerp-clamp arg3 (/ arg3 4) (-> arg0 underwater-blend value))))
(sv-256 sv-272 sv-288 a2-5)
)
(cond
Expand Down
2 changes: 1 addition & 1 deletion goal_src/jak3/engine/collide/collide-touch.gc
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@
)
)
(let ((f1-2 (- (- (vector-length gp-1) (-> v1-0 prim-core world-sphere w)) (-> s4-0 prim-core world-sphere w))))
(vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (* 0.5 f1-2)))
(vector-normalize! gp-1 (+ (-> s4-0 prim-core world-sphere w) (/ f1-2 2)))
)
(vector+! arg0 gp-1 (the-as vector (-> s4-0 prim-core)))
)
Expand Down
8 changes: 4 additions & 4 deletions goal_src/jak3/engine/common-obs/blocking-plane.gc
Original file line number Diff line number Diff line change
Expand Up @@ -154,19 +154,19 @@
)
(vector+! (-> s2-1 trans) s3-0 s4-0)
(vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5)
(+! (-> s2-1 trans y) (* 0.5 arg1))
(+! (-> 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) (* 0.00024414062 f30-1))
(set! (-> s2-1 scale y) (* 0.00024414062 arg1))
(set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH))
(set! (-> s2-1 scale y) (/ arg1 METER_LENGTH))
(set! (-> s2-1 scale z) 0.0)
(set! (-> s1-0 uvec quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad))
(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)
(let ((v1-20 (-> this root root-prim local-sphere)))
(set! (-> v1-20 x) 0.0)
(set! (-> v1-20 y) (* 0.00024414062 (* 0.5 arg1)))
(set! (-> v1-20 y) (* 0.00024414062 (/ arg1 2)))
(set! (-> v1-20 z) 0.0)
(let ((f0-17 0.5)
(f1-7 (* f30-1 f30-1))
Expand Down
10 changes: 5 additions & 5 deletions goal_src/jak3/engine/common-obs/collectables.gc
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@
(set! (-> self root trans y) (-> self base y))
(cond
((< (-> self root transv y) -8192.0)
(set! (-> self root transv y) (* -0.5 (-> self root transv y)))
(set! (-> self root transv y) (/ (-> self root transv y) -2))
)
(else
(if (and (logtest? (-> self fact options) (actor-option suck-in))
Expand Down Expand Up @@ -1057,7 +1057,7 @@
)
(else
(if (nonzero? (-> self part))
(set! (-> self part local-space-binding) (the-as particle-local-space-info (* 0.0033333334 f0-1)))
(set! (-> self part local-space-binding) (the-as particle-local-space-info (/ f0-1 300)))
)
(when (nonzero? (-> self draw))
(logior! (-> self draw status) (draw-control-status force-fade))
Expand Down Expand Up @@ -1717,7 +1717,7 @@
(set! (-> a0-6 y) 0.0)
(vector-normalize! a0-6 1.0)
)
(vector-float*! gp-2 gp-2 (rand-vu-float-range (* 0.25 f30-0) (* 0.75 f30-0)))
(vector-float*! gp-2 gp-2 (rand-vu-float-range (/ f30-0 4) (* 0.75 f30-0)))
)
(set! (-> self root transv quad) (-> gp-2 quad))
)
Expand Down Expand Up @@ -2795,7 +2795,7 @@
((and (>= f24-1 f0-10) (logtest? s2-0 (game-feature gun-red-1 gun-red-2 gun-red-3)))
(set! (-> arg1 0) (pickup-type ammo-red))
(if (>= 1 (mod (the-as int (rand-uint31-gen *random-generator*)) 3))
(set! (-> arg2 0) (* 0.5 (-> arg2 0)))
(set! (-> arg2 0) (/ (-> arg2 0) 2))
)
)
((and (>= f28-1 f0-10) (logtest? s2-0 (game-feature gun-blue-1 gun-blue-2 gun-blue-3)))
Expand All @@ -2805,7 +2805,7 @@
)
((and (>= f30-1 f0-10) (logtest? (game-feature gun-dark-1 gun-dark-2 gun-dark-3) s2-0))
(set! (-> arg1 0) (pickup-type ammo-dark))
(set! (-> arg2 0) (the float (the int (fmax 1.0 (* 0.06666667 (-> arg2 0))))))
(set! (-> arg2 0) (the float (the int (fmax 1.0 (/ (-> arg2 0) 15)))))
)
(else
(pickup-dark-set! arg0 arg1 arg2 arg3)
Expand Down
13 changes: 8 additions & 5 deletions goal_src/jak3/engine/common-obs/crates.gc
Original file line number Diff line number Diff line change
Expand Up @@ -920,7 +920,8 @@
)
)
(when (not arg0)
(suspend-for (seconds 0.04))
(suspend-for (seconds 0.04)
)
(case (-> self look)
(('iron)
(sound-play "icrate-break")
Expand Down Expand Up @@ -1012,9 +1013,11 @@
(drop-pickup (-> self fact) #t *entity-pool* (the-as fact-info #f) arg1 #t)
(process-entity-status! self (entity-perm-status dead) #t)
(process-entity-status! self (entity-perm-status subtask-complete) #t)
(suspend-for (seconds 5))
(suspend-for (seconds 5)
)
(when (logtest? (actor-option cond-respawn) (-> self fact options))
(suspend-for (seconds 15))
(suspend-for (seconds 15)
)
(go-virtual hide)
)
)
Expand Down Expand Up @@ -1346,9 +1349,9 @@

(defmethod smush-update! ((this crate))
(let ((f0-0 (update! (-> this smush))))
(set! (-> this root scale x) (+ 1.0 (* -0.5 f0-0)))
(set! (-> this root scale x) (+ 1.0 (/ f0-0 -2)))
(set! (-> this root scale y) (+ 1.0 f0-0))
(set! (-> this root scale z) (+ 1.0 (* -0.5 f0-0)))
(set! (-> this root scale z) (+ 1.0 (/ f0-0 -2)))
)
0
(none)
Expand Down
19 changes: 12 additions & 7 deletions goal_src/jak3/engine/common-obs/enemy-states.gc
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,8 @@
:code (behavior ()
(cond
((handle->process (-> self ragdoll-proc))
(suspend-for (seconds 0.2))
(suspend-for (seconds 0.2)
)
(until (ragdoll-settled? self)
(if (or (time-elapsed? (-> self state-time) (seconds 4)) (enemy-method-109 self))
(go-die self)
Expand Down Expand Up @@ -975,11 +976,13 @@
:code (behavior ()
(cond
((handle->process (-> self ragdoll-proc))
(suspend-for (seconds 0.2))
(suspend-for (seconds 0.2)
)
(if (-> self skel effect)
(do-effect (-> self skel effect) "death-default" 0.0 -1)
)
(suspend-for (seconds 0.8))
(suspend-for (seconds 0.8)
)
)
(else
(ja-channel-push! 1 (seconds 0.075))
Expand Down Expand Up @@ -1061,11 +1064,13 @@
:code (behavior ()
(cond
((handle->process (-> self ragdoll-proc))
(suspend-for (seconds 1))
(suspend-for (seconds 1)
)
(if (-> self skel effect)
(do-effect (-> self skel effect) "death-default" 0.0 -1)
)
(suspend-for (seconds 1))
(suspend-for (seconds 1)
)
(deactivate-ragdoll! self)
)
(else
Expand Down Expand Up @@ -1182,7 +1187,7 @@
(f26-1 (fmax 0.0 (fmin 1.0 f0-12)))
(f28-1 (* f28-0 f26-1))
)
(let* ((f1-8 (* 0.000061035156 (-> self root root-prim local-sphere w)))
(let* ((f1-8 (/ (-> self root root-prim local-sphere w) (meters 4)))
(f0-21 (fmax 0.0 (fmin 1.0 f1-8)))
)
(* f30-0 (lerp 2.0 1.0 f0-21))
Expand Down Expand Up @@ -1212,7 +1217,7 @@
(f0-34 (/ (- f0-32 (* (the float (the int (/ f0-32 f30-3))) f30-3)) f30-3))
(f0-36 (cos (* 65536.0 f0-34)))
(f0-37 (+ 1.0 f0-36))
(f28-3 (* 0.5 f0-37))
(f28-3 (/ f0-37 2))
)
(ja :num! identity :frame-interp0 f28-3 :frame-interp1 f28-3)
(let ((a0-20 (-> self skel root-channel 1)))
Expand Down
2 changes: 1 addition & 1 deletion goal_src/jak3/engine/common-obs/guard-projectile.gc
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@
(launch-particles (-> *part-id-table* 852) s4-0)
)
(let ((s4-1 (new 'stack-no-clear 'matrix))
(f26-0 (* 0.000027126736 f30-0))
(f26-0 (/ f30-0 (meters 9)))
(f30-1 (-> *part-id-table* 853 init-specs 3 initial-valuef))
(f28-1 (-> *part-id-table* 853 init-specs 4 initial-valuef))
)
Expand Down
2 changes: 1 addition & 1 deletion goal_src/jak3/engine/common-obs/metalhead-projectile.gc
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@
(launch-particles (-> *part-id-table* 864) s4-0)
)
(let ((s4-1 (new 'stack-no-clear 'matrix))
(f26-0 (* 0.000020345053 f30-0))
(f26-0 (/ f30-0 (meters 12)))
(f30-1 (-> *part-id-table* 865 init-specs 3 initial-valuef))
(f28-1 (-> *part-id-table* 865 init-specs 5 initial-valuef))
)
Expand Down
4 changes: 2 additions & 2 deletions goal_src/jak3/engine/common-obs/water.gc
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@
)
(set-time! (-> this drip-time))
(logclear! (-> this flags) (water-flag spawn-drip))
(seek! (-> this drip-wetness) 0.0 (* 0.001 (-> this drip-speed)))
(seek! (-> this drip-wetness) 0.0 (/ (-> this drip-speed) 1000))
(set! (-> this drip-speed) (* 1.05 (-> this drip-speed)))
(if (= (-> this drip-wetness) 0.0)
(set! (-> this drip-height) 0.0)
Expand Down Expand Up @@ -733,7 +733,7 @@
(set! (-> *part-id-table* 759 init-specs 4 initial-valuef) (+ 24576.0 arg0))
(set! (-> *part-id-table* 759 init-specs 19 initial-valuef) (+ 49152.0 arg0))
(set! (-> *part-id-table* 759 init-specs 1 initial-valuef) (* 0.0000036621095 f30-0))
(set! (-> *part-id-table* 759 init-specs 2 initial-valuef) (* 0.1 f30-0))
(set! (-> *part-id-table* 759 init-specs 2 initial-valuef) (/ f30-0 10))
(set! (-> *part-id-table* 759 init-specs 13 initial-valuef) 0.7111111)
(set! (-> *part-id-table* 759 init-specs 3 initial-valuef) arg3)
(set! (-> *part-id-table* 759 init-specs 5 initial-valuef) arg3)
Expand Down
2 changes: 1 addition & 1 deletion goal_src/jak3/engine/debug/collision-editor.gc
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@
(when (= (-> this analog-func) (collision-editor-func analog))
(set! f30-0 (* -409.6 f30-0))
(set! f28-0 (* -409.6 f28-0))
(let ((f0-8 (+ (* 0.01 f24-0) (* -0.01 f26-0))))
(let ((f0-8 (+ (/ f24-0 100) (/ f26-0 -100))))
(set! f24-0 (+ 1.0 f0-8))
)
(set! f26-0 0.0)
Expand Down
Loading

0 comments on commit e5b9c64

Please sign in to comment.