Files
jak-project/goal_src/engine/entity/entity.gc
T
Tyler Wilding 253d7996e8 decomp: almost all of the NPCs! (#748)
* all-types: add all missing `:heap-base`s

* decomp: error encountered when compiling `mayor`

`IR_StoreConstOffset::do_codegen can't handle this` for method `play-anim!`

* decomp: finalize `mayor`

* decomp: finish `bird-lady`

* decomp: finish `bird-lady-beach`

* decomp: finish `sculptor`

* decomp: finish `geologist`

* decomp: finish `oracle`

* decomp: finish `farmer` | `explorer` | almost `assistant`

blocked on sparticle-launch-group

* decomp: finish `sage`

* decomp: finish `gambler`

* decomp: finish `warrior`

* decomp: mostly finish `miners`, blocked by sp-launch-group

* fix issue in `sage`

* fix all the reference tests to use the new state stuff

* fix all of goal_src

* address feedback

* re-gen with `until` fixes
2021-08-18 21:33:31 -04:00

127 lines
3.1 KiB
Common Lisp

;;-*-Lisp-*-
(in-package goal)
;; name: entity.gc
;; name in dgo: entity
;; dgos: GAME, ENGINE
;; needs cleanup, but this does work!
(defun entity-by-name ((arg0 string))
(dotimes (s5-0 (-> *level* length))
(let ((s4-0 (the-as basic (-> *level* level s5-0))))
(when (= (-> (the-as level s4-0) status) 'active)
(let ((s3-0 (-> (the-as level s4-0) bsp actors)))
(when (nonzero? s3-0)
(dotimes (s2-0 (-> s3-0 length))
(let ((s1-0 (-> s3-0 data s2-0 actor)))
(if
(name=
(the-as
basic
((method-of-type res-lump get-property-struct)
(the-as res-lump s1-0)
'name
'interp
-1000000000.0
#f
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
arg0
)
(return (the entity s1-0))
)
)
)
)
)
(let ((s3-1 (-> (the-as level s4-0) bsp ambients)))
(when (nonzero? s3-1)
(dotimes (s2-1 (-> s3-1 length))
(let ((s1-1 (-> s3-1 data s2-1 ambient)))
(if
(name=
(the-as
basic
((method-of-type res-lump get-property-struct)
(the-as res-lump s1-1)
'name
'interp
-1000000000.0
#f
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
arg0
)
(return (the entity s1-1))
)
)
)
)
)
(set! s4-0 (-> (the-as level s4-0) bsp cameras))
(when (nonzero? (the-as (array entity-camera) s4-0))
(dotimes (s3-2 (-> (the-as (array entity-camera) s4-0) length))
(let ((s2-2 (-> (the-as (array entity-camera) s4-0) s3-2)))
(if
(name=
(the-as
basic
((method-of-type res-lump get-property-struct)
s2-2
'name
'interp
-1000000000.0
#f
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
arg0
)
(return (the entity s2-2))
)
)
)
)
)
)
)
(the-as entity #f)
)
(defun entity-by-type ((arg0 type))
(dotimes (s5-0 (-> *level* length))
(let ((v1-3 (-> *level* level s5-0)))
(when (= (-> v1-3 status) 'active)
(let ((s4-0 (-> v1-3 bsp actors)))
(when (nonzero? s4-0)
(dotimes (s3-0 (-> s4-0 length))
(let ((s2-0 (-> s4-0 data s3-0 actor)))
(if
(and
(type-type? (-> s2-0 type) entity-actor)
(= (-> s2-0 etype) arg0)
)
(return s2-0)
)
)
)
)
)
)
)
)
(the-as entity-actor #f)
)
;; TODO - for misty-teetertotter | rigid-body
(define-extern process-drawable-from-entity! (function process-drawable object none))
;; TODO - for misty-warehouse
(define-extern process-entity-status! (function process entity-perm-status symbol int))
;; TODO - for warrior
(define-extern entity-birth-no-kill (function entity none))