[decompiler] as-type and font method support (#3855)

Add support for `as-type` macro, and detecting inline font methods. This
works in all three games but I've only updated jak 3's goal_src for now.
Eventually I will go back and work through the others, but I want to get
more decompiler features in first.


![image](https://github.com/user-attachments/assets/5c31bf85-97b4-437c-bc4b-dc054e60551e)

---------

Co-authored-by: water111 <awaterford1111445@gmail.com>
This commit is contained in:
water111
2025-02-01 21:23:11 -05:00
committed by GitHub
parent d5590ab638
commit 48cb9bb787
645 changed files with 5391 additions and 16694 deletions
+3 -18
View File
@@ -293,12 +293,7 @@
;; definition for method 97 of type ashelin
(defmethod enemy-method-97 ((this ashelin))
(let* ((s5-0 (handle->process (-> this attacker-handle)))
(v1-3 (if (type? s5-0 process-focusable)
s5-0
)
)
)
(let ((v1-3 (the-as process (as-type (handle->process (-> this attacker-handle)) process-focusable))))
(when v1-3
(cond
((= (-> v1-3 type) target)
@@ -333,12 +328,7 @@
(empty)
)
(else
(let ((s4-0 (handle->process (-> this poi-handle))))
(set! s5-1 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(set! s5-1 (the-as process (as-type (handle->process (-> this poi-handle)) process-focusable)))
(if s5-1
(empty)
(set! s5-1 *target*)
@@ -352,12 +342,7 @@
(set! s5-1 v1-3)
)
(else
(let ((s4-1 (handle->process (-> this poi-handle))))
(set! s5-1 (if (type? s4-1 process-focusable)
s4-1
)
)
)
(set! s5-1 (the-as process (as-type (handle->process (-> this poi-handle)) process-focusable)))
(cond
(s5-1
(empty)
+17 -71
View File
@@ -122,12 +122,7 @@
;; WARN: Return type mismatch symbol vs none.
(defmethod reset-attacker! ((this bot))
(logclear! (-> this bot-flags) (bot-flags attacked))
(let* ((s5-0 (handle->process (-> this attacker-handle)))
(v1-5 (if (type? s5-0 process-focusable)
s5-0
)
)
)
(let ((v1-5 (the-as process (as-type (handle->process (-> this attacker-handle)) process-focusable))))
(if (and v1-5 (= (-> v1-5 type) target))
(set! (-> this attacker-handle) (the-as handle #f))
)
@@ -276,12 +271,7 @@
(dotimes (s3-0 *actor-list-length*)
(let ((v1-26 (-> *actor-list* s3-0)))
(when (logtest? (the-as collide-spec s4-0) (-> v1-26 root-prim prim-core collide-as))
(let* ((s2-0 (-> v1-26 process))
(a1-26 (if (type? s2-0 process-focusable)
s2-0
)
)
)
(let ((a1-26 (the-as process-drawable (as-type (-> v1-26 process) process-focusable))))
(when a1-26
(set-next-focus! this (the-as enemy a1-26) (the-as enemy-best-focus (&-> s5-0 next)))
(if (-> s5-0 next)
@@ -309,12 +299,7 @@
(t9-0 this arg0 arg1 arg2 arg3)
)
(logclear! (-> this bot-flags) (bot-flags bf03 bf04))
(let* ((s3-0 (handle->process (-> this incoming attacker-handle)))
(s5-0 (if (type? s3-0 process-focusable)
s3-0
)
)
)
(let ((s5-0 (the-as process (as-type (handle->process (-> this incoming attacker-handle)) process-focusable))))
(when s5-0
(cond
((= (-> s5-0 type) target)
@@ -398,23 +383,12 @@
;; definition for method 180 of type bot
(defmethod clear-poi-and-focus! ((this bot))
"Clear our point of interest and focus handles."
(let* ((s4-0 (handle->process (-> this poi-handle)))
(s5-0 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(let ((s5-0 (the-as process (as-type (handle->process (-> this poi-handle)) process-focusable))))
(when s5-0
(set! (-> this poi-handle) (the-as handle #f))
(let ((s4-1 (handle->process (-> this focus handle))))
(if (= (if (type? s4-1 process-focusable)
s4-1
)
s5-0
)
(clear-focused (-> this focus))
)
)
(if (= (the-as process (as-type (handle->process (-> this focus handle)) process-focusable)) s5-0)
(clear-focused (-> this focus))
)
)
)
(none)
@@ -482,12 +456,7 @@
;; definition for method 97 of type bot
(defmethod enemy-method-97 ((this bot))
(let* ((s5-0 (handle->process (-> this attacker-handle)))
(v1-3 (if (type? s5-0 process-focusable)
s5-0
)
)
)
(let ((v1-3 (the-as process (as-type (handle->process (-> this attacker-handle)) process-focusable))))
(when v1-3
(cond
((= (-> v1-3 type) target)
@@ -522,12 +491,7 @@
(empty)
)
(else
(let ((s4-0 (handle->process (-> this poi-handle))))
(set! s5-1 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(set! s5-1 (the-as process (as-type (handle->process (-> this poi-handle)) process-focusable)))
(if s5-1
(empty)
(set! s5-1 *target*)
@@ -541,12 +505,7 @@
(set! s5-1 v1-3)
)
(else
(let ((s4-1 (handle->process (-> this poi-handle))))
(set! s5-1 (if (type? s4-1 process-focusable)
s4-1
)
)
)
(set! s5-1 (the-as process (as-type (handle->process (-> this poi-handle)) process-focusable)))
(cond
(s5-1
(empty)
@@ -691,12 +650,7 @@
(dotimes (i *actor-list-length*)
(let ((actor (-> *actor-list* i)))
(when (logtest? (the-as int coll-spec) (-> actor root-prim prim-core collide-as))
(let* ((proc (-> actor process))
(enemy (if (type? proc process-focusable)
proc
)
)
)
(let ((enemy (the-as process-drawable (as-type (-> actor process) process-focusable))))
(if (and enemy
enemy
(not (logtest? (-> (the-as process-focusable enemy) focus-status) (focus-status disable dead)))
@@ -857,13 +811,9 @@
(('notify)
(case (-> arg3 param 0)
(('attack)
(let ((s5-2 (-> arg3 param 1)))
(when (if (type? s5-2 process-focusable)
s5-2
)
(logior! (-> this enemy-flags) (enemy-flag victory))
(set-time! (-> this hit-focus-time))
)
(when (the-as uint (as-type (-> arg3 param 1) process-focusable))
(logior! (-> this enemy-flags) (enemy-flag victory))
(set-time! (-> this hit-focus-time))
)
#t
)
@@ -986,13 +936,9 @@
)
(else
(when (!= (-> arg0 type) target)
(let* ((touch-entry (-> arg1 param 0))
(s2-0 arg0)
(v1-6 (if (type? s2-0 process-focusable)
s2-0
)
)
)
(let ((touch-entry (-> arg1 param 0))
(v1-6 (the-as process (as-type arg0 process-focusable)))
)
(cond
((and (focus-test? this dangerous)
(logtest? (process-mask enemy) (-> arg0 mask))
+2 -12
View File
@@ -404,12 +404,7 @@
(('notify)
(case (-> arg3 param 0)
(('hit-by)
(let* ((s4-0 arg0)
(v1-2 (if (type? s4-0 bot)
s4-0
)
)
)
(let ((v1-2 (the-as process (as-type arg0 bot))))
(when v1-2
(when (= (-> (the-as process (-> arg3 param 1)) type) target)
(logior! (-> this bot-flags) (ash 1 (+ (-> (the-as bot v1-2) slave-id) 19)))
@@ -419,12 +414,7 @@
)
)
(('mission-failed)
(let* ((s4-1 arg0)
(s5-1 (if (type? s4-1 bot)
s4-1
)
)
)
(let ((s5-1 (the-as process (as-type arg0 bot))))
(when s5-1
(when (not (logtest? (-> this bot-flags) (bot-flags too-far-fail)))
(when (not (logtest? (-> this bot-flags) (bot-flags bf09)))
+2 -6
View File
@@ -397,13 +397,9 @@
)
)
(let* ((v1-24 (-> (the-as sig arg0) actor-group 0 data (-> this actor-index) actor))
(s3-1 (when v1-24
(let ((s2-0 (-> v1-24 extra process)))
(if (type? s2-0 process-focusable)
s2-0
)
(s3-1 (if v1-24
(the-as process (as-type (-> v1-24 extra process) process-focusable))
)
)
)
)
(cond
+4 -24
View File
@@ -254,12 +254,7 @@
;; definition for method 97 of type sig
(defmethod enemy-method-97 ((this sig))
(let* ((s5-0 (handle->process (-> this attacker-handle)))
(s4-0 (if (type? s5-0 process-focusable)
s5-0
)
)
)
(let ((s4-0 (the-as process (as-type (handle->process (-> this attacker-handle)) process-focusable))))
(when s4-0
(cond
((= (-> s4-0 type) target)
@@ -302,12 +297,7 @@
(empty)
)
(else
(let ((s4-1 (handle->process (-> this poi-handle))))
(set! s5-1 (if (type? s4-1 process-focusable)
s4-1
)
)
)
(set! s5-1 (the-as process (as-type (handle->process (-> this poi-handle)) process-focusable)))
(if s5-1
(empty)
(set! s5-1 *target*)
@@ -329,12 +319,7 @@
)
(else
(when (not (logtest? (bot-flags bf19) (-> this bot-flags)))
(let ((s4-2 (handle->process (-> this poi-handle))))
(set! s5-1 (if (type? s4-2 process-focusable)
s4-2
)
)
)
(set! s5-1 (the-as process (as-type (handle->process (-> this poi-handle)) process-focusable)))
(cond
(s5-1
(empty)
@@ -1428,12 +1413,7 @@
(a0-14 (-> v1-33 root-prim))
)
(when (logtest? (collide-spec hit-by-others-list pusher) (-> a0-14 prim-core collide-as))
(let* ((s1-0 (-> v1-33 process))
(s2-0 (if (type? s1-0 process-focusable)
s1-0
)
)
)
(let ((s2-0 (the-as process-drawable (as-type (-> v1-33 process) process-focusable))))
(when s2-0
(let ((f0-6 (vector-vector-distance-squared s5-0 (get-trans (the-as process-focusable s2-0) 0))))
(when (or (< f30-0 0.0) (< f0-6 f30-0))
+1 -5
View File
@@ -1281,11 +1281,7 @@
;; definition for method 30 of type battle
(defmethod get-spawner-for-enemy ((this battle) (arg0 process))
(let ((v1-0 (if (type? arg0 nav-enemy)
(the-as nav-enemy arg0)
)
)
)
(let ((v1-0 (as-type arg0 nav-enemy)))
(when v1-0
(dotimes (a0-3 (-> this spawners length))
(let* ((a1-5 (-> this spawners data a0-3))
+1 -6
View File
@@ -411,12 +411,7 @@
(sv-288 symbol)
(sv-304 symbol)
)
(let* ((target *target*)
(proc-focus (if (type? target process-focusable)
target
)
)
)
(let ((proc-focus (the-as target (as-type *target* process-focusable))))
(when proc-focus
(let ((focus-trans (get-trans proc-focus 0)))
(let* ((a0-3 (vector-! (new 'stack-no-clear 'vector) focus-trans (-> self dividing-wall pos)))
@@ -868,12 +868,7 @@
(set! (-> v1-4 action-mask) (collide-action solid))
)
(when (>= (fill-and-probe-using-line-sphere *collide-cache* s4-0) 0.0)
(let* ((s3-0 (-> s4-0 best-other-tri collide-ptr))
(s4-1 (if (type? s3-0 collide-shape-prim-sphere)
(the-as collide-shape-prim-sphere s3-0)
)
)
)
(let ((s4-1 (as-type (-> s4-0 best-other-tri collide-ptr) collide-shape-prim-sphere)))
(when s4-1
(set! (-> s5-0 y) 0.0)
(vector-normalize! s5-0 1.0)
@@ -943,12 +938,7 @@
;; definition for method 70 of type amphibian
(defmethod go-hostile ((this amphibian))
(let* ((s4-0 (handle->process (-> this attacker-handle)))
(s5-0 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(let ((s5-0 (the-as process (as-type (handle->process (-> this attacker-handle)) process-focusable))))
(when s5-0
(set! (-> this attacker-handle) (the-as handle #f))
(when (collide-check? (-> this focus) (the-as process-focusable s5-0))
+12 -29
View File
@@ -862,12 +862,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod flitter-method-180 ((this flitter))
(let* ((s5-0 (handle->process (-> this focus handle)))
(s3-0 (if (type? s5-0 process-focusable)
(the-as process-focusable s5-0)
)
)
)
(let ((s3-0 (as-type (handle->process (-> this focus handle)) process-focusable)))
(when s3-0
(let* ((s5-1 (get-trans s3-0 0))
(s4-1 (vector-! (new 'stack-no-clear 'vector) s5-1 (-> this root trans)))
@@ -946,12 +941,8 @@
(local-vars (v1-29 symbol))
(stop-looking-at-target! self)
(set! (-> self skel root-channel 0 frame-group) arg0)
(let ((s4-1 (enemy-method-50 self (new 'stack-no-clear 'vector)))
(s3-0 (-> self root))
)
(when (if (type? s3-0 collide-shape-moving)
s3-0
)
(let ((s4-1 (enemy-method-50 self (new 'stack-no-clear 'vector))))
(when (as-type (-> self root) collide-shape-moving)
(set! (-> self root transv y) 33775.48)
(ja :num-func num-func-identity :frame-num 0.0)
(set-time! (-> self state-time))
@@ -1058,18 +1049,15 @@
(cond
((= v1-11 (enemy-aware enemy-aware-3))
(cond
((when gp-0
(let* ((gp-1 self)
(s5-1 (method-of-object gp-1 flitter-method-182))
(s4-0 (handle->process (-> self focus handle)))
)
(s5-1 gp-1 (the-as process-focusable (if (type? s4-0 process-focusable)
s4-0
)
)
)
((if gp-0
(flitter-method-182
self
(the-as
process-focusable
(the-as process (as-type (handle->process (-> self focus handle)) process-focusable))
)
)
)
)
(if (and (get-enemy-target self) (time-elapsed? (the-as int (-> self off-screen-timer)) (seconds 0.3)))
(go-hostile self)
)
@@ -1204,12 +1192,7 @@
)
:trans (behavior ()
(local-vars (s5-2 object))
(let* ((s5-0 (handle->process (-> self focus handle)))
(gp-0 (if (type? s5-0 process-focusable)
(the-as process-focusable s5-0)
)
)
)
(let ((gp-0 (as-type (handle->process (-> self focus handle)) process-focusable)))
(set! s5-2 (cond
((and gp-0
(not (time-elapsed? (-> self state-time) (seconds 1.5)))
+2 -15
View File
@@ -316,12 +316,7 @@
(dotimes (group-idx (-> this actor-group-count))
(let ((group (-> this actor-group group-idx)))
(dotimes (actor-idx (-> group length))
(let* ((actor-proc (-> group data actor-idx actor extra process))
(fodder-proc (if (type? actor-proc fodder)
(the-as fodder actor-proc)
)
)
)
(let ((fodder-proc (as-type (-> group data actor-idx actor extra process) fodder)))
(when (and fodder-proc (!= fodder-proc this) (time-elapsed? (-> fodder-proc look-at-other-time) (seconds 0.25)))
(let* ((dir-to-other-fodder
(vector-! (new 'stack-no-clear 'vector) (-> fodder-proc root trans) (-> this root trans))
@@ -379,15 +374,7 @@
(let ((proc (the-as process-drawable #f)))
(cond
((and (not (time-elapsed? (-> this look-at-other-time) (seconds 0.5)))
(begin
(let ((other-proc (handle->process (-> this look-at-other))))
(set! proc (if (type? other-proc process-drawable)
(the-as process-drawable other-proc)
)
)
)
proc
)
(begin (set! proc (as-type (handle->process (-> this look-at-other)) process-drawable)) proc)
)
(let ((s5-1 (vector<-cspace! (new 'static 'vector) (-> proc node-list data 5))))
(look-at-position! this s5-1)
+1 -6
View File
@@ -480,12 +480,7 @@
)
)
)
(let* ((gp-1 *target*)
(a0-4 (if (type? gp-1 process-focusable)
gp-1
)
)
)
(let ((a0-4 (the-as target (as-type *target* process-focusable))))
(when a0-4
(let* ((gp-2 (-> self root))
(s3-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) (get-trans a0-4 0) (-> gp-2 trans)) 1.0))
@@ -1223,12 +1223,7 @@
)
(('hit 'hit-flinch 'hit-knocked)
(speech-control-method-13 *speech-control* (the-as handle this))
(let* ((s1-0 (handle->process (-> this incoming attacker-handle)))
(a0-13 (if (type? s1-0 process-focusable)
s1-0
)
)
)
(let ((a0-13 (the-as process (as-type (handle->process (-> this incoming attacker-handle)) process-focusable))))
(if (and a0-13 (logtest? (-> a0-13 mask) (process-mask target)))
(speech-control-method-12 *speech-control* this (speech-type speech-type-11))
)
@@ -1385,22 +1380,18 @@
((< (fill-and-probe-using-line-sphere *collide-cache* s5-0) 0.0)
0
)
((and (the-as basic (as-type (-> s5-0 best-other-tri collide-ptr) collide-shape-prim))
(< (vector-dot
(-> s5-0 best-other-tri normal)
(vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri)))
)
0.0
)
)
2
)
(else
(let ((s4-1 (-> s5-0 best-other-tri collide-ptr)))
(if (and (if (type? s4-1 collide-shape-prim)
s4-1
)
(< (vector-dot
(-> s5-0 best-other-tri normal)
(vector-! (new 'stack-no-clear 'vector) arg2 (the-as vector (-> s5-0 best-other-tri)))
)
0.0
)
)
2
0
)
)
0
)
)
)
@@ -2602,13 +2593,9 @@
(set-point! (-> this l-control) 1 s5-0)
(set! (-> this l-control spec) (-> *lightning-spec-id-table* 13))
(+! (-> this l-control state points-to-draw) 2)
(let* ((s4-1 (-> s3-0 best-other-tri collide-ptr))
(v1-45 (if (type? s4-1 collide-shape-prim)
(the-as collide-shape-prim s4-1)
)
)
(s4-2 #t)
)
(let ((v1-45 (as-type (-> s3-0 best-other-tri collide-ptr) collide-shape-prim))
(s4-2 #t)
)
(when v1-45
(set! s4-2 #f)
(if (logtest? (-> v1-45 prim-core collide-as) (collide-spec jak bot))
@@ -3820,12 +3807,7 @@
;; definition for method 201 of type crimson-guard-level
;; WARN: Return type mismatch int vs none.
(defmethod crimson-guard-level-method-201 ((this crimson-guard-level) (arg0 float))
(let* ((s3-0 (handle->process (-> this transport)))
(s4-0 (if (type? s3-0 process-focusable)
(the-as process-focusable s3-0)
)
)
)
(let ((s4-0 (as-type (handle->process (-> this transport)) process-focusable)))
(when s4-0
(let ((s2-0 (matrix<-transformq! (new 'stack-no-clear 'matrix) (the-as transformq (-> s4-0 root trans))))
(s3-1 (new 'stack-no-clear 'vector))
@@ -874,12 +874,7 @@
)
)
(let ((gp-0 (-> self dest-pos)))
(let* ((s5-0 (handle->process (-> self focus handle)))
(a0-6 (if (type? s5-0 process-focusable)
s5-0
)
)
)
(let ((a0-6 (the-as process (as-type (handle->process (-> self focus handle)) process-focusable))))
(set! (-> gp-0 quad) (-> (get-trans (the-as process-focusable a0-6) 0) quad))
)
(+! (-> gp-0 y) -20480.0)
@@ -1194,12 +1189,7 @@
(hover-enemy-method-153 this)
)
(when (> (-> this hit-points) 0)
(let* ((s1-0 (handle->process (-> this incoming attacker-handle)))
(v1-23 (if (type? s1-0 process-focusable)
s1-0
)
)
)
(let ((v1-23 (the-as process (as-type (handle->process (-> this incoming attacker-handle)) process-focusable))))
(if (and *target* v1-23 (let ((f0-0 (vector-vector-distance-squared (-> this root trans) (-> this focus-pos)))
(f1-0 122880.0)
)
@@ -176,12 +176,7 @@
(hover-formation-method-15 a0-2 gp-0 (-> self offset))
)
(else
(let* ((s5-0 (handle->process (-> self focus handle)))
(a0-7 (if (type? s5-0 process-focusable)
s5-0
)
)
)
(let ((a0-7 (the-as process (as-type (handle->process (-> self focus handle)) process-focusable))))
(cond
(a0-7
(let* ((s5-1 (get-trans (the-as process-focusable a0-7) 3))
@@ -477,16 +472,12 @@
(hover-enemy-method-141 self 1.0)
)
)
(let* ((gp-0 *target*)
(s1-0 (if (type? gp-0 process-focusable)
gp-0
)
)
(gp-1 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
(s4-0 (-> self root))
(s5-0 (get-point-at-percent-along-path! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp))
)
(let ((s1-0 (the-as target (as-type *target* process-focusable)))
(gp-1 (new 'stack-no-clear 'vector))
(s2-0 (new 'stack-no-clear 'vector))
(s4-0 (-> self root))
(s5-0 (get-point-at-percent-along-path! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp))
)
(let ((s0-0 (get-point-at-percent-along-path! (-> self path) (new 'stack-no-clear 'vector) 1.0 'interp))
(s3-1
(-> (the-as collide-shape-prim-group (-> self root root-prim))
@@ -16,18 +16,10 @@
;; definition for method 16 of type hover-formation-control
(defmethod hover-formation-control-method-16 ((this hover-formation-control))
(let ((gp-0 (hover-formation-control-method-13 this (new 'stack-no-clear 'vector)))
(s4-0 (cond
((-> this anchor-proc)
(let ((s3-0 (handle->process (-> this anchor-proc))))
(if (type? s3-0 process-focusable)
(the-as process-focusable s3-0)
)
)
)
(else
(s4-0 (if (-> this anchor-proc)
(as-type (handle->process (-> this anchor-proc)) process-focusable)
*target*
)
)
)
)
(and s4-0
@@ -61,18 +53,10 @@
)
)
)
(s3-0 (cond
((-> this anchor-proc)
(let ((s2-0 (handle->process (-> this anchor-proc))))
(if (type? s2-0 process-focusable)
(the-as process-focusable s2-0)
)
)
)
(else
(s3-0 (if (-> this anchor-proc)
(as-type (handle->process (-> this anchor-proc)) process-focusable)
*target*
)
)
)
)
(cond
@@ -116,18 +100,10 @@
)
)
)
(a0-7 (cond
((-> this anchor-proc)
(let ((s4-0 (handle->process (-> this anchor-proc))))
(if (type? s4-0 process-focusable)
(the-as process-focusable s4-0)
)
)
)
(else
(a0-7 (if (-> this anchor-proc)
(as-type (handle->process (-> this anchor-proc)) process-focusable)
*target*
)
)
)
)
(cond
@@ -312,18 +288,10 @@
(vector-rotate-y! arg0 arg1 arg2)
(cond
((logtest? (-> this flags) 2)
(let ((s2-0 (cond
((-> this anchor-proc)
(let ((s4-0 (handle->process (-> this anchor-proc))))
(if (type? s4-0 process-focusable)
(the-as process-focusable s4-0)
)
)
)
(else
(let ((s2-0 (if (-> this anchor-proc)
(as-type (handle->process (-> this anchor-proc)) process-focusable)
*target*
)
)
)
(s4-1 (hover-formation-control-method-15 this (new 'stack-no-clear 'vector) arg0))
(s3-0 (new 'stack-no-clear 'vector))
@@ -402,12 +370,7 @@
(set! (-> s5-0 best-cost) -1.0)
(set! (-> s5-0 count) 0)
(dotimes (s4-0 16)
(let* ((s3-0 (handle->process (-> this actor-table s4-0)))
(a0-8 (if (type? s3-0 process-focusable)
(the-as process-focusable s3-0)
)
)
)
(let ((a0-8 (as-type (handle->process (-> this actor-table s4-0)) process-focusable)))
(cond
(a0-8
(set! (-> s5-0 actor-position s4-0 quad) (-> (get-trans a0-8 3) quad))
@@ -925,12 +925,7 @@
(let ((v1-2 (the-as list-node (-> this sphere-list))))
(while v1-2
(let ((s5-0 (-> v1-2 next)))
(let* ((s3-0 (handle->process (-> (the-as hover-nav-sphere v1-2) handle)))
(s4-0 (if (type? s3-0 hover-enemy)
s3-0
)
)
)
(let ((s4-0 (the-as process (as-type (handle->process (-> (the-as hover-nav-sphere v1-2) handle)) hover-enemy))))
(when s4-0
(let ((a1-9 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-9 from) (process->ppointer pp))
+3 -7
View File
@@ -496,13 +496,9 @@
;; definition for method 104 of type metalmonk
;; INFO: Used lq/sq
(defmethod enemy-method-104 ((this metalmonk) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint))
(let* ((s3-0 arg0)
(a0-2 (if (type? s3-0 process-focusable)
s3-0
)
)
(s3-1 (new 'stack-no-clear 'vector))
)
(let ((a0-2 (the-as process (as-type arg0 process-focusable)))
(s3-1 (new 'stack-no-clear 'vector))
)
(let ((s1-0 (new 'stack-no-clear 'vector)))
(vector-! s3-1 (get-trans (the-as process-focusable a0-2) 0) (-> this root trans))
(set! (-> s3-1 y) 0.0)
+1 -6
View File
@@ -63,12 +63,7 @@
;; definition for method 45 of type com-elevator
(defmethod commited-to-ride? ((this com-elevator))
"@returns if the target is considered within the elevator area enough to begin descending/ascending"
(let* ((s5-0 *target*)
(a0-2 (if (type? s5-0 process-focusable)
s5-0
)
)
)
(let ((a0-2 (the-as target (as-type *target* process-focusable))))
(and (when a0-2
(let* ((v1-2 (get-trans a0-2 0))
(s5-2 (vector-! (new 'stack-no-clear 'vector) v1-2 (-> this root trans)))
@@ -130,12 +130,7 @@
(case message
(('touched)
(when (+ (current-time) (seconds -2))
(let* ((s3-0 proc)
(proc-draw (if (type? s3-0 process-drawable)
(the-as process-drawable s3-0)
)
)
)
(let ((proc-draw (as-type proc process-drawable)))
(when proc-draw
(let ((spike-quat (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))
(touched-from-dir (vector-normalize!
+24 -69
View File
@@ -52,13 +52,9 @@
(s4-0 (new 'stack-no-clear 'vector))
)
(set! (-> s4-0 quad) (-> s5-0 transv quad))
(let* ((f30-0 (vector-length s4-0))
(s1-0 *target*)
(a0-2 (if (type? s1-0 process-focusable)
s1-0
)
)
)
(let ((f30-0 (vector-length s4-0))
(a0-2 (the-as target (as-type *target* process-focusable)))
)
(when a0-2
(let ((s1-1 (new 'stack-no-clear 'vector)))
(set! (-> s1-1 quad) (-> (get-trans a0-2 0) quad))
@@ -487,12 +483,7 @@
(nav-enemy-method-166 self)
(logior! (-> self flags) (gun-buoy-flags gubflags-0))
(logior! (-> self water flags) (water-flags touch-water))
(let* ((gp-0 *target*)
(s3-0 (if (type? gp-0 process-focusable)
gp-0
)
)
)
(let ((s3-0 (the-as target (as-type *target* process-focusable))))
(cond
(s3-0
(let ((s4-0 (new 'stack-no-clear 'vector)))
@@ -636,12 +627,7 @@
(ja-channel-push! 1 (seconds 0.075))
(let ((f30-0 (rnd-float-range self 0.8 1.2)))
(new 'stack-no-clear 'vector)
(let* ((gp-0 (handle->process (-> self focus handle)))
(a0-6 (if (type? gp-0 process-focusable)
gp-0
)
)
)
(let ((a0-6 (the-as process (as-type (handle->process (-> self focus handle)) process-focusable))))
(if (and a0-6 (focus-test? (the-as process-focusable a0-6) board))
(set! f30-0 (* 2.0 f30-0))
)
@@ -728,12 +714,7 @@
(set! (-> self warning-interval) (seconds 0.1))
)
(else
(let* ((gp-0 (handle->process (-> self focus handle)))
(v1-6 (if (type? gp-0 process-focusable)
gp-0
)
)
)
(let ((v1-6 (the-as process (as-type (handle->process (-> self focus handle)) process-focusable))))
(cond
((focus-test? (the-as process-focusable v1-6) board)
(set! (-> self warning-interval) (seconds 0.5))
@@ -830,13 +811,9 @@
)
)
)
(let ((gp-0 *target*))
(if (if (type? gp-0 process-focusable)
gp-0
)
(go-virtual attack)
)
)
(if (the-as target (as-type *target* process-focusable))
(go-virtual attack)
)
)
)
:code sleep-code
@@ -854,12 +831,7 @@
)
)
)
(let* ((s5-0 (handle->process (-> self focus handle)))
(gp-0 (if (type? s5-0 process-focusable)
s5-0
)
)
)
(let ((gp-0 (the-as process (as-type (handle->process (-> self focus handle)) process-focusable))))
(if (and gp-0 (focus-test? (the-as process-focusable gp-0) dead))
(go-virtual victory)
)
@@ -870,12 +842,7 @@
)
:code (behavior ()
(dotimes (gp-0 4)
(let* ((s5-0 *target*)
(a1-1 (if (type? s5-0 process-focusable)
s5-0
)
)
)
(let ((a1-1 (the-as target (as-type *target* process-focusable))))
(if a1-1
(gun-buoy-method-183 self a1-1)
)
@@ -946,12 +913,7 @@
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(-> this root)
(let* ((s4-0 *target*)
(s5-0 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(let ((s5-0 (the-as target (as-type *target* process-focusable))))
(cond
(s5-0
(let* ((s2-1 (vector-normalize-copy!
@@ -1048,22 +1010,18 @@
(-> this fact)
(let ((v1-10
(or (not (and (-> this next-state) (= (-> this next-state name) 'dormant-aware)))
(let ((s2-0 arg0))
(cond
((if (type? s2-0 target)
s2-0
)
(let ((v1-12 arg0))
(and v1-12
(or (focus-test? v1-12 on-water under-water)
(= (-> (the-as collide-shape-moving (-> v1-12 root)) ground-pat material) (pat-material waterbottom))
)
)
)
(cond
((the-as process-focusable (as-type arg0 target))
(let ((v1-12 arg0))
(and v1-12
(or (focus-test? v1-12 on-water under-water)
(= (-> (the-as collide-shape-moving (-> v1-12 root)) ground-pat material) (pat-material waterbottom))
)
)
)
(else
(< f30-0 (+ 16384.0 f28-0))
)
)
(else
(< f30-0 (+ 16384.0 f28-0))
)
)
)
@@ -1072,10 +1030,7 @@
(and v1-10
(begin
(set! f30-1 (-> this enemy-info notice-nav-radius))
(set! v1-19 (if (type? arg0 target)
arg0
)
)
(set! v1-19 (the-as process-focusable (as-type arg0 target)))
v1-19
)
(and (and v1-19
+1 -6
View File
@@ -782,12 +782,7 @@
(case arg2
(('touch 'bonk 'attack)
(set! sv-144 (the-as vector (send-event (ppointer->process (-> this parent)) 'widow-get-center)))
(let* ((s1-0 arg0)
(s0-0 (if (type? s1-0 process-drawable)
s1-0
)
)
)
(let ((s0-0 (the-as process (as-type arg0 process-drawable))))
(let ((v1-5 sv-144))
(b! (not v1-5) cfg-15 :likely-delay (set! v1-6 sv-144))
)
+1 -6
View File
@@ -787,12 +787,7 @@
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touched)
(let* ((s4-0 proc)
(v1-1 (if (type? s4-0 process-drawable)
(the-as process-drawable s4-0)
)
)
)
(let ((v1-1 (as-type proc process-drawable)))
(when v1-1
(let ((s4-1 (-> v1-1 root))
(a1-3 (new 'stack 'collide-query))
+9 -23
View File
@@ -317,32 +317,22 @@
(set! (-> this strings 0 scale) 0.0)
(set! (-> s1-0 origin x) 45.0)
(set! (-> s1-0 origin y) 20.0)
(let ((v1-15 s1-0))
(set! (-> v1-15 width) (the float 422))
)
(let ((v1-16 s1-0))
(set! (-> v1-16 height) (the float 80))
)
(set-width! s1-0 422)
(set-height! s1-0 80)
(let ((a0-12 s1-0))
(set! (-> a0-12 color) (font-color red))
)
(let ((a0-13 s1-0))
(set! (-> a0-13 flags) (font-flags kerning middle middle-vert large))
)
(let ((v1-19 s1-0))
(set! (-> v1-19 scale) 1.0)
)
(set-scale! s1-0 1.0)
(cond
((zero? (-> s5-0 finish-count))
(set! s0-0 80)
(let ((v1-21 s1-0))
(set! (-> v1-21 scale) 1.6)
)
(when (= (-> *setting-control* user-default language) (language-enum german))
(let ((v1-24 s1-0))
(set! (-> v1-24 scale) 1.0)
(set-scale! s1-0 1.6)
(if (= (-> *setting-control* user-default language) (language-enum german))
(set-scale! s1-0 1.0)
)
)
(set! sv-112 print-game-text)
(let ((a0-20 (lookup-text! *common-text* (text-id race-you-win) #f))
(a2-2 #f)
@@ -354,14 +344,10 @@
)
(else
(set! s0-0 80)
(let ((v1-27 s1-0))
(set! (-> v1-27 scale) 1.6)
)
(when (= (-> *setting-control* user-default language) (language-enum german))
(let ((v1-30 s1-0))
(set! (-> v1-30 scale) 1.0)
(set-scale! s1-0 1.6)
(if (= (-> *setting-control* user-default language) (language-enum german))
(set-scale! s1-0 1.0)
)
)
(set! sv-128 print-game-text)
(let ((a0-26 (lookup-text! *common-text* (text-id race-you-lose) #f))
(a1-5 s1-0)
+15 -31
View File
@@ -601,13 +601,11 @@
)
)
(((race-state-enum player-get-on))
(let* ((f30-0 (* 0.0033333334 (the float (- (-> this current-time) (-> this countdown-start-time)))))
(s4-0 (handle->process (-> this racer-array (-> this i-player) racer)))
(s5-1 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(let ((f30-0 (* 0.0033333334 (the float (- (-> this current-time) (-> this countdown-start-time)))))
(s5-1
(the-as process (as-type (handle->process (-> this racer-array (-> this i-player) racer)) process-focusable))
)
)
(cond
((< f30-0 1.0)
(when s5-1
@@ -630,12 +628,10 @@
)
)
(((race-state-enum player-set-pos))
(let* ((s4-2 (handle->process (-> this racer-array (-> this i-player) racer)))
(s5-3 (if (type? s4-2 process-focusable)
s4-2
)
)
)
(let ((s5-3
(the-as process (as-type (handle->process (-> this racer-array (-> this i-player) racer)) process-focusable))
)
)
(when s5-3
(cubic-curve-method-10 (-> this player-intro-curve) (-> (the-as process-focusable s5-3) root trans) 1.0)
(vector-reset! (-> (the-as process-focusable s5-3) root transv))
@@ -1255,15 +1251,9 @@
(new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning))
)
)
(let ((v1-4 gp-1))
(set! (-> v1-4 scale) 0.7)
)
(let ((v1-5 gp-1))
(set! (-> v1-5 width) (the float 225))
)
(let ((v1-6 gp-1))
(set! (-> v1-6 height) (the float 70))
)
(set-scale! gp-1 0.7)
(set-width! gp-1 225)
(set-height! gp-1 70)
(set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2)))))
(set! (-> gp-1 origin y) 320.0)
(set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large))
@@ -1285,15 +1275,9 @@
(new 'stack 'font-context *font-default-matrix* 70 20 0.0 (font-color orange) (font-flags shadow kerning))
)
)
(let ((v1-4 gp-1))
(set! (-> v1-4 scale) 0.7)
)
(let ((v1-5 gp-1))
(set! (-> v1-5 width) (the float 240))
)
(let ((v1-6 gp-1))
(set! (-> v1-6 height) (the float 35))
)
(set-scale! gp-1 0.7)
(set-width! gp-1 240)
(set-height! gp-1 35)
(set! (-> gp-1 origin x) (the float (- 256 (the int (/ (-> gp-1 width) 2)))))
(set! (-> gp-1 origin y) 320.0)
(set! (-> gp-1 flags) (font-flags shadow kerning middle middle-vert large))
+3 -9
View File
@@ -612,15 +612,9 @@
(new 'stack 'font-context *font-default-matrix* 32 320 0.0 (font-color default) (font-flags shadow kerning))
)
)
(let ((v1-51 gp-0))
(set! (-> v1-51 width) (the float 340))
)
(let ((v1-52 gp-0))
(set! (-> v1-52 height) (the float 80))
)
(let ((v1-53 gp-0))
(set! (-> v1-53 scale) 0.9)
)
(set-width! gp-0 340)
(set-height! gp-0 80)
(set-scale! gp-0 0.9)
(set! (-> gp-0 flags) (font-flags shadow kerning large))
(print-game-text
(lookup-text! *common-text* (text-id press-triangle-to-use) #f)