jak-project/goal_src/jak2/engine/target/target-h.gc

383 lines
18 KiB
Common Lisp
Raw Normal View History

;;-*-Lisp-*-
(in-package goal)
;; name: target-h.gc
;; name in dgo: target-h
;; dgos: ENGINE, GAME
(declare-type sidekick process-drawable)
(declare-type gun process-drawable)
(declare-type racer-info basic)
(declare-type tube-info basic)
(declare-type flut-info basic)
(declare-type board-info basic)
(declare-type pilot-info basic)
(declare-type gun-info basic)
(declare-type darkjak-info basic)
(declare-type mech-info basic)
(declare-type indax-info basic)
decomp: `hover-*` files, `wasp`, `crimson-guard-hover`, `flamer`, `target-turret`, `drill-turret`, `jellyfish` (#2198) Manual patches: - `drill-turret`: The static data for `*turret-13-path*`, `*turret-14-path*` and `*turret-15-path*` was decompiled by hand and the integers in the `set-speed-mult` events have been replaced with boxed integer arrays that contain only that integer in order to make the compiler happy. To that effect, the event handler in `target-turret` was changed to access that array instead of just accessing the int. - `hover-nav-control`: In `hover-nav-control::10`, `arg2` is usually a `vector`, but there are some places where it is called with `#t` as `arg2` and, subsequently, crashes the game because it tries to access the `quad` of `arg2` if `arg2` is truthy. To mitigate this, the condition `arg2` has been replaced with `(and (!= arg2 #t) arg2)` (in this case, it would jump to the `else` that just resets the `dest-vel` and `transv` `quad`s) - `drill-baron`: The static data for `*drill-ship-turret-speed-event*` has been decompiled by hand. TODOs: - Jellyfish crash the game - Destroying the metalhead eggs that are on the breakable wall crashes the game (already happened with the Peacemaker before) - Figure out why static data of type `turret-path-event` doesn't decompile The docs for all the hover-nav and nav-network code could use some love in the future, I'm not smart enough to figure out what any of that code actually means, but it seems to work... Also threw in the fix for the ▲ that was accidentally left commented out.
2023-02-09 18:22:56 -05:00
(declare-type turret-info basic)
(declare-type sparticle-launcher basic)
2022-08-28 16:13:42 -04:00
;; NOTE - for level-info, defined in `logic-target`
(define-extern start (function symbol continue-point target))
;; for target
(define-extern want-to-darkjak? (function symbol :behavior target))
(define-extern can-feet? (function symbol symbol :behavior target))
(define-extern slide-down-test (function none :behavior target))
(define-extern target-standard-event-handler (function process int symbol event-message-block object :behavior target))
(define-extern target-state-hook-exit (function none :behavior target))
(define-extern move-legs? (function symbol :behavior target))
(define-extern can-duck? (function symbol :behavior target))
(define-extern can-jump? (function symbol symbol :behavior target))
(define-extern target-jump-go (function none :behavior target))
(define-extern can-hands? (function symbol symbol :behavior target))
(define-extern target-stance-anim (function none :behavior target))
(define-extern target-effect-exit (function none :behavior target))
(define-extern can-roll? (function symbol :behavior target))
(define-extern target-walk-event-handler (function process int symbol event-message-block object :behavior target))
(define-extern target-walk-anim (function int none :behavior target))
(define-extern set-forward-vel (function float vector :behavior target))
(define-extern ja-done? (function int symbol :behavior process-drawable))
(define-extern delete-back-vel (function none :behavior target))
(define-extern target-top-anim-base-mode (function int none :behavior target))
(define-extern target-jump-event-handler (function process int symbol event-message-block object :behavior target))
(define-extern ja-group-size (function int :behavior process-drawable))
(define-extern target-falling-anim (function int time-frame symbol :behavior target))
(define-extern *uppercut-jump-mods* surface)
(define-extern ja-eval (function int :behavior process-drawable))
(define-extern target-land-effect (function none :behavior target))
(define-extern target-hit-ground-anim (function symbol symbol none :behavior target))
(define-extern are-still? (function symbol :behavior target))
(define-extern *attack-end-mods* surface)
(define-extern target-dangerous-event-handler (function process int symbol event-message-block object :behavior target))
(define-extern target-start-attack (function none :behavior target))
(define-extern target-danger-set! (function symbol symbol none :behavior target))
(define-extern smack-surface? (function symbol symbol :behavior target))
(define-extern target-height-above-ground (function float :behavior target))
(define-extern target-align-vel-z-adjust (function float float :behavior target))
2022-11-12 17:56:07 -05:00
(define-extern part-tracker-init (function sparticle-launch-group time-frame (function part-tracker none) (pointer process-drawable) process matrix none :behavior part-tracker))
(define-extern target-bonk-event-handler (function process int symbol event-message-block object :behavior target))
(define-extern target-attack-air-anim (function none :behavior target))
(define-extern *uppercut-mods* surface)
(define-extern touch-tracker-init (function vector float time-frame none :behavior touch-tracker))
;; target-util
(define-extern target-move-dist (function time-frame float :behavior target))
(define-extern get-intersect-point (function vector touching-prims-entry collide-shape touching-shapes-entry vector))
;; target-swim
;; target-darkjak
(define-extern set-darkjak-texture-morph! (function float none))
(define-extern process-drawable-random-point! (function process-drawable vector vector))
(define-extern target-falling-anim-trans (function none :behavior target))
(define-extern ja-blend-eval (function int :behavior process-drawable))
;; target-gun - TODO move to `gun-h` perhaps?
(define-extern target-gun-end-mode (function symbol symbol :behavior target))
(define-extern target-gun-marking-menu (function target none))
(define-extern gun-init (function none :behavior gun))
(declare-type gun-red-shot process-drawable)
(define-extern target-gun-type-set! (function int none :behavior target))
(define-extern target-gun-fire-blue (function (pointer process) :behavior target))
(define-extern target-gun-fire-yellow (function (pointer process) :behavior target))
(define-extern target-gun-fire-red (function (pointer gun-red-shot) :behavior target))
(define-extern target-gun-fire-dark (function (pointer process) :behavior target))
(define-extern target-pos (function int vector))
(define-extern stop (function symbol int))
;; target-anim
;; target2
(define-extern target-gun-check (function none :behavior target))
(define-extern target-gun-fire (function pickup-type none :behavior target))
(define-extern target-darkjak-end-mode (function none :behavior target))
(define-extern target-gun-init (function int none :behavior target))
(define-extern *hit-ground-hard-mods* surface)
(define-extern *float-mods* surface)
2022-11-30 22:36:09 -05:00
(define-extern target-send-attack (function process symbol touching-shapes-entry int int penetrate symbol :behavior target))
2022-11-20 09:21:25 -05:00
(define-extern target-powerup-effect (function symbol none :behavior target))
(defenum darkjak-stage
:bitfield #t
:type uint32
(force-on)
(active)
(bomb0)
(bomb1)
(invinc)
(giant)
(no-anim)
(disable-force-on)
)
;; og:ignore-form:(new 'static 'boxed-array
;; DECOMP BEGINS
(deftype target (process-focusable)
((self target :override)
(fact fact-info-target :override)
(control control-info :offset 128)
(skel2 joint-control :offset-assert 204)
(shadow-backup shadow-geo :offset-assert 208)
(target-flags uint32 :offset 188)
(game game-info :offset-assert 212)
(neck joint-mod :offset-assert 216)
(head joint-mod :offset-assert 220)
(upper-body joint-mod :offset-assert 224)
(horns joint-mod :offset-assert 228)
(hair joint-mod 2 :offset-assert 232)
(darkjak-interp float :offset-assert 240)
(darkjak-giant-interp float :offset-assert 244)
(arm-ik joint-mod-ik 2 :offset-assert 248)
(leg-ik joint-mod-ik 2 :offset-assert 256)
(foot joint-mod 2 :offset-assert 264)
2023-01-07 10:32:03 -05:00
(mech-ik joint-mod-ik 2 :offset-assert 272)
(init-time time-frame :offset 272)
(teleport-time time-frame :offset-assert 280)
(state-hook-time time-frame :offset-assert 288)
(state-hook (function none :behavior target) :offset-assert 296)
(cam-user-mode symbol :offset-assert 300)
(sidekick (pointer sidekick) :offset-assert 304)
(manipy (pointer manipy) :offset-assert 308)
(mirror (pointer process-drawable) :offset-assert 312)
(attack-info attack-info :inline :offset-assert 320)
(attack-info-rec attack-info :inline :offset-assert 480)
(attack-info-old attack-info 8 :inline :offset-assert 640)
(anim-seed uint64 :offset-assert 1920)
(alt-cam-pos vector :inline :offset-assert 1936)
(current-level level :offset-assert 1952)
(saved-pos transformq :inline :offset-assert 1968)
(saved-owner uint64 :offset-assert 2016)
(alt-neck-pos vector :inline :offset-assert 2032)
(focus-search (array collide-shape) :offset-assert 2048)
(excitement float :offset-assert 2052)
(shock-effect-time time-frame :offset-assert 2056)
(beard? symbol :offset-assert 2064)
(spool-anim spool-anim :offset-assert 2068)
(ambient-time time-frame :offset-assert 2072)
(fp-hud handle :offset-assert 2080)
(no-load-wait uint64 :offset-assert 2088)
(no-look-around-wait uint64 :offset-assert 2096)
(burn-proc handle :offset-assert 2104)
(pre-joint-hook (function none :behavior target) :offset-assert 2112)
(notify handle :offset-assert 2120)
(mode-cache basic :offset-assert 2128)
(mode-param1 handle :offset-assert 2136)
(mode-param2 uint64 :offset-assert 2144)
(mode-param3 uint64 :offset-assert 2152)
(tobot-state state :offset-assert 2160)
(tobot? symbol :offset-assert 2164)
(tobot-recorder basic :offset-assert 2168)
(color-effect basic :offset-assert 2172)
(color-effect-start-time time-frame :offset-assert 2176)
(color-effect-duration uint64 :offset-assert 2184)
(racer racer-info :offset-assert 2192)
(tube tube-info :offset-assert 2196)
(flut flut-info :offset-assert 2200)
(board board-info :offset-assert 2204)
(pilot pilot-info :offset-assert 2208)
(gun gun-info :offset-assert 2212)
(mech mech-info :offset-assert 2216)
decomp: `hover-*` files, `wasp`, `crimson-guard-hover`, `flamer`, `target-turret`, `drill-turret`, `jellyfish` (#2198) Manual patches: - `drill-turret`: The static data for `*turret-13-path*`, `*turret-14-path*` and `*turret-15-path*` was decompiled by hand and the integers in the `set-speed-mult` events have been replaced with boxed integer arrays that contain only that integer in order to make the compiler happy. To that effect, the event handler in `target-turret` was changed to access that array instead of just accessing the int. - `hover-nav-control`: In `hover-nav-control::10`, `arg2` is usually a `vector`, but there are some places where it is called with `#t` as `arg2` and, subsequently, crashes the game because it tries to access the `quad` of `arg2` if `arg2` is truthy. To mitigate this, the condition `arg2` has been replaced with `(and (!= arg2 #t) arg2)` (in this case, it would jump to the `else` that just resets the `dest-vel` and `transv` `quad`s) - `drill-baron`: The static data for `*drill-ship-turret-speed-event*` has been decompiled by hand. TODOs: - Jellyfish crash the game - Destroying the metalhead eggs that are on the breakable wall crashes the game (already happened with the Peacemaker before) - Figure out why static data of type `turret-path-event` doesn't decompile The docs for all the hover-nav and nav-network code could use some love in the future, I'm not smart enough to figure out what any of that code actually means, but it seems to work... Also threw in the fix for the ▲ that was accidentally left commented out.
2023-02-09 18:22:56 -05:00
(turret turret-info :offset-assert 2220)
(darkjak darkjak-info :offset-assert 2224)
(indax indax-info :offset-assert 2228)
)
:heap-base #x840
:method-count-assert 29
:size-assert #x8b8
:flag-assert #x1d084008b8
(:methods
2022-10-30 15:54:10 -04:00
(do-edge-grabs (_type_ collide-cache collide-edge-spec) none 27)
(init-target (_type_ continue-point symbol) none :behavior target 28)
)
(:states
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-attack
(target-attack-air symbol)
(target-attack-uppercut float float)
(target-attack-uppercut-jump float float)
(target-board-clone-anim handle)
target-board-duck-stance
target-board-falling
(target-board-flip float float symbol)
(target-board-get-off object symbol)
target-board-get-on
(target-board-grab symbol)
(target-board-grenade handle)
target-board-halfpipe
(target-board-hit vector attack-info)
target-board-hit-ground
(target-board-hold float float symbol)
(target-board-jump meters meters symbol)
target-board-jump-kick
(target-board-pegasus handle)
[opengoal] make `none` a child of `object` (#3001) Previously, `object` and `none` were both top-level types. This made decompilation rather messy as they have no LCA and resulted in a lot of variables coming out as type `none` which is very very wrong and additionally there were plenty of casts to `object`. This changes it so `none` becomes a child of `object` (it is still represented by `NullType` which remains unusable in compilation). This change makes `object` the sole top-level type, and the type that can represent *any* GOAL object. I believe this matches the original GOAL built-in type structure. A function that has a return type of `object` can now return an integer or a `none` at the same time. However, keep in mind that the return value of `(none)` is still undefined, just as before. This also makes a cast to `object` meaningless in 90% of the situations it showed up in (as every single thing is already an `object`) and the decompiler will no longer emit them. Casts to `none` are also reduced. Yay! Additionally, state handlers also don't get the final `(none)` printed out anymore. The return type of a state handler is completely meaningless outside the event handler (which is return type `object` anyway) so there are no limitations on what the last form needs to be. I did this instead of making them return `object` to trick the decompiler into not trying to output a variable to be used as a return value (internally, in the decompiler they still have return type `none`, but they have `object` elsewhere). Fixes #1703 Fixes #830 Fixes #928
2023-09-22 05:54:49 -04:00
(target-board-ride-edge symbol)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-board-stance
(target-board-start object)
(target-board-trickx float float symbol)
(target-board-turn-to vector time-frame)
(target-board-wall-kick vector float)
target-carry-drop
target-carry-falling
(target-carry-hit-ground symbol)
(target-carry-jump float float symbol)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-carry-pickup
target-carry-stance
target-carry-throw
target-carry-walk
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
(target-clone-anim handle)
(target-continue continue-point)
target-darkjak-bomb0
(target-darkjak-bomb1 float float)
target-darkjak-get-off
(target-darkjak-get-on darkjak-stage)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-darkjak-giant
target-darkjak-running-attack
(target-death symbol)
(target-demo symbol)
(target-double-jump float float)
(target-duck-high-jump float float symbol)
(target-duck-high-jump-jump float float symbol)
(target-duck-stance symbol)
(target-duck-walk symbol)
target-edge-grab
(target-edge-grab-jump float float)
target-edge-grab-off
(target-falling symbol)
target-float
(target-flop float float float)
(target-flop-hit-ground symbol)
(target-flut-start handle)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
(target-grab symbol)
target-gun-stance
target-gun-walk
target-hide
(target-high-jump float float object)
(target-hit symbol attack-info)
(target-hit-ground symbol)
(target-hit-ground-hard float)
target-ice-stance
target-ice-walk
target-indax-attack
(target-indax-attack-air symbol)
(target-indax-death symbol)
(target-indax-double-jump float float)
(target-indax-falling symbol)
(target-indax-hit symbol attack-info)
(target-indax-hit-ground symbol)
(target-indax-jump float float surface)
target-indax-running-attack
target-indax-stance
(target-indax-start handle)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-indax-trip
target-indax-walk
(target-jump float float surface)
(target-jump-forward float float)
(target-launch float symbol vector int)
target-load-wait
target-look-around
target-mech-carry-drag
target-mech-carry-drop
target-mech-carry-falling
(target-mech-carry-hit-ground symbol)
(target-mech-carry-jump float float symbol)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-mech-carry-pickup
target-mech-carry-stance
target-mech-carry-throw
target-mech-carry-walk
(target-mech-clone-anim handle)
(target-mech-death symbol)
(target-mech-falling symbol)
target-mech-get-off
(target-mech-get-on handle)
target-mech-grab
(target-mech-hit symbol attack-info)
(target-mech-hit-ground symbol)
(target-mech-jump float float surface)
target-mech-punch
target-mech-stance
(target-mech-start handle float symbol)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-mech-walk
(target-pilot-clone-anim handle)
(target-pilot-death symbol)
(target-pilot-edge-grab pilot-edge-grab-info)
target-pilot-get-off
target-pilot-get-on
target-pilot-grab
(target-pilot-hit symbol attack-info)
target-pilot-impact
target-pilot-stance
(target-pilot-start handle symbol symbol)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
(target-play-anim string handle)
(target-pole-cycle handle)
(target-pole-flip-forward float float float)
(target-pole-flip-forward-jump float float)
(target-pole-flip-up object object float)
(target-pole-flip-up-jump float float)
2022-11-20 09:21:25 -05:00
(target-racing-start handle)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-roll
(target-roll-flip float float)
target-running-attack
target-slide-down
target-slide-down-to-ground
target-stance
target-stance-ambient
target-stance-look-around
target-startup
target-swim-down
(target-swim-jump float float)
(target-swim-jump-jump float float surface)
target-swim-stance
target-swim-up
target-swim-walk
(target-title symbol)
target-tube
(target-tube-death symbol)
(target-tube-hit symbol attack-info)
(target-tube-jump float float)
2022-11-20 09:21:25 -05:00
(target-tube-start handle)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-turn-around
decomp: `hover-*` files, `wasp`, `crimson-guard-hover`, `flamer`, `target-turret`, `drill-turret`, `jellyfish` (#2198) Manual patches: - `drill-turret`: The static data for `*turret-13-path*`, `*turret-14-path*` and `*turret-15-path*` was decompiled by hand and the integers in the `set-speed-mult` events have been replaced with boxed integer arrays that contain only that integer in order to make the compiler happy. To that effect, the event handler in `target-turret` was changed to access that array instead of just accessing the int. - `hover-nav-control`: In `hover-nav-control::10`, `arg2` is usually a `vector`, but there are some places where it is called with `#t` as `arg2` and, subsequently, crashes the game because it tries to access the `quad` of `arg2` if `arg2` is truthy. To mitigate this, the condition `arg2` has been replaced with `(and (!= arg2 #t) arg2)` (in this case, it would jump to the `else` that just resets the `dest-vel` and `transv` `quad`s) - `drill-baron`: The static data for `*drill-ship-turret-speed-event*` has been decompiled by hand. TODOs: - Jellyfish crash the game - Destroying the metalhead eggs that are on the breakable wall crashes the game (already happened with the Peacemaker before) - Figure out why static data of type `turret-path-event` doesn't decompile The docs for all the hover-nav and nav-network code could use some love in the future, I'm not smart enough to figure out what any of that code actually means, but it seems to work... Also threw in the fix for the ▲ that was accidentally left commented out.
2023-02-09 18:22:56 -05:00
target-turret-get-off
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
(target-turret-get-on handle)
decomp: `hover-*` files, `wasp`, `crimson-guard-hover`, `flamer`, `target-turret`, `drill-turret`, `jellyfish` (#2198) Manual patches: - `drill-turret`: The static data for `*turret-13-path*`, `*turret-14-path*` and `*turret-15-path*` was decompiled by hand and the integers in the `set-speed-mult` events have been replaced with boxed integer arrays that contain only that integer in order to make the compiler happy. To that effect, the event handler in `target-turret` was changed to access that array instead of just accessing the int. - `hover-nav-control`: In `hover-nav-control::10`, `arg2` is usually a `vector`, but there are some places where it is called with `#t` as `arg2` and, subsequently, crashes the game because it tries to access the `quad` of `arg2` if `arg2` is truthy. To mitigate this, the condition `arg2` has been replaced with `(and (!= arg2 #t) arg2)` (in this case, it would jump to the `else` that just resets the `dest-vel` and `transv` `quad`s) - `drill-baron`: The static data for `*drill-ship-turret-speed-event*` has been decompiled by hand. TODOs: - Jellyfish crash the game - Destroying the metalhead eggs that are on the breakable wall crashes the game (already happened with the Peacemaker before) - Figure out why static data of type `turret-path-event` doesn't decompile The docs for all the hover-nav and nav-network code could use some love in the future, I'm not smart enough to figure out what any of that code actually means, but it seems to work... Also threw in the fix for the ▲ that was accidentally left commented out.
2023-02-09 18:22:56 -05:00
(target-turret-stance handle)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-wade-stance
target-wade-walk
target-walk
(target-warp-in vector vector target)
(target-warp-out vector vector target)
docs: add support for `:override-doc` in method declarations as well as documenting state handlers (#2139) Adding support for better child-type method docstrings. This is a problem unique to methods. Usually, a child-type will have the same signature and a common name will apply, but the implementation is different. This means, you probably want a different docstring to describe what is happening. Currently this is possible to do via `:replace`. The problem with replace is two fold: - a replaced method ends up in the generated `deftype`...because you usually change the signature! - we don't put docstrings in the `deftype` in normal GOAL, this is just something we do for the `all-types` file (they go in the `defmethod` instead) - more importantly, this means anytime you now want to change the parent's name/args/return type -- you have to apply that change everywhere. So this is a better design you can now just declare the method like so: ```clj (:override-doc "my new docstring" <method_id>) ``` And internally a pseudo-replaced method will be added, but it will inherit everything from the parent (except the docstring of course) Unrelated - I also made all the keyword args for declaring methods not depend on ordering This also adds support for documenting virtual and non-virtual state handlers. For example: ```clj (:states (part-tester-idle (:event "test") symbol)) ``` or ```clj (idle () _type_ :state (:event "test") 20) ``` I will probably add the ability to give some sort of over-view docstring at a later date. Co-authored-by: water <awaterford111445@gmail.com>
2023-01-21 20:45:45 -05:00
target-yellow-jump-blast
)
)
(define-perm *target* target #f)
(deftype sidekick (process-drawable)
((parent (pointer target) :override)
(control control-info :offset 128)
(anim-seed uint64 :offset 208)
(shadow-in-movie? symbol :offset-assert 216)
(special-anim-time time-frame :offset-assert 224)
(special-anim-interp float :offset-assert 232)
(special-anim-frame float :offset-assert 236)
(offset transformq :inline :offset-assert 240)
(mirror (pointer process-drawable) :offset-assert 288)
)
:heap-base #xb0
:method-count-assert 20
:size-assert #x124
:flag-assert #x1400b00124
(:states
sidekick-clone
)
)
(define-perm *sidekick* sidekick #f)