Files
jak-project/test/decompiler/reference/levels/jungle/jungle-elevator_REF.gc
T
ManDude 24578b64b9 proper support for hardcoded "time" types (#1141)
* hardcode `time-frame`things

* Update cam-states_REF.gc

* Update level-info_REF.gc

* update refs 1

* update refs 2

* update refs 3

* update refs 4

* update refs 5

* update detection and casting

* Update FormExpressionAnalysis.cpp

* update refs 6

* update mood decomp

* update refs 7

* update refs 8

* remove temp entity birth code

* update time-frame casts

* fix compiler

* hardcode stuff and fix some types

* fix some bitfield detection being wrong

* bug fixes

* detect seconds on adds with immediate

* update refs 9

* fix casts and rand-vu-int-range bugs (update refs 10)

* update refs 11

* update 12

* update 13

* update 14

* Update game-info_REF.gc

* improve cpad macros detection

* remove unused code

* update refs

* clang

* update source code

* Update cam-states.gc

* `lavatube-energy` finish

* update refs

* fix actor bank stuff

* Update navigate.gc

* reduce entity default stack size

* Update transformq-h.gc

* oops forgot these

* fix code and tests

* fix mood sound stuff

* Update load-dgo.gc

* Update README.md
2022-02-12 12:26:19 -05:00

187 lines
5.5 KiB
Common Lisp
Vendored
Generated

;;-*-Lisp-*-
(in-package goal)
;; definition of type jungle-elevator
(deftype jungle-elevator (plat-button)
((bottom-height float :offset-assert 240)
(teleport-if-below-y float :offset-assert 244)
(teleport-if-above-y float :offset-assert 248)
)
:heap-base #x90
:method-count-assert 33
:size-assert #xfc
:flag-assert #x21009000fc
)
;; definition for method 3 of type jungle-elevator
(defmethod inspect jungle-elevator ((obj jungle-elevator))
(let ((t9-0 (method-of-type plat-button inspect)))
(t9-0 obj)
)
(format #t "~T~Tbottom-height: ~f~%" (-> obj bottom-height))
(format #t "~T~Tteleport-if-below-y: ~f~%" (-> obj teleport-if-below-y))
(format #t "~T~Tteleport-if-above-y: ~f~%" (-> obj teleport-if-above-y))
obj
)
;; definition for method 26 of type jungle-elevator
(defmethod can-activate? jungle-elevator ((obj jungle-elevator))
(and ((method-of-type plat-button can-activate?) obj) (task-complete? *game-info* (game-task jungle-tower)))
)
;; failed to figure out what this is:
(defstate plat-button-move-downward (jungle-elevator)
:virtual #t
:enter
(behavior ()
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-downward) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> self draw light-index) (the-as uint 255))
(set! (-> self bottom-height) (-> jungle bottom-height))
(set! (-> jungle bottom-height) (-> jungleb bottom-height))
(send-event *target* 'reset-pickup 'eco)
(none)
)
:exit
(behavior ()
(set! (-> jungle bottom-height) (-> self bottom-height))
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-downward) exit)))
(if t9-0
(t9-0)
)
)
(none)
)
:trans
(behavior ()
(let ((s5-0 (new 'stack-no-clear 'vector))
(gp-0 (new 'stack-no-clear 'vector))
)
(set! (-> s5-0 quad) (-> self root-override trans quad))
(let ((t9-1 (-> (the-as (state plat-button) (find-parent-method jungle-elevator 23)) trans)))
(if t9-1
(t9-1)
)
)
(vector-! gp-0 (-> self root-override trans) s5-0)
(when (< (-> self path-pos) 0.9)
(move-by-vector! (-> *target* control) gp-0)
(send-event *target* 'reset-height)
)
)
(if (and (>= (-> self path-pos) 0.2) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)))
(load-commands-set! *level* (load-command-get-index *level* 'jungle 0))
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-button-move-upward (jungle-elevator)
:virtual #t
:enter
(behavior ()
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) enter)))
(if t9-0
(t9-0)
)
)
(set! (-> self draw light-index) (the-as uint 255))
(set! (-> self bottom-height) (-> jungle bottom-height))
(set! (-> jungle bottom-height) (-> jungleb bottom-height))
(set! (-> self grab-player?) (process-grab? *target*))
(none)
)
:exit
(behavior ()
(set! (-> jungle bottom-height) (-> self bottom-height))
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) exit)))
(if t9-0
(t9-0)
)
)
(none)
)
:trans
(behavior ()
(let ((t9-0 (-> (method-of-type plat-button plat-button-move-upward) trans)))
(if t9-0
(t9-0)
)
)
(if (and (< (-> self path-pos) 0.8) (< (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2)))
(load-commands-set! *level* (load-command-get-index *level* 'jungle 1))
)
(none)
)
)
;; failed to figure out what this is:
(defstate plat-button-at-end (jungle-elevator)
:virtual #t
:code
(behavior ()
(cond
((!= (-> self path-pos) 0.0)
(set! (-> self draw light-index) (the-as uint 1))
(let ((a1-1 (res-lump-struct (-> self entity) 'continue-name structure)))
(when a1-1
(let ((v1-4 (set-continue! *game-info* (the-as basic a1-1))))
(load-commands-set! *level* (-> v1-4 load-commands))
)
)
)
)
(else
(set! (-> self draw light-index) (the-as uint 255))
(load-commands-set! *level* '())
)
)
(let ((t9-4 (-> (method-of-type plat-button plat-button-at-end) code)))
(if t9-4
((the-as (function none :behavior plat-button) t9-4))
)
)
(none)
)
)
;; definition for method 30 of type jungle-elevator
(defmethod should-teleport? jungle-elevator ((obj jungle-elevator))
(let ((f0-0 (-> (camera-pos) y)))
(case (-> obj path-pos)
((0.0)
(when (< f0-0 (-> obj teleport-if-below-y))
(set! (-> obj draw light-index) (the-as uint 1))
(return #t)
)
)
((1.0)
(when (< (-> obj teleport-if-above-y) f0-0)
(set! (-> obj draw light-index) (the-as uint 255))
(return #t)
)
)
)
)
#f
)
;; definition for method 29 of type jungle-elevator
;; INFO: Return type mismatch symbol vs none.
(defmethod can-target-move? jungle-elevator ((obj jungle-elevator))
(let ((s5-0 (new 'stack-no-clear 'vector)))
(eval-path-curve! (-> obj path) s5-0 0.4 'interp)
(set! (-> obj teleport-if-above-y) (-> s5-0 y))
(eval-path-curve! (-> obj path) s5-0 0.6 'interp)
(set! (-> obj teleport-if-below-y) (-> s5-0 y))
)
(set! (-> obj draw light-index) (the-as uint 255))
(set! (-> obj bidirectional?) #f)
(set! (-> obj should-grab-player?) #t)
(none)
)