mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 21:27:52 -04:00
2969833b2d
- `speech` - `ambient` - `water-h` - `vol-h` - `generic-obs` - `carry-h` - `pilot-h` - `board-h` - `gun-h` - `flut-h` - `indax-h` - `lightjak-h` - `darkjak-h` - `target-util` - `history` - `collide-reaction-target` - `logic-target` - `sidekick` - `projectile` - `voicebox` - `ragdoll-edit` - most of `ragdoll` (not added to gsrc yet) - `curves` - `find-nearest` - `lightjak-wings` - `target-handler` - `target-anim` - `target` - `target2` - `target-swim` - `target-lightjak` - `target-invisible` - `target-death` - `target-gun` - `gun-util` - `board-util` - `target-board` - `board-states` - `mech-h` - `vol` - `vent` - `viewer` - `gem-pool` - `collectables` - `crates` - `secrets-menu` Additionally: - Detection of non-virtual state inheritance - Added a config file that allows overriding the process stack size set by `stack-size-set!` calls - Fix for integer multiplication with `r0` - Fixed detection for the following macros: - `static-attack-info` - `defpart` and `defpartgroup` (probably still needs adjustments, uses Jak 2 implementation at the moment) - `sound-play` (Jak 3 seems to always call `sound-play-by-name` with a `sound-group` of 0, so the macro has been temporarily defaulted to use that) One somewhat significant change made here that should be noted is that the return type of `process::init-from-entity!` was changed to `object`. I've been thinking about this for a while, since it looks a bit nicer without the `(none)` at the end and I have recently encountered init methods that early return `0`.
164 lines
4.6 KiB
Common Lisp
164 lines
4.6 KiB
Common Lisp
;;-*-Lisp-*-
|
|
(in-package goal)
|
|
|
|
;; name: projectile-h.gc
|
|
;; name in dgo: projectile-h
|
|
;; dgos: GAME
|
|
|
|
;; +++projectile-options
|
|
(defenum projectile-options
|
|
:bitfield #t
|
|
:type uint64
|
|
(po0 0)
|
|
(po1 1)
|
|
(po2 2)
|
|
(po3 3)
|
|
(po4 4)
|
|
(po5 5)
|
|
(po6 6)
|
|
(po7 7)
|
|
(po8 8)
|
|
(po9 9)
|
|
(po10 10)
|
|
(po11 11)
|
|
(po12 12)
|
|
(po13 13)
|
|
(po14 14)
|
|
(po15 15)
|
|
(po16 16)
|
|
(po17 17)
|
|
(po18 18)
|
|
(po19 19)
|
|
(po20 20)
|
|
(po21 21)
|
|
(po22 22)
|
|
(po23 23)
|
|
(po24 24)
|
|
(po25 25)
|
|
(po26 26)
|
|
(po27 27)
|
|
(po28 28)
|
|
(po29 29)
|
|
(po30 30)
|
|
(po31 31)
|
|
)
|
|
;; ---projectile-options
|
|
|
|
|
|
(declare-type projectile process)
|
|
(declare-type projectile-init-by-other-params structure)
|
|
(define-extern projectile-init-by-other (function projectile-init-by-other-params object :behavior projectile))
|
|
|
|
;; DECOMP BEGINS
|
|
|
|
(deftype projectile (process-drawable)
|
|
((parent (pointer process-drawable) :override)
|
|
(root collide-shape-moving :override)
|
|
(starting-pos vector :inline)
|
|
(starting-dir vector :inline)
|
|
(target-pos vector :inline)
|
|
(base-target-pos vector :inline)
|
|
(pre-move-transv vector :inline)
|
|
(timeout time-frame)
|
|
(spawn-time time-frame)
|
|
(options projectile-options)
|
|
(last-target handle)
|
|
(notify-handle handle)
|
|
(owner-handle handle)
|
|
(ignore-handle handle)
|
|
(update-velocity (function projectile none))
|
|
(move (function projectile none))
|
|
(pick-target (function projectile none))
|
|
(max-speed float)
|
|
(old-dist float 16)
|
|
(old-dist-count int32)
|
|
(hits int32)
|
|
(max-hits int32)
|
|
(tween float)
|
|
(attack-mode symbol)
|
|
(attack-id uint32)
|
|
(damage float)
|
|
(vehicle-damage-factor float)
|
|
(vehicle-impulse-factor float)
|
|
(charge-level float)
|
|
(sound-id sound-id)
|
|
(stop-speed meters)
|
|
(invinc-time time-frame)
|
|
(desired-target uint64)
|
|
(desired-target-pos vector :inline)
|
|
)
|
|
(:state-methods
|
|
die
|
|
dissipate
|
|
impact
|
|
moving
|
|
)
|
|
(:methods
|
|
(projectile-method-24 (_type_) none)
|
|
(projectile-method-25 (_type_) none)
|
|
(projectile-method-26 (_type_) none)
|
|
(projectile-method-27 (_type_) none)
|
|
(play-impact-sound (_type_ projectile-options) none)
|
|
(projectile-method-29 (_type_) none)
|
|
(setup-collision! (_type_) none)
|
|
(projectile-method-31 (_type_) none)
|
|
(projectile-method-32 (_type_) none)
|
|
(go-impact! (_type_) none)
|
|
(projectile-method-34 (_type_) none)
|
|
(event-handler! (_type_ process int symbol event-message-block) object)
|
|
(handle-proj-hit! (_type_ process event-message-block) object)
|
|
(deal-damage! (_type_ process event-message-block) symbol)
|
|
(made-impact? (_type_) symbol)
|
|
(projectile-method-39 (_type_) none)
|
|
(projectile-method-40 (_type_) int)
|
|
)
|
|
)
|
|
|
|
|
|
(deftype projectile-init-by-other-params (structure)
|
|
((pos vector :inline)
|
|
(vel vector :inline)
|
|
(target-pos vector :inline)
|
|
(target-handle uint64)
|
|
(ent entity)
|
|
(charge float)
|
|
(attack-id uint32)
|
|
(options projectile-options)
|
|
(notify-handle handle)
|
|
(owner-handle handle)
|
|
(ignore-handle handle)
|
|
(timeout time-frame)
|
|
(damage float)
|
|
(vehicle-damage-factor float)
|
|
(vehicle-impulse-factor float)
|
|
)
|
|
)
|
|
|
|
|
|
(defun spawn-projectile ((proj-type type) (params projectile-init-by-other-params) (parent-proc-tree process-tree) (pool dead-pool))
|
|
"Create a new process for a projectile of the given type."
|
|
(let ((s4-0 (get-process pool proj-type #x4000 1)))
|
|
(when s4-0
|
|
(let ((t9-1 (method-of-type process activate)))
|
|
(t9-1 s4-0 parent-proc-tree "projectile" (the-as pointer #x70004000))
|
|
)
|
|
(run-now-in-process s4-0 projectile-init-by-other params)
|
|
(-> s4-0 ppointer)
|
|
)
|
|
)
|
|
)
|
|
|
|
(deftype projectile-bounce (projectile)
|
|
((played-bounce-time time-frame)
|
|
(tumble-quat quaternion :inline)
|
|
(gravity float)
|
|
)
|
|
(:state-methods
|
|
sitting
|
|
)
|
|
(:methods
|
|
(projectile-bounce-method-42 (_type_) none)
|
|
(projectile-bounce-method-43 (_type_) none)
|
|
)
|
|
)
|