mirror of
https://github.com/open-goal/jak-project
synced 2026-09-10 04:22:13 -04:00
jak2 gsrc
This commit is contained in:
@@ -1042,7 +1042,7 @@
|
||||
(defun fov->maya ((arg0 float))
|
||||
(if (= arg0 0.0)
|
||||
0.0
|
||||
(/ 12.700255 (tan (* 0.5 arg0)))
|
||||
(/ 12.700255 (tan (/ arg0 2)))
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
@@ -214,10 +214,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)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -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))))
|
||||
@@ -104,8 +104,8 @@
|
||||
(let ((f30-0 (vector-length a0-7)))
|
||||
(cond
|
||||
(#f
|
||||
(let* ((f28-0 (* 0.01 f30-0 (-> v1-0 x)))
|
||||
(f26-0 (* 0.01 f30-0 (-> v1-0 y)))
|
||||
(let* ((f28-0 (* (/ f30-0 100) (-> v1-0 x)))
|
||||
(f26-0 (* (/ f30-0 100) (-> v1-0 y)))
|
||||
(f0-5 f28-0)
|
||||
(f0-7 (* f0-5 f0-5))
|
||||
(f1-2 f26-0)
|
||||
@@ -348,16 +348,16 @@
|
||||
((and (not s3-0) (cpad-hold? arg3 r2))
|
||||
(cond
|
||||
((cpad-hold? arg3 l2)
|
||||
(set! (-> arg0 y) (- (-> arg0 y) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f26-0))))
|
||||
(set! (-> arg0 x) (- (-> arg0 x) (* 0.5 (-> *CAM_FREE-bank* rot-speed) (- f0-60))))
|
||||
(set! (-> arg0 y) (- (-> arg0 y) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f26-0))))
|
||||
(set! (-> arg0 x) (- (-> arg0 x) (* (/ (-> *CAM_FREE-bank* rot-speed) 2) (- f0-60))))
|
||||
)
|
||||
(else
|
||||
(set! (-> arg0 y) (- (-> arg0 y) (* (- f26-0) (-> *CAM_FREE-bank* rot-speed))))
|
||||
(set! (-> arg0 x) (- (-> arg0 x) (* (- f0-60) (-> *CAM_FREE-bank* rot-speed))))
|
||||
)
|
||||
)
|
||||
(+! (-> arg1 x) (* 0.2 (-> *CAM_FREE-bank* speed) f28-14))
|
||||
(+! (-> arg1 z) (* 0.2 (-> *CAM_FREE-bank* speed) f30-14))
|
||||
(+! (-> arg1 x) (* (/ (-> *CAM_FREE-bank* speed) 5) f28-14))
|
||||
(+! (-> arg1 z) (* (/ (-> *CAM_FREE-bank* speed) 5) f30-14))
|
||||
)
|
||||
((and (not s3-0) (cpad-hold? arg3 l2))
|
||||
(+! (-> arg1 x) (* f28-14 (-> *CAM_FREE-bank* speed)))
|
||||
|
||||
@@ -2285,7 +2285,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)
|
||||
@@ -2308,7 +2308,7 @@
|
||||
(let ((f0-23 f26-0))
|
||||
(when (< f26-0 0.0)
|
||||
(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))
|
||||
|
||||
@@ -265,7 +265,7 @@
|
||||
0.0
|
||||
)
|
||||
((>= 0.25 arg0)
|
||||
(* 0.5 arg0)
|
||||
(/ arg0 2)
|
||||
)
|
||||
((>= arg0 0.75)
|
||||
(- 1.0 (* 0.5 (- 1.0 arg0)))
|
||||
@@ -734,7 +734,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))
|
||||
@@ -764,7 +764,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)))
|
||||
@@ -837,7 +837,7 @@
|
||||
(tracking-spline-method-19 this (* (-> this max-move) (-> pp clock time-adjust-ratio)) arg0 s4-0)
|
||||
(tracking-spline-method-14 this s4-0)
|
||||
(dotimes (s3-0 63)
|
||||
(tracking-spline-method-18 this (* 0.015625 (-> this sample-len)) arg0 s4-0)
|
||||
(tracking-spline-method-18 this (/ (-> this sample-len) 64) arg0 s4-0)
|
||||
)
|
||||
(vector-float*! arg0 arg0 0.015625)
|
||||
(let ((a2-3 (-> s4-0 cur-pt)))
|
||||
@@ -1213,7 +1213,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
|
||||
@@ -1439,7 +1439,7 @@
|
||||
(let ((f28-0 (vector-dot s3-0 (the-as vector (-> arg0 vector)))))
|
||||
(set! sv-128 s2-0)
|
||||
(set! sv-112 (-> arg0 vector))
|
||||
(let ((f0-7 (* 0.8 (tan (* 0.5 arg2)))))
|
||||
(let ((f0-7 (* 0.8 (tan (/ arg2 2)))))
|
||||
(.lvf vf1 (&-> sv-112 0 quad))
|
||||
(let ((v1-11 f0-7))
|
||||
(.mov vf2 v1-11)
|
||||
@@ -1472,7 +1472,7 @@
|
||||
(let ((f28-1 (vector-dot s3-0 (-> arg0 vector 1))))
|
||||
(set! sv-160 s2-0)
|
||||
(set! sv-144 (-> arg0 vector 1))
|
||||
(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)
|
||||
@@ -1498,7 +1498,7 @@
|
||||
(let ((f28-2 (vector-dot s3-0 (-> arg0 vector 1))))
|
||||
(let ((s0-1 s2-0))
|
||||
(set! sv-176 (-> arg0 vector 1))
|
||||
(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)
|
||||
)
|
||||
)
|
||||
@@ -1657,7 +1657,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
|
||||
|
||||
@@ -487,7 +487,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)))
|
||||
)
|
||||
|
||||
@@ -112,11 +112,11 @@
|
||||
)
|
||||
(vector+! (-> s2-1 trans) s3-0 s4-0)
|
||||
(vector-float*! (-> s2-1 trans) (-> s2-1 trans) 0.5)
|
||||
(+! (-> s2-1 trans y) (* 0.5 height))
|
||||
(+! (-> s2-1 trans y) (/ height 2))
|
||||
(vector-! (the-as vector (-> s1-0 vector)) s4-0 s3-0)
|
||||
(let ((f30-1 (vector-normalize-ret-len! (the-as vector (-> s1-0 vector)) 1.0)))
|
||||
(set! (-> s2-1 scale x) (* 0.00024414062 f30-1))
|
||||
(set! (-> s2-1 scale y) (* 0.00024414062 height))
|
||||
(set! (-> s2-1 scale x) (/ f30-1 METER_LENGTH))
|
||||
(set! (-> s2-1 scale y) (/ height METER_LENGTH))
|
||||
(set! (-> s2-1 scale z) 0.0)
|
||||
(set! (-> s1-0 vector 1 quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad))
|
||||
(vector-cross! (-> s1-0 vector 2) (the-as vector (-> s1-0 vector)) (-> s1-0 vector 1))
|
||||
@@ -124,7 +124,7 @@
|
||||
(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 height)))
|
||||
(set! (-> v1-20 y) (* 0.00024414062 (/ height 2)))
|
||||
(set! (-> v1-20 z) 0.0)
|
||||
(let ((f0-17 0.5)
|
||||
(f1-7 (* f30-1 f30-1))
|
||||
@@ -160,11 +160,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this blocking-plane) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(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))
|
||||
)
|
||||
|
||||
@@ -880,7 +880,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))
|
||||
@@ -1014,7 +1014,7 @@
|
||||
)
|
||||
(else
|
||||
(if (nonzero? (-> self part))
|
||||
(set! (-> self part fade) (* 0.0033333334 f0-1))
|
||||
(set! (-> self part fade) (/ f0-1 300))
|
||||
)
|
||||
(when (nonzero? (-> self draw))
|
||||
(logior! (-> self draw status) (draw-control-status force-fade))
|
||||
@@ -1240,11 +1240,11 @@
|
||||
|
||||
(defmethod init-from-entity! ((this eco-yellow) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-yellow) (-> *FACT-bank* eco-single-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1256,11 +1256,11 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod init-from-entity! ((this eco-red) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-red) (-> *FACT-bank* eco-single-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1272,11 +1272,11 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod init-from-entity! ((this eco-blue) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-blue) (-> *FACT-bank* eco-single-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1288,11 +1288,11 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod init-from-entity! ((this eco-green) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-green) (-> *FACT-bank* eco-single-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1304,11 +1304,11 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod init-from-entity! ((this health) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type health) (-> *FACT-bank* health-default-inc))
|
||||
(none)
|
||||
)
|
||||
@@ -1344,16 +1344,17 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod init-from-entity! ((this eco-pill) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(init-common this arg0 (pickup-type eco-pill-green) (-> *FACT-bank* health-small-inc))
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod deactivate ((this eco-pill))
|
||||
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
||||
(+! (-> *game-info* live-eco-pill-count) -1)
|
||||
((method-of-type collectable deactivate) this)
|
||||
(none)
|
||||
@@ -1396,6 +1397,7 @@ This commonly includes things such as:
|
||||
|
||||
|
||||
(defmethod run-logic? ((this money))
|
||||
"Should this process be run? Checked by execute-process-tree."
|
||||
(or (not (logtest? (-> this mask) (process-mask actor-pause)))
|
||||
(or (and (nonzero? (-> this draw))
|
||||
(logtest? (-> this draw status) (draw-control-status on-screen))
|
||||
@@ -1410,6 +1412,7 @@ This commonly includes things such as:
|
||||
)
|
||||
|
||||
(defmethod deactivate ((this money))
|
||||
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
||||
(when (and (-> this next-state) (= (-> this next-state name) 'pickup))
|
||||
(case (-> this pickup-type)
|
||||
(((pickup-type gem))
|
||||
@@ -1546,11 +1549,11 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod init-from-entity! ((this money) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(initialize-allocations this)
|
||||
(process-drawable-from-entity! this (-> this entity))
|
||||
(initialize-options this 0 1024.0 (the-as fact-info #f))
|
||||
@@ -1629,6 +1632,7 @@ This commonly includes things such as:
|
||||
|
||||
|
||||
(defmethod deactivate ((this gem))
|
||||
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
||||
(+! (-> *game-info* live-gem-count) -1)
|
||||
(call-parent-method this)
|
||||
(none)
|
||||
@@ -1980,11 +1984,11 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod init-from-entity! ((this trick-point) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(initialize-allocations this)
|
||||
(process-drawable-from-entity! this (-> this entity))
|
||||
(initialize-options this 0 1024.0 (the-as fact-info #f))
|
||||
@@ -2234,11 +2238,11 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod init-from-entity! ((this eco) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(let ((v1-1 (res-lump-value (-> this entity) 'eco-info uint128 :time -1000000000.0)))
|
||||
(set! (-> this type) (cond
|
||||
((= (the-as uint v1-1) 3)
|
||||
@@ -2557,14 +2561,14 @@ This commonly includes things such as:
|
||||
)
|
||||
((and (>= f22-0 f0-5) (logtest? s2-1 (game-feature gun-red)))
|
||||
(set! s2-0 (pickup-type ammo-red))
|
||||
(set! f30-0 (* 0.5 f30-0))
|
||||
(set! f30-0 (/ f30-0 2))
|
||||
)
|
||||
((and (>= f24-0 f0-5) (logtest? s2-1 (game-feature gun-blue)))
|
||||
(set! s2-0 (pickup-type ammo-blue))
|
||||
)
|
||||
((and (>= f28-0 f0-5) (logtest? s2-1 (game-feature gun-dark)))
|
||||
(set! s2-0 (pickup-type ammo-dark))
|
||||
(set! f30-0 (* 0.1 f30-0))
|
||||
(set! f30-0 (/ f30-0 10))
|
||||
)
|
||||
(else
|
||||
(set! s2-0 (pickup-type eco-pill-dark))
|
||||
|
||||
@@ -1291,9 +1291,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)
|
||||
|
||||
@@ -301,7 +301,7 @@
|
||||
(f0-9 (fmax -1.0 (fmin 1.0 f0-7)))
|
||||
)
|
||||
(set! (-> gp-0 global-scale) (* 4096.0 (* 3.0 (+ 1.0 f0-9))))
|
||||
(set! (-> gp-0 individual-normal-scale) (+ 0.5 (* 0.5 f0-9)))
|
||||
(set! (-> gp-0 individual-normal-scale) (+ 0.5 (/ f0-9 2)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -830,7 +830,7 @@
|
||||
(set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 f30-0))
|
||||
(set! (-> *part-id-table* 506 init-specs 19 initial-valuef) (+ 49152.0 f30-0))
|
||||
(set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f28-0))
|
||||
(set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f28-0))
|
||||
(set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (/ f28-0 10))
|
||||
(set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111)
|
||||
(set! (-> *part-id-table* 506 init-specs 3 initial-valuef) (-> this wake-size))
|
||||
(set! (-> *part-id-table* 506 init-specs 5 initial-valuef) (-> this wake-size))
|
||||
@@ -1089,7 +1089,7 @@
|
||||
)
|
||||
(set-time! (-> this drip-time))
|
||||
(logclear! (-> this flags) (water-flags 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)
|
||||
@@ -1144,9 +1144,9 @@
|
||||
(set! (-> *part-id-table* 512 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0)))
|
||||
(set! (-> *part-id-table* 513 init-specs 12 initial-valuef) (* 13.653334 (* -0.15 f0-0)))
|
||||
(set! (-> *part-id-table* 513 init-specs 12 random-rangef) (* 13.653334 (* -0.075 f0-0)))
|
||||
(set! (-> *part-id-table* 519 init-specs 2 initial-valuef) (* 4096.0 (* 0.1 f0-0)))
|
||||
(set! (-> *part-id-table* 519 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 10)))
|
||||
(set! (-> *part-id-table* 519 init-specs 2 random-rangef) (* 4096.0 (* 0.4 f0-0)))
|
||||
(set! (-> *part-id-table* 519 init-specs 4 initial-valuef) (* 4096.0 (* 0.1 f0-0)))
|
||||
(set! (-> *part-id-table* 519 init-specs 4 initial-valuef) (* 4096.0 (/ f0-0 10)))
|
||||
(set! (-> *part-id-table* 519 init-specs 4 random-rangef) (* 4096.0 (* 0.4 f0-0)))
|
||||
(set! (-> *part-id-table* 519 init-specs 9 initial-valuef) (* 13.653334 (* 1.5 f0-0)))
|
||||
(set! (-> *part-id-table* 519 init-specs 9 random-rangef) (* 13.653334 (* 3.4 f0-0)))
|
||||
@@ -1160,11 +1160,11 @@
|
||||
(set! (-> *part-id-table* 516 init-specs 10 random-rangef) (* 13.653334 (* 2.4 f0-0)))
|
||||
(set! (-> *part-id-table* 516 init-specs 11 initial-valuef) (* 13.653334 (* 1.5 f0-0)))
|
||||
(set! (-> *part-id-table* 516 init-specs 11 random-rangef) (* 13.653334 (* 2.4 f0-0)))
|
||||
(set! (-> *part-id-table* 520 init-specs 1 initial-valuef) (* 0.5 f0-0))
|
||||
(set! (-> *part-id-table* 520 init-specs 2 initial-valuef) (* 4096.0 (* -0.25 f0-0)))
|
||||
(set! (-> *part-id-table* 520 init-specs 2 random-rangef) (* 4096.0 (* 0.5 f0-0)))
|
||||
(set! (-> *part-id-table* 520 init-specs 3 initial-valuef) (* 4096.0 (* -0.25 f0-0)))
|
||||
(set! (-> *part-id-table* 520 init-specs 3 random-rangef) (* 4096.0 (* 0.5 f0-0)))
|
||||
(set! (-> *part-id-table* 520 init-specs 1 initial-valuef) (/ f0-0 2))
|
||||
(set! (-> *part-id-table* 520 init-specs 2 initial-valuef) (* 4096.0 (/ f0-0 -4)))
|
||||
(set! (-> *part-id-table* 520 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 2)))
|
||||
(set! (-> *part-id-table* 520 init-specs 3 initial-valuef) (* 4096.0 (/ f0-0 -4)))
|
||||
(set! (-> *part-id-table* 520 init-specs 3 random-rangef) (* 4096.0 (/ f0-0 2)))
|
||||
(set! (-> *part-id-table* 520 init-specs 10 initial-valuef) (* 13.653334 (* -0.75 f0-0)))
|
||||
(set! (-> *part-id-table* 520 init-specs 10 random-rangef) (* 13.653334 (* 1.5 f0-0)))
|
||||
(set! (-> *part-id-table* 520 init-specs 12 initial-valuef) (* 13.653334 (* -0.75 f0-0)))
|
||||
@@ -1173,7 +1173,7 @@
|
||||
(set! (-> *part-id-table* 520 init-specs 11 random-rangef) (* 13.653334 (* 2.0 f0-0)))
|
||||
(set! (-> *part-id-table* 520 init-specs 15 initial-valuef) (* 13.653334 (* -0.3 f0-0)))
|
||||
(set! (-> *part-id-table* 520 init-specs 15 random-rangef) (* 13.653334 (* -0.075 f0-0)))
|
||||
(set! (-> *part-id-table* 517 init-specs 1 initial-valuef) (* 0.5 f0-0))
|
||||
(set! (-> *part-id-table* 517 init-specs 1 initial-valuef) (/ f0-0 2))
|
||||
(set! (-> *part-id-table* 517 init-specs 2 initial-valuef) (* 1.2 f0-0))
|
||||
(set! (-> *part-id-table* 517 init-specs 9 initial-valuef) (* 13.653334 f0-0))
|
||||
(set! (-> *part-id-table* 517 init-specs 9 random-rangef) (* 13.653334 (* 2.0 f0-0)))
|
||||
@@ -1196,10 +1196,10 @@
|
||||
(set! (-> *part-id-table* 515 init-specs 13 initial-valuef) (* 13.653334 (* -0.3 f0-0)))
|
||||
(set! (-> *part-id-table* 515 init-specs 13 random-rangef) (* 13.653334 (* -0.075 f0-0)))
|
||||
(set! (-> *part-id-table* 514 init-specs 2 initial-valuef) (* 4096.0 (* 1.2 f0-0)))
|
||||
(set! (-> *part-id-table* 514 init-specs 2 random-rangef) (* 4096.0 (* 0.2 f0-0)))
|
||||
(set! (-> *part-id-table* 514 init-specs 2 random-rangef) (* 4096.0 (/ f0-0 5)))
|
||||
(set! (-> *part-id-table* 514 init-specs 3 initial-valuef) (* 4096.0 (* 0.4 f0-0)))
|
||||
(set! (-> *part-id-table* 514 init-specs 3 random-rangef) (* 4096.0 (* 1.2 f0-0)))
|
||||
(set! (-> *part-id-table* 514 init-specs 7 initial-valuef) (* 4096.0 (* 0.2 f0-0)))
|
||||
(set! (-> *part-id-table* 514 init-specs 7 initial-valuef) (* 4096.0 (/ f0-0 5)))
|
||||
(set! (-> *part-id-table* 514 init-specs 7 random-rangef) (* 4096.0 (* 2.2 f0-0)))
|
||||
(set! (-> *part-id-table* 518 init-specs 2 initial-valuef) (* 4096.0 (* 0.3 f0-0)))
|
||||
(set! (-> *part-id-table* 518 init-specs 2 random-rangef) (* 4096.0 (* 0.9 f0-0)))
|
||||
@@ -1302,7 +1302,7 @@
|
||||
(set! (-> *part-id-table* 506 init-specs 4 initial-valuef) (+ 24576.0 arg0))
|
||||
(set! (-> *part-id-table* 506 init-specs 19 initial-valuef) (+ 49152.0 arg0))
|
||||
(set! (-> *part-id-table* 506 init-specs 1 initial-valuef) (* 0.0000036621095 f30-0))
|
||||
(set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (* 0.1 f30-0))
|
||||
(set! (-> *part-id-table* 506 init-specs 2 initial-valuef) (/ f30-0 10))
|
||||
(set! (-> *part-id-table* 506 init-specs 13 initial-valuef) 0.7111111)
|
||||
(set! (-> *part-id-table* 506 init-specs 3 initial-valuef) arg3)
|
||||
(set! (-> *part-id-table* 506 init-specs 5 initial-valuef) arg3)
|
||||
|
||||
@@ -298,13 +298,13 @@
|
||||
(case arg0
|
||||
(('close)
|
||||
(if (and *math-camera* *subdivide-settings*)
|
||||
(* 0.00024414062 (-> *subdivide-settings* close 7))
|
||||
(/ (-> *subdivide-settings* close 7) METER_LENGTH)
|
||||
arg3
|
||||
)
|
||||
)
|
||||
(('far)
|
||||
(if (and *math-camera* *subdivide-settings*)
|
||||
(* 0.00024414062 (-> *subdivide-settings* far 7))
|
||||
(/ (-> *subdivide-settings* far 7) METER_LENGTH)
|
||||
arg3
|
||||
)
|
||||
)
|
||||
@@ -559,7 +559,7 @@
|
||||
(if (= arg1 (debug-menu-msg press))
|
||||
(set! (-> v1-0 camera-to-bbox-dist) (* 4096.0 arg2))
|
||||
)
|
||||
(* 0.00024414062 (-> v1-0 camera-to-bbox-dist))
|
||||
(/ (-> v1-0 camera-to-bbox-dist) METER_LENGTH)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -974,7 +974,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(* 0.00024414062 f1-2)
|
||||
(/ f1-2 METER_LENGTH)
|
||||
)
|
||||
)
|
||||
(else
|
||||
@@ -1011,7 +1011,7 @@
|
||||
(set! (-> (the-as prototype-bucket-tie gp-0) tie-vanish-far) f0-0)
|
||||
)
|
||||
)
|
||||
(* 0.00024414062 f0-0)
|
||||
(/ f0-0 METER_LENGTH)
|
||||
)
|
||||
)
|
||||
(else
|
||||
@@ -2550,7 +2550,7 @@
|
||||
(set! (-> gp-0 dists x) (* 4096.0 arg2))
|
||||
(prototype-bucket-recalc-fields gp-0)
|
||||
)
|
||||
(* 0.00024414062 (-> gp-0 dists x))
|
||||
(/ (-> gp-0 dists x) METER_LENGTH)
|
||||
)
|
||||
(else
|
||||
(empty)
|
||||
@@ -2581,7 +2581,7 @@
|
||||
(set! (-> gp-0 dists w) (* 4096.0 arg2))
|
||||
(prototype-bucket-recalc-fields gp-0)
|
||||
)
|
||||
(* 0.00024414062 (-> gp-0 dists w))
|
||||
(/ (-> gp-0 dists w) METER_LENGTH)
|
||||
)
|
||||
(else
|
||||
(empty)
|
||||
@@ -4362,10 +4362,7 @@
|
||||
,(lambda ()
|
||||
(let ((v1-1 (process-spawn-function process (lambda ()
|
||||
(set-master-mode 'game)
|
||||
(let ((gp-0 (current-time)))
|
||||
(until (time-elapsed? gp-0 (seconds 0.3))
|
||||
(suspend)
|
||||
)
|
||||
(suspend-for (seconds 0.3)
|
||||
)
|
||||
(until #f
|
||||
(format *stdcon* "press x clear map, press circle cancel~%")
|
||||
@@ -5252,13 +5249,13 @@
|
||||
fog-dists
|
||||
x
|
||||
)
|
||||
(* 0.00024414062
|
||||
(-> *overide-mood-fog-table*
|
||||
(/ (-> *overide-mood-fog-table*
|
||||
data
|
||||
(the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)))
|
||||
fog-dists
|
||||
x
|
||||
)
|
||||
METER_LENGTH
|
||||
)
|
||||
)
|
||||
(set! (-> *overide-mood-fog-table*
|
||||
@@ -5267,13 +5264,13 @@
|
||||
fog-dists
|
||||
y
|
||||
)
|
||||
(* 0.00024414062
|
||||
(-> *overide-mood-fog-table*
|
||||
(/ (-> *overide-mood-fog-table*
|
||||
data
|
||||
(the-as uint (logand (-> *time-of-day-context* mode) (time-of-day-palette-id unk0 unk1 unk2)))
|
||||
fog-dists
|
||||
y
|
||||
)
|
||||
METER_LENGTH
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -5286,10 +5283,10 @@
|
||||
(dotimes (v1-1 8)
|
||||
(set! (-> *overide-mood-fog-table* data v1-1 fog-color w) 1.0)
|
||||
(set! (-> *overide-mood-fog-table* data v1-1 fog-dists x)
|
||||
(* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists x))
|
||||
(/ (-> *overide-mood-fog-table* data v1-1 fog-dists x) METER_LENGTH)
|
||||
)
|
||||
(set! (-> *overide-mood-fog-table* data v1-1 fog-dists y)
|
||||
(* 0.00024414062 (-> *overide-mood-fog-table* data v1-1 fog-dists y))
|
||||
(/ (-> *overide-mood-fog-table* data v1-1 fog-dists y) METER_LENGTH)
|
||||
)
|
||||
)
|
||||
#f
|
||||
@@ -5616,10 +5613,10 @@
|
||||
(set! (-> *overide-mood-color-table* data v1-2 amb-color w) 1.0)
|
||||
(set! (-> *overide-mood-fog-table* data v1-2 fog-color w) 1.0)
|
||||
(set! (-> *overide-mood-fog-table* data v1-2 fog-dists x)
|
||||
(* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists x))
|
||||
(/ (-> *overide-mood-fog-table* data v1-2 fog-dists x) METER_LENGTH)
|
||||
)
|
||||
(set! (-> *overide-mood-fog-table* data v1-2 fog-dists y)
|
||||
(* 0.00024414062 (-> *overide-mood-fog-table* data v1-2 fog-dists y))
|
||||
(/ (-> *overide-mood-fog-table* data v1-2 fog-dists y) METER_LENGTH)
|
||||
)
|
||||
(set-vector! (-> *time-of-day-context* times v1-2) 1.0 1.0 1.0 1.0)
|
||||
)
|
||||
@@ -5643,7 +5640,7 @@
|
||||
(flag "Sound channels" *display-iop-info* dm-boolean-toggle-pick-func)
|
||||
(function "Reload Banks" #f sound-bank-reload)
|
||||
(function "List Sounds" #f ,(lambda () (list-sounds) (none)))
|
||||
;(function "IOP Info" #f ,(lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)) (none)))
|
||||
(function "IOP Info" #f ,(lambda () (loader-test-command (sound-command iop-mem) (the-as uint 0)) (none)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -642,7 +642,7 @@
|
||||
)
|
||||
(else
|
||||
(vector-! s5-1 (edit-get-trans s1-2) s4-1)
|
||||
(let ((f0-9 (* 0.00390625 f30-1 (vector-length s5-1))))
|
||||
(let ((f0-9 (* (/ f30-1 256) (vector-length s5-1))))
|
||||
(set! f0-6 (fmax -40960.0 (fmin 40960.0 f0-9)))
|
||||
)
|
||||
(set! (-> arg0 move-speed) f0-6)
|
||||
@@ -692,7 +692,7 @@
|
||||
)
|
||||
(else
|
||||
(vector-! s5-2 (edit-get-trans s1-3) s4-2)
|
||||
(let ((f0-21 (* 0.00390625 f30-2 (vector-length s5-2))))
|
||||
(let ((f0-21 (* (/ f30-2 256) (vector-length s5-2))))
|
||||
(set! f0-18 (fmax -40960.0 (fmin 40960.0 f0-21)))
|
||||
)
|
||||
(set! (-> arg0 move-speed) f0-18)
|
||||
@@ -742,7 +742,7 @@
|
||||
)
|
||||
(else
|
||||
(vector-! s5-3 (edit-get-trans s1-4) s4-3)
|
||||
(let ((f0-32 (* 0.00390625 f30-3 (vector-length s5-3))))
|
||||
(let ((f0-32 (* (/ f30-3 256) (vector-length s5-3))))
|
||||
(set! (-> arg0 move-speed) f0-32)
|
||||
(set! f0-29 (fmax -40960.0 (fmin 40960.0 f0-32)))
|
||||
)
|
||||
@@ -1437,23 +1437,23 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch process-drawable vs editable-player.
|
||||
(defmethod relocate ((this editable-player) (arg0 int))
|
||||
(defmethod relocate ((this editable-player) (offset int))
|
||||
(let ((v1-0 *kernel-context*))
|
||||
(set! (-> v1-0 relocating-process) this)
|
||||
(set! (-> v1-0 relocating-min) (the-as int (&-> this type)))
|
||||
(set! (-> v1-0 relocating-max)
|
||||
(the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this)))
|
||||
)
|
||||
(set! (-> v1-0 relocating-offset) arg0)
|
||||
(set! (-> v1-0 relocating-offset) offset)
|
||||
)
|
||||
(let ((v1-2 (-> this current)))
|
||||
(if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int v1-2) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> this current) arg0)
|
||||
(&+! (-> this current) offset)
|
||||
)
|
||||
)
|
||||
(the-as editable-player ((method-of-type process-drawable relocate) this arg0))
|
||||
(the-as editable-player ((method-of-type process-drawable relocate) this offset))
|
||||
)
|
||||
|
||||
(defmethod editable-player-method-21 ((this editable-player))
|
||||
|
||||
@@ -1082,7 +1082,7 @@
|
||||
(* 0.00024414062 (- (-> this trans x) (-> arg0 level-offset x)))
|
||||
(* 0.00024414062 (- (-> this trans y) (-> arg0 level-offset y)))
|
||||
(* 0.00024414062 (- (-> this trans z) (-> arg0 level-offset z)))
|
||||
(* 0.00024414062 (-> this radius))
|
||||
(/ (-> this radius) METER_LENGTH)
|
||||
)
|
||||
(if (= (-> this direction w) 0.0)
|
||||
(format s5-0 ", dir_x=0.0, dir_y=0.0, dir_z=0.0")
|
||||
@@ -1808,9 +1808,9 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch (array editable) vs editable-array.
|
||||
(defmethod relocate ((this editable-array) (arg0 int))
|
||||
(defmethod relocate ((this editable-array) (offset int))
|
||||
(the-as editable-array (when (nonzero? (-> this selection))
|
||||
(let ((v0-0 (&+ (-> this selection) arg0)))
|
||||
(let ((v0-0 (&+ (-> this selection) offset)))
|
||||
(set! (-> this selection) v0-0)
|
||||
v0-0
|
||||
)
|
||||
|
||||
@@ -149,13 +149,14 @@
|
||||
)
|
||||
|
||||
(defmethod deactivate ((this nav-graph-editor))
|
||||
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
||||
(set! *nav-graph-editor* (the-as (pointer nav-graph-editor) #f))
|
||||
((method-of-type process deactivate) this)
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod relocate ((this nav-graph-editor) (arg0 int))
|
||||
(call-parent-method this arg0)
|
||||
(defmethod relocate ((this nav-graph-editor) (offset int))
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch symbol vs none.
|
||||
@@ -1777,7 +1778,7 @@
|
||||
(let ((gp-0 (-> self nav-graph edge-array data (-> self selected-index))))
|
||||
(format *stdcon* "Density = ~F~%" (-> gp-0 density))
|
||||
(logior! (-> gp-0 mysql-save-flag) (mysql-save-flag update))
|
||||
(+! (-> gp-0 density) (* 0.01 (-> *mouse* speedx)))
|
||||
(+! (-> gp-0 density) (/ (-> *mouse* speedx) 100))
|
||||
(if (< (-> gp-0 density) 0.0)
|
||||
(set! (-> gp-0 density) 0.0)
|
||||
)
|
||||
|
||||
@@ -1143,7 +1143,7 @@
|
||||
(sound-play-by-name
|
||||
(sound-name-with-material "zoom-land" (-> self control ground-pat) "")
|
||||
(new-sound-id)
|
||||
(the int (* 1024.0 (* 0.000016276043 (-> self control ground-impact-vel))))
|
||||
(the int (* 1024.0 (/ (-> self control ground-impact-vel) (meters 15))))
|
||||
0
|
||||
0
|
||||
(sound-group sfx)
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
(vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0))
|
||||
)
|
||||
(vector-normalize! s1-0 (-> this radius))
|
||||
(vector-float*! s0-0 (-> this axis) (* 0.125 (-> this length)))
|
||||
(vector-float*! s0-0 (-> this axis) (/ (-> this length) 8))
|
||||
(let ((s5-0 (new 'stack-no-clear 'cylinder-verts))
|
||||
(s4-0 (new 'stack-no-clear 'cylinder-verts))
|
||||
(s3-0 (new 'stack-no-clear 'matrix))
|
||||
@@ -242,7 +242,7 @@
|
||||
(vector-cross! s1-0 (-> this axis) (new 'static 'vector :y 1.0))
|
||||
)
|
||||
(vector-normalize! s1-0 (-> this radius))
|
||||
(vector-float*! s0-0 (-> this axis) (* 0.14285715 (-> this length)))
|
||||
(vector-float*! s0-0 (-> this axis) (/ (-> this length) 7))
|
||||
(let ((s5-0 (new 'stack-no-clear 'cylinder-flat-verts))
|
||||
(s4-0 (new 'stack-no-clear 'cylinder-flat-verts))
|
||||
(s3-0 (new 'stack-no-clear 'matrix))
|
||||
|
||||
@@ -26,9 +26,9 @@
|
||||
|
||||
(defun ripple-make-request ((waveform ripple-wave) (effect merc-effect))
|
||||
"Iterate through [[*ripple-globals*]] `requests` looking for the one that matches the provided `effect`
|
||||
If NOT found, append a new [[ripple-request]] with the providded `effect` and `waveform` to the end of the `requests`.
|
||||
|
||||
NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!"
|
||||
If NOT found, append a new [[ripple-request]] with the providded `effect` and `waveform` to the end of the `requests`.
|
||||
|
||||
NOTE: There can only be 16 effects at a given time, NOOP if already at that limit!"
|
||||
(let ((v1-1 (-> *ripple-globals* count))
|
||||
(a2-1 (-> *ripple-globals* requests))
|
||||
(a3-0 0)
|
||||
@@ -74,10 +74,10 @@ NOTE: There can only be 16 effects at a given time, NOOP if already at that limi
|
||||
|
||||
(defun ripple-execute ()
|
||||
"Iterate through [[*ripple-globals*]] requests, from the end to index `0`
|
||||
For each request, if it has a `waveform` create the wave-table via `ripple-create-wave-table`
|
||||
Then for each `waveform` apply the `effect` using `ripple-apply-wave-table`
|
||||
|
||||
Once completed, all `requests` have been processed and the `count` is reset to `0`"
|
||||
For each request, if it has a `waveform` create the wave-table via `ripple-create-wave-table`
|
||||
Then for each `waveform` apply the `effect` using `ripple-apply-wave-table`
|
||||
|
||||
Once completed, all `requests` have been processed and the `count` is reset to `0`"
|
||||
(when (-> *ripple-globals* count)
|
||||
(ripple-execute-init)
|
||||
(let ((gp-0 0)
|
||||
@@ -192,7 +192,7 @@ Once completed, all `requests` have been processed and the `count` is reset to `
|
||||
(if (< f0-23 0.0)
|
||||
(set! f0-23 (-> gp-0 global-scale))
|
||||
)
|
||||
(+ f30-0 (* 0.0078125 f1-12 f0-23))
|
||||
(+ f30-0 (* (/ f1-12 128) f0-23))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -11,11 +11,11 @@
|
||||
|
||||
(defun set-video-mode ((tv-format symbol))
|
||||
"Set related settings to the video mode in the settings, [[*video-params*]] and the [[*video-mode*]]
|
||||
`ntsc` has a [[*video-mode*]] value of `0`, where as `pal` has a value of `1`
|
||||
|
||||
Will also set a bunch of common settings related to profiling and the camera to finalize the switch
|
||||
|
||||
@param tv-format Recognizes `ntsc` and `pal`"
|
||||
`ntsc` has a [[*video-mode*]] value of `0`, where as `pal` has a value of `1`
|
||||
|
||||
Will also set a bunch of common settings related to profiling and the camera to finalize the switch
|
||||
|
||||
@param tv-format Recognizes `ntsc` and `pal`"
|
||||
(case tv-format
|
||||
(('ntsc)
|
||||
(set! (-> *setting-control* user-default display-dx) 0)
|
||||
@@ -42,7 +42,7 @@ Will also set a bunch of common settings related to profiling and the camera to
|
||||
(set! (-> *video-params* reset-video-mode) #t)
|
||||
(set! (-> *math-camera* isometric vector 1 y) 0.5)
|
||||
(set! (-> *math-camera* y-clip) 416.0)
|
||||
(set! (-> *math-camera* y-pix) (* 0.5 (-> *math-camera* y-clip)))
|
||||
(set! (-> *math-camera* y-pix) (/ (-> *math-camera* y-clip) 2))
|
||||
(set! *profile-y* 1848)
|
||||
(set! (-> *video-params* set-video-mode) #t)
|
||||
0
|
||||
@@ -56,7 +56,7 @@ Will also set a bunch of common settings related to profiling and the camera to
|
||||
|
||||
(defun set-aspect-ratio ((aspect symbol))
|
||||
"Set [[*video-params*]] aspect-ratio related settings based on the mode provided.
|
||||
@param aspect Recognizes `aspect4x3` and `aspect16x9`"
|
||||
@param aspect Recognizes `aspect4x3` and `aspect16x9`"
|
||||
(case aspect
|
||||
(('aspect4x3)
|
||||
(set! (-> *video-params* relative-x-scale) 1.0)
|
||||
@@ -78,7 +78,7 @@ Will also set a bunch of common settings related to profiling and the camera to
|
||||
|
||||
(defun set-progressive-scan ((val symbol))
|
||||
"Flip the progressive scan setting flag depending on the value provided
|
||||
@param val The value to set the progressive scan flag to"
|
||||
@param val The value to set the progressive scan flag to"
|
||||
(set! (-> *setting-control* user-default use-progressive-scan) val)
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -481,7 +481,7 @@
|
||||
)
|
||||
(cond
|
||||
((< f0-3 15.0)
|
||||
(set! (-> gp-1 blink) (* 0.06666667 f0-3))
|
||||
(set! (-> gp-1 blink) (/ f0-3 15))
|
||||
)
|
||||
((< 45.0 f0-3)
|
||||
(set! (-> gp-1 blink) (* 0.06666667 (- 60.0 f0-3)))
|
||||
@@ -536,7 +536,7 @@
|
||||
(set! (-> v1-12 r) 1.0)
|
||||
)
|
||||
(let ((f0-8 (- 1.0 (get-sphere-interp a0-9 a1-3 1024000.0 2048000.0))))
|
||||
(update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (* 0.5 f0-8)) 30.0 30.0)
|
||||
(update-mood-weather! *mood-control* (+ 0.25 (* 0.75 f0-8)) (+ 0.5 (/ f0-8 2)) 30.0 30.0)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1304,7 +1304,7 @@
|
||||
(let ((v1-1 (level-get *level* 'palent)))
|
||||
(when v1-1
|
||||
(let ((v1-2 (the-as object (-> v1-1 mood-context state))))
|
||||
(set! (-> (the-as palent-states v1-2) turret-value) (* 0.5 arg0))
|
||||
(set! (-> (the-as palent-states v1-2) turret-value) (/ arg0 2))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1385,9 +1385,9 @@
|
||||
|
||||
(defun update-village1-lights ((arg0 mood-context))
|
||||
(let ((v1-0 (-> arg0 light-group)))
|
||||
(set! (-> v1-0 0 dir0 extra x) (* 0.5 (-> v1-0 0 dir0 extra x)))
|
||||
(set! (-> v1-0 0 dir1 extra x) (* 0.5 (-> v1-0 0 dir1 extra x)))
|
||||
(set! (-> v1-0 0 dir2 extra x) (* 0.5 (-> v1-0 0 dir2 extra x)))
|
||||
(set! (-> v1-0 0 dir0 extra x) (/ (-> v1-0 0 dir0 extra x) 2))
|
||||
(set! (-> v1-0 0 dir1 extra x) (/ (-> v1-0 0 dir1 extra x) 2))
|
||||
(set! (-> v1-0 0 dir2 extra x) (/ (-> v1-0 0 dir2 extra x) 2))
|
||||
(set! (-> v1-0 0 ambi extra x) (* 0.75 (-> v1-0 0 ambi extra x)))
|
||||
)
|
||||
)
|
||||
@@ -1403,7 +1403,7 @@
|
||||
(set! (-> arg0 times 6 w) (- 1.0 f0-0))
|
||||
(set! (-> arg0 times 7 w) f0-0)
|
||||
(if (!= f0-0 0.0)
|
||||
(set-filter-color! (- 1.0 (* 0.25 f0-0)) (- 1.0 (* 0.5 f0-0)) 1.0)
|
||||
(set-filter-color! (- 1.0 (/ f0-0 4)) (- 1.0 (/ f0-0 2)) 1.0)
|
||||
)
|
||||
)
|
||||
(when (not (paused?))
|
||||
|
||||
@@ -586,7 +586,7 @@
|
||||
(if (or (and (>= a0-37 350) (< a0-37 400)) (>= a0-37 500))
|
||||
(+! f4-0 f0-8)
|
||||
)
|
||||
(let ((f0-10 (* 0.0006510417 f4-0)))
|
||||
(let ((f0-10 (/ f4-0 1536)))
|
||||
(set! (-> arg0 times 2 w) f0-10)
|
||||
(set! (-> arg0 light-group 3 dir1 extra x) f0-10)
|
||||
)
|
||||
@@ -625,7 +625,7 @@
|
||||
(if (nonzero? (-> s5-0 spec-hog-2-on))
|
||||
(set! (-> s5-0 spec-hog-2-on initial-valuef) f0-19)
|
||||
)
|
||||
(set! (-> arg0 times 3 w) (+ 0.5 (* 0.0009765625 f0-19)))
|
||||
(set! (-> arg0 times 3 w) (+ 0.5 (/ f0-19 1024)))
|
||||
)
|
||||
(set! (-> arg0 light-group 4 dir1 extra x) (-> arg0 times 3 w))
|
||||
(let ((v1-6 (mod v1-5 600)))
|
||||
@@ -638,7 +638,7 @@
|
||||
(if (nonzero? (-> s5-0 spec-hiphog-on2))
|
||||
(set! (-> s5-0 spec-hiphog-on2 initial-valuef) f0-24)
|
||||
)
|
||||
(set! (-> arg0 times 4 w) (* 0.001953125 f0-24))
|
||||
(set! (-> arg0 times 4 w) (/ f0-24 512))
|
||||
)
|
||||
)
|
||||
(else
|
||||
@@ -659,7 +659,7 @@
|
||||
(if (nonzero? (-> s5-0 spec-clock-moon))
|
||||
(set! (-> s5-0 spec-clock-moon initial-valuef) f0-31)
|
||||
)
|
||||
(set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (* 0.001953125 f0-31)))
|
||||
(set-vector! (-> arg0 times 5) 0.471 0.722 1.0 (+ 0.5 (/ f0-31 512)))
|
||||
)
|
||||
)
|
||||
(else
|
||||
@@ -667,7 +667,7 @@
|
||||
(if (nonzero? (-> s5-0 spec-clock-sun))
|
||||
(set! (-> s5-0 spec-clock-sun initial-valuef) f0-35)
|
||||
)
|
||||
(set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (* 0.0009765625 f0-35)))
|
||||
(set-vector! (-> arg0 times 5) 1.0 0.99 0.54 (+ 0.5 (/ f0-35 1024)))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2328,7 +2328,7 @@
|
||||
)
|
||||
(when (!= (-> gp-0 explosion) 0.0)
|
||||
(set! (-> arg0 times 7 w) (-> gp-0 explosion))
|
||||
(let ((f0-15 (- 1.0 (* 0.5 (-> gp-0 explosion)))))
|
||||
(let ((f0-15 (- 1.0 (/ (-> gp-0 explosion) 2))))
|
||||
(set! (-> arg0 times 2 w) (* (-> arg0 times 2 w) f0-15))
|
||||
(set! (-> arg0 times 3 w) (* (-> arg0 times 3 w) f0-15))
|
||||
(set! (-> arg0 times 0 w) (* (-> arg0 times 0 w) f0-15))
|
||||
@@ -2437,7 +2437,7 @@
|
||||
((< 0.0 (-> gp-1 flash))
|
||||
(set! (-> gp-1 level) (-> gp-1 flash))
|
||||
(set-vector! (-> gp-1 dir) 0.0 0.0 1.0 0.0)
|
||||
(set! (-> gp-1 flash) (- (-> gp-1 flash) (* 0.5 (-> *display* base-clock seconds-per-frame))))
|
||||
(set! (-> gp-1 flash) (- (-> gp-1 flash) (/ (-> *display* base-clock seconds-per-frame) 2)))
|
||||
(set! (-> gp-1 time) 0.0)
|
||||
)
|
||||
(else
|
||||
@@ -2461,7 +2461,7 @@
|
||||
(let ((f30-0 (vector-length (-> gp-1 pos))))
|
||||
(set! (-> gp-1 dir quad) (-> gp-1 pos quad))
|
||||
(vector-normalize! (-> gp-1 dir) 1.0)
|
||||
(set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (* 0.000009765625 f30-0)))))
|
||||
(set! (-> gp-1 level) (* (-> gp-1 scale) (- 1.0 (fmin 1.0 (/ f30-0 (meters 25))))))
|
||||
)
|
||||
(set! (-> gp-1 pos z) (- (-> gp-1 pos z) (* (-> gp-1 delta) (-> *display* base-clock seconds-per-frame))))
|
||||
)
|
||||
@@ -2560,7 +2560,7 @@
|
||||
(set! (-> arg0 times 5 w) (+ (-> gp-1 purple) (-> gp-1 purple-noise)))
|
||||
(when (not (paused?))
|
||||
(seek! (-> gp-1 purple) 0.0 (* 4.0 (seconds-per-frame)))
|
||||
(set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (* 0.2 (-> gp-1 purple))))
|
||||
(set! (-> gp-1 purple-noise) (rand-vu-float-range 0.0 (/ (-> gp-1 purple) 5)))
|
||||
(+! (-> gp-1 rot) (* 16384.0 (seconds-per-frame)))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -97,15 +97,18 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch pointer vs none.
|
||||
(defun init-overide-table ((arg0 mood-table))
|
||||
(set! (-> arg0 mood-fog-table) (new 'debug 'mood-fog-table))
|
||||
(set! (-> arg0 mood-color-table) (new 'debug 'mood-color-table))
|
||||
(set! (-> arg0 mood-channel-group) *no-cloud-mood-channel-group*)
|
||||
(set! (-> arg0 mood-direction-table) *mood-direction-table*)
|
||||
(set! (-> arg0 mood-sky-table) *mood-sky-table*)
|
||||
(set! (-> arg0 mood-interp-table) *mood-interp-table*)
|
||||
(mem-copy! (the-as pointer (-> arg0 mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384)
|
||||
(mem-copy! (the-as pointer (-> arg0 mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256)
|
||||
(defun init-overide-table ((table mood-table))
|
||||
"Similar to [[init-mood-table]], does the bare minimum to setup the given [[mood-table]]
|
||||
@param! table The table to initialize
|
||||
@returns [[none]]"
|
||||
(set! (-> table mood-fog-table) (new 'debug 'mood-fog-table))
|
||||
(set! (-> table mood-color-table) (new 'debug 'mood-color-table))
|
||||
(set! (-> table mood-channel-group) *no-cloud-mood-channel-group*)
|
||||
(set! (-> table mood-direction-table) *mood-direction-table*)
|
||||
(set! (-> table mood-sky-table) *mood-sky-table*)
|
||||
(set! (-> table mood-interp-table) *mood-interp-table*)
|
||||
(mem-copy! (the-as pointer (-> table mood-fog-table)) (the-as pointer *no-cloud-clear-mood-fog-table*) 384)
|
||||
(mem-copy! (the-as pointer (-> table mood-color-table)) (the-as pointer *no-cloud-mood-color-table*) 256)
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -115,62 +118,62 @@
|
||||
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defun print-mood-tables ()
|
||||
"Print out the contents of the [[*overide-table*]]"
|
||||
"Generates the GOAL code for defining the current state of [[*overide-table*]]"
|
||||
(mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) (the-as pointer *overide-mood-fog-table*) 384)
|
||||
(mem-copy!
|
||||
(the-as pointer (-> *overide-table* mood-color-table))
|
||||
(the-as pointer *overide-mood-color-table*)
|
||||
256
|
||||
)
|
||||
(dotimes (v1-2 8)
|
||||
(dotimes (data-idx 8)
|
||||
(vector-float*!
|
||||
(the-as vector (-> *overide-table* mood-fog-table data v1-2))
|
||||
(the-as vector (-> *overide-table* mood-fog-table data v1-2))
|
||||
(-> *overide-table* mood-fog-table data v1-2 fog-color w)
|
||||
(the-as vector (-> *overide-table* mood-fog-table data data-idx))
|
||||
(the-as vector (-> *overide-table* mood-fog-table data data-idx))
|
||||
(-> *overide-table* mood-fog-table data data-idx fog-color w)
|
||||
)
|
||||
(vector-float*!
|
||||
(the-as vector (-> *overide-table* mood-color-table data v1-2))
|
||||
(the-as vector (-> *overide-table* mood-color-table data v1-2))
|
||||
(-> *overide-table* mood-color-table data v1-2 lgt-color w)
|
||||
(the-as vector (-> *overide-table* mood-color-table data data-idx))
|
||||
(the-as vector (-> *overide-table* mood-color-table data data-idx))
|
||||
(-> *overide-table* mood-color-table data data-idx lgt-color w)
|
||||
)
|
||||
(vector-float*!
|
||||
(the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32)))
|
||||
(the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* v1-2 32)))
|
||||
(-> *overide-table* mood-color-table data v1-2 amb-color w)
|
||||
(the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* data-idx 32)))
|
||||
(the-as vector (+ (the-as uint (-> *overide-table* mood-color-table data 0 amb-color)) (* data-idx 32)))
|
||||
(-> *overide-table* mood-color-table data data-idx amb-color w)
|
||||
)
|
||||
(set! (-> *overide-table* mood-fog-table data v1-2 fog-color w) 128.0)
|
||||
(set! (-> *overide-table* mood-color-table data v1-2 lgt-color w) 0.0)
|
||||
(set! (-> *overide-table* mood-color-table data v1-2 amb-color w) 1.0)
|
||||
(set! (-> *overide-table* mood-fog-table data data-idx fog-color w) 128.0)
|
||||
(set! (-> *overide-table* mood-color-table data data-idx lgt-color w) 0.0)
|
||||
(set! (-> *overide-table* mood-color-table data data-idx amb-color w) 1.0)
|
||||
)
|
||||
(format 0 "(define *overide-mood-color-table*~%")
|
||||
(format 0 " (new 'static 'mood-color-table~%")
|
||||
(format 0 " :data (new 'static 'inline-array 'mood-color 0~%")
|
||||
(dotimes (gp-0 8)
|
||||
(dotimes (_color-idx 8)
|
||||
(format 0 " (new 'static 'mood-color")
|
||||
(let ((v1-5 gp-0))
|
||||
(let ((color-idx _color-idx))
|
||||
(cond
|
||||
((zero? v1-5)
|
||||
((zero? color-idx)
|
||||
(format 0 " ; sun rise~%")
|
||||
)
|
||||
((= v1-5 1)
|
||||
((= color-idx 1)
|
||||
(format 0 " ; morning~%")
|
||||
)
|
||||
((= v1-5 2)
|
||||
((= color-idx 2)
|
||||
(format 0 " ; noon~%")
|
||||
)
|
||||
((= v1-5 3)
|
||||
((= color-idx 3)
|
||||
(format 0 " ; afternoon~%")
|
||||
)
|
||||
((= v1-5 4)
|
||||
((= color-idx 4)
|
||||
(format 0 " ; sunset~%")
|
||||
)
|
||||
((= v1-5 5)
|
||||
((= color-idx 5)
|
||||
(format 0 " ; twilight~%")
|
||||
)
|
||||
((= v1-5 6)
|
||||
((= color-idx 6)
|
||||
(format 0 " ; evening~%")
|
||||
)
|
||||
((= v1-5 7)
|
||||
((= color-idx 7)
|
||||
(format 0 " ; green sun~%")
|
||||
)
|
||||
)
|
||||
@@ -178,18 +181,18 @@
|
||||
(format
|
||||
0
|
||||
" :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%"
|
||||
(-> *overide-table* mood-color-table data gp-0 lgt-color x)
|
||||
(-> *overide-table* mood-color-table data gp-0 lgt-color y)
|
||||
(-> *overide-table* mood-color-table data gp-0 lgt-color z)
|
||||
(-> *overide-table* mood-color-table data gp-0 lgt-color w)
|
||||
(-> *overide-table* mood-color-table data _color-idx lgt-color x)
|
||||
(-> *overide-table* mood-color-table data _color-idx lgt-color y)
|
||||
(-> *overide-table* mood-color-table data _color-idx lgt-color z)
|
||||
(-> *overide-table* mood-color-table data _color-idx lgt-color w)
|
||||
)
|
||||
(format
|
||||
0
|
||||
" :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%"
|
||||
(-> *overide-table* mood-color-table data gp-0 amb-color x)
|
||||
(-> *overide-table* mood-color-table data gp-0 amb-color y)
|
||||
(-> *overide-table* mood-color-table data gp-0 amb-color z)
|
||||
(-> *overide-table* mood-color-table data gp-0 amb-color w)
|
||||
(-> *overide-table* mood-color-table data _color-idx amb-color x)
|
||||
(-> *overide-table* mood-color-table data _color-idx amb-color y)
|
||||
(-> *overide-table* mood-color-table data _color-idx amb-color z)
|
||||
(-> *overide-table* mood-color-table data _color-idx amb-color w)
|
||||
)
|
||||
(format 0 " )~%")
|
||||
)
|
||||
@@ -199,32 +202,32 @@
|
||||
(format 0 "(define *overide-mood-fog-table*~%")
|
||||
(format 0 " (new 'static 'mood-fog-table~%")
|
||||
(format 0 " :data (new 'static 'inline-array 'mood-fog 0~%")
|
||||
(dotimes (gp-1 8)
|
||||
(dotimes (_fog-idx 8)
|
||||
(format 0 " (new 'static 'mood-fog")
|
||||
(let ((v1-33 gp-1))
|
||||
(let ((fog-idx _fog-idx))
|
||||
(cond
|
||||
((zero? v1-33)
|
||||
((zero? fog-idx)
|
||||
(format 0 " ; sun rise~%")
|
||||
)
|
||||
((= v1-33 1)
|
||||
((= fog-idx 1)
|
||||
(format 0 " ; morning~%")
|
||||
)
|
||||
((= v1-33 2)
|
||||
((= fog-idx 2)
|
||||
(format 0 " ; noon~%")
|
||||
)
|
||||
((= v1-33 3)
|
||||
((= fog-idx 3)
|
||||
(format 0 " ; afternoon~%")
|
||||
)
|
||||
((= v1-33 4)
|
||||
((= fog-idx 4)
|
||||
(format 0 " ; sunset~%")
|
||||
)
|
||||
((= v1-33 5)
|
||||
((= fog-idx 5)
|
||||
(format 0 " ; twilight~%")
|
||||
)
|
||||
((= v1-33 6)
|
||||
((= fog-idx 6)
|
||||
(format 0 " ; evening~%")
|
||||
)
|
||||
((= v1-33 7)
|
||||
((= fog-idx 7)
|
||||
(format 0 " ; green sun~%")
|
||||
)
|
||||
)
|
||||
@@ -232,18 +235,18 @@
|
||||
(format
|
||||
0
|
||||
" :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%"
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-color x)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-color y)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-color z)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-color w)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-color x)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-color y)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-color z)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-color w)
|
||||
)
|
||||
(format
|
||||
0
|
||||
" :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%"
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-dists x)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-dists y)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-dists w)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-dists z)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-dists x)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-dists y)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-dists w)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-dists z)
|
||||
)
|
||||
(format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%")
|
||||
(format 0 " )~%")
|
||||
@@ -258,38 +261,46 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defun desaturate-mood-colors ((arg0 float) (arg1 float) (arg2 float))
|
||||
"Unused - Generate GOAL code for a new [[*overide-mood-color-table*]] definition that desaturates the color
|
||||
Apply said overrides to the [[*overide-table*]]"
|
||||
Apply said overrides to the [[*overide-table*]]"
|
||||
(mem-copy!
|
||||
(the-as pointer (-> *overide-table* mood-color-table))
|
||||
(the-as pointer *no-cloud-mood-color-table*)
|
||||
256
|
||||
)
|
||||
(dotimes (v1-1 8)
|
||||
(let ((a1-3 (-> *overide-table* mood-color-table data v1-1))
|
||||
(dotimes (data-idx 8)
|
||||
(let ((color-data (-> *overide-table* mood-color-table data data-idx))
|
||||
(mood-colors
|
||||
(the-as
|
||||
(inline-array mood-color)
|
||||
(-> (the-as (inline-array mood-color) (-> *overide-table* mood-color-table data 0 amb-color)) v1-1)
|
||||
(-> (the-as (inline-array mood-color) (-> *overide-table* mood-color-table data 0 amb-color)) data-idx)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let ((f1-2 (fmax (fmax (-> a1-3 lgt-color x) (-> a1-3 lgt-color y)) (-> a1-3 lgt-color z)))
|
||||
(f0-4
|
||||
(let ((max-light-color
|
||||
(fmax (fmax (-> color-data lgt-color x) (-> color-data lgt-color y)) (-> color-data lgt-color z))
|
||||
)
|
||||
(max-0th-light-color
|
||||
(fmax (fmax (-> mood-colors 0 lgt-color x) (-> mood-colors 0 lgt-color y)) (-> mood-colors 0 lgt-color z))
|
||||
)
|
||||
)
|
||||
(set! (-> a1-3 lgt-color x) (* (+ (-> a1-3 lgt-color x) (* (- f1-2 (-> a1-3 lgt-color x)) arg0)) arg1))
|
||||
(set! (-> a1-3 lgt-color y) (* (+ (-> a1-3 lgt-color y) (* (- f1-2 (-> a1-3 lgt-color y)) arg0)) arg1))
|
||||
(set! (-> a1-3 lgt-color z) (* (+ (-> a1-3 lgt-color z) (* (- f1-2 (-> a1-3 lgt-color z)) arg0)) arg1))
|
||||
(set! (-> a1-3 lgt-color w) 0.0)
|
||||
(set! (-> color-data lgt-color x)
|
||||
(* (+ (-> color-data lgt-color x) (* (- max-light-color (-> color-data lgt-color x)) arg0)) arg1)
|
||||
)
|
||||
(set! (-> color-data lgt-color y)
|
||||
(* (+ (-> color-data lgt-color y) (* (- max-light-color (-> color-data lgt-color y)) arg0)) arg1)
|
||||
)
|
||||
(set! (-> color-data lgt-color z)
|
||||
(* (+ (-> color-data lgt-color z) (* (- max-light-color (-> color-data lgt-color z)) arg0)) arg1)
|
||||
)
|
||||
(set! (-> color-data lgt-color w) 0.0)
|
||||
(set! (-> mood-colors 0 lgt-color x)
|
||||
(* (+ (-> mood-colors 0 lgt-color x) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2)
|
||||
(* (+ (-> mood-colors 0 lgt-color x) (* (- max-0th-light-color (-> mood-colors 0 lgt-color x)) arg0)) arg2)
|
||||
)
|
||||
(set! (-> mood-colors 0 lgt-color y)
|
||||
(* (+ (-> mood-colors 0 lgt-color y) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2)
|
||||
(* (+ (-> mood-colors 0 lgt-color y) (* (- max-0th-light-color (-> mood-colors 0 lgt-color x)) arg0)) arg2)
|
||||
)
|
||||
(set! (-> mood-colors 0 lgt-color z)
|
||||
(* (+ (-> mood-colors 0 lgt-color z) (* (- f0-4 (-> mood-colors 0 lgt-color x)) arg0)) arg2)
|
||||
(* (+ (-> mood-colors 0 lgt-color z) (* (- max-0th-light-color (-> mood-colors 0 lgt-color x)) arg0)) arg2)
|
||||
)
|
||||
)
|
||||
(set! (-> mood-colors 0 lgt-color w) 1.0)
|
||||
@@ -298,32 +309,32 @@ Apply said overrides to the [[*overide-table*]]"
|
||||
(format 0 "(define *overide-mood-color-table*~%")
|
||||
(format 0 " (new 'static 'mood-color-table~%")
|
||||
(format 0 " :data (new 'static 'inline-array 'mood-color 0~%")
|
||||
(dotimes (gp-1 8)
|
||||
(dotimes (_color-idx 8)
|
||||
(format 0 " (new 'static 'mood-color")
|
||||
(let ((v1-4 gp-1))
|
||||
(let ((color-idx _color-idx))
|
||||
(cond
|
||||
((zero? v1-4)
|
||||
((zero? color-idx)
|
||||
(format 0 " ; sun rise~%")
|
||||
)
|
||||
((= v1-4 1)
|
||||
((= color-idx 1)
|
||||
(format 0 " ; morning~%")
|
||||
)
|
||||
((= v1-4 2)
|
||||
((= color-idx 2)
|
||||
(format 0 " ; noon~%")
|
||||
)
|
||||
((= v1-4 3)
|
||||
((= color-idx 3)
|
||||
(format 0 " ; afternoon~%")
|
||||
)
|
||||
((= v1-4 4)
|
||||
((= color-idx 4)
|
||||
(format 0 " ; sunset~%")
|
||||
)
|
||||
((= v1-4 5)
|
||||
((= color-idx 5)
|
||||
(format 0 " ; twilight~%")
|
||||
)
|
||||
((= v1-4 6)
|
||||
((= color-idx 6)
|
||||
(format 0 " ; evening~%")
|
||||
)
|
||||
((= v1-4 7)
|
||||
((= color-idx 7)
|
||||
(format 0 " ; green sun~%")
|
||||
)
|
||||
)
|
||||
@@ -331,18 +342,18 @@ Apply said overrides to the [[*overide-table*]]"
|
||||
(format
|
||||
0
|
||||
" :lgt-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%"
|
||||
(-> *overide-table* mood-color-table data gp-1 lgt-color x)
|
||||
(-> *overide-table* mood-color-table data gp-1 lgt-color y)
|
||||
(-> *overide-table* mood-color-table data gp-1 lgt-color z)
|
||||
(-> *overide-table* mood-color-table data gp-1 lgt-color w)
|
||||
(-> *overide-table* mood-color-table data _color-idx lgt-color x)
|
||||
(-> *overide-table* mood-color-table data _color-idx lgt-color y)
|
||||
(-> *overide-table* mood-color-table data _color-idx lgt-color z)
|
||||
(-> *overide-table* mood-color-table data _color-idx lgt-color w)
|
||||
)
|
||||
(format
|
||||
0
|
||||
" :amb-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%"
|
||||
(-> *overide-table* mood-color-table data gp-1 amb-color x)
|
||||
(-> *overide-table* mood-color-table data gp-1 amb-color y)
|
||||
(-> *overide-table* mood-color-table data gp-1 amb-color z)
|
||||
(-> *overide-table* mood-color-table data gp-1 amb-color w)
|
||||
(-> *overide-table* mood-color-table data _color-idx amb-color x)
|
||||
(-> *overide-table* mood-color-table data _color-idx amb-color y)
|
||||
(-> *overide-table* mood-color-table data _color-idx amb-color z)
|
||||
(-> *overide-table* mood-color-table data _color-idx amb-color w)
|
||||
)
|
||||
(format 0 " )~%")
|
||||
)
|
||||
@@ -355,47 +366,53 @@ Apply said overrides to the [[*overide-table*]]"
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defun desaturate-mood-fog ((arg0 (pointer mood-fog-table)) (arg1 float) (arg2 float))
|
||||
"Unused - Generate GOAL code for a new [[*overide-mood-fog-table*]] definition that desaturates the fog color
|
||||
Apply said overrides to the [[*overide-table*]]"
|
||||
Apply said overrides to the [[*overide-table*]]"
|
||||
(mem-copy! (the-as pointer (-> *overide-table* mood-fog-table)) arg0 384)
|
||||
(dotimes (v1-2 8)
|
||||
(let ((a0-5 (-> *overide-table* mood-fog-table data v1-2)))
|
||||
(let ((f0-2 (fmax (fmax (-> a0-5 fog-color x) (-> a0-5 fog-color y)) (-> a0-5 fog-color z))))
|
||||
(set! (-> a0-5 fog-color x) (* (+ (-> a0-5 fog-color x) (* (- f0-2 (-> a0-5 fog-color x)) arg1)) arg2))
|
||||
(set! (-> a0-5 fog-color y) (* (+ (-> a0-5 fog-color y) (* (- f0-2 (-> a0-5 fog-color y)) arg1)) arg2))
|
||||
(set! (-> a0-5 fog-color z) (* (+ (-> a0-5 fog-color z) (* (- f0-2 (-> a0-5 fog-color z)) arg1)) arg2))
|
||||
(dotimes (data-idx 8)
|
||||
(let ((fog-data (-> *overide-table* mood-fog-table data data-idx)))
|
||||
(let ((max-fog-val (fmax (fmax (-> fog-data fog-color x) (-> fog-data fog-color y)) (-> fog-data fog-color z))))
|
||||
(set! (-> fog-data fog-color x)
|
||||
(* (+ (-> fog-data fog-color x) (* (- max-fog-val (-> fog-data fog-color x)) arg1)) arg2)
|
||||
)
|
||||
(set! (-> fog-data fog-color y)
|
||||
(* (+ (-> fog-data fog-color y) (* (- max-fog-val (-> fog-data fog-color y)) arg1)) arg2)
|
||||
)
|
||||
(set! (-> fog-data fog-color z)
|
||||
(* (+ (-> fog-data fog-color z) (* (- max-fog-val (-> fog-data fog-color z)) arg1)) arg2)
|
||||
)
|
||||
)
|
||||
(set! (-> a0-5 fog-color w) 1.0)
|
||||
(set! (-> fog-data fog-color w) 1.0)
|
||||
)
|
||||
)
|
||||
(format 0 "(define *overide-mood-fog-table*~%")
|
||||
(format 0 " (new 'static 'mood-fog-table~%")
|
||||
(format 0 " :data (new 'static 'inline-array 'mood-fog 0~%")
|
||||
(dotimes (gp-1 8)
|
||||
(dotimes (_fog-idx 8)
|
||||
(format 0 " (new 'static 'mood-fog")
|
||||
(let ((v1-5 gp-1))
|
||||
(let ((fog-idx _fog-idx))
|
||||
(cond
|
||||
((zero? v1-5)
|
||||
((zero? fog-idx)
|
||||
(format 0 " ; sun rise~%")
|
||||
)
|
||||
((= v1-5 1)
|
||||
((= fog-idx 1)
|
||||
(format 0 " ; morning~%")
|
||||
)
|
||||
((= v1-5 2)
|
||||
((= fog-idx 2)
|
||||
(format 0 " ; noon~%")
|
||||
)
|
||||
((= v1-5 3)
|
||||
((= fog-idx 3)
|
||||
(format 0 " ; afternoon~%")
|
||||
)
|
||||
((= v1-5 4)
|
||||
((= fog-idx 4)
|
||||
(format 0 " ; sunset~%")
|
||||
)
|
||||
((= v1-5 5)
|
||||
((= fog-idx 5)
|
||||
(format 0 " ; twilight~%")
|
||||
)
|
||||
((= v1-5 6)
|
||||
((= fog-idx 6)
|
||||
(format 0 " ; evening~%")
|
||||
)
|
||||
((= v1-5 7)
|
||||
((= fog-idx 7)
|
||||
(format 0 " ; green sun~%")
|
||||
)
|
||||
)
|
||||
@@ -403,18 +420,18 @@ Apply said overrides to the [[*overide-table*]]"
|
||||
(format
|
||||
0
|
||||
" :fog-color (new 'static 'vector :x ~f :y ~f :z ~f :w ~f)~%"
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-color x)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-color y)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-color z)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-color w)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-color x)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-color y)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-color z)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-color w)
|
||||
)
|
||||
(format
|
||||
0
|
||||
" :fog-start (meters ~f) :fog-end (meters ~f) :fog-min ~f :fog-max ~f ~%"
|
||||
(* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists x))
|
||||
(* 0.00024414062 (-> *overide-table* mood-fog-table data gp-1 fog-dists y))
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-dists w)
|
||||
(-> *overide-table* mood-fog-table data gp-1 fog-dists z)
|
||||
(/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists x) METER_LENGTH)
|
||||
(/ (-> *overide-table* mood-fog-table data _fog-idx fog-dists y) METER_LENGTH)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-dists w)
|
||||
(-> *overide-table* mood-fog-table data _fog-idx fog-dists z)
|
||||
)
|
||||
(format 0 " :erase-color (new 'static 'vector :x 0.0 :y 0.0 :z 0.0 :w 128.0)~%")
|
||||
(format 0 " )~%")
|
||||
|
||||
@@ -24,10 +24,10 @@
|
||||
#f
|
||||
)
|
||||
|
||||
(defun clear-mood-times ((arg0 mood-context))
|
||||
(defun clear-mood-times ((mood-ctx mood-context))
|
||||
"Clear all of the mood times on the given context"
|
||||
(dotimes (v1-0 8)
|
||||
(set! (-> arg0 times v1-0 w) 0.0)
|
||||
(dotimes (idx 8)
|
||||
(set! (-> mood-ctx times idx w) 0.0)
|
||||
)
|
||||
#f
|
||||
)
|
||||
@@ -531,8 +531,8 @@
|
||||
(set! (-> arg0 times arg1 w) f30-1)
|
||||
(when (not (paused?))
|
||||
(if (< 0.75 f30-1)
|
||||
(set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.04 (-> pp clock time-adjust-ratio))))
|
||||
(set! (-> gp-0 fade) (- (-> gp-0 fade) (* 0.02 (-> pp clock time-adjust-ratio))))
|
||||
(set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 25)))
|
||||
(set! (-> gp-0 fade) (- (-> gp-0 fade) (/ (-> pp clock time-adjust-ratio) 50)))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -897,9 +897,9 @@
|
||||
;; WARN: Return type mismatch int vs sound-id.
|
||||
(defmethod play-or-stop-lightning! ((this mood-control) (arg0 sound-spec) (arg1 vector))
|
||||
"Handles playing/stopping of the lightning sound
|
||||
- Plays the lightning sound if we are not loading and `lightning-id` is zero
|
||||
- Stops the lightning sound first if `lightning-id` is non-zero
|
||||
Returns the current value of `lightning-id`"
|
||||
- Plays the lightning sound if we are not loading and `lightning-id` is zero
|
||||
- Stops the lightning sound first if `lightning-id` is non-zero
|
||||
Returns the current value of `lightning-id`"
|
||||
(vector+! (new 'stack-no-clear 'vector) arg1 (math-camera-pos))
|
||||
(the-as sound-id (cond
|
||||
((or (load-in-progress? *level*) (movie?))
|
||||
@@ -1331,8 +1331,8 @@ Returns the current value of `lightning-id`"
|
||||
|
||||
(defmethod update-mood-weather! ((this mood-control) (cloud-target float) (fog-target float) (cloud-speed float) (fog-speed float))
|
||||
"Set the `target-interp` and `speed-interp` for the clouds and fog
|
||||
If `*-speed` is 0.0, use the `*-target` args to set `current-interp`
|
||||
See [[mood-weather]]"
|
||||
If `*-speed` is 0.0, use the `*-target` args to set `current-interp`
|
||||
See [[mood-weather]]"
|
||||
(set! (-> this target-interp cloud) cloud-target)
|
||||
(set! (-> this target-interp fog) fog-target)
|
||||
(set! (-> this speed-interp cloud) cloud-speed)
|
||||
@@ -1349,7 +1349,7 @@ See [[mood-weather]]"
|
||||
|
||||
(defmethod update-mood-range! ((this mood-control) (min-cloud float) (max-cloud float) (min-fog float) (max-fog float))
|
||||
"Set the minimum and maximum ranges of clouds and fog
|
||||
See [[mood-range]]"
|
||||
See [[mood-range]]"
|
||||
(set! (-> this range min-cloud) min-cloud)
|
||||
(set! (-> this range max-cloud) max-cloud)
|
||||
(set! (-> this range min-fog) min-fog)
|
||||
@@ -1360,7 +1360,7 @@ See [[mood-range]]"
|
||||
|
||||
(defmethod set-time-for-random-weather! ((this mood-control) (arg0 float) (arg1 float))
|
||||
"Set the `time-until-random`'s cloud and fog values
|
||||
See [[mood-weather]]"
|
||||
See [[mood-weather]]"
|
||||
(set! (-> this time-until-random cloud) arg0)
|
||||
(set! (-> this time-until-random fog) arg1)
|
||||
0
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
)
|
||||
|
||||
(defmethod deactivate ((this time-of-day-proc))
|
||||
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
||||
(if (nonzero? (-> this sun))
|
||||
(kill-and-free-particles (-> this sun))
|
||||
)
|
||||
@@ -198,7 +199,7 @@
|
||||
(-> self time-of-day)
|
||||
)
|
||||
(('time-of-day-norm)
|
||||
(* 0.041666668 (-> self time-of-day))
|
||||
(/ (-> self time-of-day) 24)
|
||||
)
|
||||
(('hour)
|
||||
(-> self hours)
|
||||
@@ -305,10 +306,10 @@
|
||||
(set! (-> *overide-mood-color-table* data v1-8 amb-color w) 1.0)
|
||||
(set! (-> *overide-mood-fog-table* data v1-8 fog-color w) 1.0)
|
||||
(set! (-> *overide-mood-fog-table* data v1-8 fog-dists x)
|
||||
(* 0.00024414062 (-> *overide-mood-fog-table* data v1-8 fog-dists x))
|
||||
(/ (-> *overide-mood-fog-table* data v1-8 fog-dists x) METER_LENGTH)
|
||||
)
|
||||
(set! (-> *overide-mood-fog-table* data v1-8 fog-dists y)
|
||||
(* 0.00024414062 (-> *overide-mood-fog-table* data v1-8 fog-dists y))
|
||||
(/ (-> *overide-mood-fog-table* data v1-8 fog-dists y) METER_LENGTH)
|
||||
)
|
||||
(set-vector! (-> *time-of-day-context* times v1-8) 1.0 1.0 1.0 1.0)
|
||||
)
|
||||
@@ -366,7 +367,7 @@
|
||||
)
|
||||
(let* ((f0-23 (fmax (fmax (-> s4-0 x) (-> s4-0 y)) (-> s4-0 z)))
|
||||
(f2-14 (fmax (fmax (-> s5-0 x) (-> s5-0 y)) (-> s5-0 z)))
|
||||
(f0-27 (fmin 0.85 (- 1.0 (/ (* 0.5 f2-14) (+ f0-23 f2-14)))))
|
||||
(f0-27 (fmin 0.85 (- 1.0 (/ (/ f2-14 2) (+ f0-23 f2-14)))))
|
||||
(v0-1 (-> arg0 current-shadow-color))
|
||||
)
|
||||
(set! (-> v0-1 x) f0-27)
|
||||
@@ -631,8 +632,8 @@
|
||||
(v1-1 (-> *time-of-day-context* current-fog))
|
||||
(f1-0 (-> v1-1 fog-dists x))
|
||||
(f2-0 (-> v1-1 fog-dists y))
|
||||
(f3-1 (* 0.003921569 (-> v1-1 fog-dists w)))
|
||||
(f4-2 (* 0.003921569 (-> v1-1 fog-dists z)))
|
||||
(f3-1 (/ (-> v1-1 fog-dists w) 255))
|
||||
(f4-2 (/ (-> v1-1 fog-dists z) 255))
|
||||
)
|
||||
(+ f4-2 (* (fmax 0.0 (fmin 1.0 (/ (- f0-0 f1-0) (- f2-0 f1-0)))) (- f3-1 f4-2)))
|
||||
)
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
(set-vector! (-> arg0 constants) -0.25 -0.5 0.0 393216.0)
|
||||
(let* ((s4-0 (-> (matrix-local->world #f #f) vector 2))
|
||||
(f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z)))))
|
||||
(f1-1 (+ 0.5 (* -0.5 (-> s4-0 y))))
|
||||
(f1-1 (+ 0.5 (/ (-> s4-0 y) -2)))
|
||||
)
|
||||
(set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 0.0)
|
||||
)
|
||||
@@ -271,7 +271,7 @@
|
||||
(let ((f0-16 (* 128.0 (-> *time-of-day-context* ocean-alpha))))
|
||||
(if (-> *time-of-day-context* sky)
|
||||
(set-vector! (-> arg0 env-color) f0-16 f0-16 f0-16 f0-16)
|
||||
(set-vector! (-> arg0 env-color) f0-16 f0-16 (* 0.5 f0-16) f0-16)
|
||||
(set-vector! (-> arg0 env-color) f0-16 f0-16 (/ f0-16 2) f0-16)
|
||||
)
|
||||
)
|
||||
(set-vector! (-> arg0 index-table 0) 63 84 66 0)
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
(set-vector! (-> arg0 constants) -0.25 -0.5 0.0 0.000010172526)
|
||||
(let* ((s4-0 (-> (matrix-local->world #f #f) vector 2))
|
||||
(f0-12 (- 1.5 (* 0.000015258789 (atan (-> s4-0 x) (-> s4-0 z)))))
|
||||
(f1-1 (+ 0.5 (* -0.5 (-> s4-0 y))))
|
||||
(f1-1 (+ 0.5 (/ (-> s4-0 y) -2)))
|
||||
)
|
||||
(set-vector! (-> arg0 constants2) f0-12 f1-1 1.0 128.0)
|
||||
)
|
||||
@@ -342,7 +342,7 @@
|
||||
(let ((f0-28 (* 128.0 (-> *time-of-day-context* ocean-alpha))))
|
||||
(if (-> *time-of-day-context* sky)
|
||||
(set-vector! (-> arg0 env-color) f0-28 f0-28 f0-28 f0-28)
|
||||
(set-vector! (-> arg0 env-color) f0-28 f0-28 (* 0.5 f0-28) f0-28)
|
||||
(set-vector! (-> arg0 env-color) f0-28 f0-28 (/ f0-28 2) f0-28)
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 drw2-adgif tag) (new 'static 'gif-tag64 :nloop #x2 :eop #x1 :nreg #x1))
|
||||
|
||||
@@ -569,8 +569,8 @@
|
||||
|
||||
(defmethod ocean-method-84 ((this ocean) (arg0 dma-buffer) (arg1 sky-upload-data) (arg2 vector4w) (arg3 float))
|
||||
(when (>= (-> arg1 sun 0 pos y) -150.0)
|
||||
(let* ((f2-0 (* 0.00010050251 (-> arg1 sun 0 pos x)))
|
||||
(f1-3 (* 0.00010050251 (-> arg1 sun 0 pos z)))
|
||||
(let* ((f2-0 (/ (-> arg1 sun 0 pos x) 9950))
|
||||
(f1-3 (/ (-> arg1 sun 0 pos z) 9950))
|
||||
(f0-6 (if (< 0.0 (-> arg1 sun 0 pos y))
|
||||
1.0
|
||||
(* 0.006666667 (+ 150.0 (-> arg1 sun 0 pos y)))
|
||||
@@ -737,7 +737,7 @@
|
||||
(vector--float*! s2-0 arg2 (-> s3-0 sun1-normal) 9.0)
|
||||
(vector--float*! s4-0 arg2 (-> s3-0 moon-normal) 9.0)
|
||||
(vector-float*! s5-0 s5-0 (* (-> s3-0 sun0-scale) f28-0))
|
||||
(vector+float*! s5-0 s5-0 s2-0 (* 0.25 f28-0 (-> s3-0 sun1-scale)))
|
||||
(vector+float*! s5-0 s5-0 s2-0 (* (/ f28-0 4) (-> s3-0 sun1-scale)))
|
||||
(vector+float*! s5-0 s5-0 s4-0 (* (-> s3-0 moon-scale) f28-0))
|
||||
)
|
||||
(+! (-> arg0 x) (fmax (fmin (-> s5-0 x) f30-0) (- f30-0)))
|
||||
|
||||
@@ -10,8 +10,8 @@
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(defmethod set-corners! ((this ocean) (corner-x float) (corner-z float))
|
||||
(let* ((f2-0 (* 0.00008138021 corner-x))
|
||||
(f3-0 (* 0.00008138021 corner-z))
|
||||
(let* ((f2-0 (/ corner-x (meters 3)))
|
||||
(f3-0 (/ corner-z (meters 3)))
|
||||
(f0-2 f2-0)
|
||||
(f0-4 (- f0-2 (the float (the int f0-2))))
|
||||
(f1-6 f3-0)
|
||||
@@ -41,8 +41,8 @@
|
||||
((and (-> this heights) *ocean-map*)
|
||||
(let* ((f30-0 (- (-> arg0 x) (-> this start-corner x)))
|
||||
(f28-0 (- (-> arg0 z) (-> this start-corner z)))
|
||||
(v1-3 (the int (* 0.0000025431316 f30-0)))
|
||||
(a0-2 (the int (* 0.0000025431316 f28-0)))
|
||||
(v1-3 (the int (/ f30-0 (meters 96))))
|
||||
(a0-2 (the int (/ f28-0 (meters 96))))
|
||||
(v1-7 (-> this ocean-trans-indices data (+ (* 48 a0-2) v1-3)))
|
||||
)
|
||||
(cond
|
||||
@@ -53,8 +53,8 @@
|
||||
)
|
||||
)
|
||||
((begin
|
||||
(let ((a0-8 (logand (the int (* 0.000010172526 f30-0)) 3))
|
||||
(a3-4 (logand (the int (* 0.000010172526 f28-0)) 3))
|
||||
(let ((a0-8 (logand (the int (/ f30-0 (meters 24))) 3))
|
||||
(a3-4 (logand (the int (/ f28-0 (meters 24))) 3))
|
||||
(v1-10 (-> this ocean-near-indices data (-> v1-7 child)))
|
||||
)
|
||||
(set! v1-12 (-> (the-as (pointer int16) (+ (* (+ (* a3-4 4) a0-8) 2) (the-as int v1-10)))))
|
||||
@@ -67,14 +67,12 @@
|
||||
)
|
||||
)
|
||||
(else
|
||||
(let ((a0-14 (logand (the int (* 0.00008138021 f30-0)) 7)))
|
||||
(let ((a0-14 (logand (the int (/ f30-0 (meters 3))) 7)))
|
||||
(cond
|
||||
((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (* 0.00008138021 f28-0)) 7))
|
||||
(ash 1 a0-14)
|
||||
)
|
||||
((not (logtest? (-> this ocean-mid-masks data v1-12 mask (logand (the int (/ f28-0 (meters 3))) 7)) (ash 1 a0-14))
|
||||
)
|
||||
(let* ((f1-2 (vector-vector-distance arg0 (math-camera-pos)))
|
||||
(f26-0 (- 1.0 (fmin 1.0 (* 0.000010172526 f1-2))))
|
||||
(f26-0 (- 1.0 (fmin 1.0 (/ f1-2 (meters 24)))))
|
||||
)
|
||||
(if (-> this ocean-near-translucent?)
|
||||
(+ (* f26-0 (set-corners! this f30-0 f28-0)) (-> this start-corner y))
|
||||
|
||||
@@ -251,8 +251,8 @@
|
||||
(set! (-> arg1 radius) f28-0)
|
||||
(let ((f24-0 (sin f26-0))
|
||||
(f26-1 (cos f26-0))
|
||||
(f22-0 (sin (* 0.5 f30-0)))
|
||||
(f0-5 (cos (* 0.5 f30-0)))
|
||||
(f22-0 (sin (/ f30-0 2)))
|
||||
(f0-5 (cos (/ f30-0 2)))
|
||||
(a1-1 (new 'stack-no-clear 'vector))
|
||||
(s4-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
|
||||
@@ -77,13 +77,7 @@ across the screen. The resolution of the circle is defined by the number of "tur
|
||||
(let ((rot (* 65536.0 (/ (the float turn) (the float turns)))))
|
||||
(set-vector! (-> tbls entry entry-idx) (* (sin rot) cam-aspx) (* (cos rot) cam-aspy) 0.0 0.0)
|
||||
(let ((s3-1 (+ entry-idx 1)))
|
||||
(set-vector!
|
||||
(-> tbls entry s3-1)
|
||||
(* 0.001953125 cam-aspx (sin rot))
|
||||
(* 0.001953125 cam-aspy (cos rot))
|
||||
0.0
|
||||
0.0
|
||||
)
|
||||
(set-vector! (-> tbls entry s3-1) (* (/ cam-aspx 512) (sin rot)) (* (/ cam-aspy 512) (cos rot)) 0.0 0.0)
|
||||
(set! entry-idx (+ s3-1 1))
|
||||
)
|
||||
)
|
||||
@@ -92,7 +86,7 @@ across the screen. The resolution of the circle is defined by the number of "tur
|
||||
)
|
||||
(set-vector! (-> tbls entry entry-idx) 0.0 cam-aspy 0.0 0.0)
|
||||
(let ((v1-20 (+ entry-idx 1)))
|
||||
(set-vector! (-> tbls entry v1-20) 0.0 (* 0.001953125 cam-aspy) 0.0 0.0)
|
||||
(set-vector! (-> tbls entry v1-20) 0.0 (/ cam-aspy 512) 0.0 0.0)
|
||||
(+ v1-20 1)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -539,7 +539,7 @@
|
||||
1.0
|
||||
)
|
||||
(else
|
||||
(let* ((f1-1 (* 0.00024414062 a0-5))
|
||||
(let* ((f1-1 (/ a0-5 METER_LENGTH))
|
||||
(f0-4 (- f1-1 (the float (the int f1-1))))
|
||||
)
|
||||
(let ((f1-3 (* 4096.0 (- f1-1 f0-4))))
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
)
|
||||
|
||||
(defun time-to-apex ((arg0 float) (arg1 float))
|
||||
(the int (/ arg0 (- (* 0.0033333334 arg1))))
|
||||
(the int (/ arg0 (- (/ arg1 300))))
|
||||
)
|
||||
|
||||
(defun time-to-ground ((arg0 float) (arg1 float) (arg2 float))
|
||||
@@ -38,8 +38,8 @@
|
||||
(v0-0 0)
|
||||
)
|
||||
(while (< (- arg2) f0-0)
|
||||
(set! arg0 (- arg0 (* 0.0033333334 arg1)))
|
||||
(+! f0-0 (* 0.0033333334 arg0))
|
||||
(set! arg0 (- arg0 (/ arg1 300)))
|
||||
(+! f0-0 (/ arg0 300))
|
||||
(+! v0-0 1)
|
||||
)
|
||||
v0-0
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defmethod relocate ((this rigid-body-control) (arg0 int))
|
||||
(&+! (-> this process) arg0)
|
||||
(defmethod relocate ((this rigid-body-control) (offset int))
|
||||
(&+! (-> this process) offset)
|
||||
this
|
||||
)
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
)
|
||||
(matrix-identity! (-> this inertial-tensor))
|
||||
(matrix-identity! (-> this inv-inertial-tensor))
|
||||
(let ((f0-4 (* 0.083333336 f24-0)))
|
||||
(let ((f0-4 (/ f24-0 12)))
|
||||
(let* ((f1-1 f30-0)
|
||||
(f1-3 (* f1-1 f1-1))
|
||||
(f2-0 f26-0)
|
||||
@@ -1023,11 +1023,11 @@
|
||||
|
||||
(defmethod init-from-entity! ((this rigid-body-object) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(allocate-and-init-cshape this)
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(init-skel-and-rigid-body this)
|
||||
@@ -1410,7 +1410,7 @@ This commonly includes things such as:
|
||||
(f0-9 (/ 163840.0 (get-inv-mass a0-38)))
|
||||
)
|
||||
(vector-reset! (-> this player-force))
|
||||
(set! (-> this player-force y) (* -0.1 f0-9 f30-2))
|
||||
(set! (-> this player-force y) (* (/ f0-9 -10) f30-2))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
(defmethod compute-trans-at-time ((this trajectory) (arg0 float) (arg1 vector))
|
||||
(vector+float*! arg1 (-> this initial-position) (-> this initial-velocity) arg0)
|
||||
(+! (-> arg1 y) (* 0.5 arg0 arg0 (-> this gravity)))
|
||||
(+! (-> arg1 y) (* (/ arg0 2) arg0 (-> this gravity)))
|
||||
arg1
|
||||
)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
(vector-! (-> this initial-velocity) arg1 arg0)
|
||||
(vector-xz-normalize! (-> this initial-velocity) f0-3)
|
||||
)
|
||||
(set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* 0.5 arg2 (-> this gravity))))
|
||||
(set! (-> this initial-velocity y) (- (/ (- (-> arg1 y) (-> arg0 y)) arg2) (* (/ arg2 2) (-> this gravity))))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -234,6 +234,7 @@
|
||||
)
|
||||
|
||||
(defmethod deactivate ((this scene-player))
|
||||
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
||||
(set! *scene-player* (the-as (pointer scene-player) #f))
|
||||
(kill-persister *setting-control* (the-as engine-pers 'blackout) 'bg-a-force)
|
||||
((method-of-type process-drawable deactivate) this)
|
||||
@@ -241,23 +242,23 @@
|
||||
)
|
||||
|
||||
;; WARN: Return type mismatch process-drawable vs scene-player.
|
||||
(defmethod relocate ((this scene-player) (arg0 int))
|
||||
(defmethod relocate ((this scene-player) (offset int))
|
||||
(let ((v1-0 *kernel-context*))
|
||||
(set! (-> v1-0 relocating-process) this)
|
||||
(set! (-> v1-0 relocating-min) (the-as int (&-> this type)))
|
||||
(set! (-> v1-0 relocating-max)
|
||||
(the-as int (+ (+ (-> this allocated-length) -4 (-> process size)) (the-as int this)))
|
||||
)
|
||||
(set! (-> v1-0 relocating-offset) arg0)
|
||||
(set! (-> v1-0 relocating-offset) offset)
|
||||
)
|
||||
(let ((v1-2 (-> this scene-list)))
|
||||
(if (and (>= (the-as int v1-2) (-> *kernel-context* relocating-min))
|
||||
(< (the-as int v1-2) (-> *kernel-context* relocating-max))
|
||||
)
|
||||
(&+! (-> this scene-list) arg0)
|
||||
(&+! (-> this scene-list) offset)
|
||||
)
|
||||
)
|
||||
(the-as scene-player ((method-of-type process-drawable relocate) this arg0))
|
||||
(the-as scene-player ((method-of-type process-drawable relocate) this offset))
|
||||
)
|
||||
|
||||
(defmethod scene-player-method-25 ((this scene-player) (arg0 float))
|
||||
@@ -661,7 +662,7 @@
|
||||
)
|
||||
(let* ((v1-28 (-> s3-0 base))
|
||||
(a2-23
|
||||
(+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width)))))
|
||||
(+ (- 1793 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2))))
|
||||
)
|
||||
(a3-8 (+ (the int (-> arg1 origin y)) 1841))
|
||||
(a0-23 (+ a2-23 (-> arg0 width)))
|
||||
@@ -687,7 +688,7 @@
|
||||
(&+! (-> s3-0 base) 112)
|
||||
(let* ((v1-32 (-> s3-0 base))
|
||||
(a1-38
|
||||
(+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (* 0.5 (-> arg1 width)))))
|
||||
(+ (- 1792 (the-as int (shr (-> arg0 width) 1))) (the int (+ (-> arg1 origin x) (/ (-> arg1 width) 2))))
|
||||
)
|
||||
(a3-11 (+ (the int (-> arg1 origin y)) 1840))
|
||||
(a0-30 (+ a1-38 (-> arg0 width)))
|
||||
@@ -1051,10 +1052,7 @@
|
||||
(* 30.0 (seconds-per-frame))
|
||||
(bucket-id screen-filter)
|
||||
)
|
||||
(let ((gp-0 (current-time)))
|
||||
(until (time-elapsed? gp-0 (seconds 0.05))
|
||||
(suspend)
|
||||
)
|
||||
(suspend-for (seconds 0.05)
|
||||
)
|
||||
(set! (-> *setting-control* user-current bg-a) 0.0)
|
||||
(remove-setting! 'movie)
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
|
||||
|
||||
(defmethod kill-callback ((this engine-sound-pers) (arg0 connection-pers))
|
||||
"Called when a connection is removed."
|
||||
(let ((v1-0 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
|
||||
(set! (-> v1-0 command) (sound-command set-param))
|
||||
(set! (-> v1-0 id) (the-as sound-id (-> arg0 param-int64 0)))
|
||||
@@ -40,8 +41,9 @@
|
||||
|
||||
(kmemclose)
|
||||
|
||||
(defun sound-name= ((arg0 sound-name) (arg1 sound-name))
|
||||
(and (= (the-as uint arg0) (the-as uint arg1)) (= (-> arg0 hi) (-> arg1 hi)))
|
||||
(defun sound-name= ((a sound-name) (b sound-name))
|
||||
"Are two sound names the same?"
|
||||
(and (= (the-as uint a) (the-as uint b)) (= (-> a hi) (-> b hi)))
|
||||
)
|
||||
|
||||
(deftype sound-iop-info (structure)
|
||||
@@ -75,6 +77,7 @@
|
||||
(define *sound-iop-info* (new 'global 'sound-iop-info))
|
||||
|
||||
(defun str-is-playing? ()
|
||||
"Is any streaming audio playing?"
|
||||
(countdown (v1-0 4)
|
||||
(if (and (>= (the-as uint (-> *sound-iop-info* stream-id v1-0)) 0)
|
||||
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-four))
|
||||
@@ -86,6 +89,7 @@
|
||||
)
|
||||
|
||||
(defun str-id-is-playing? ((arg0 int))
|
||||
"Is any streaming audio with the given ID playing?"
|
||||
(countdown (v1-0 4)
|
||||
(if (and (= arg0 (-> *sound-iop-info* stream-id v1-0))
|
||||
(logtest? (-> *sound-iop-info* stream-status v1-0) (stream-status ststatus-one ststatus-six))
|
||||
@@ -96,31 +100,35 @@
|
||||
#f
|
||||
)
|
||||
|
||||
(defun current-str-pos ((arg0 sound-id))
|
||||
(defun current-str-pos ((id sound-id))
|
||||
"Get the current stream position of the given sound ID, or -1 if it is not playing."
|
||||
(if (>= (-> *setting-control* user-current movie-skip-frame) 0.0)
|
||||
(return (the int (* 34.133335 (-> *setting-control* user-current movie-skip-frame))))
|
||||
)
|
||||
(dotimes (v1-5 4)
|
||||
(if (= arg0 (-> *sound-iop-info* stream-id v1-5))
|
||||
(if (= id (-> *sound-iop-info* stream-id v1-5))
|
||||
(return (the-as int (-> *sound-iop-info* stream-position v1-5)))
|
||||
)
|
||||
)
|
||||
-1
|
||||
)
|
||||
|
||||
(defun is-ramdisk-loaded? ((arg0 symbol))
|
||||
(defun is-ramdisk-loaded? ((name symbol))
|
||||
"Check if the ramdisk-name is set to this (unused)."
|
||||
(let ((gp-0 (-> *sound-iop-info* ramdisk-name))
|
||||
(s5-0 (symbol->string arg0))
|
||||
(s5-0 (symbol->string name))
|
||||
)
|
||||
(and (charp-prefix= (-> s5-0 data) gp-0) (= (-> gp-0 (length s5-0)) 46))
|
||||
)
|
||||
)
|
||||
|
||||
(defun is-cd-in? ()
|
||||
"Is the CD/DVD in the ps2?"
|
||||
(zero? (-> *sound-iop-info* nocd))
|
||||
)
|
||||
|
||||
(defun new-sound-id ()
|
||||
"Allocate a new sound ID, used to identify a unique playback of a sound."
|
||||
(set! *current-sound-id* (+ *current-sound-id* 1))
|
||||
(if (< (the-as int *current-sound-id*) #x10000)
|
||||
(set! *current-sound-id* (the-as sound-id #x10000))
|
||||
@@ -129,6 +137,7 @@
|
||||
)
|
||||
|
||||
(defun check-irx-version ()
|
||||
"Confirm OVERLORD version is correct and set up the sound-iop-info address so the OVERLORD can report back to the EE."
|
||||
(let ((gp-0 (the-as sound-rpc-get-irx-version (add-element *sound-loader-rpc*))))
|
||||
(set! (-> gp-0 command) (sound-command get-irx-version))
|
||||
(set! (-> gp-0 ee-addr) (&-> *sound-iop-info* frame))
|
||||
@@ -145,22 +154,24 @@
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-bank-iop-store ((arg0 sound-name))
|
||||
(defun sound-bank-iop-store ((name sound-name))
|
||||
"Send a iop-store RPC to loader with the given name"
|
||||
(let ((gp-0 (new-sound-id)))
|
||||
(let ((v1-1 (the-as sound-rpc-bank-cmd (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command iop-store))
|
||||
(set! (-> v1-1 bank-name) arg0)
|
||||
(set! (-> v1-1 bank-name) name)
|
||||
)
|
||||
(call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0))
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
(defun sound-bank-iop-free ((arg0 sound-name))
|
||||
(defun sound-bank-iop-free ((name sound-name))
|
||||
"Send a iop-free RPC to loader with the given name"
|
||||
(let ((gp-0 (new-sound-id)))
|
||||
(let ((v1-1 (the-as sound-rpc-bank-cmd (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command iop-free))
|
||||
(set! (-> v1-1 bank-name) arg0)
|
||||
(set! (-> v1-1 bank-name) name)
|
||||
)
|
||||
(call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0))
|
||||
gp-0
|
||||
@@ -168,6 +179,7 @@
|
||||
)
|
||||
|
||||
(defun sound-bank-load ((arg0 sound-name))
|
||||
"Send RPC to load a sound bank."
|
||||
(let ((gp-0 (new-sound-id)))
|
||||
(let ((v1-1 (the-as sound-rpc-load-bank (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command load-bank))
|
||||
@@ -178,48 +190,53 @@
|
||||
)
|
||||
)
|
||||
|
||||
(defun sound-bank-load-from-iop ((arg0 sound-name))
|
||||
(defun sound-bank-load-from-iop ((name sound-name))
|
||||
"Send load-bank-from-iop rpc to loader"
|
||||
(let ((gp-0 (new-sound-id)))
|
||||
(let ((v1-1 (the-as sound-rpc-load-bank (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command load-bank-from-iop))
|
||||
(set! (-> v1-1 bank-name) arg0)
|
||||
(set! (-> v1-1 bank-name) name)
|
||||
)
|
||||
(call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0))
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
(defun sound-bank-load-from-ee ((arg0 sound-name) (arg1 pointer))
|
||||
(defun sound-bank-load-from-ee ((name sound-name) (addr pointer))
|
||||
"Send load-bank-from-ee rpc to loader"
|
||||
(let ((gp-0 (new-sound-id)))
|
||||
(let ((v1-1 (the-as sound-rpc-load-bank (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command load-bank-from-ee))
|
||||
(set! (-> v1-1 bank-name) arg0)
|
||||
(set! (-> v1-1 ee-addr) arg1)
|
||||
(set! (-> v1-1 bank-name) name)
|
||||
(set! (-> v1-1 ee-addr) addr)
|
||||
)
|
||||
(call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0))
|
||||
gp-0
|
||||
)
|
||||
)
|
||||
|
||||
(defun sound-bank-unload ((arg0 sound-name))
|
||||
(defun sound-bank-unload ((name sound-name))
|
||||
"Send unload-bank rpc to loader"
|
||||
(let ((v1-1 (the-as sound-rpc-unload-bank (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command unload-bank))
|
||||
(set! (-> v1-1 bank-name) arg0)
|
||||
(set! (-> v1-1 bank-name) name)
|
||||
)
|
||||
(call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0))
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-music-load ((arg0 sound-name))
|
||||
(defun sound-music-load ((name sound-name))
|
||||
"Send load-music rpc to loader"
|
||||
(let ((v1-1 (the-as sound-rpc-load-music (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command load-music))
|
||||
(set! (-> v1-1 bank-name) arg0)
|
||||
(set! (-> v1-1 bank-name) name)
|
||||
)
|
||||
(call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0))
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-music-unload ()
|
||||
"Send unload-music rpc to loader."
|
||||
(let ((v1-1 (the-as sound-rpc-unload-music (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command unload-music))
|
||||
)
|
||||
@@ -228,6 +245,7 @@
|
||||
)
|
||||
|
||||
(defun set-language ((arg0 language-enum))
|
||||
"Send set-language rpc to loader. Note this is only for sound, no game text is changed."
|
||||
(kset-language arg0)
|
||||
(let ((v1-1 (the-as sound-rpc-set-language (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command set-language))
|
||||
@@ -238,6 +256,7 @@
|
||||
)
|
||||
|
||||
(defun sound-set-stereo-mode ((arg0 stereo-mode))
|
||||
"Send set-stereo-mode rpc to loader."
|
||||
(let ((v1-1 (the-as sound-rpc-set-stereo-mode (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command set-stereo-mode))
|
||||
(set! (-> v1-1 mode) (the-as int arg0))
|
||||
@@ -248,6 +267,7 @@
|
||||
)
|
||||
|
||||
(defun list-sounds ()
|
||||
"Send list-sounds rpc to loader."
|
||||
(let ((v1-1 (the-as sound-rpc-list-sounds (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) (sound-command list-sounds))
|
||||
)
|
||||
@@ -262,6 +282,7 @@
|
||||
)
|
||||
|
||||
(defun sound-buffer-dump ()
|
||||
"Print out all sound-commands in the buffer."
|
||||
(let ((gp-0 (-> *sound-player-rpc* current elt-used))
|
||||
(s5-0 (-> *sound-player-rpc* current elt-size))
|
||||
)
|
||||
@@ -299,6 +320,7 @@
|
||||
(define *sound-player-enable* #t)
|
||||
|
||||
(defun swap-sound-buffers ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float))
|
||||
"Per-frame update of sound system - update loop-engine, update ear trans, send player RPC, check for missing/dirty CD."
|
||||
(run-pending-updates! *sound-loop-engine* (-> *display* base-clock frame-counter))
|
||||
(cond
|
||||
((check-busy *sound-player-rpc*)
|
||||
@@ -332,37 +354,42 @@
|
||||
)
|
||||
|
||||
(defun get-sound-buffer-entry ()
|
||||
"Allocate a new entry in the player RPC queue, to be flushed on the next frame."
|
||||
(add-element *sound-player-rpc*)
|
||||
)
|
||||
|
||||
(defun free-last-sound-buffer-entry ()
|
||||
"Remove the last thing added with get-sound-buffer-entry."
|
||||
(decrement-elt-used *sound-player-rpc*)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun sound-basic-cb ((arg0 int) (arg1 (pointer int32)))
|
||||
"Unknown and unused callback."
|
||||
(set! (-> arg1 0) arg0)
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun sound-trans-convert ((arg0 vector3w) (arg1 vector))
|
||||
"Convert a GOAL translation (meters) to integer format for the IOP"
|
||||
(let ((v1-0 (if arg1
|
||||
arg1
|
||||
(ear-trans 0)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 x) (the int (* 0.0625 (-> v1-0 x))))
|
||||
(set! (-> arg0 y) (the int (* 0.0625 (-> v1-0 y))))
|
||||
(set! (-> arg0 z) (the int (* 0.0625 (-> v1-0 z))))
|
||||
(set! (-> arg0 x) (the int (/ (-> v1-0 x) 16)))
|
||||
(set! (-> arg0 y) (the int (/ (-> v1-0 y) 16)))
|
||||
(set! (-> arg0 z) (the int (/ (-> v1-0 z) 16)))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-angle-convert ((arg0 float))
|
||||
(let* ((f0-3 (the float (sar (shl (the int arg0) 48) 48)))
|
||||
(defun sound-angle-convert ((float-angle float))
|
||||
"Convert a GOAL angle to integer format for the iop"
|
||||
(let* ((f0-3 (the float (sar (shl (the int float-angle) 48) 48)))
|
||||
(v0-0 (the int (* 0.005493164 f0-3)))
|
||||
)
|
||||
(if (< v0-0 0)
|
||||
@@ -377,6 +404,7 @@
|
||||
|
||||
;; WARN: Return type mismatch uint128 vs sound-name.
|
||||
(defun string->sound-name ((arg0 string))
|
||||
"Create a sound-name from a string"
|
||||
(let ((v1-0 (new 'stack-no-clear 'qword)))
|
||||
(set! (-> v1-0 quad) (the-as uint128 0))
|
||||
(let ((a1-0 (the-as (pointer uint8) v1-0))
|
||||
@@ -393,6 +421,7 @@
|
||||
)
|
||||
|
||||
(defun sound-set-volume ((arg0 sound-group) (arg1 float))
|
||||
"Send set-master-volume rpc."
|
||||
(let ((v1-0 (the-as sound-rpc-set-master-volume (get-sound-buffer-entry))))
|
||||
(set! (-> v1-0 command) (sound-command set-master-volume))
|
||||
(set! (-> v1-0 group) arg0)
|
||||
@@ -401,18 +430,20 @@
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-set-reverb ((arg0 int) (arg1 float) (arg2 float) (arg3 uint))
|
||||
(defun sound-set-reverb ((reverb int) (left float) (right float) (core uint))
|
||||
"Send set-reverb rpc"
|
||||
(let ((v1-0 (the-as sound-rpc-set-reverb (get-sound-buffer-entry))))
|
||||
(set! (-> v1-0 command) (sound-command set-reverb))
|
||||
(set! (-> v1-0 core) arg3)
|
||||
(set! (-> v1-0 reverb) arg0)
|
||||
(set! (-> v1-0 left) (the-as uint (the int (* 32767.0 arg1))))
|
||||
(set! (-> v1-0 right) (the-as uint (the int (* 32767.0 arg2))))
|
||||
(set! (-> v1-0 core) core)
|
||||
(set! (-> v1-0 reverb) reverb)
|
||||
(set! (-> v1-0 left) (the-as uint (the int (* 32767.0 left))))
|
||||
(set! (-> v1-0 right) (the-as uint (the int (* 32767.0 right))))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-set-ear-trans ((arg0 vector) (arg1 vector) (arg2 vector) (arg3 float))
|
||||
"Send set-ear-trans rpc"
|
||||
(let ((gp-0 (the-as sound-rpc-set-ear-trans (get-sound-buffer-entry))))
|
||||
(set! (-> gp-0 command) (sound-command set-ear-trans))
|
||||
(sound-trans-convert (the-as vector3w (-> gp-0 ear-trans0)) arg0)
|
||||
@@ -424,8 +455,9 @@
|
||||
)
|
||||
|
||||
(defbehavior sound-play-by-name process-drawable ((arg0 sound-name) (arg1 sound-id) (arg2 int) (arg3 int) (arg4 int) (arg5 sound-group) (arg6 object))
|
||||
"Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]]
|
||||
otherwise, an explicit [[vector]] can be provided"
|
||||
"Send play rpc to play a sound!
|
||||
Last arg can by a symbol with value [[#t]], in which case it will pull `trans` [[vector]] off the current [[process-drawable]]
|
||||
otherwise, an explicit [[vector]] can be provided"
|
||||
(local-vars (sv-16 sound-group))
|
||||
(set! sv-16 arg5)
|
||||
(let ((s4-0 arg6))
|
||||
@@ -455,6 +487,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
|
||||
(defbehavior sound-play-by-spec process-drawable ((arg0 sound-spec) (arg1 sound-id) (arg2 vector))
|
||||
"Send play rpc to play a sound!"
|
||||
(when *sound-player-enable*
|
||||
(let ((s5-0 (the-as sound-rpc-play (get-sound-buffer-entry))))
|
||||
(set! (-> s5-0 command) (sound-command play))
|
||||
@@ -483,37 +516,41 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
arg1
|
||||
)
|
||||
|
||||
(defun sound-pause ((arg0 sound-id))
|
||||
(when (nonzero? arg0)
|
||||
(defun sound-pause ((id sound-id))
|
||||
"Send pause-sound rpc to pause by id"
|
||||
(when (nonzero? id)
|
||||
(let ((v1-1 (the-as sound-rpc-pause-sound (get-sound-buffer-entry))))
|
||||
(set! (-> v1-1 command) (sound-command pause-sound))
|
||||
(set! (-> v1-1 id) arg0)
|
||||
(set! (-> v1-1 id) id)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-stop ((arg0 sound-id))
|
||||
(when (nonzero? arg0)
|
||||
(defun sound-stop ((id sound-id))
|
||||
"Send stop-sound rpc to stop by id"
|
||||
(when (nonzero? id)
|
||||
(let ((v1-1 (the-as sound-rpc-stop-sound (get-sound-buffer-entry))))
|
||||
(set! (-> v1-1 command) (sound-command stop-sound))
|
||||
(set! (-> v1-1 id) arg0)
|
||||
(set! (-> v1-1 id) id)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-continue ((arg0 sound-id))
|
||||
(when (nonzero? arg0)
|
||||
(defun sound-continue ((id sound-id))
|
||||
"Send continue-sound rpc to continue by id"
|
||||
(when (nonzero? id)
|
||||
(let ((v1-1 (the-as sound-rpc-continue-sound (get-sound-buffer-entry))))
|
||||
(set! (-> v1-1 command) (sound-command continue-sound))
|
||||
(set! (-> v1-1 id) arg0)
|
||||
(set! (-> v1-1 id) id)
|
||||
)
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-group-pause ((arg0 sound-group))
|
||||
"Send pause-group rpc"
|
||||
(let ((v1-0 (the-as sound-rpc-pause-group (get-sound-buffer-entry))))
|
||||
(set! (-> v1-0 command) (sound-command pause-group))
|
||||
(set! (-> v1-0 group) arg0)
|
||||
@@ -522,6 +559,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
|
||||
(defun sound-group-stop ((arg0 sound-group))
|
||||
"Send stop-group rpc"
|
||||
(let ((v1-0 (the-as sound-rpc-stop-group (get-sound-buffer-entry))))
|
||||
(set! (-> v1-0 command) (sound-command stop-group))
|
||||
(set! (-> v1-0 group) arg0)
|
||||
@@ -530,6 +568,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
|
||||
(defun sound-group-continue ((arg0 sound-group))
|
||||
"Send continue-group rpc"
|
||||
(let ((v1-0 (the-as sound-rpc-continue-group (get-sound-buffer-entry))))
|
||||
(set! (-> v1-0 command) (sound-command continue-group))
|
||||
(set! (-> v1-0 group) arg0)
|
||||
@@ -537,33 +576,37 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-set-flava ((arg0 uint) (arg1 uint))
|
||||
(defun sound-set-flava ((flava uint) (excitement uint))
|
||||
"Send set-flava rpc"
|
||||
(let ((v1-0 (the-as sound-rpc-set-flava (get-sound-buffer-entry))))
|
||||
(set! (-> v1-0 command) (sound-command set-flava))
|
||||
(set! (-> v1-0 flava) arg0)
|
||||
(set! (-> v1-0 excitement) arg1)
|
||||
(set! (-> v1-0 flava) flava)
|
||||
(set! (-> v1-0 excitement) excitement)
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-set-midi-reg ((arg0 int) (arg1 int))
|
||||
(defun sound-set-midi-reg ((reg int) (val int))
|
||||
"Send set-midi-reg rpc"
|
||||
(let ((v1-0 (the-as sound-rpc-set-midi-reg (get-sound-buffer-entry))))
|
||||
(set! (-> v1-0 command) (sound-command set-midi-reg))
|
||||
(set! (-> v1-0 reg) arg0)
|
||||
(set! (-> v1-0 value) arg1)
|
||||
(set! (-> v1-0 reg) reg)
|
||||
(set! (-> v1-0 value) val)
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-set-fps ((arg0 int))
|
||||
(defun sound-set-fps ((fps int))
|
||||
"Send set-fps rpc"
|
||||
(let ((v1-0 (the-as sound-rpc-set-fps (get-sound-buffer-entry))))
|
||||
(set! (-> v1-0 command) (sound-command set-fps))
|
||||
(set! (-> v1-0 fps) (the-as uint arg0))
|
||||
(set! (-> v1-0 fps) (the-as uint fps))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun sound-volume-off ()
|
||||
"Adjust settings to turn all sound volume off"
|
||||
(set-setting! 'music-volume 'abs 0.0 0)
|
||||
(set-setting! 'sfx-volume 'abs 0.0 0)
|
||||
(set-setting! 'ambient-volume 'abs 0.0 0)
|
||||
@@ -574,6 +617,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
|
||||
;; WARN: Return type mismatch object vs ambient-sound.
|
||||
(defmethod new ambient-sound ((allocation symbol) (type-to-make type) (arg0 basic) (arg1 vector))
|
||||
"Set up ambient-sound. Can use an entity-actor (grabs from lump), sound-spec, or name as a string."
|
||||
(local-vars
|
||||
(sv-16 sound-spec)
|
||||
(sv-32 sound-name)
|
||||
@@ -679,6 +723,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
|
||||
(defmethod update! ((this ambient-sound))
|
||||
"Per-frame update of ambient sound."
|
||||
(with-pp
|
||||
(if (not *ambient-sound-class*)
|
||||
(return (the-as int #f))
|
||||
@@ -772,6 +817,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
|
||||
(defmethod update-trans! ((this ambient-sound) (arg0 vector))
|
||||
"Change the trans of the sound."
|
||||
(with-pp
|
||||
(set! (-> this trans quad) (-> arg0 quad))
|
||||
(when (nonzero? (-> this playing-id))
|
||||
@@ -798,6 +844,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
|
||||
(defmethod update-vol! ((this ambient-sound) (arg0 float))
|
||||
"Change the volume of the sound."
|
||||
(when (nonzero? (-> this playing-id))
|
||||
(when *sound-player-enable*
|
||||
(let ((v1-4 (the-as sound-rpc-set-param (get-sound-buffer-entry))))
|
||||
@@ -831,21 +878,23 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
|
||||
(defmethod set-falloff-far! ((this ambient-sound) (arg0 float))
|
||||
(set! (-> this falloff-far) (the int (* 0.00024414062 arg0)))
|
||||
(set! (-> this falloff-far) (the int (/ arg0 METER_LENGTH)))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod change-sound! ((this ambient-sound) (arg0 sound-name))
|
||||
(when (not (and (= (the-as uint (-> this name)) (the-as uint arg0)) (= (-> arg0 hi) (-> this name hi))))
|
||||
(defmethod change-sound! ((this ambient-sound) (new-sound sound-name))
|
||||
"Change the sound being played."
|
||||
(when (not (and (= (the-as uint (-> this name)) (the-as uint new-sound)) (= (-> new-sound hi) (-> this name hi))))
|
||||
(stop! this)
|
||||
(set! (-> this playing-id) (new-sound-id))
|
||||
(set! (-> this name) arg0)
|
||||
(set! (-> this name) new-sound)
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun show-iop-info ((arg0 dma-buffer))
|
||||
"Display iop info on screen."
|
||||
(dotimes (s5-0 24)
|
||||
(draw-string-xy
|
||||
(if (zero? (-> *sound-iop-info* chinfo s5-0))
|
||||
@@ -898,7 +947,8 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
0
|
||||
)
|
||||
|
||||
(defun show-iop-memory ((arg0 dma-buffer))
|
||||
(defun show-iop-memory ((dma dma-buffer))
|
||||
"Display iop memory stats on screen"
|
||||
(let ((s5-0 draw-string-xy))
|
||||
(format
|
||||
(clear *temp-string*)
|
||||
@@ -906,7 +956,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
(-> *sound-iop-info* freemem)
|
||||
(shr (-> *sound-iop-info* freemem) 10)
|
||||
)
|
||||
(s5-0 *temp-string* arg0 32 96 (font-color default) (font-flags shadow))
|
||||
(s5-0 *temp-string* dma 32 96 (font-color default) (font-flags shadow))
|
||||
)
|
||||
(let ((s5-1 draw-string-xy))
|
||||
(format
|
||||
@@ -915,12 +965,13 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
(-> *sound-iop-info* freemem2)
|
||||
(shr (-> *sound-iop-info* freemem2) 10)
|
||||
)
|
||||
(s5-1 *temp-string* arg0 32 64 (font-color default) (font-flags shadow))
|
||||
(s5-1 *temp-string* dma 32 64 (font-color default) (font-flags shadow))
|
||||
)
|
||||
0
|
||||
)
|
||||
|
||||
(defun ear-trans ((arg0 int))
|
||||
"Get the current location of the ear. Use 1 for the settings ear-handle, or 0 for the camera."
|
||||
(cond
|
||||
((or (movie?) *external-cam-mode*)
|
||||
(math-camera-pos)
|
||||
@@ -935,6 +986,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
|
||||
(defun-debug make-sqrt-table ()
|
||||
"Generate integer square-root table used in the IOP."
|
||||
(format #t "static int sqrt_table[256] =~%{~%")
|
||||
(dotimes (gp-0 256)
|
||||
(let* ((f0-2 (sqrtf (* 16777216.0 (the float gp-0))))
|
||||
@@ -968,11 +1020,12 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
)
|
||||
|
||||
(defun loader-test-command ((arg0 sound-command) (arg1 uint))
|
||||
(defun loader-test-command ((cmd sound-command) (param uint))
|
||||
"Send a command to loader by ID."
|
||||
(let ((v1-1 (the-as sound-rpc-test-cmd (add-element *sound-loader-rpc*))))
|
||||
(set! (-> v1-1 command) arg0)
|
||||
(set! (-> v1-1 command) cmd)
|
||||
(set! (-> v1-1 ee-addr) (the-as pointer 0))
|
||||
(set! (-> v1-1 param0) arg1)
|
||||
(set! (-> v1-1 param0) param)
|
||||
)
|
||||
(call *sound-loader-rpc* (the-as uint 0) (the-as pointer 0) (the-as uint 0))
|
||||
(sync *sound-loader-rpc* #f)
|
||||
@@ -980,12 +1033,13 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
(none)
|
||||
)
|
||||
|
||||
(defun doppler-pitch-shift ((arg0 vector) (arg1 vector))
|
||||
(defun doppler-pitch-shift ((sound-pos vector) (sound-vel vector))
|
||||
"Compute pitch shift for the doppler effect. This is done assuming the listener is *target* and has *target*'s velocity."
|
||||
(let ((gp-0 (new 'stack-no-clear 'inline-array 'vector 2)))
|
||||
(vector-! (-> gp-0 0) (target-pos 0) arg0)
|
||||
(vector-! (-> gp-0 0) (target-pos 0) sound-pos)
|
||||
(if *target*
|
||||
(vector-! (-> gp-0 1) arg1 (-> *target* control transv))
|
||||
(set! (-> gp-0 1 quad) (-> arg1 quad))
|
||||
(vector-! (-> gp-0 1) sound-vel (-> *target* control transv))
|
||||
(set! (-> gp-0 1 quad) (-> sound-vel quad))
|
||||
)
|
||||
(vector-normalize! (-> gp-0 0) 1.0)
|
||||
(let ((f0-1 (/ 1228800.0 (fmax 0.1 (- 1228800.0 (vector-dot (-> gp-0 0) (-> gp-0 1)))))))
|
||||
@@ -995,6 +1049,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
)
|
||||
|
||||
(defun sound-bank-reload ()
|
||||
"Start a background process to unload all sound banks, then load them again."
|
||||
(process-spawn-function
|
||||
process
|
||||
(lambda ()
|
||||
@@ -1008,10 +1063,7 @@ otherwise, an explicit [[vector]] can be provided"
|
||||
(set! (-> a1-3 0) 'empty0)
|
||||
(want-sound-banks *load-state* a1-3)
|
||||
)
|
||||
(let ((s5-0 (current-time)))
|
||||
(until (time-elapsed? s5-0 (seconds 1))
|
||||
(suspend)
|
||||
)
|
||||
(suspend-for (seconds 1)
|
||||
)
|
||||
(let ((a1-4 (new 'stack-no-clear 'array 'symbol 4)))
|
||||
(set! (-> a1-4 2) (-> gp-0 2))
|
||||
|
||||
@@ -66,8 +66,8 @@
|
||||
)
|
||||
)
|
||||
(set! (-> self board turn-anim-targ) (+ (lerp-scale
|
||||
(* 0.5 (-> *TARGET_BOARD-bank* turn-frames))
|
||||
(* -0.5 (-> *TARGET_BOARD-bank* turn-frames))
|
||||
(/ (-> *TARGET_BOARD-bank* turn-frames) 2)
|
||||
(/ (-> *TARGET_BOARD-bank* turn-frames) -2)
|
||||
f26-0
|
||||
-5461.3335
|
||||
5461.3335
|
||||
@@ -80,8 +80,8 @@
|
||||
32768.0
|
||||
)
|
||||
(lerp-scale
|
||||
(* 0.2 (-> *TARGET_BOARD-bank* turn-frames))
|
||||
(* -0.2 (-> *TARGET_BOARD-bank* turn-frames))
|
||||
(/ (-> *TARGET_BOARD-bank* turn-frames) 5)
|
||||
(/ (-> *TARGET_BOARD-bank* turn-frames) -5)
|
||||
(-> self board turn-anim-mag)
|
||||
1.0
|
||||
-1.0
|
||||
@@ -89,7 +89,7 @@
|
||||
)
|
||||
)
|
||||
(when (and (or (< (* f30-0 (-> self board turn-anim-targ)) 0.0) (= f30-0 0.0))
|
||||
(and (< (* 0.2 (-> *TARGET_BOARD-bank* turn-frames)) (fabs (- f30-0 (-> self board turn-anim-targ))))
|
||||
(and (< (/ (-> *TARGET_BOARD-bank* turn-frames) 5) (fabs (- f30-0 (-> self board turn-anim-targ))))
|
||||
(>= (current-time) (-> self control turn-lockout-end-time))
|
||||
)
|
||||
)
|
||||
@@ -2187,7 +2187,7 @@
|
||||
(else
|
||||
(let ((f30-1
|
||||
(* (lerp-scale 0.7 1.0 (fabs (-> self board ride-lean)) 0.0 1.0)
|
||||
(lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (* 0.5 (-> self control mod-surface transv-max)))
|
||||
(lerp-scale 0.8 1.0 (fabs (-> self board ride-speed)) 0.0 (/ (-> self control mod-surface transv-max) 2))
|
||||
)
|
||||
)
|
||||
(f0-23
|
||||
@@ -2973,7 +2973,8 @@
|
||||
(let ((s4-1 (new-stack-vector0)))
|
||||
(set! (-> s4-1 quad) (-> self control last-trans-on-ground quad))
|
||||
(ja-channel-set! 0)
|
||||
(suspend-for (seconds 1))
|
||||
(suspend-for (seconds 1)
|
||||
)
|
||||
(move-to-point! (-> self control) s4-1)
|
||||
)
|
||||
(set! (-> self control camera-pos quad) (-> self control trans quad))
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
(set! (-> arg0 slope-down-factor) (-> arg1 slope-down-factor))
|
||||
(set! (-> arg0 seek0)
|
||||
(lerp-scale
|
||||
(* 0.1 (-> arg0 seek0))
|
||||
(/ (-> arg0 seek0) 10)
|
||||
(-> arg0 seek0)
|
||||
(the float (- (current-time) (-> self board spin-time)))
|
||||
0.0
|
||||
@@ -175,7 +175,7 @@
|
||||
)
|
||||
(set! (-> arg0 seek90)
|
||||
(lerp-scale
|
||||
(* 0.1 (-> arg0 seek90))
|
||||
(/ (-> arg0 seek90) 10)
|
||||
(-> arg0 seek90)
|
||||
(the float (- (current-time) (-> self board spin-time)))
|
||||
0.0
|
||||
@@ -191,8 +191,8 @@
|
||||
(when (not (time-elapsed? (-> self board spin-ground-start-time) (seconds 0.3)))
|
||||
(set-time! (-> self control last-attack-end-time))
|
||||
(set-time! (-> self board spin-ground-time))
|
||||
(set! (-> arg0 seek0) (* 0.1 (-> arg0 seek0)))
|
||||
(set! (-> arg0 seek90) (* 0.1 (-> arg0 seek90)))
|
||||
(set! (-> arg0 seek0) (/ (-> arg0 seek0) 10))
|
||||
(set! (-> arg0 seek90) (/ (-> arg0 seek90) 10))
|
||||
(set! (-> arg0 vel-turn) 131072.0)
|
||||
(set! (-> arg0 turnv) 91022.22)
|
||||
)
|
||||
@@ -1749,7 +1749,7 @@
|
||||
(< 0.98 (vector-dot (-> self board unknown-vector01) (-> self control standard-dynamics gravity-normal)))
|
||||
(< f26-0 8192.0)
|
||||
(< f30-0 8192.0)
|
||||
(or (< (* 0.2 f28-0) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1))))
|
||||
(or (< (/ f28-0 5) f30-0) (not (time-elapsed? (-> self board unknown-time-frame00) (seconds 0.1))))
|
||||
)
|
||||
(vector+float*!
|
||||
(-> self control transv)
|
||||
@@ -2065,7 +2065,7 @@
|
||||
(set! (-> s2-0 start-pos quad) (-> v1-2 prim-core world-sphere quad))
|
||||
(set! (-> s2-0 move-dist quad) (-> arg1 quad))
|
||||
(let ((a0-3 s2-0))
|
||||
(set! (-> a0-3 radius) (* 0.5 (-> v1-2 prim-core world-sphere w)))
|
||||
(set! (-> a0-3 radius) (/ (-> v1-2 prim-core world-sphere w) 2))
|
||||
(set! (-> a0-3 collide-with) (-> v1-2 prim-core collide-with))
|
||||
(set! (-> a0-3 ignore-process0) (-> arg0 process))
|
||||
(set! (-> a0-3 ignore-process1) #f)
|
||||
@@ -2466,7 +2466,7 @@
|
||||
(let* ((f30-0 (-> self board ride-speed))
|
||||
(f0-4 (lerp-scale
|
||||
(-> self control current-surface fric)
|
||||
(* 0.2 (-> self control current-surface fric))
|
||||
(/ (-> self control current-surface fric) 5)
|
||||
f30-0
|
||||
0.0
|
||||
(-> self control current-surface transv-max)
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
)
|
||||
(when (and (or (and (< f0-27 0.95) (>= f30-0 0.0))
|
||||
(and (logtest? sv-32 (cshape-reaction-flags csrf05)) (< f0-27 0.3))
|
||||
(< f1-11 (* -0.25 (-> arg1 best-my-prim local-sphere w)))
|
||||
(< f1-11 (/ (-> arg1 best-my-prim local-sphere w) -4))
|
||||
)
|
||||
(>= (vector-dot tangent contact-normal) -0.000001)
|
||||
)
|
||||
|
||||
@@ -103,7 +103,7 @@
|
||||
(vector-normalize! s5-1 1.0)
|
||||
(launch-particles (-> *part-id-table* 224) gp-0)
|
||||
(let ((s3-0 (new 'stack-no-clear 'matrix))
|
||||
(f28-1 (* 0.000015258789 f30-0))
|
||||
(f28-1 (/ f30-0 (meters 16)))
|
||||
(f30-1 (-> *part-id-table* 226 init-specs 3 initial-valuef))
|
||||
)
|
||||
(forward-up->inv-matrix s3-0 s5-1 *up-vector*)
|
||||
|
||||
@@ -635,7 +635,7 @@
|
||||
(set! f2-0 (-> a1-3 a2-6 w))
|
||||
)
|
||||
)
|
||||
(let ((f1-1 (* 0.0625 f1-0)))
|
||||
(let ((f1-1 (/ f1-0 16)))
|
||||
(set! (-> self control idx-of-fastest-xz-vel) a0-3)
|
||||
(set! (-> self control average-xz-vel) f1-1)
|
||||
(if (logtest? (-> self control current-surface flags) (surface-flag no-turn-around))
|
||||
@@ -3304,6 +3304,7 @@
|
||||
)
|
||||
|
||||
(defmethod deactivate ((this target))
|
||||
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
||||
(kill-persister *setting-control* (the-as engine-pers 'bg-a-speed) 'bg-a-speed)
|
||||
(if (nonzero? (-> this darkjak))
|
||||
(sound-stop (-> this darkjak tone))
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
(quaternion-rotate-local-x! s1-0 s1-0 32768.0)
|
||||
(let ((a0-3 s0-0))
|
||||
(let ((v1-10 arg1))
|
||||
(let ((a1-4 (* 0.5 arg4)))
|
||||
(let ((a1-4 (/ arg4 2)))
|
||||
(.mov vf7 a1-4)
|
||||
)
|
||||
(.lvf vf5 (&-> arg2 quad))
|
||||
|
||||
@@ -776,7 +776,7 @@
|
||||
(else
|
||||
(seek! (-> self mech jump-thrust) 0.0 (* 491520.0 (seconds-per-frame)))
|
||||
(set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust)))
|
||||
(set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust)))
|
||||
(set! (-> self mech thruster-flame-length) (/ (-> self mech jump-thrust) 35))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1002,7 +1002,8 @@
|
||||
(let ((s4-1 (new-stack-vector0)))
|
||||
(set! (-> s4-1 quad) (-> self control last-trans-on-ground quad))
|
||||
(ja-channel-set! 0)
|
||||
(suspend-for (seconds 1))
|
||||
(suspend-for (seconds 1)
|
||||
)
|
||||
(move-to-point! (-> self control) s4-1)
|
||||
)
|
||||
(set! (-> self control camera-pos quad) (-> self control trans quad))
|
||||
@@ -1137,7 +1138,9 @@
|
||||
)
|
||||
(ja-channel-push! 1 (seconds 0.3))
|
||||
(ja-no-eval :group! jakb-mech-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0)
|
||||
(suspend-for (seconds 0.8) (ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5)))
|
||||
(suspend-for (seconds 0.8)
|
||||
(ja :group! jakb-mech-jump-loop-ja :num! (loop! 0.5))
|
||||
)
|
||||
(remove-setting! 'mode-name)
|
||||
)
|
||||
(else
|
||||
@@ -1257,7 +1260,8 @@
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
(suspend-for (seconds 2))
|
||||
(suspend-for (seconds 2)
|
||||
)
|
||||
)
|
||||
)
|
||||
(set! (-> self control transv quad) (the-as uint128 0))
|
||||
@@ -1281,7 +1285,7 @@
|
||||
(dotimes (s4-0 1)
|
||||
((method-of-type sphere new) (the-as symbol (+ (the-as uint s5-0) (* s4-0 16))) sphere)
|
||||
)
|
||||
(let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio)))))
|
||||
(let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10))))
|
||||
(set! (-> (the-as sphere (&-> s5-0 x)) quad)
|
||||
(-> self control collision-spheres 2 prim-core world-sphere quad)
|
||||
)
|
||||
@@ -2106,7 +2110,7 @@
|
||||
(* 491520.0 (seconds-per-frame))
|
||||
)
|
||||
(set! (-> self mech thruster-flame-width) (* 0.021428572 (-> self mech jump-thrust)))
|
||||
(set! (-> self mech thruster-flame-length) (* 0.028571429 (-> self mech jump-thrust)))
|
||||
(set! (-> self mech thruster-flame-length) (/ (-> self mech jump-thrust) 35))
|
||||
(let ((v1-120 (ja-group)))
|
||||
(if (and v1-120 (or (= v1-120 jakb-mech-push-ja) (= v1-120 jakb-mech-pull-ja)))
|
||||
(ja :num! (loop! f26-1))
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype surface (basic)
|
||||
"Definition of a bunch of parameters for different types of surfaces.
|
||||
Parameters include values such as max speed, friction, callback functions that run
|
||||
on impact, during touch, on exit, etc."
|
||||
((name symbol)
|
||||
(turnv float)
|
||||
(turnvv float)
|
||||
@@ -111,17 +114,17 @@
|
||||
|
||||
|
||||
(defun calc-terminal-vel ((arg0 float) (arg1 float) (arg2 float))
|
||||
(- (* (/ (- (* 0.016666668 arg0) arg1) arg2) (- 1.0 arg2)) arg1)
|
||||
(- (* (/ (- (/ arg0 60) arg1) arg2) (- 1.0 arg2)) arg1)
|
||||
)
|
||||
|
||||
(defun calc-terminal2-vel ((arg0 float) (arg1 float) (arg2 float) (arg3 float))
|
||||
(let ((f0-4 (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2))))
|
||||
(let ((f0-4 (sqrtf (/ (- (/ arg0 60) arg1) arg2))))
|
||||
(- f0-4 (+ arg1 (* arg2 (* f0-4 f0-4))))
|
||||
)
|
||||
)
|
||||
|
||||
(defun calc-terminal4-vel ((arg0 float) (arg1 float) (arg2 float))
|
||||
(let ((f0-5 (sqrtf (sqrtf (/ (- (* 0.016666668 arg0) arg1) arg2)))))
|
||||
(let ((f0-5 (sqrtf (sqrtf (/ (- (/ arg0 60) arg1) arg2)))))
|
||||
(- f0-5 (+ arg1 (* arg2 (* f0-5 f0-5 f0-5 f0-5))))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -662,7 +662,7 @@
|
||||
)
|
||||
((lambda :behavior target
|
||||
()
|
||||
(let ((f30-0 (fmax 0.8 (fmin 1.0 (* 0.000048828126 (-> self control ctrl-xz-vel))))))
|
||||
(let ((f30-0 (fmax 0.8 (fmin 1.0 (/ (-> self control ctrl-xz-vel) (meters 5))))))
|
||||
(cond
|
||||
((and (rand-vu-percent? 0.3) (< 20480.0 (-> self control ctrl-xz-vel)))
|
||||
(ja-no-eval :group! jakb-attack-from-stance-alt-end-ja :num! (seek! (ja-aframe 29.0 0) f30-0) :frame-num 0.0)
|
||||
@@ -1020,10 +1020,10 @@
|
||||
)
|
||||
)
|
||||
(let ((f0-37 (fabs (- f20-0 f30-0))))
|
||||
(set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-37)))))
|
||||
(set! f30-0 (seek f30-0 f20-0 (fmax 0.05 (fmin 0.2 (/ f0-37 4)))))
|
||||
)
|
||||
(let ((f0-42 (fabs (- f22-1 f28-0))))
|
||||
(set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (* 0.25 f0-42)))))
|
||||
(set! f28-0 (seek f28-0 f22-1 (fmax 0.05 (fmin 0.2 (/ f0-42 4)))))
|
||||
)
|
||||
)
|
||||
(set! (-> self control unknown-float-n12iuh3n1) f30-0)
|
||||
@@ -1556,7 +1556,7 @@
|
||||
(let ((f0-11 (target-height-above-ground))
|
||||
(f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
|
||||
)
|
||||
(while (not (or (and (< (fabs (/ f0-11 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0))
|
||||
(while (not (or (and (< (fabs (/ f0-11 (/ f1-1 300))) 150.0) (< f1-1 0.0))
|
||||
(time-elapsed? (-> self state-time) (seconds 1.7))
|
||||
)
|
||||
)
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
(dotimes (s4-0 1)
|
||||
((method-of-type sphere new) (the-as symbol (-> s5-0 s4-0)) sphere)
|
||||
)
|
||||
(let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio)))))
|
||||
(let ((f30-0 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10))))
|
||||
(set! (-> s5-0 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad))
|
||||
(set! (-> s5-0 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-0 0.0 1.0))
|
||||
(let ((v1-17 gp-0))
|
||||
|
||||
@@ -599,7 +599,7 @@
|
||||
(set-setting! 'rapid-tracking #f 0.0 0)
|
||||
((lambda :behavior target
|
||||
()
|
||||
(set! (-> self control bend-target) (* 0.5 (-> self control bend-target)))
|
||||
(set! (-> self control bend-target) (/ (-> self control bend-target) 2))
|
||||
(if (logtest? (water-flags touch-water) (-> self water flags))
|
||||
(sound-play "swim-stroke")
|
||||
)
|
||||
|
||||
@@ -310,7 +310,8 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(suspend-for (seconds 0.05))
|
||||
(suspend-for (seconds 0.05)
|
||||
)
|
||||
)
|
||||
((logtest? (-> arg0 flags) (continue-flags title))
|
||||
(go target-title #t)
|
||||
@@ -333,7 +334,8 @@
|
||||
(intro-play)
|
||||
)
|
||||
((logtest? (-> arg0 flags) (continue-flags warp-gate))
|
||||
(suspend-for (seconds 0.05))
|
||||
(suspend-for (seconds 0.05)
|
||||
)
|
||||
(let ((s5-8 (new 'static 'vector))
|
||||
(a2-26 (find-nearest-entity (-> arg0 trans) warp-gate))
|
||||
)
|
||||
@@ -362,7 +364,8 @@
|
||||
(go target-grab 'stance)
|
||||
)
|
||||
(else
|
||||
(suspend-for (seconds 0.05))
|
||||
(suspend-for (seconds 0.05)
|
||||
)
|
||||
)
|
||||
)
|
||||
(let* ((a0-122 *game-info*)
|
||||
@@ -981,7 +984,7 @@
|
||||
(set! (-> sv-32 vector y) (-> sv-32 shove-up))
|
||||
)
|
||||
(when (and (focus-test? self dark) (nonzero? (-> self darkjak)))
|
||||
(set! (-> sv-32 damage) (fmax 1.0 (ceil (* 0.5 (-> sv-32 damage)))))
|
||||
(set! (-> sv-32 damage) (fmax 1.0 (ceil (/ (-> sv-32 damage) 2))))
|
||||
(if (< (- (-> self fact health) (-> sv-32 damage)) 1.0)
|
||||
(set! (-> sv-32 damage) (+ -1.0 (-> self fact health)))
|
||||
)
|
||||
@@ -1013,7 +1016,8 @@
|
||||
(let ((gp-1 (new-stack-vector0)))
|
||||
(set! (-> gp-1 quad) (-> self control last-trans-on-ground quad))
|
||||
(ja-channel-set! 0)
|
||||
(suspend-for (seconds 1))
|
||||
(suspend-for (seconds 1)
|
||||
)
|
||||
(move-to-point! (-> self control) gp-1)
|
||||
)
|
||||
(set! (-> self control camera-pos quad) (-> self control trans quad))
|
||||
@@ -1628,7 +1632,8 @@
|
||||
(set! (-> self post-hook) target-no-ja-move-post)
|
||||
(ja-channel-set! 0)
|
||||
(ja-post)
|
||||
(suspend-for (seconds 2))
|
||||
(suspend-for (seconds 2)
|
||||
)
|
||||
(b! #t cfg-131 :delay (nop!))
|
||||
(label cfg-79)
|
||||
(b! (not (or (= v1-63 'grenade) (= v1-63 'big-explosion) (= v1-63 'explode))) cfg-122 :delay (empty-form))
|
||||
@@ -1739,7 +1744,8 @@
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
(suspend-for (seconds 2))
|
||||
(suspend-for (seconds 2)
|
||||
)
|
||||
)
|
||||
(b! #t cfg-131 :delay (nop!))
|
||||
(label cfg-122)
|
||||
@@ -1788,7 +1794,8 @@
|
||||
(set! (-> self post-hook) target-no-ja-move-post)
|
||||
(ja-channel-set! 0)
|
||||
(ja-post)
|
||||
(suspend-for (seconds 2))
|
||||
(suspend-for (seconds 2)
|
||||
)
|
||||
)
|
||||
)
|
||||
(label cfg-131)
|
||||
@@ -1804,7 +1811,8 @@
|
||||
(set! (-> self post-hook) target-no-ja-move-post)
|
||||
(ja-channel-set! 0)
|
||||
(ja-post)
|
||||
(suspend-for (seconds 1.2))
|
||||
(suspend-for (seconds 1.2)
|
||||
)
|
||||
)
|
||||
((= v1-50 'endlessfall)
|
||||
((lambda :behavior target
|
||||
@@ -1842,8 +1850,7 @@
|
||||
(target-falling-anim 30 (seconds 0.33))
|
||||
(ja-channel-push! 1 (seconds 0.3))
|
||||
(ja-no-eval :group! jakb-launch-jump-loop-ja :num! (loop! 0.5) :frame-num 0.0)
|
||||
(suspend-for
|
||||
(seconds 0.8)
|
||||
(suspend-for (seconds 0.8)
|
||||
(when (and (logtest? (-> self control status) (collide-status on-surface)) (!= (-> self control cur-pat event) 2))
|
||||
(set! v1-24 'target-hit-ground-hard)
|
||||
(goto cfg-17)
|
||||
@@ -1886,7 +1893,8 @@
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
(suspend-for (seconds 2))
|
||||
(suspend-for (seconds 2)
|
||||
)
|
||||
)
|
||||
(remove-setting! 'mode-name)
|
||||
(none)
|
||||
@@ -1975,7 +1983,8 @@
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
(suspend-for (seconds 2))
|
||||
(suspend-for (seconds 2)
|
||||
)
|
||||
)
|
||||
((= v1-50 'centipede)
|
||||
(set! (-> self trans-hook) #f)
|
||||
|
||||
@@ -1637,7 +1637,7 @@
|
||||
(dotimes (s4-1 1)
|
||||
((method-of-type sphere new) (the-as symbol (-> s5-2 s4-1)) sphere)
|
||||
)
|
||||
(let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (* 0.1 (-> self clock time-adjust-ratio)))))
|
||||
(let ((f30-1 (seek (-> self control collide-mode-transition) 1.0 (/ (-> self clock time-adjust-ratio) 10))))
|
||||
(set! (-> s5-2 0 quad) (-> self control collision-spheres 2 prim-core world-sphere quad))
|
||||
(set! (-> s5-2 0 r) (lerp-scale (-> *TARGET-bank* body-radius) 7372.8 f30-1 0.0 1.0))
|
||||
(let ((v1-212 gp-3))
|
||||
@@ -1726,7 +1726,7 @@
|
||||
(let* ((f0-28 (deg-diff (y-angle (-> self control)) (vector-y-angle (-> self control to-target-pt-xz))))
|
||||
(f0-30 (fmax -5461.3335 (fmin 5461.3335 f0-28)))
|
||||
)
|
||||
(seek! (-> self upper-body twist z) f0-30 (fabs (* 0.2 f0-30)))
|
||||
(seek! (-> self upper-body twist z) f0-30 (fabs (/ f0-30 5)))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -181,10 +181,10 @@
|
||||
(f24-0 (fmax -1.0 (fmin 1.0 (* 1.6 (-> self control local-slope-x)))))
|
||||
)
|
||||
(let ((f1-4 (fabs (- f0-10 f28-0))))
|
||||
(set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (* 0.25 f1-4)))))
|
||||
(set! f28-0 (seek f28-0 f0-10 (fmax 0.05 (fmin 0.2 (/ f1-4 4)))))
|
||||
)
|
||||
(let ((f0-14 (fabs (- f24-0 f26-0))))
|
||||
(set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (* 0.25 f0-14)))))
|
||||
(set! f26-0 (seek f26-0 f24-0 (fmax 0.05 (fmin 0.2 (/ f0-14 4)))))
|
||||
)
|
||||
)
|
||||
(ja :chan 3 :group! jakb-walk-down-ja :dist (-> *TARGET-bank* walk-down-cycle-dist))
|
||||
|
||||
@@ -813,7 +813,7 @@
|
||||
(f2-0 f1-2)
|
||||
)
|
||||
(if (< f0-2 0.0)
|
||||
(set! f0-2 (* 0.5 f0-2))
|
||||
(set! f0-2 (/ f0-2 2))
|
||||
)
|
||||
(vector+!
|
||||
(-> arg1 vector)
|
||||
@@ -1087,11 +1087,11 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this slide-control) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(logclear! (-> this mask) (process-mask actor-pause))
|
||||
|
||||
@@ -271,7 +271,7 @@
|
||||
(launch-particles (-> *part-id-table* 608) 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* 923 init-specs 3 initial-valuef))
|
||||
(f28-1 (-> *part-id-table* 923 init-specs 4 initial-valuef))
|
||||
)
|
||||
|
||||
@@ -384,7 +384,7 @@
|
||||
)
|
||||
)
|
||||
(set! (-> this sprites 28 color w)
|
||||
(the int (* 0.00390625 (-> this fade-interp) (the float (-> this values 2 current))))
|
||||
(the int (* (/ (-> this fade-interp) 256) (the float (-> this values 2 current))))
|
||||
)
|
||||
(set-as-offset-from!
|
||||
(-> this sprites 28)
|
||||
|
||||
@@ -1080,7 +1080,7 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(* 0.125 f30-0)
|
||||
(/ f30-0 8)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1720,10 +1720,10 @@
|
||||
(f30-0 (fmax -1.0 (fmin 1.0 arg2)))
|
||||
)
|
||||
(let ((f1-5 (fabs (- f0-1 (-> arg0 blend 1)))))
|
||||
(seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (* 0.2 arg3)))
|
||||
(seek! (-> arg0 blend 1) f0-1 (fmax (fmin (* f1-5 arg3) (* 0.8 arg3)) (/ arg3 5)))
|
||||
)
|
||||
(let ((f0-9 (fabs (- f30-0 (-> arg0 blend 2)))))
|
||||
(seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (* 0.2 arg3)))
|
||||
(seek! (-> arg0 blend 2) f30-0 (fmax (fmin (* f0-9 arg3) (* 0.8 arg3)) (/ arg3 5)))
|
||||
)
|
||||
)
|
||||
(cond
|
||||
@@ -1897,8 +1897,8 @@
|
||||
(cond
|
||||
((and (< 0.0 f0-4) (focus-test? this in-air))
|
||||
(let* ((v0-1 (new 'static 'vector))
|
||||
(f0-5 (+ (* 0.0016666667 (-> v1-0 dynam gravity-length)) f0-4))
|
||||
(f0-8 (/ (* 0.5 f0-5 f0-5) (-> v1-0 dynam gravity-length)))
|
||||
(f0-5 (+ (/ (-> v1-0 dynam gravity-length) 600) f0-4))
|
||||
(f0-8 (/ (* (/ f0-5 2) f0-5) (-> v1-0 dynam gravity-length)))
|
||||
)
|
||||
(vector+float*! v0-1 (-> v1-0 trans) (-> v1-0 dynam gravity-normal) f0-8)
|
||||
)
|
||||
|
||||
@@ -494,11 +494,11 @@
|
||||
(delete-back-vel)
|
||||
(let* ((f0-4 arg5)
|
||||
(f1-2 0.0)
|
||||
(f2-2 (+ (* 0.0016666667 (-> self control dynam gravity-length))
|
||||
(f2-2 (+ (/ (-> self control dynam gravity-length) 600)
|
||||
(fmax 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
|
||||
)
|
||||
)
|
||||
(f0-5 (* f0-4 (fmax f1-2 (/ (* 0.5 f2-2 f2-2) (-> self control dynam gravity-length)))))
|
||||
(f0-5 (* f0-4 (fmax f1-2 (/ (* (/ f2-2 2) f2-2) (-> self control dynam gravity-length)))))
|
||||
(s3-1 (+ arg0 f0-5))
|
||||
)
|
||||
(let ((s2-1 (+ arg1 f0-5)))
|
||||
@@ -626,7 +626,7 @@
|
||||
(nonzero? (-> self darkjak))
|
||||
(logtest? (-> self darkjak stage) (darkjak-stage giant))
|
||||
)
|
||||
(set! (-> v1-62 y) (* 0.5 (-> v1-62 y)))
|
||||
(set! (-> v1-62 y) (/ (-> v1-62 y) 2))
|
||||
)
|
||||
(set! v0-1 (-> self control anim-collide-offset-local))
|
||||
(set! (-> v0-1 quad) (-> v1-62 quad))
|
||||
@@ -2645,7 +2645,7 @@
|
||||
)
|
||||
(else
|
||||
(let* ((f1-5 (/ f0-2 (* (-> self control dynam gravity-length) (seconds-per-frame))))
|
||||
(f0-7 (* 0.5 f1-5 (seconds-per-frame) f0-2))
|
||||
(f0-7 (* (/ f1-5 2) (seconds-per-frame) f0-2))
|
||||
)
|
||||
(let ((v1-22 (ja-group)))
|
||||
(if (and v1-22
|
||||
|
||||
@@ -50,7 +50,10 @@
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
(suspend-for (seconds 0.3) (suspend) (ja :num! (seek! (ja-aframe 19.0 0) 0.05)))
|
||||
(suspend-for (seconds 0.3)
|
||||
(suspend)
|
||||
(ja :num! (seek! (ja-aframe 19.0 0) 0.05))
|
||||
)
|
||||
(ja-channel-push! 1 (seconds 0.3))
|
||||
(ja-no-eval :group! jakb-painful-land-ja :num! (seek!) :frame-num (ja-aframe 40.0 0))
|
||||
(until (ja-done? 0)
|
||||
@@ -649,7 +652,7 @@
|
||||
(let ((f0-1 (target-height-above-ground))
|
||||
(f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))
|
||||
)
|
||||
(while (not (and (< (fabs (/ f0-1 (* 0.0033333334 f1-1))) 40.0) (and (< f1-1 0.0) (ja-min? 0))))
|
||||
(while (not (and (< (fabs (/ f0-1 (/ f1-1 300))) 40.0) (and (< f1-1 0.0) (ja-min? 0))))
|
||||
(suspend)
|
||||
(ja :num! (loop!))
|
||||
(set! f0-1 (target-height-above-ground))
|
||||
@@ -1196,7 +1199,9 @@
|
||||
(until #f
|
||||
(let ((s5-0 (rand-vu-int-range 30 600)))
|
||||
(ja :group! jakb-wall-hide-head-ja)
|
||||
(suspend-for s5-0 (gp-0))
|
||||
(suspend-for s5-0
|
||||
(gp-0)
|
||||
)
|
||||
)
|
||||
(let ((f30-0 (rand-vu-float-range 0.5 1.5)))
|
||||
(cond
|
||||
@@ -1234,7 +1239,9 @@
|
||||
(ja :num! (seek! max f30-0))
|
||||
)
|
||||
(let ((s5-2 (rand-vu-int-range 60 300)))
|
||||
(suspend-for s5-2 (gp-0))
|
||||
(suspend-for s5-2
|
||||
(gp-0)
|
||||
)
|
||||
)
|
||||
(ja-no-eval :group! jakb-wall-hide-head-left-ja :num! (seek! 0.0 f30-0) :frame-num max)
|
||||
(until (ja-done? 0)
|
||||
@@ -1251,7 +1258,9 @@
|
||||
(ja :num! (seek! 0.0 f30-0))
|
||||
)
|
||||
(let ((s5-3 (rand-vu-int-range 60 300)))
|
||||
(suspend-for s5-3 (gp-0))
|
||||
(suspend-for s5-3
|
||||
(gp-0)
|
||||
)
|
||||
)
|
||||
(ja-no-eval :group! jakb-wall-hide-head-right-ja :num! (seek! max f30-0) :frame-num 0.0)
|
||||
(until (ja-done? 0)
|
||||
|
||||
@@ -924,7 +924,7 @@
|
||||
:code (behavior ()
|
||||
(until #f
|
||||
(if (not (logtest? (-> *kernel-context* prevent-from-run) (process-mask pause)))
|
||||
(seek! (-> self offset) 0.0 (* 0.1 (-> self clock time-adjust-ratio)))
|
||||
(seek! (-> self offset) 0.0 (/ (-> self clock time-adjust-ratio) 10))
|
||||
)
|
||||
(if (>= 0.0 (-> self offset))
|
||||
(go hud-in)
|
||||
|
||||
@@ -1134,6 +1134,10 @@
|
||||
|
||||
|
||||
(defmethod run-pending-updates! ((this engine-minimap) (arg0 time-frame))
|
||||
"Run updates if they scheduled. If something is found that has no pending update, kill it.
|
||||
Note that we won't kill things on this call if they fail to update their `update-time`.
|
||||
They will survive until the next call to `run-pending-updates`!
|
||||
(or you can modify their `update-time` before that to prevent them from being killed.)"
|
||||
(let ((s2-0 (the-as (pointer connection-pers) (&-> this alive-list)))
|
||||
(s3-0 (-> this alive-list))
|
||||
)
|
||||
@@ -1242,6 +1246,7 @@
|
||||
|
||||
;; WARN: Function (method 10 engine-minimap) has a return type of none, but the expression builder found a return statement.
|
||||
(defmethod kill-callback ((this engine-minimap) (arg0 connection-pers))
|
||||
"Called when a connection is removed."
|
||||
(if (not arg0)
|
||||
(return #f)
|
||||
)
|
||||
@@ -1346,7 +1351,7 @@
|
||||
(set! (-> this target-inv-scale) 0.5)
|
||||
)
|
||||
)
|
||||
(seek! (-> this offset y) (-> this target-inv-scale) (* 0.5 f30-2))
|
||||
(seek! (-> this offset y) (-> this target-inv-scale) (/ f30-2 2))
|
||||
)
|
||||
(run-pending-updates! (-> this engine) (-> *display* base-clock frame-counter))
|
||||
(when (and (-> this ctywide) (and (= (-> this ctywide status) 'active) (!= (-> this offset w) 0.0)))
|
||||
@@ -1927,23 +1932,23 @@
|
||||
(set-vector! (-> arg0 mat vector 2) (* (-> s1-0 x) f30-0) 0.0 (-> s1-0 z) 0.0)
|
||||
)
|
||||
(vector-! s2-0 (target-pos 0) (-> this minimap-corner))
|
||||
(set! (-> s2-0 x) (* 0.00000023841858 (-> s2-0 x)))
|
||||
(set! (-> s2-0 z) (* 0.00000023841858 (-> s2-0 z)))
|
||||
(set! (-> s2-0 x) (/ (-> s2-0 x) (meters 1024)))
|
||||
(set! (-> s2-0 z) (/ (-> s2-0 z) (meters 1024)))
|
||||
(vector+! (-> arg0 mat trans) s2-0 (-> this offset))
|
||||
)
|
||||
)
|
||||
(set! (-> arg0 mat trans y) 0.0)
|
||||
(set! (-> arg0 corner 0 x) (* 0.25 (-> this offset y)))
|
||||
(set! (-> arg0 corner 0 z) (* 0.25 (-> this offset y)))
|
||||
(set! (-> arg0 corner 0 x) (/ (-> this offset y) 4))
|
||||
(set! (-> arg0 corner 0 z) (/ (-> this offset y) 4))
|
||||
(set! (-> arg0 corner 0 w) 1.0)
|
||||
(set! (-> arg0 corner 1 x) (* -0.25 (-> this offset y)))
|
||||
(set! (-> arg0 corner 1 z) (* 0.25 (-> this offset y)))
|
||||
(set! (-> arg0 corner 1 x) (/ (-> this offset y) -4))
|
||||
(set! (-> arg0 corner 1 z) (/ (-> this offset y) 4))
|
||||
(set! (-> arg0 corner 1 w) 1.0)
|
||||
(set! (-> arg0 corner 2 x) (* 0.25 (-> this offset y)))
|
||||
(set! (-> arg0 corner 2 z) (* -0.25 (-> this offset y)))
|
||||
(set! (-> arg0 corner 2 x) (/ (-> this offset y) 4))
|
||||
(set! (-> arg0 corner 2 z) (/ (-> this offset y) -4))
|
||||
(set! (-> arg0 corner 2 w) 1.0)
|
||||
(set! (-> arg0 corner 3 x) (* -0.25 (-> this offset y)))
|
||||
(set! (-> arg0 corner 3 z) (* -0.25 (-> this offset y)))
|
||||
(set! (-> arg0 corner 3 x) (/ (-> this offset y) -4))
|
||||
(set! (-> arg0 corner 3 z) (/ (-> this offset y) -4))
|
||||
(set! (-> arg0 corner 3 w) 1.0)
|
||||
(vector-matrix*! (the-as vector (-> arg0 corner)) (the-as vector (-> arg0 corner)) (-> arg0 mat))
|
||||
(vector-matrix*! (-> arg0 corner 1) (-> arg0 corner 1) (-> arg0 mat))
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
(kmemclose)
|
||||
|
||||
(defmethod relocate ((this game-text-info) (arg0 int))
|
||||
(defmethod relocate ((this game-text-info) (offset int))
|
||||
(let ((v1-1 (-> *level* loading-level)))
|
||||
(when v1-1
|
||||
(set! (-> v1-1 loaded-text-info (-> v1-1 loaded-text-info-count)) this)
|
||||
@@ -52,21 +52,21 @@
|
||||
)
|
||||
|
||||
|
||||
(defmethod mem-usage ((this game-text-info) (arg0 memory-usage-block) (arg1 int))
|
||||
(set! (-> arg0 length) (max 84 (-> arg0 length)))
|
||||
(set! (-> arg0 data 83 name) "string")
|
||||
(+! (-> arg0 data 83 count) 1)
|
||||
(defmethod mem-usage ((this game-text-info) (usage memory-usage-block) (flags int))
|
||||
(set! (-> usage length) (max 84 (-> usage length)))
|
||||
(set! (-> usage data 83 name) "string")
|
||||
(+! (-> usage data 83 count) 1)
|
||||
(let ((v1-6 (asize-of this)))
|
||||
(+! (-> arg0 data 83 used) v1-6)
|
||||
(+! (-> arg0 data 83 total) (logand -16 (+ v1-6 15)))
|
||||
(+! (-> usage data 83 used) v1-6)
|
||||
(+! (-> usage data 83 total) (logand -16 (+ v1-6 15)))
|
||||
)
|
||||
(dotimes (s4-0 (-> this length))
|
||||
(set! (-> arg0 length) (max 84 (-> arg0 length)))
|
||||
(set! (-> arg0 data 83 name) "string")
|
||||
(+! (-> arg0 data 83 count) 1)
|
||||
(set! (-> usage length) (max 84 (-> usage length)))
|
||||
(set! (-> usage data 83 name) "string")
|
||||
(+! (-> usage data 83 count) 1)
|
||||
(let ((v1-18 (asize-of (-> this data s4-0 text))))
|
||||
(+! (-> arg0 data 83 used) v1-18)
|
||||
(+! (-> arg0 data 83 total) (logand -16 (+ v1-18 15)))
|
||||
(+! (-> usage data 83 used) v1-18)
|
||||
(+! (-> usage data 83 total) (logand -16 (+ v1-18 15)))
|
||||
)
|
||||
)
|
||||
this
|
||||
@@ -464,7 +464,7 @@ in a single text group and file."
|
||||
)
|
||||
(set! sv-64 0)
|
||||
(if (logtest? (-> arg1 flags) (font-flags middle))
|
||||
(+! (-> arg1 origin x) (* 0.5 (-> arg1 width)))
|
||||
(+! (-> arg1 origin x) (/ (-> arg1 width) 2))
|
||||
)
|
||||
(set! sv-72 (-> sv-32 0))
|
||||
(set! sv-80 0)
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
;; DECOMP BEGINS
|
||||
|
||||
(deftype smush-control (structure)
|
||||
"This holds information about the current state of an object's smush."
|
||||
((start-time time-frame)
|
||||
(period float)
|
||||
(duration float)
|
||||
@@ -45,23 +46,23 @@
|
||||
(defmethod update! ((this smush-control))
|
||||
(cond
|
||||
((!= (-> this amp) 0.0)
|
||||
(let* ((f30-0 (the float (- (current-time) (-> this start-time))))
|
||||
(f0-2 (-> this period))
|
||||
(f28-0 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2)))
|
||||
(let* ((elapsed-time (the float (- (current-time) (-> this start-time))))
|
||||
(period (-> this period))
|
||||
(f28-0 (- elapsed-time (* (the float (the int (/ elapsed-time period))) period)))
|
||||
)
|
||||
(when (>= (- f30-0 (-> this ticks)) (-> this period))
|
||||
(when (>= (- elapsed-time (-> this ticks)) (-> this period))
|
||||
(set! (-> this amp) (* (-> this amp) (-> this damp-amp)))
|
||||
(set! (-> this period) (* (-> this period) (-> this damp-period)))
|
||||
(set! (-> this ticks) f30-0)
|
||||
(set! (-> this ticks) elapsed-time)
|
||||
(if (< (-> this damp-period) 0.0)
|
||||
(set-zero! this)
|
||||
)
|
||||
)
|
||||
(if (>= f30-0 (-> this duration))
|
||||
(if (>= elapsed-time (-> this duration))
|
||||
(set-zero! this)
|
||||
)
|
||||
(* (sin (/ (* 65536.0 f28-0) (-> this period)))
|
||||
(* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration)))
|
||||
(* (-> this amp) (/ (- (-> this duration) elapsed-time) (-> this duration)))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -74,12 +75,12 @@
|
||||
(defmethod get-no-update ((this smush-control))
|
||||
(cond
|
||||
((!= (-> this amp) 0.0)
|
||||
(let* ((f30-0 (the float (- (current-time) (-> this start-time))))
|
||||
(f0-2 (-> this period))
|
||||
(f0-4 (- f30-0 (* (the float (the int (/ f30-0 f0-2))) f0-2)))
|
||||
(let* ((elapsed-time (the float (- (current-time) (-> this start-time))))
|
||||
(period (-> this period))
|
||||
(f0-4 (- elapsed-time (* (the float (the int (/ elapsed-time period))) period)))
|
||||
)
|
||||
(* (sin (/ (* 65536.0 f0-4) (-> this period)))
|
||||
(* (-> this amp) (/ (- (-> this duration) f30-0) (-> this duration)))
|
||||
(* (-> this amp) (/ (- (-> this duration) elapsed-time) (-> this duration)))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -96,15 +97,22 @@
|
||||
this
|
||||
)
|
||||
|
||||
(defmethod activate! ((this smush-control) (arg0 float) (arg1 int) (arg2 int) (arg3 float) (arg4 float) (arg5 clock))
|
||||
(when (>= (fabs (* 0.2 (-> this amp))) (fabs (get-no-update this)))
|
||||
(set! (-> this amp) arg0)
|
||||
(set! (-> this period) (the float arg1))
|
||||
(set! (-> this duration) (the float arg2))
|
||||
(set! (-> this damp-amp) arg3)
|
||||
(set! (-> this damp-period) arg4)
|
||||
(defmethod activate! ((this smush-control)
|
||||
(amplitude float)
|
||||
(period int)
|
||||
(duration int)
|
||||
(damp-amplitude float)
|
||||
(damp-period float)
|
||||
(clock clock)
|
||||
)
|
||||
(when (>= (fabs (/ (-> this amp) 5)) (fabs (get-no-update this)))
|
||||
(set! (-> this amp) amplitude)
|
||||
(set! (-> this period) (the float period))
|
||||
(set! (-> this duration) (the float duration))
|
||||
(set! (-> this damp-amp) damp-amplitude)
|
||||
(set! (-> this damp-period) damp-period)
|
||||
(set! (-> this ticks) 0.0)
|
||||
(set! (-> this start-time) (-> arg5 frame-counter))
|
||||
(set! (-> this start-time) (-> clock frame-counter))
|
||||
)
|
||||
this
|
||||
)
|
||||
|
||||
@@ -425,7 +425,7 @@
|
||||
(defmethod set-params! ((this delayed-rand-float) (arg0 int) (arg1 int) (arg2 float))
|
||||
(set! (-> this min-time) arg0)
|
||||
(set! (-> this max-time) arg1)
|
||||
(set! (-> this max-val) (* 0.5 arg2))
|
||||
(set! (-> this max-val) (/ arg2 2))
|
||||
(set! (-> this start-time) 0)
|
||||
(set! (-> this timer) 0)
|
||||
(set! (-> this value) 0.0)
|
||||
@@ -525,8 +525,8 @@
|
||||
(defmethod set-params! ((this delayed-rand-vector) (arg0 int) (arg1 int) (arg2 float) (arg3 float))
|
||||
(set! (-> this min-time) arg0)
|
||||
(set! (-> this max-time) arg1)
|
||||
(set! (-> this xz-max) (* 0.5 arg2))
|
||||
(set! (-> this y-max) (* 0.5 arg3))
|
||||
(set! (-> this xz-max) (/ arg2 2))
|
||||
(set! (-> this y-max) (/ arg3 2))
|
||||
(set! (-> this start-time) 0)
|
||||
(set! (-> this timer) 0)
|
||||
(vector-reset! (-> this value))
|
||||
|
||||
@@ -252,7 +252,7 @@
|
||||
(quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (-> self rotspeed) (seconds-per-frame)))
|
||||
(let ((f1-2 (- (-> self dest-height) (-> self root trans y))))
|
||||
(if (< 0.0 f1-2)
|
||||
(+! (-> self root trans y) (* (fmax 6144.0 (* 0.5 f1-2)) (seconds-per-frame)))
|
||||
(+! (-> self root trans y) (* (fmax 6144.0 (/ f1-2 2)) (seconds-per-frame)))
|
||||
)
|
||||
)
|
||||
(update! (-> self sound))
|
||||
@@ -271,7 +271,7 @@
|
||||
(quaternion-rotate-y! (-> self root quat) (-> self root quat) (* (-> self rotspeed) (seconds-per-frame)))
|
||||
(let ((f1-2 (- (-> self dest-height) (-> self root trans y))))
|
||||
(if (< 0.0 f1-2)
|
||||
(+! (-> self root trans y) (* (fmax 6144.0 (* 0.5 f1-2)) (seconds-per-frame)))
|
||||
(+! (-> self root trans y) (* (fmax 6144.0 (/ f1-2 2)) (seconds-per-frame)))
|
||||
)
|
||||
)
|
||||
(update! (-> self sound))
|
||||
@@ -557,21 +557,25 @@
|
||||
)
|
||||
)
|
||||
:code (behavior ()
|
||||
(suspend-for (the int (-> self cycle-offset)))
|
||||
(suspend-for (the int (-> self cycle-offset))
|
||||
)
|
||||
(until #f
|
||||
(suspend-for (the int (-> self cycle-time)))
|
||||
(suspend-for (the int (-> self cycle-time))
|
||||
)
|
||||
(activate! (-> self smush) -1.0 60 225 1.0 1.0 (-> self clock))
|
||||
(sound-play "rot-pipe-wiggle" :position (-> self root trans))
|
||||
(suspend-for (seconds 0.75) (set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush)))))
|
||||
(suspend-for (seconds 0.75)
|
||||
(set! (-> self shudder-angle) (* 364.0889 (update! (-> self smush))))
|
||||
)
|
||||
(set! (-> self shudder-angle) 0.0)
|
||||
(set-zero! (-> self smush))
|
||||
(suspend-for (seconds 0.25))
|
||||
(suspend-for (seconds 0.25)
|
||||
)
|
||||
(sound-play "rot-pipe-turn" :position (-> self root trans))
|
||||
(let* ((f0-7 2.0)
|
||||
(f30-1 (* 16384.0 f0-7))
|
||||
)
|
||||
(suspend-for
|
||||
(seconds 0.5)
|
||||
(suspend-for (seconds 0.5)
|
||||
(set! (-> self rot-angle)
|
||||
(the float (sar (shl (the int (+ (-> self rot-angle) (* f30-1 (seconds-per-frame)))) 48) 48))
|
||||
)
|
||||
|
||||
@@ -163,8 +163,8 @@
|
||||
)
|
||||
(else
|
||||
(let ((f0-16 (+ 0.1 (* (-> s5-0 extra w) (sin (* 32768.0 (/ (-> s5-0 extra y) (-> s5-0 extra z))))))))
|
||||
(set-vector! (-> s5-0 start-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0)
|
||||
(set-vector! (-> s5-0 end-color) (* 0.5 f0-16) (* 0.7 f0-16) f0-16 1.0)
|
||||
(set-vector! (-> s5-0 start-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0)
|
||||
(set-vector! (-> s5-0 end-color) (/ f0-16 2) (* 0.7 f0-16) f0-16 1.0)
|
||||
)
|
||||
(set! (-> s5-0 extra y) (- (-> s5-0 extra y) (* 300.0 (seconds-per-frame))))
|
||||
)
|
||||
|
||||
@@ -1024,7 +1024,7 @@
|
||||
(f2-2 f1-1)
|
||||
(f2-4 (/ 1.0 f2-2))
|
||||
)
|
||||
(+ 1.0 (* 0.2 f0-0))
|
||||
(+ 1.0 (/ f0-0 5))
|
||||
(set! (-> this delta-wiggle-angle) (* 182.04445 f1-1))
|
||||
(set! (-> this wiggle-factor) (* 2.0 f2-4))
|
||||
)
|
||||
|
||||
@@ -737,7 +737,7 @@
|
||||
(set! (-> a1-4 data 0 end-time) f0-3)
|
||||
(set! (-> a1-4 data 1 end-time) f0-3)
|
||||
)
|
||||
(set! f0-3 (* 0.5 f0-3))
|
||||
(set! f0-3 (/ f0-3 2))
|
||||
)
|
||||
)
|
||||
#f
|
||||
|
||||
@@ -467,10 +467,10 @@
|
||||
(ja-channel-push! 1 (seconds 0.2))
|
||||
(let ((f30-0 (rnd-float-range self 0.9 1.1)))
|
||||
(until #f
|
||||
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (* 0.1 f30-0)) :frame-num 9.0)
|
||||
(ja-no-eval :group! roboguard-idle0-ja :num! (seek! 10.0 (/ f30-0 10)) :frame-num 9.0)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(ja :num! (seek! 10.0 (* 0.1 f30-0)))
|
||||
(ja :num! (seek! 10.0 (/ f30-0 10)))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1107,7 +1107,7 @@
|
||||
s5-1
|
||||
s5-1
|
||||
gp-0
|
||||
(* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame))
|
||||
(* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1000,7 +1000,7 @@
|
||||
(set! (-> t0-0 z) 0.0)
|
||||
(set! (-> t0-0 w) 1.0)
|
||||
(let ((v0-5 (t9-5 a0-31 a1-16 a2-22 a3-1 t0-0 (/ f28-0 f30-0))))
|
||||
(set! (-> s1-0 delta-y) (* 0.05 (-> v0-5 y) (vector-length (-> s1-0 speed))))
|
||||
(set! (-> s1-0 delta-y) (* (/ (-> v0-5 y) 20) (vector-length (-> s1-0 speed))))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -2477,7 +2477,7 @@
|
||||
)
|
||||
(set! (-> v1-3 main-y) (- (-> s4-0 feet s0-0 real-position y) (-> s4-0 root trans y)))
|
||||
(set! (-> v1-3 main-y) (-> v1-3 delta-y))
|
||||
(+! f30-0 (* 0.25 (-> v1-3 main-y)))
|
||||
(+! f30-0 (/ (-> v1-3 main-y) 4))
|
||||
(set! (-> s1-0 quad) (-> v1-3 pos-offset quad))
|
||||
(set! (-> s1-0 y) (* -2.0 (-> v1-3 main-y)))
|
||||
(new 'stack-no-clear 'vector)
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
)
|
||||
|
||||
(defmethod set-speed-limit ((this nav-branch) (arg0 float))
|
||||
(set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0)))))))
|
||||
(set! (-> this speed-limit) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024)))))))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod set-width ((this nav-branch) (arg0 float))
|
||||
(set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.00390625 arg0)))))))
|
||||
(set! (-> this width) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 256)))))))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -307,7 +307,7 @@
|
||||
)
|
||||
|
||||
(defmethod set-radius ((this nav-node) (arg0 float))
|
||||
(set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (* 0.0009765625 arg0)))))))
|
||||
(set! (-> this radius) (the-as uint (max 0 (min 255 (the int (+ 0.5 (/ arg0 1024)))))))
|
||||
0
|
||||
(none)
|
||||
)
|
||||
@@ -1097,7 +1097,7 @@
|
||||
|
||||
(defmethod patch-nodes ((this nav-graph))
|
||||
"Patch nodes. Node pointers are stored as indices into arrays to be allocated on the level heap
|
||||
and patched at runtime after loading."
|
||||
and patched at runtime after loading."
|
||||
(when (not (-> this patched))
|
||||
(set! (-> this patched) #t)
|
||||
(let ((s5-0 0))
|
||||
|
||||
@@ -492,7 +492,7 @@
|
||||
)
|
||||
0
|
||||
(let* ((f0-0 (-> v1-0 cell-width))
|
||||
(f1-1 (* 0.5 f0-0))
|
||||
(f1-1 (/ (the float f0-0) 2))
|
||||
)
|
||||
(let ((f3-0 (- (-> arg0 x) f1-1))
|
||||
(f2-2 (- (-> arg0 z) f1-1))
|
||||
|
||||
@@ -498,11 +498,11 @@
|
||||
)
|
||||
(vector+! (-> s1-0 trans) s4-0 s3-0)
|
||||
(vector-float*! (-> s1-0 trans) (-> s1-0 trans) 0.5)
|
||||
(+! (-> s1-0 trans y) (* 0.5 arg1))
|
||||
(+! (-> s1-0 trans y) (/ arg1 2))
|
||||
(vector-! (the-as vector (-> s2-2 vector)) s3-0 s4-0)
|
||||
(let ((f30-1 (vector-normalize-ret-len! (the-as vector (-> s2-2 vector)) 1.0)))
|
||||
(set! (-> s1-0 scale x) (* 0.00024414062 f30-1))
|
||||
(set! (-> s1-0 scale y) (* 0.00024414062 arg1))
|
||||
(set! (-> s1-0 scale x) (/ f30-1 METER_LENGTH))
|
||||
(set! (-> s1-0 scale y) (/ arg1 METER_LENGTH))
|
||||
(set! (-> s1-0 scale z) 1.0)
|
||||
(set! (-> s2-2 vector 1 quad) (-> (new 'static 'vector :y 1.0 :w 1.0) quad))
|
||||
(vector-cross! (-> s2-2 vector 2) (the-as vector (-> s2-2 vector)) (-> s2-2 vector 1))
|
||||
@@ -512,7 +512,7 @@
|
||||
(set! (-> this plane w) (- (vector-dot (-> s2-2 vector 2) (-> this root trans))))
|
||||
(let ((v0-8 (-> this root root-prim local-sphere)))
|
||||
(set! (-> v0-8 x) 0.0)
|
||||
(set! (-> v0-8 y) (* 0.00024414062 (* 0.5 arg1)))
|
||||
(set! (-> v0-8 y) (* 0.00024414062 (/ arg1 2)))
|
||||
(set! (-> v0-8 z) 0.0)
|
||||
(let ((f0-20 0.5)
|
||||
(f1-7 (* f30-1 f30-1))
|
||||
@@ -663,7 +663,7 @@
|
||||
0.0
|
||||
0.0
|
||||
0.0
|
||||
(let* ((f28-0 (/ 1.0 (* 0.00024414062 (-> arg1 omega))))
|
||||
(let* ((f28-0 (/ 1.0 (/ (-> arg1 omega) METER_LENGTH)))
|
||||
(f26-0 (* (rand-vu-float-range -136.53334 136.53334) f28-0))
|
||||
(f30-0 (* (rand-vu-float-range 0.0 136.53334) f28-0))
|
||||
(f0-8 (* (rand-vu-float-range -13.653334 54.613335) f28-0))
|
||||
@@ -1825,7 +1825,7 @@
|
||||
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
|
||||
(.svf (&-> s0-0 quad) vf6)
|
||||
(let ((f30-0 (vector-vector-xz-distance s4-0 s0-0)))
|
||||
(let ((f0-2 (* 0.0000012207031 f30-0))
|
||||
(let ((f0-2 (/ f30-0 (meters 200)))
|
||||
(a0-7 s4-0)
|
||||
)
|
||||
(let ((v1-10 s4-0))
|
||||
@@ -1899,7 +1899,7 @@
|
||||
)
|
||||
)
|
||||
(let ((s5-1 (new 'stack-no-clear 'quaternion)))
|
||||
(let ((f0-42 (/ 45511.11 (* 0.00024414062 f30-0))))
|
||||
(let ((f0-42 (/ 45511.11 (/ f30-0 METER_LENGTH))))
|
||||
(quaternion-axis-angle! s5-1 1.0 0.0 0.0 (fmax (fmin (-> this angle-guns) f0-42) (- f0-42)))
|
||||
)
|
||||
(quaternion*!
|
||||
|
||||
@@ -1033,8 +1033,8 @@
|
||||
(let* ((a0-1 (-> arg4 control))
|
||||
(v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans)))
|
||||
)
|
||||
(set! (-> arg1 vel-sxvel x) (* 0.083333336 (-> v1-1 x)))
|
||||
(set! (-> arg1 vel-sxvel y) (* 0.083333336 (-> v1-1 y)))
|
||||
(set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) 12))
|
||||
(set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) 12))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
@@ -1375,9 +1375,9 @@
|
||||
(let* ((a0-1 (-> arg4 control))
|
||||
(v1-1 (vector-! (new 'stack-no-clear 'vector) (-> arg2 x-y-z-sx) (-> a0-1 origin trans)))
|
||||
)
|
||||
(set! (-> arg1 vel-sxvel x) (* -0.008333334 (-> v1-1 x)))
|
||||
(set! (-> arg1 vel-sxvel y) (* -0.008333334 (-> v1-1 y)))
|
||||
(set! (-> arg1 vel-sxvel z) (* -0.008333334 (-> v1-1 z)))
|
||||
(set! (-> arg1 vel-sxvel x) (/ (-> v1-1 x) -120))
|
||||
(set! (-> arg1 vel-sxvel y) (/ (-> v1-1 y) -120))
|
||||
(set! (-> arg1 vel-sxvel z) (/ (-> v1-1 z) -120))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -168,11 +168,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this ctypal-broke-wall) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(format #t "~A initialising~%" (-> this name))
|
||||
(let ((s4-0 (new 'process 'collide-shape this (collide-list-enum usually-hit-by-player))))
|
||||
(let ((v1-2 (new 'process 'collide-shape-prim-mesh s4-0 (the-as uint 0) (the-as uint 0))))
|
||||
@@ -200,9 +200,9 @@ This commonly includes things such as:
|
||||
(format
|
||||
0
|
||||
"trans ~F ~F ~F~%"
|
||||
(* 0.00024414062 (-> v1-10 trans x))
|
||||
(* 0.00024414062 (-> v1-10 trans y))
|
||||
(* 0.00024414062 (-> v1-10 trans z))
|
||||
(/ (-> v1-10 trans x) METER_LENGTH)
|
||||
(/ (-> v1-10 trans y) METER_LENGTH)
|
||||
(/ (-> v1-10 trans z) METER_LENGTH)
|
||||
)
|
||||
)
|
||||
(set! (-> this ent) arg0)
|
||||
@@ -224,6 +224,7 @@ This commonly includes things such as:
|
||||
)
|
||||
|
||||
(defmethod run-logic? ((this ctypal-baron-statue-broken))
|
||||
"Should this process be run? Checked by execute-process-tree."
|
||||
#t
|
||||
)
|
||||
|
||||
@@ -235,11 +236,11 @@ This commonly includes things such as:
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defmethod init-from-entity! ((this ctypal-baron-statue-broken) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(initialize-skeleton
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
(quaternion-vector-angle!
|
||||
(-> arg1 root quat)
|
||||
*up-vector*
|
||||
(* 182.04445 (* 0.00024414062 (-> arg1 course spots 1 center w)))
|
||||
(* 182.04445 (/ (-> arg1 course spots 1 center w) METER_LENGTH))
|
||||
)
|
||||
(ai-task-control-method-12 (-> arg1 ai-ctrl) arg1)
|
||||
(go-to-waypoint! arg1 5 #f)
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
(quaternion-vector-angle!
|
||||
(-> arg1 root quat)
|
||||
*up-vector*
|
||||
(* 182.04445 (* 0.00024414062 (-> arg1 course spots 1 center w)))
|
||||
(* 182.04445 (/ (-> arg1 course spots 1 center w) METER_LENGTH))
|
||||
)
|
||||
(ai-task-control-method-12 (-> arg1 ai-ctrl) arg1)
|
||||
(go-to-waypoint! arg1 5 #f)
|
||||
|
||||
@@ -435,7 +435,7 @@
|
||||
(if (or (= (-> this incoming knocked-type) (knocked-type knocked-type-2))
|
||||
(= (-> this incoming knocked-type) (knocked-type knocked-type-3))
|
||||
)
|
||||
(set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed)))
|
||||
(set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2))
|
||||
)
|
||||
(let ((a0-47 (-> this skel root-channel 0)))
|
||||
(set! (-> a0-47 frame-group) (the-as art-joint-anim s4-0))
|
||||
|
||||
@@ -97,8 +97,8 @@
|
||||
;; WARN: Return type mismatch int vs enemy-aware.
|
||||
(defmethod update-target-awareness! ((this citizen) (arg0 process-focusable) (arg1 enemy-best-focus))
|
||||
"Checks a variety of criteria to determine the level of awareness the enemy is of the target. Sets `aware` and related fields as well!
|
||||
@TODO - flesh out docs
|
||||
@returns the value that sets `aware`"
|
||||
@TODO - flesh out docs
|
||||
@returns the value that sets `aware`"
|
||||
(when arg1
|
||||
(let ((f0-0 (vector-vector-distance (get-trans arg0 0) (-> this root trans))))
|
||||
(when (< f0-0 (-> arg1 rating))
|
||||
@@ -239,7 +239,7 @@
|
||||
|
||||
(defmethod general-event-handler ((this citizen) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('hit 'hit-flinch 'hit-knocked)
|
||||
(let ((v1-1 #f))
|
||||
@@ -357,9 +357,9 @@
|
||||
|
||||
(defmethod common-post ((this citizen))
|
||||
"Does a lot of various things relating to interacting with the target
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
(when (< (-> this next-time-look-at) (current-time))
|
||||
(when (nonzero? (-> this neck))
|
||||
(let ((a0-4 (handle->process (-> this focus handle))))
|
||||
@@ -587,7 +587,7 @@
|
||||
s5-1
|
||||
s5-1
|
||||
gp-0
|
||||
(* (fmax 0.5 (* 0.00024414062 (-> arg0 state speed))) (seconds-per-frame))
|
||||
(* (fmax 0.5 (/ (-> arg0 state speed) METER_LENGTH)) (seconds-per-frame))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -645,11 +645,11 @@
|
||||
;; WARN: Return type mismatch entity-perm-status vs none.
|
||||
(defmethod init-from-entity! ((this citizen) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(process-entity-status! this (entity-perm-status dead) #t)
|
||||
(none)
|
||||
)
|
||||
|
||||
@@ -254,7 +254,7 @@
|
||||
|
||||
(defmethod general-event-handler ((this civilian) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('track)
|
||||
#f
|
||||
@@ -950,7 +950,7 @@
|
||||
)
|
||||
(if (and (-> self allow-dive)
|
||||
(< (vector-length v1-8) (* (-> self dive-reaction) (vector-length (-> self cp-vec))))
|
||||
(< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (* 0.5 (-> self cp-sphere r)))
|
||||
(< (fabs (vector4-dot (-> self root trans) (the-as vector (-> self cp-plane)))) (/ (-> self cp-sphere r) 2))
|
||||
)
|
||||
(go-dive self)
|
||||
)
|
||||
|
||||
@@ -453,9 +453,9 @@
|
||||
|
||||
(defmethod common-post ((this crimson-guard))
|
||||
"Does a lot of various things relating to interacting with the target
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
(let ((t9-0 (method-of-type citizen common-post)))
|
||||
(t9-0 this)
|
||||
)
|
||||
@@ -494,7 +494,7 @@
|
||||
;; WARN: disable def twice: 122. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
|
||||
(defmethod general-event-handler ((this crimson-guard) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('hit 'hit-flinch 'hit-knocked)
|
||||
(speech-control-method-13 *speech-control* (the-as handle this))
|
||||
@@ -968,7 +968,7 @@
|
||||
(((knocked-type knocked-type-2))
|
||||
(ja-channel-push! 1 (seconds 0.1))
|
||||
(let ((a1-17 (-> this draw art-group data (-> this info knocked (-> this hit-face)))))
|
||||
(set! (-> arg0 anim-speed) (* 0.5 (-> arg0 anim-speed)))
|
||||
(set! (-> arg0 anim-speed) (/ (-> arg0 anim-speed) 2))
|
||||
(let ((a0-36 (-> this skel root-channel 0)))
|
||||
(set! (-> a0-36 frame-group) (the-as art-joint-anim a1-17))
|
||||
(set! (-> a0-36 param 0) (the float (+ (-> (the-as art-joint-anim a1-17) frames num-frames) -1)))
|
||||
@@ -1536,7 +1536,7 @@
|
||||
(set! (-> this target-vel) (vector-length (-> this target-vel-vec)))
|
||||
(let ((s5-4 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) (-> this target-pos))))
|
||||
(let* ((f0-3 (vector-length s5-4))
|
||||
(f0-4 (* 0.0000012207031 f0-3))
|
||||
(f0-4 (/ f0-3 (meters 200)))
|
||||
(a1-9 (-> this target-pos-predict))
|
||||
)
|
||||
(let ((v1-62 (-> this target-pos)))
|
||||
@@ -1941,7 +1941,7 @@
|
||||
(.svf (&-> a1-6 quad) vf6)
|
||||
)
|
||||
(let ((f30-2 (* 0.5 (vector-vector-xz-distance s5-0 s3-0))))
|
||||
(vector-normalize! s4-0 (* 0.5 f30-2))
|
||||
(vector-normalize! s4-0 (/ f30-2 2))
|
||||
(vector-normalize! s2-0 (* 2.0 f30-2))
|
||||
)
|
||||
(do-spline gp-0 s5-0 s4-0 s3-0 s2-0 0.9)
|
||||
@@ -3672,14 +3672,14 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod relocate ((this crimson-guard) (arg0 int))
|
||||
(defmethod relocate ((this crimson-guard) (offset int))
|
||||
(if (nonzero? (-> this joint))
|
||||
(&+! (-> this joint) arg0)
|
||||
(&+! (-> this joint) offset)
|
||||
)
|
||||
(if (nonzero? (-> this l-control))
|
||||
(&+! (-> this l-control) arg0)
|
||||
(&+! (-> this l-control) offset)
|
||||
)
|
||||
(call-parent-method this arg0)
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod init-enemy! ((this crimson-guard))
|
||||
|
||||
@@ -382,10 +382,12 @@
|
||||
)
|
||||
)
|
||||
)
|
||||
(suspend-for (seconds 0.6))
|
||||
(suspend-for (seconds 0.6)
|
||||
)
|
||||
(+! (-> self root trans y) -8192.0)
|
||||
(logior! (-> self draw status) (draw-control-status no-draw))
|
||||
(suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6))))
|
||||
(suspend-for (the int (* 300.0 (rnd-float-range self 0.0 0.6)))
|
||||
)
|
||||
(logclear! (-> self draw status) (draw-control-status no-draw))
|
||||
(go-virtual ambush-jumping)
|
||||
)
|
||||
@@ -550,7 +552,7 @@
|
||||
(set! (-> this last-change-dir) (the-as uint (current-time)))
|
||||
(set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7)))
|
||||
(let ((s3-2 (new 'stack-no-clear 'vector))
|
||||
(f0-9 (* 0.5 f30-0 (tan (-> this move-angle))))
|
||||
(f0-9 (* (/ f30-0 2) (tan (-> this move-angle))))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(if (-> this heading)
|
||||
|
||||
@@ -380,9 +380,9 @@
|
||||
|
||||
(defmethod common-post ((this metalhead-predator))
|
||||
"Does a lot of various things relating to interacting with the target
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
- tracks when the enemy was last drawn
|
||||
- looks at the target and handles attacking
|
||||
@TODO Not extremely well understood yet"
|
||||
(let ((t9-0 (method-of-type citizen-enemy common-post)))
|
||||
(t9-0 this)
|
||||
)
|
||||
@@ -395,7 +395,7 @@
|
||||
;; WARN: disable def twice: 21. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
|
||||
(defmethod general-event-handler ((this metalhead-predator) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
|
||||
"Handles various events for the enemy
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
|
||||
(case arg2
|
||||
(('attack)
|
||||
(set! (-> this shock-effect-end) (the-as int (+ (current-time) (seconds 1))))
|
||||
@@ -697,7 +697,7 @@
|
||||
(.sub.vf vf6 vf4 vf5 :mask #b111)
|
||||
(.svf (&-> sv-240 quad) vf6)
|
||||
(let* ((f0-5 (vector-length sv-240))
|
||||
(f0-6 (* 0.0000018780048 f0-5))
|
||||
(f0-6 (/ f0-5 (meters 130)))
|
||||
)
|
||||
(set! sv-256 (new 'stack-no-clear 'vector))
|
||||
(let ((s0-0 (new 'stack-no-clear 'vector))
|
||||
@@ -1090,8 +1090,8 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod relocate ((this metalhead-predator) (arg0 int))
|
||||
(call-parent-method this arg0)
|
||||
(defmethod relocate ((this metalhead-predator) (offset int))
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod init-enemy! ((this metalhead-predator))
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
|
||||
(defmethod add-new-supression-box ((this traffic-suppressor) (arg0 traffic-suppression-params))
|
||||
"Create a suppression box for these params.
|
||||
The param object is updated with the ID of the box and can be later used with update-box-from-params."
|
||||
The param object is updated with the ID of the box and can be later used with update-box-from-params."
|
||||
(set! (-> arg0 id) -1)
|
||||
(let ((v1-1 0))
|
||||
(b! #t cfg-4 :delay (nop!))
|
||||
@@ -445,7 +445,7 @@ The param object is updated with the ID of the box and can be later used with up
|
||||
|
||||
(defmethod deactivate-object ((this traffic-tracker) (arg0 int) (arg1 symbol))
|
||||
"Send a traffic-off event (or traffic-off-force) to deactivate an object, specified by index in active object array.
|
||||
Process is recycled and moved to reserved, if it deactivates."
|
||||
Process is recycled and moved to reserved, if it deactivates."
|
||||
(with-pp
|
||||
(let* ((s3-0 (-> this active-object-type-list arg0))
|
||||
(gp-0 'traffic-off)
|
||||
@@ -611,9 +611,8 @@ Process is recycled and moved to reserved, if it deactivates."
|
||||
(+! (-> s4-0 params position z) (* (-> s4-0 vector 0 x) f0-6))
|
||||
)
|
||||
)
|
||||
(set! (-> s4-0 vector 2 y) (+ (* 0.5 (-> s4-0 vector 2 x))
|
||||
(* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing))
|
||||
)
|
||||
(set! (-> s4-0 vector 2 y)
|
||||
(+ (/ (-> s4-0 vector 2 x) 2) (* (-> this rand) (-> this traffic inv-density-factor) (-> arg1 spawn-spacing)))
|
||||
)
|
||||
(vector-float*! (-> s4-0 params velocity) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 x))
|
||||
(vector-float*! (-> s4-0 vector 1) (the-as vector (-> s4-0 vector)) (-> s4-0 vector 2 y))
|
||||
@@ -1325,7 +1324,7 @@ Process is recycled and moved to reserved, if it deactivates."
|
||||
(set! decay-rate 1.5)
|
||||
)
|
||||
)
|
||||
(set! (-> v1-1 0 decay-rate) (* 0.1 decay-rate))
|
||||
(set! (-> v1-1 0 decay-rate) (/ decay-rate 10))
|
||||
(when (< (-> v1-1 0 danger-level) danger-level)
|
||||
(set! (-> v1-1 0 danger-level) danger-level)
|
||||
(set! (-> v1-1 0 sphere r) danger-radius)
|
||||
@@ -2131,9 +2130,8 @@ Process is recycled and moved to reserved, if it deactivates."
|
||||
|
||||
(defmethod traffic-engine-method-49 ((this traffic-engine) (los vector) (arg2 int) (target-status traffic-target-status))
|
||||
(local-vars
|
||||
;; og:preserve-this stack array -> pointer
|
||||
(guards (pointer crimson-guard))
|
||||
(guard-target-dists (pointer float))
|
||||
(guards (array crimson-guard))
|
||||
(guard-target-dists (array float))
|
||||
(guard-idx int)
|
||||
(sv-208 int)
|
||||
(sv-216 float)
|
||||
@@ -2180,9 +2178,8 @@ Process is recycled and moved to reserved, if it deactivates."
|
||||
(when (not (update-guard-status-spots target-pos))
|
||||
)
|
||||
(when (update-guard-status-spots target-pos)
|
||||
;; og:preserve-this stack array -> pointer
|
||||
(set! guards (new 'stack-no-clear 'array 'crimson-guard 16))
|
||||
(set! guard-target-dists (new 'stack-no-clear 'array 'float 16))
|
||||
(set! guards (the-as (array crimson-guard) (new 'stack 'boxed-array crimson-guard 16)))
|
||||
(set! guard-target-dists (the-as (array float) (new 'stack 'boxed-array float 16)))
|
||||
(set! guard-idx 0)
|
||||
(dotimes (guard-count (the-as int (-> this vehicle-tracker-array active-object-count)))
|
||||
(case (-> this vehicle-tracker-array active-object-type-list guard-count)
|
||||
@@ -2222,8 +2219,7 @@ Process is recycled and moved to reserved, if it deactivates."
|
||||
)
|
||||
)
|
||||
(dotimes (s4-1 guard-idx)
|
||||
;; og:preserve-this stack array -> pointer
|
||||
(let ((crimson-guard (-> (the-as (pointer crimson-guard) guards) s4-1)))
|
||||
(let ((crimson-guard (-> (the-as (array crimson-guard) guards) s4-1)))
|
||||
(when (= (-> crimson-guard move-index) -1)
|
||||
(set! sv-208 -1)
|
||||
;; og:preserve-this kinda hacky, was ps2 weird infinity.
|
||||
|
||||
@@ -1017,29 +1017,29 @@
|
||||
)
|
||||
|
||||
|
||||
(defmethod relocate ((this bikea) (arg0 int))
|
||||
(defmethod relocate ((this bikea) (offset int))
|
||||
(if (nonzero? (-> this fin-fl))
|
||||
(&+! (-> this fin-fl) arg0)
|
||||
(&+! (-> this fin-fl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-fr))
|
||||
(&+! (-> this fin-fr) arg0)
|
||||
(&+! (-> this fin-fr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rl))
|
||||
(&+! (-> this fin-rl) arg0)
|
||||
(&+! (-> this fin-rl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rr))
|
||||
(&+! (-> this fin-rr) arg0)
|
||||
(&+! (-> this fin-rr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this rudder))
|
||||
(&+! (-> this rudder) arg0)
|
||||
(&+! (-> this rudder) offset)
|
||||
)
|
||||
(if (nonzero? (-> this brake-l))
|
||||
(&+! (-> this brake-l) arg0)
|
||||
(&+! (-> this brake-l) offset)
|
||||
)
|
||||
(if (nonzero? (-> this brake-r))
|
||||
(&+! (-> this brake-r) arg0)
|
||||
(&+! (-> this brake-r) offset)
|
||||
)
|
||||
(call-parent-method this arg0)
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod allocate-and-init-cshape ((this bikea))
|
||||
@@ -1101,10 +1101,10 @@
|
||||
(f28-0 (* -13653.333 (-> this controls brake)))
|
||||
(s5-0 (new 'static 'vector :x 1.0 :w 1.0))
|
||||
)
|
||||
(quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (* -0.2 f26-0) f30-0))
|
||||
(quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (* 0.2 f26-0) f30-0))
|
||||
(quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5)))
|
||||
(quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5)))
|
||||
(quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- (/ f26-0 -5) f30-0))
|
||||
(quaternion-vector-angle! (-> this fin-fr rotation) s5-0 (- (/ f26-0 5) f30-0))
|
||||
(quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0)
|
||||
(quaternion-vector-angle! (-> this brake-l rotation) s5-0 f28-0)
|
||||
(quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0)
|
||||
@@ -1144,32 +1144,32 @@
|
||||
)
|
||||
|
||||
|
||||
(defmethod relocate ((this bikeb) (arg0 int))
|
||||
(defmethod relocate ((this bikeb) (offset int))
|
||||
(if (nonzero? (-> this fin-rl))
|
||||
(&+! (-> this fin-rl) arg0)
|
||||
(&+! (-> this fin-rl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rr))
|
||||
(&+! (-> this fin-rr) arg0)
|
||||
(&+! (-> this fin-rr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this rudder))
|
||||
(&+! (-> this rudder) arg0)
|
||||
(&+! (-> this rudder) offset)
|
||||
)
|
||||
(if (nonzero? (-> this rudder-f))
|
||||
(&+! (-> this rudder-f) arg0)
|
||||
(&+! (-> this rudder-f) offset)
|
||||
)
|
||||
(if (nonzero? (-> this brake-l))
|
||||
(&+! (-> this brake-l) arg0)
|
||||
(&+! (-> this brake-l) offset)
|
||||
)
|
||||
(if (nonzero? (-> this brake-r))
|
||||
(&+! (-> this brake-r) arg0)
|
||||
(&+! (-> this brake-r) offset)
|
||||
)
|
||||
(if (nonzero? (-> this flap-l))
|
||||
(&+! (-> this flap-l) arg0)
|
||||
(&+! (-> this flap-l) offset)
|
||||
)
|
||||
(if (nonzero? (-> this flap-r))
|
||||
(&+! (-> this flap-r) arg0)
|
||||
(&+! (-> this flap-r) offset)
|
||||
)
|
||||
(call-parent-method this arg0)
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod allocate-and-init-cshape ((this bikeb))
|
||||
@@ -1231,8 +1231,8 @@
|
||||
(f28-0 (* 13653.333 (-> this controls brake)))
|
||||
(s5-0 (new 'static 'vector :x 1.0 :w 1.0))
|
||||
)
|
||||
(quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5)))
|
||||
(quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5)))
|
||||
(quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0)
|
||||
(quaternion-vector-angle! (-> this rudder-f rotation) s5-0 (- f30-0))
|
||||
(quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0))
|
||||
@@ -1279,41 +1279,41 @@
|
||||
)
|
||||
|
||||
|
||||
(defmethod relocate ((this bikec) (arg0 int))
|
||||
(defmethod relocate ((this bikec) (offset int))
|
||||
(if (nonzero? (-> this fin-fl))
|
||||
(&+! (-> this fin-fl) arg0)
|
||||
(&+! (-> this fin-fl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-fr))
|
||||
(&+! (-> this fin-fr) arg0)
|
||||
(&+! (-> this fin-fr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rl))
|
||||
(&+! (-> this fin-rl) arg0)
|
||||
(&+! (-> this fin-rl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rr))
|
||||
(&+! (-> this fin-rr) arg0)
|
||||
(&+! (-> this fin-rr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin2-fl))
|
||||
(&+! (-> this fin2-fl) arg0)
|
||||
(&+! (-> this fin2-fl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin2-fr))
|
||||
(&+! (-> this fin2-fr) arg0)
|
||||
(&+! (-> this fin2-fr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this rudder))
|
||||
(&+! (-> this rudder) arg0)
|
||||
(&+! (-> this rudder) offset)
|
||||
)
|
||||
(if (nonzero? (-> this brake-l))
|
||||
(&+! (-> this brake-l) arg0)
|
||||
(&+! (-> this brake-l) offset)
|
||||
)
|
||||
(if (nonzero? (-> this brake-r))
|
||||
(&+! (-> this brake-r) arg0)
|
||||
(&+! (-> this brake-r) offset)
|
||||
)
|
||||
(if (nonzero? (-> this spoiler-l))
|
||||
(&+! (-> this spoiler-l) arg0)
|
||||
(&+! (-> this spoiler-l) offset)
|
||||
)
|
||||
(if (nonzero? (-> this spoiler-r))
|
||||
(&+! (-> this spoiler-r) arg0)
|
||||
(&+! (-> this spoiler-r) offset)
|
||||
)
|
||||
(call-parent-method this arg0)
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod allocate-and-init-cshape ((this bikec))
|
||||
@@ -1379,8 +1379,8 @@
|
||||
(quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f26-0)
|
||||
(quaternion-vector-angle! (-> this fin2-fl rotation) s5-0 (- f26-0))
|
||||
(quaternion-vector-angle! (-> this fin2-fr rotation) s5-0 f26-0)
|
||||
(quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (* 0.2 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (* 0.2 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ f26-0 (/ f30-0 5)))
|
||||
(quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (- f26-0) (/ f30-0 5)))
|
||||
(quaternion-vector-angle! (-> this rudder rotation) s5-0 f30-0)
|
||||
(quaternion-vector-angle! (-> this brake-l rotation) s5-0 (- f28-0))
|
||||
(quaternion-vector-angle! (-> this brake-r rotation) s5-0 f28-0)
|
||||
@@ -1440,11 +1440,11 @@
|
||||
)
|
||||
|
||||
|
||||
(defmethod relocate ((this guard-bike) (arg0 int))
|
||||
(defmethod relocate ((this guard-bike) (offset int))
|
||||
(if (nonzero? (-> this turret-jm))
|
||||
(&+! (-> this turret-jm) arg0)
|
||||
(&+! (-> this turret-jm) offset)
|
||||
)
|
||||
(call-parent-method this arg0)
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod start-jump ((this guard-bike))
|
||||
|
||||
@@ -1134,35 +1134,35 @@
|
||||
)
|
||||
|
||||
|
||||
(defmethod relocate ((this cara) (arg0 int))
|
||||
(defmethod relocate ((this cara) (offset int))
|
||||
(if (nonzero? (-> this steering-wheel-l))
|
||||
(&+! (-> this steering-wheel-l) arg0)
|
||||
(&+! (-> this steering-wheel-l) offset)
|
||||
)
|
||||
(if (nonzero? (-> this steering-wheel-r))
|
||||
(&+! (-> this steering-wheel-r) arg0)
|
||||
(&+! (-> this steering-wheel-r) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-fl))
|
||||
(&+! (-> this fin-fl) arg0)
|
||||
(&+! (-> this fin-fl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-fr))
|
||||
(&+! (-> this fin-fr) arg0)
|
||||
(&+! (-> this fin-fr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rl))
|
||||
(&+! (-> this fin-rl) arg0)
|
||||
(&+! (-> this fin-rl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rr))
|
||||
(&+! (-> this fin-rr) arg0)
|
||||
(&+! (-> this fin-rr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this rudder))
|
||||
(&+! (-> this rudder) arg0)
|
||||
(&+! (-> this rudder) offset)
|
||||
)
|
||||
(if (nonzero? (-> this rudder-l))
|
||||
(&+! (-> this rudder-l) arg0)
|
||||
(&+! (-> this rudder-l) offset)
|
||||
)
|
||||
(if (nonzero? (-> this rudder-r))
|
||||
(&+! (-> this rudder-r) arg0)
|
||||
(&+! (-> this rudder-r) offset)
|
||||
)
|
||||
(call-parent-method this arg0)
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod allocate-and-init-cshape ((this cara))
|
||||
@@ -1279,26 +1279,26 @@
|
||||
)
|
||||
|
||||
|
||||
(defmethod relocate ((this carb) (arg0 int))
|
||||
(defmethod relocate ((this carb) (offset int))
|
||||
(if (nonzero? (-> this steering-wheel-l))
|
||||
(&+! (-> this steering-wheel-l) arg0)
|
||||
(&+! (-> this steering-wheel-l) offset)
|
||||
)
|
||||
(if (nonzero? (-> this steering-wheel-r))
|
||||
(&+! (-> this steering-wheel-r) arg0)
|
||||
(&+! (-> this steering-wheel-r) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-fl))
|
||||
(&+! (-> this fin-fl) arg0)
|
||||
(&+! (-> this fin-fl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-fr))
|
||||
(&+! (-> this fin-fr) arg0)
|
||||
(&+! (-> this fin-fr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rl))
|
||||
(&+! (-> this fin-rl) arg0)
|
||||
(&+! (-> this fin-rl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rr))
|
||||
(&+! (-> this fin-rr) arg0)
|
||||
(&+! (-> this fin-rr) offset)
|
||||
)
|
||||
(call-parent-method this arg0)
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod allocate-and-init-cshape ((this carb))
|
||||
@@ -1411,29 +1411,29 @@
|
||||
)
|
||||
|
||||
|
||||
(defmethod relocate ((this carc) (arg0 int))
|
||||
(defmethod relocate ((this carc) (offset int))
|
||||
(if (nonzero? (-> this steering-wheel))
|
||||
(&+! (-> this steering-wheel) arg0)
|
||||
(&+! (-> this steering-wheel) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-fl))
|
||||
(&+! (-> this fin-fl) arg0)
|
||||
(&+! (-> this fin-fl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-fr))
|
||||
(&+! (-> this fin-fr) arg0)
|
||||
(&+! (-> this fin-fr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rl))
|
||||
(&+! (-> this fin-rl) arg0)
|
||||
(&+! (-> this fin-rl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin-rr))
|
||||
(&+! (-> this fin-rr) arg0)
|
||||
(&+! (-> this fin-rr) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin2-rl))
|
||||
(&+! (-> this fin2-rl) arg0)
|
||||
(&+! (-> this fin2-rl) offset)
|
||||
)
|
||||
(if (nonzero? (-> this fin2-rr))
|
||||
(&+! (-> this fin2-rr) arg0)
|
||||
(&+! (-> this fin2-rr) offset)
|
||||
)
|
||||
(call-parent-method this arg0)
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod allocate-and-init-cshape ((this carc))
|
||||
@@ -1503,10 +1503,10 @@
|
||||
(quaternion-vector-angle! (-> this steering-wheel rotation) s5-0 f0-3)
|
||||
(quaternion-vector-angle! (-> this fin-fl rotation) s5-0 (- f28-0))
|
||||
(quaternion-vector-angle! (-> this fin-fr rotation) s5-0 f28-0)
|
||||
(quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (* -0.2 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (* -0.2 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (* 0.2 f28-0) (* -0.8 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (* -0.2 f28-0) (* -0.8 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin-rl rotation) s5-0 (+ (* 0.8 f28-0) (/ f30-0 -5)))
|
||||
(quaternion-vector-angle! (-> this fin-rr rotation) s5-0 (+ (* -0.8 f28-0) (/ f30-0 -5)))
|
||||
(quaternion-vector-angle! (-> this fin2-rl rotation) s5-0 (+ (/ f28-0 5) (* -0.8 f30-0)))
|
||||
(quaternion-vector-angle! (-> this fin2-rr rotation) s5-0 (+ (/ f28-0 -5) (* -0.8 f30-0)))
|
||||
)
|
||||
0
|
||||
(none)
|
||||
@@ -1558,11 +1558,11 @@
|
||||
)
|
||||
|
||||
|
||||
(defmethod relocate ((this hellcat) (arg0 int))
|
||||
(defmethod relocate ((this hellcat) (offset int))
|
||||
(if (nonzero? (-> this turret-jm))
|
||||
(&+! (-> this turret-jm) arg0)
|
||||
(&+! (-> this turret-jm) offset)
|
||||
)
|
||||
(call-parent-method this arg0)
|
||||
(call-parent-method this offset)
|
||||
)
|
||||
|
||||
(defmethod allocate-and-init-cshape ((this hellcat))
|
||||
|
||||
@@ -173,7 +173,7 @@
|
||||
;; WARN: Return type mismatch object vs none.
|
||||
(defun calc-fade-vals ((arg0 float))
|
||||
"@unused just a debugging print function"
|
||||
(let* ((f1-1 (* 0.00024414062 arg0))
|
||||
(let* ((f1-1 (/ arg0 METER_LENGTH))
|
||||
(f0-3 (- f1-1 (the float (the int f1-1))))
|
||||
(f1-3 (* 4096.0 (- f1-1 f0-3)))
|
||||
(f1-5 (/ -1.0 (* (- 1.0 f0-3) f1-3)))
|
||||
@@ -230,14 +230,14 @@
|
||||
(init-vf0-vector)
|
||||
(let* ((f0-0 (rand-vu-float-range 1.0 1.33))
|
||||
(s4-1 (* arg3 f0-0))
|
||||
(s0-0 (fmin (* arg2 f0-0) (* 0.5 s4-1)))
|
||||
(s0-0 (fmin (* arg2 f0-0) (/ s4-1 2)))
|
||||
(s3-1 (new 'stack-no-clear 'inline-array 'vehicle-control-point 3))
|
||||
(s2-0 (-> this info))
|
||||
)
|
||||
(let ((a1-2 (-> s3-1 0 normal)))
|
||||
(let ((v1-2 arg0))
|
||||
(let ((a0-2 arg1))
|
||||
(let ((a2-2 (* 0.25 s4-1)))
|
||||
(let ((a2-2 (/ s4-1 4)))
|
||||
(.mov vf7 a2-2)
|
||||
)
|
||||
(.lvf vf5 (&-> a0-2 quad))
|
||||
@@ -265,13 +265,13 @@
|
||||
(let ((f0-14 (* 4.0 s0-0)))
|
||||
(set! (-> s3-1 1 local-pos w) f0-14)
|
||||
(set! (-> s3-1 1 normal w) f0-14)
|
||||
(set! (-> s3-1 1 normal x) (* 0.025 f0-14))
|
||||
(set! (-> s3-1 1 normal x) (/ f0-14 40))
|
||||
)
|
||||
(add! *simple-sprite-system* (the-as sprite-glow-data (-> s3-1 1)))
|
||||
(forward-up->quaternion (the-as quaternion (-> s3-1 0)) arg1 (the-as vector (-> this rbody state matrix)))
|
||||
(quaternion-rotate-local-x! (the-as quaternion (-> s3-1 0)) (the-as quaternion (-> s3-1 0)) 32768.0)
|
||||
(let ((v1-16 (-> s3-1 0 normal)))
|
||||
(let ((a0-10 (* 0.5 s4-1)))
|
||||
(let ((a0-10 (/ s4-1 2)))
|
||||
(.mov vf7 a0-10)
|
||||
)
|
||||
(.lvf vf5 (&-> arg1 quad))
|
||||
@@ -451,7 +451,7 @@
|
||||
(-> this info part-vel)
|
||||
(-> this rbody state lin-velocity)
|
||||
(-> s5-0 0 vector 1)
|
||||
(* 0.2 (-> this info max-engine-thrust) (+ 0.5 (-> this engine-power-factor)))
|
||||
(* (/ (-> this info max-engine-thrust) 5) (+ 0.5 (-> this engine-power-factor)))
|
||||
)
|
||||
(let ((v1-117 (-> this info part-vel))
|
||||
(a0-45 (-> this info part-vel))
|
||||
|
||||
@@ -323,7 +323,7 @@
|
||||
(-> gp-0 vec-12 x)
|
||||
)
|
||||
)
|
||||
(set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (* 0.1 (-> gp-0 vec-12 x))))))
|
||||
(set! (-> this aim-rot-vel s3-1) (* (-> this aim-rot-vel s3-1) (fmax 0.0 (- 1.0 (/ (-> gp-0 vec-12 x) 10)))))
|
||||
(+! (-> this aim-rot s3-1) (* (-> this aim-rot-vel s3-1) (-> gp-0 vec-12 x)))
|
||||
(when (or (zero? s3-1) (not (logtest? (-> this flags) (turret-flag no-rot-y-clamp))))
|
||||
(let ((f0-31 (-> this info rot-min s3-1)))
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
(let ((f1-5 (fmin (-> this water-height) (+ (-> s0-0 world-sphere y) (-> s0-0 world-sphere w)))))
|
||||
0.0
|
||||
(let* ((f2-5 (fmax -1.0 (fmin 1.0 (/ (- (-> this water-height) (-> s0-0 world-sphere y)) (-> s0-0 world-sphere w)))))
|
||||
(f30-0 (+ 0.5 (* -0.25 f2-5 f2-5 f2-5) (* 0.75 f2-5)))
|
||||
(f30-0 (+ 0.5 (* (/ f2-5 -4) f2-5 f2-5) (* 0.75 f2-5)))
|
||||
)
|
||||
(set! (-> s4-0 local-pos 0 y) (* 0.5 (+ f0-2 f1-5)))
|
||||
(let ((v1-18 (-> this rbody))
|
||||
@@ -303,8 +303,8 @@
|
||||
(let ((f1-20 (fmax 0.0 f0-38)))
|
||||
(+! (-> this lift-thrust s2-1) f1-20)
|
||||
(when (logtest? (rigid-body-object-flag flight-level-transition) (-> this flags))
|
||||
(+! (-> this roll-thrust 0) (* 0.05 f1-20))
|
||||
(+! (-> this roll-thrust 1) (* 0.05 f1-20))
|
||||
(+! (-> this roll-thrust 0) (/ f1-20 20))
|
||||
(+! (-> this roll-thrust 1) (/ f1-20 20))
|
||||
)
|
||||
)
|
||||
(vector-reset! (-> arg1 force))
|
||||
@@ -326,7 +326,7 @@
|
||||
(and (> (-> this flight-level-index) 0) (< f0-40 0.0) (< (-> arg1 velocity y) 0.0))
|
||||
)
|
||||
(vector-reset! (-> arg1 force))
|
||||
(let ((f0-43 (* -0.25 (-> this info inv-lift-thruster-count)))
|
||||
(let ((f0-43 (/ (-> this info inv-lift-thruster-count) -4))
|
||||
(f1-28 arg0)
|
||||
)
|
||||
(set! (-> arg1 force y) (* f0-43 (/ 1.0 f1-28) (-> this info info mass) (-> arg1 velocity y)))
|
||||
|
||||
@@ -151,11 +151,11 @@
|
||||
;; WARN: Return type mismatch entity-perm-status vs none.
|
||||
(defmethod init-from-entity! ((this vehicle) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(process-entity-status! this (entity-perm-status dead) #t)
|
||||
(none)
|
||||
)
|
||||
@@ -419,7 +419,7 @@ This commonly includes things such as:
|
||||
(let* ((v1-1 (-> this rbody state lin-velocity))
|
||||
(f0-4 (sqrtf (+ (* (-> v1-1 x) (-> v1-1 x)) (* (-> v1-1 z) (-> v1-1 z)))))
|
||||
(f0-6 (/ (- arg0 f0-4) arg0))
|
||||
(f1-6 (* 0.005 f0-6))
|
||||
(f1-6 (/ f0-6 200))
|
||||
)
|
||||
(set! (-> this controls throttle) (fmax 0.0 (fmin 1.0 (+ (-> this controls throttle) f1-6))))
|
||||
)
|
||||
|
||||
@@ -453,7 +453,7 @@
|
||||
(set! f1-6 (* f0-23 f0-23))
|
||||
)
|
||||
(if (not (logtest? (-> this flags) (rigid-body-object-flag riding)))
|
||||
(set! f1-6 (* 0.5 f1-6))
|
||||
(set! f1-6 (/ f1-6 2))
|
||||
)
|
||||
)
|
||||
(+! (-> this power-level)
|
||||
@@ -1230,7 +1230,7 @@
|
||||
)
|
||||
(when (< f0-9 (* f1-8 f1-8))
|
||||
(let ((f0-10 (vector-length (-> this root transv))))
|
||||
(seek! (-> this engine-power-factor) (* 0.000016276043 f0-10) (* 6.0 (seconds-per-frame)))
|
||||
(seek! (-> this engine-power-factor) (/ f0-10 (meters 15)) (* 6.0 (seconds-per-frame)))
|
||||
)
|
||||
(do-engine-sounds this)
|
||||
)
|
||||
@@ -1517,7 +1517,7 @@
|
||||
((or (logtest? (penetrate dark-giant) arg3)
|
||||
(and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'eco-dark))
|
||||
)
|
||||
(set! (-> s5-0 vector 2 y) (* 0.1 (-> s5-0 vector 2 y)))
|
||||
(set! (-> s5-0 vector 2 y) (/ (-> s5-0 vector 2 y) 10))
|
||||
(set! f0-2 (* 409600.0 (-> this info info mass)))
|
||||
(/ 0.4 (-> this info damage-factor))
|
||||
)
|
||||
|
||||
@@ -192,7 +192,7 @@
|
||||
(static-sound-name "sig-gun-powerup")
|
||||
(-> this powerup-sound-id)
|
||||
(the int (* 1024.0 f28-0))
|
||||
(the int (* 1524.0 (+ 0.5 (* 0.5 f30-0))))
|
||||
(the int (* 1524.0 (+ 0.5 (/ f30-0 2))))
|
||||
0
|
||||
(sound-group sfx)
|
||||
s4-0
|
||||
|
||||
@@ -1493,7 +1493,7 @@
|
||||
(until #f
|
||||
(suspend)
|
||||
(let* ((f0-1 (vector-length (-> self root transv)))
|
||||
(f0-3 (fmax 0.1 (* 0.000020345053 f0-1)))
|
||||
(f0-3 (fmax 0.1 (/ f0-1 (meters 12))))
|
||||
)
|
||||
(ja :num! (loop! f0-3))
|
||||
)
|
||||
@@ -1612,14 +1612,14 @@
|
||||
:code (behavior ()
|
||||
(ja-channel-push! 1 (seconds 0.15))
|
||||
(let* ((f0-0 (vector-length (-> self root transv)))
|
||||
(f0-2 (fmax 0.1 (* 0.000020345053 f0-0)))
|
||||
(f0-2 (fmax 0.1 (/ f0-0 (meters 12))))
|
||||
)
|
||||
(ja-no-eval :group! sig-chased-run-jump-land0-ja :num! (seek! max f0-2) :frame-num 0.0)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(let* ((f0-4 (vector-length (-> self root transv)))
|
||||
(f0-6 (fmax 0.1 (* 0.000020345053 f0-4)))
|
||||
(f0-6 (fmax 0.1 (/ f0-4 (meters 12))))
|
||||
)
|
||||
(ja :num! (seek! max f0-6))
|
||||
)
|
||||
@@ -1744,14 +1744,14 @@
|
||||
:code (behavior ()
|
||||
(ja-channel-push! 1 (seconds 0.15))
|
||||
(let* ((f0-0 (vector-length (-> self root transv)))
|
||||
(f0-2 (fmax 0.1 (* 0.000020345053 f0-0)))
|
||||
(f0-2 (fmax 0.1 (/ f0-0 (meters 12))))
|
||||
)
|
||||
(ja-no-eval :group! sig-chased-shoot-jump-land0-ja :num! (seek! max f0-2) :frame-num 0.0)
|
||||
)
|
||||
(until (ja-done? 0)
|
||||
(suspend)
|
||||
(let* ((f0-4 (vector-length (-> self root transv)))
|
||||
(f0-6 (fmax 0.1 (* 0.000020345053 f0-4)))
|
||||
(f0-6 (fmax 0.1 (/ f0-4 (meters 12))))
|
||||
)
|
||||
(ja :num! (seek! max f0-6))
|
||||
)
|
||||
|
||||
@@ -958,19 +958,19 @@
|
||||
(cond
|
||||
((or (not (and v1-6 (= v1-6 (-> this draw art-group data 3)))) (or (= (-> this jump-why) 4) (>= f2-1 8192.0)))
|
||||
(logior! (-> this bot-flags) (bot-flags bf23))
|
||||
(let ((f2-3 (fmax 12288.0 (* 0.5 f1-0)))
|
||||
(let ((f2-3 (fmax 12288.0 (/ f1-0 2)))
|
||||
(f1-3 (fmax (-> arg0 start-pos y) (-> arg0 dest-pos y)))
|
||||
)
|
||||
(- (fmax (+ (fmin (-> arg0 start-pos y) (-> arg0 dest-pos y)) f2-3) (+ 10240.0 f1-3)) f1-3)
|
||||
)
|
||||
)
|
||||
(else
|
||||
(fmax 2048.0 (* 0.2 f1-0))
|
||||
(fmax 2048.0 (/ f1-0 5))
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (* 0.000011111111 f0-2))
|
||||
(setup-from-to-height! (-> arg0 traj) (-> arg0 start-pos) (-> arg0 dest-pos) f1-4 (/ f0-2 90000))
|
||||
)
|
||||
)
|
||||
(none)
|
||||
|
||||
@@ -750,6 +750,7 @@
|
||||
)
|
||||
|
||||
(defmethod deactivate ((this elec-gate))
|
||||
"Make a process dead, clean it up, remove it from the active pool, and return to dead pool."
|
||||
(set-elec-scale-if-close! this 0.0)
|
||||
(call-parent-method this)
|
||||
(none)
|
||||
@@ -773,9 +774,9 @@
|
||||
|
||||
(defmethod set-state! ((this elec-gate))
|
||||
"If either [[actor-option::17]] is set on the [[elec-gate]] or the related subtask is completed
|
||||
make the gate `idle`.
|
||||
|
||||
Otherwise, the gate will be `active`."
|
||||
make the gate `idle`.
|
||||
|
||||
Otherwise, the gate will be `active`."
|
||||
(if (or (logtest? (actor-option user17) (-> this fact options))
|
||||
(and (-> this entity) (logtest? (-> this entity extra perm status) (entity-perm-status subtask-complete)))
|
||||
)
|
||||
@@ -788,11 +789,11 @@ Otherwise, the gate will be `active`."
|
||||
|
||||
(defmethod init-from-entity! ((this elec-gate) (arg0 entity-actor))
|
||||
"Typically the method that does the initial setup on the process, potentially using the [[entity-actor]] provided as part of that.
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
This commonly includes things such as:
|
||||
- stack size
|
||||
- collision information
|
||||
- loading the skeleton group / bones
|
||||
- sounds"
|
||||
(set! (-> this root) (new 'process 'trsqv))
|
||||
(process-drawable-from-entity! this arg0)
|
||||
(set! (-> this entity) arg0)
|
||||
@@ -841,7 +842,7 @@ This commonly includes things such as:
|
||||
(get-point-in-path! (-> this path-r) (new 'stack-no-clear 'vector) 0.0 'interp)
|
||||
)
|
||||
)
|
||||
(set! (-> this wall-xz) (* 0.5 (-> this wall-xz)))
|
||||
(set! (-> this wall-xz) (/ (-> this wall-xz) 2))
|
||||
(+! (-> this wall-xz) 4096.0)
|
||||
(set! (-> this wall-y)
|
||||
(fabs
|
||||
@@ -874,8 +875,8 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod set-elec-scale! ((this fort-elec-gate) (scale float))
|
||||
"Calls associated mood functions to set the scale with the value provided
|
||||
@see mood-funcs
|
||||
@see mood-funcs2"
|
||||
@see mood-funcs
|
||||
@see mood-funcs2"
|
||||
(set-fordumpa-electricity-scale! scale)
|
||||
(set-forresca-electricity-scale! scale (-> this palette-id))
|
||||
(set-forrescb-electricity-scale! scale (-> this palette-id))
|
||||
@@ -898,8 +899,8 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod set-elec-scale! ((this drill-elec-gate) (arg0 float))
|
||||
"Calls associated mood functions to set the scale with the value provided
|
||||
@see mood-funcs
|
||||
@see mood-funcs2"
|
||||
@see mood-funcs
|
||||
@see mood-funcs2"
|
||||
(set-drill-electricity-scale! arg0 (-> this palette-id))
|
||||
0
|
||||
(none)
|
||||
@@ -924,8 +925,8 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod set-elec-scale! ((this castle-elec-gate) (arg0 float))
|
||||
"Calls associated mood functions to set the scale with the value provided
|
||||
@see mood-funcs
|
||||
@see mood-funcs2"
|
||||
@see mood-funcs
|
||||
@see mood-funcs2"
|
||||
(set-castle-electricity-scale! arg0)
|
||||
0
|
||||
(none)
|
||||
@@ -995,8 +996,8 @@ This commonly includes things such as:
|
||||
|
||||
(defmethod set-elec-scale! ((this palroof-elec-gate) (arg0 float))
|
||||
"Calls associated mood functions to set the scale with the value provided
|
||||
@see mood-funcs
|
||||
@see mood-funcs2"
|
||||
@see mood-funcs
|
||||
@see mood-funcs2"
|
||||
(set-palroof-electricity-scale! arg0 (-> this palette-id))
|
||||
0
|
||||
(none)
|
||||
|
||||
@@ -675,7 +675,7 @@
|
||||
(set! (-> s2-0 quad) (-> (get-trans (the-as process-focusable s0-0) 3) quad))
|
||||
(let ((s1-2 (vector-! (new 'stack-no-clear 'vector) (-> this root trans) s2-0)))
|
||||
(let* ((f0-0 (vector-length s1-2))
|
||||
(f0-1 (* 0.0000030517579 f0-0))
|
||||
(f0-1 (/ f0-0 (meters 80)))
|
||||
(a0-7 s2-0)
|
||||
)
|
||||
(let ((v1-17 s2-0))
|
||||
|
||||
@@ -857,7 +857,7 @@
|
||||
(set! (-> this last-change-dir) (the-as uint (current-time)))
|
||||
(set! (-> this change-dir-time) (rand-vu-int-range (seconds 0.5) (seconds 0.7)))
|
||||
(let ((s3-2 (new 'stack-no-clear 'vector))
|
||||
(f0-9 (* 0.5 f30-0 (tan (-> this move-angle))))
|
||||
(f0-9 (* (/ f30-0 2) (tan (-> this move-angle))))
|
||||
(s2-0 (new 'stack-no-clear 'vector))
|
||||
)
|
||||
(if (-> this heading)
|
||||
|
||||
@@ -1372,10 +1372,10 @@
|
||||
(-> arg0 thrust s3-0)
|
||||
(+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0)))
|
||||
(fmax 0.0 (-> v0-6 y))
|
||||
(fabs (* 0.2 (-> v0-6 z)))
|
||||
(fabs (/ (-> v0-6 z) 5))
|
||||
(fmax 0.0 (-> s1-1 y))
|
||||
)
|
||||
(* 0.2 f30-0)
|
||||
(/ f30-0 5)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1397,7 +1397,7 @@
|
||||
(set! (-> *part-id-table* 721 init-specs 0 initial-valuef) (* f24-0 f0-14))
|
||||
(set! (-> arg0 thrust s3-0) f28-0)
|
||||
(let ((f0-15 (* f26-0 f0-14)))
|
||||
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-15))
|
||||
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-15 -2))
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1473,7 +1473,7 @@
|
||||
)
|
||||
(set! (-> *part-id-table* 721 init-specs 0 initial-valuef) f1-0)
|
||||
)
|
||||
(let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-0))))
|
||||
(let ((v1-29 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-0 -2))))
|
||||
(vector+! (-> s5-0 trans) s4-0 v1-29)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1453,7 +1453,7 @@
|
||||
(vector-normalize-copy! (-> s5-0 curve-matrix vector 2) s3-0 1.0)
|
||||
(vector-normalize-copy! (-> s5-0 curve-matrix trans) s4-0 1.0)
|
||||
(set! (-> s5-0 pos-index 0) (vector-dot s3-0 (-> s5-0 curve-matrix trans)))
|
||||
(set! (-> s5-0 pos-index 1) (/ (* 0.5 (-> s5-0 pos-index 0) (-> s5-0 pos-index 0)) (* 0.2 f28-0)))
|
||||
(set! (-> s5-0 pos-index 1) (/ (* (/ (-> s5-0 pos-index 0) 2) (-> s5-0 pos-index 0)) (/ f28-0 5)))
|
||||
(set! (-> s5-0 dist) (vector-dot (-> this dest-vel) (-> s5-0 curve-matrix trans)))
|
||||
(vector-normalize-copy! (-> s5-0 curve-matrix vector 1) s4-0 (-> this target-speed))
|
||||
(vector-! (the-as vector (-> s5-0 curve-matrix)) (-> s5-0 curve-matrix vector 1) s3-0)
|
||||
@@ -1674,9 +1674,9 @@
|
||||
(none)
|
||||
)
|
||||
|
||||
(defmethod relocate ((this hover-nav-control) (arg0 int))
|
||||
(defmethod relocate ((this hover-nav-control) (offset int))
|
||||
(if (nonzero? (-> this root))
|
||||
(&+! (-> this root) arg0)
|
||||
(&+! (-> this root) offset)
|
||||
)
|
||||
this
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
(let ((s4-0 (new 'stack-no-clear 'vector)))
|
||||
(set! (-> s4-0 quad) (-> arg0 quad))
|
||||
(let* ((f0-2 (vector-vector-distance s4-0 arg1))
|
||||
(s3-1 (+ (the int (* 0.000008138021 f0-2)) 1))
|
||||
(s3-1 (+ (the int (/ f0-2 (meters 30))) 1))
|
||||
(s2-0 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 move-dist) 110592.0))
|
||||
)
|
||||
(dotimes (s1-0 s3-1)
|
||||
|
||||
@@ -1210,10 +1210,10 @@
|
||||
(-> arg0 thrust s3-0)
|
||||
(+ (* 0.4 (fmax 0.0 (* (-> v0-6 x) s0-0)))
|
||||
(fmax 0.0 (-> v0-6 y))
|
||||
(fabs (* 0.2 (-> v0-6 z)))
|
||||
(fabs (/ (-> v0-6 z) 5))
|
||||
(fmax 0.0 (-> s1-1 y))
|
||||
)
|
||||
(* 0.2 f30-0)
|
||||
(/ f30-0 5)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -1237,7 +1237,7 @@
|
||||
(set! (-> *part-id-table* 721 init-specs 0 initial-valuef) (* f24-0 f0-15))
|
||||
(set! (-> arg0 thrust s3-0) f28-0)
|
||||
(let ((f0-16 (* f26-0 f0-15)))
|
||||
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (* -0.5 f0-16))
|
||||
(vector-normalize-copy! (new 'stack-no-clear 'vector) (-> s5-0 vector 1) (/ f0-16 -2))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1035,7 +1035,7 @@
|
||||
)
|
||||
)
|
||||
(let ((v1-17 (-> self nav)))
|
||||
(set! (-> v1-17 max-rotation-rate) (* 0.05 (-> *spyder-nav-enemy-info* maximum-rotation-rate)))
|
||||
(set! (-> v1-17 max-rotation-rate) (/ (-> *spyder-nav-enemy-info* maximum-rotation-rate) 20))
|
||||
)
|
||||
0
|
||||
(ja-channel-push! 2 (seconds 0.2))
|
||||
@@ -1067,8 +1067,7 @@
|
||||
(set! (-> self fire-info 0 quad) (-> s3-0 quad))
|
||||
(set! (-> self fire-info 1 quad) (-> s2-1 quad))
|
||||
)
|
||||
(suspend-for
|
||||
(seconds 0.2)
|
||||
(suspend-for (seconds 0.2)
|
||||
(set! f30-0 (seek f30-0 (lerp-scale 0.0 1.0 (the float s4-0) 0.0 8.0) (seconds-per-frame)))
|
||||
(ja :num! (loop!))
|
||||
(ja :chan 1 :num! (chan 0) :frame-interp0 f30-0 :frame-interp1 f30-0)
|
||||
|
||||
@@ -516,7 +516,7 @@
|
||||
(* 40.96 (seconds-per-frame))
|
||||
)
|
||||
)
|
||||
(let ((f30-0 (- 1.0 (fabs (* 0.000012207031 (-> self y-offset))))))
|
||||
(let ((f30-0 (- 1.0 (fabs (/ (-> self y-offset) (meters 20))))))
|
||||
(let ((f0-7 (* f30-0 f30-0)))
|
||||
(set-vector! (-> self root scale) f30-0 f30-0 f30-0 1.0)
|
||||
(let ((t9-1 vector-lerp!)
|
||||
@@ -552,7 +552,7 @@
|
||||
:code sleep-code
|
||||
:post (behavior ()
|
||||
(seek! (-> self y-offset) -81920.0 (* 49152.0 (seconds-per-frame)))
|
||||
(let ((f30-0 (- 1.0 (fabs (* 0.000012207031 (-> self y-offset))))))
|
||||
(let ((f30-0 (- 1.0 (fabs (/ (-> self y-offset) (meters 20))))))
|
||||
(let ((f0-5 (* f30-0 f30-0)))
|
||||
(set-vector! (-> self root scale) f30-0 f30-0 f30-0 1.0)
|
||||
(let ((t9-1 vector-lerp!)
|
||||
@@ -826,7 +826,8 @@
|
||||
(gun-buoy-method-183 self a1-1)
|
||||
)
|
||||
)
|
||||
(suspend-for (seconds 0.75))
|
||||
(suspend-for (seconds 0.75)
|
||||
)
|
||||
)
|
||||
(go-virtual hostile)
|
||||
)
|
||||
@@ -852,7 +853,8 @@
|
||||
(suspend)
|
||||
(ja :num! (seek!))
|
||||
)
|
||||
(suspend-for (seconds 2))
|
||||
(suspend-for (seconds 2)
|
||||
)
|
||||
(go-virtual exit-ambush)
|
||||
)
|
||||
:post gun-buoy-chase-post
|
||||
@@ -1093,7 +1095,7 @@
|
||||
(f1-1 (-> this elev-angle))
|
||||
(f0-7 (fmax -728.1778 (fmin 728.1778 f1-1)))
|
||||
(f1-2 (- f1-1 f0-7))
|
||||
(f2-3 (* 0.2 f1-2))
|
||||
(f2-3 (/ f1-2 5))
|
||||
(f30-0 (+ f0-7 (* 0.8 f1-2)))
|
||||
)
|
||||
(quaternion-vector-angle! s5-1 *x-vector* f2-3)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user