mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
decomp: finish target-racer
| target-tube
(#1042)
* decomp: finish `target-racer` target-racing-turn-anim was the `cond` issue here * decomp: finish `target-tube` target-tube-turn-anim was the issue here
This commit is contained in:
parent
b11a45d836
commit
004ecd4fe3
|
@ -3583,12 +3583,6 @@ FormElement* sc_to_handle_get_proc(ShortCircuitElement* elt,
|
|||
|
||||
void ShortCircuitElement::push_to_stack(const Env& env, FormPool& pool, FormStack& stack) {
|
||||
mark_popped();
|
||||
if (!used_as_value.value_or(false)) {
|
||||
throw std::runtime_error(
|
||||
"ShortCircuitElement::push_to_stack not implemented for result not used case.");
|
||||
|
||||
stack.push_form_element(this, true);
|
||||
} else {
|
||||
if (already_rewritten) {
|
||||
stack.push_form_element(this, true);
|
||||
return;
|
||||
|
@ -3642,7 +3636,6 @@ void ShortCircuitElement::push_to_stack(const Env& env, FormPool& pool, FormStac
|
|||
stack.push_value_to_reg(final_result, pool.alloc_single_form(nullptr, to_push), true,
|
||||
env.get_variable_type(final_result, false));
|
||||
already_rewritten = true;
|
||||
}
|
||||
}
|
||||
|
||||
void ShortCircuitElement::update_from_stack(const Env& env,
|
||||
|
|
|
@ -9414,7 +9414,7 @@
|
|||
(load-game! (_type_ game-save) game-save 25)
|
||||
(clear-text-seen! (_type_ game-text-id) none 26)
|
||||
(get-death-count (_type_ symbol) int 27)
|
||||
(get-health-percent-lost (_type_) float 28)
|
||||
(get-health-percent-lost (_type_ symbol) float 28)
|
||||
)
|
||||
)
|
||||
|
||||
|
@ -31706,7 +31706,7 @@
|
|||
;; - Functions
|
||||
|
||||
(define-extern swamp-rat-nest-check-dummy (function none :behavior swamp-rat-nest))
|
||||
(define-extern swamp-rat-nest-spawn-rat (function (pointer process) :behavior swamp-rat-nest))
|
||||
(define-extern swamp-rat-nest-spawn-rat (function (pointer process) :behavior swamp-rat-nest)) ;; this needs a t2 symbol arg to pass to swamp-rat-init-from-other...but
|
||||
(define-extern swamp-rat-nest-dummy-init-by-other (function swamp-rat-nest-dummy none :behavior swamp-rat-nest-dummy))
|
||||
(define-extern swamp-rat-nest-pick-spawn-joint (function int :behavior swamp-rat-nest))
|
||||
(define-extern swamp-rat-nest-dummy-take-damage (function int int :behavior swamp-rat-nest-dummy))
|
||||
|
@ -32787,7 +32787,7 @@
|
|||
)
|
||||
|
||||
(deftype slide-control (process-drawable)
|
||||
((target uint64 :offset-assert 176)
|
||||
((target handle :offset-assert 176)
|
||||
(pos float :offset-assert 184)
|
||||
(trans vector :inline :offset-assert 192)
|
||||
(rot vector :inline :offset-assert 208)
|
||||
|
@ -32805,8 +32805,8 @@
|
|||
|
||||
;; - Functions
|
||||
|
||||
(define-extern find-target-point function)
|
||||
(define-extern distance-from-tangent function)
|
||||
(define-extern find-target-point (function vector float :behavior slide-control))
|
||||
(define-extern distance-from-tangent (function path-control float vector vector vector vector float))
|
||||
(define-extern target-tube-post (function none :behavior target))
|
||||
(define-extern target-tube-turn-anim (function none :behavior target))
|
||||
(define-extern tube-thrust (function float float none :behavior target))
|
||||
|
@ -32815,12 +32815,12 @@
|
|||
;; - Unknowns
|
||||
|
||||
(define-extern target-tube (state target)) ;; unknown type
|
||||
(define-extern target-tube-death (state target)) ;; unknown type
|
||||
(define-extern target-tube-death (state symbol target)) ;; unknown type
|
||||
(define-extern *tube-jump-mods* surface) ;; unknown type
|
||||
(define-extern target-tube-jump (state target)) ;; unknown type
|
||||
(define-extern target-tube-jump (state float float target)) ;; unknown type
|
||||
(define-extern *tube-mods* surface) ;; unknown type
|
||||
(define-extern *tube-surface* surface) ;; unknown type
|
||||
(define-extern target-tube-hit (state target)) ;; unknown type
|
||||
(define-extern target-tube-hit (state handle attack-info target)) ;; unknown type
|
||||
(define-extern *tube-hit-mods* surface) ;; unknown type
|
||||
(define-extern *TUBE-bank* tube-bank) ;; unknown type
|
||||
|
||||
|
|
|
@ -306,7 +306,6 @@
|
|||
// all unchecked and in level DGO code
|
||||
"(anon-function 21 plant-boss)", // CFG
|
||||
"target-flut-falling-anim-trans", // CFG failure
|
||||
"(anon-function 2 target-tube)",
|
||||
"(anon-function 5 orbit-plat)", // CFG
|
||||
"(anon-function 2 ogreboss)"
|
||||
|
||||
|
|
|
@ -6026,5 +6026,42 @@
|
|||
[32, "collide-tri-result"]
|
||||
],
|
||||
|
||||
"(enter target-tube-hit)": [
|
||||
[16, "event-message-block"]
|
||||
],
|
||||
|
||||
"(event slide-control-ride slide-control)": [
|
||||
[16, "event-message-block"]
|
||||
],
|
||||
|
||||
"(code target-tube-death)": [
|
||||
[16, "vector"]
|
||||
],
|
||||
|
||||
"(code target-tube-hit)": [
|
||||
[16, "vector"],
|
||||
[32, "vector"],
|
||||
[48, "vector"],
|
||||
[64, "vector"],
|
||||
[80, "vector"]
|
||||
],
|
||||
|
||||
"find-target-point": [
|
||||
[16, "vector"],
|
||||
[32, "vector"],
|
||||
[48, "vector"]
|
||||
],
|
||||
|
||||
"(trans slide-control-watch slide-control)": [
|
||||
[16, "vector"],
|
||||
[32, "event-message-block"]
|
||||
],
|
||||
|
||||
"distance-from-tangent": [
|
||||
[16, "vector"],
|
||||
[32, "vector"],
|
||||
[48, "vector"]
|
||||
],
|
||||
|
||||
"placeholder-do-not-add-below!": []
|
||||
}
|
||||
|
|
|
@ -7441,5 +7441,24 @@
|
|||
[28, "v1", "joint-exploder-joint"]
|
||||
],
|
||||
|
||||
"racer-effects": [
|
||||
[739, "v0", "sound-rpc-set-param"]
|
||||
],
|
||||
|
||||
"(code target-tube)": [
|
||||
[31, "v1", "art-joint-anim"]
|
||||
],
|
||||
|
||||
"(event slide-control-ride slide-control)": [
|
||||
[24, "gp", "process-drawable"],
|
||||
[31, "v1", "vector"],
|
||||
[35, "v1", "vector"],
|
||||
[39, "v1", "vector"]
|
||||
],
|
||||
|
||||
"(code target-tube-start)": [
|
||||
[110, "v1", "float"]
|
||||
],
|
||||
|
||||
"placeholder-do-not-add-below": []
|
||||
}
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
(load-game! (_type_ game-save) game-save 25)
|
||||
(clear-text-seen! (_type_ game-text-id) none 26)
|
||||
(get-death-count (_type_ symbol) int 27)
|
||||
(get-health-percent-lost (_type_) float 28)
|
||||
(get-health-percent-lost (_type_ symbol) float 28)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
@ -1128,6 +1128,6 @@
|
|||
)
|
||||
)
|
||||
|
||||
(defmethod get-health-percent-lost game-info ((obj game-info))
|
||||
(defmethod get-health-percent-lost game-info ((obj game-info) (arg0 symbol))
|
||||
(* 0.25 (the float (get-death-count obj #f)))
|
||||
)
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
2
test/decompiler/reference/engine/game/game-info-h_REF.gc
generated
vendored
2
test/decompiler/reference/engine/game/game-info-h_REF.gc
generated
vendored
|
@ -225,7 +225,7 @@
|
|||
(load-game! (_type_ game-save) game-save 25)
|
||||
(clear-text-seen! (_type_ game-text-id) none 26)
|
||||
(get-death-count (_type_ symbol) int 27)
|
||||
(get-health-percent-lost (_type_) float 28)
|
||||
(get-health-percent-lost (_type_ symbol) float 28)
|
||||
)
|
||||
)
|
||||
|
||||
|
|
2
test/decompiler/reference/engine/game/game-info_REF.gc
generated
vendored
2
test/decompiler/reference/engine/game/game-info_REF.gc
generated
vendored
|
@ -1239,6 +1239,6 @@
|
|||
)
|
||||
|
||||
;; definition for method 28 of type game-info
|
||||
(defmethod get-health-percent-lost game-info ((obj game-info))
|
||||
(defmethod get-health-percent-lost game-info ((obj game-info) (arg0 symbol))
|
||||
(* 0.25 (the float (get-death-count obj #f)))
|
||||
)
|
||||
|
|
1715
test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc
generated
vendored
Normal file
1715
test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1163
test/decompiler/reference/levels/sunken/target-tube_REF.gc
generated
vendored
Normal file
1163
test/decompiler/reference/levels/sunken/target-tube_REF.gc
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
17
test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc
generated
vendored
17
test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc
generated
vendored
|
@ -1387,32 +1387,21 @@ swamp-rat-nest-default-event-handler
|
|||
(set! (-> obj path) (new 'process 'path-control obj 'path 0.0))
|
||||
(logior! (-> obj path flags) (path-control-flag display draw-line draw-point draw-text))
|
||||
(let ((s5-1 (res-lump-value arg0 'num-lurkers uint128 :default (the-as uint128 3))))
|
||||
(let* ((a0-8 *game-info*) (t9-5 (method-of-object a0-8 get-health-percent-lost))) (if (>= (t9-5 a0-8) 0.5)
|
||||
(if (>= (get-health-percent-lost *game-info* #f) 0.5)
|
||||
(+! s5-1 -1)
|
||||
)
|
||||
)
|
||||
(set! (-> obj rat-count) (max 1 (min 4 (the-as int s5-1))))
|
||||
)
|
||||
(set! (-> obj defensive-rat-count) 2)
|
||||
(let* ((a0-11 *game-info*)
|
||||
(t9-6 (method-of-object a0-11 get-health-percent-lost))
|
||||
)
|
||||
(if (>= (t9-6 a0-11) 0.75)
|
||||
(if (>= (get-health-percent-lost *game-info* #f) 0.75)
|
||||
(+! (-> obj defensive-rat-count) -1)
|
||||
)
|
||||
)
|
||||
(set! (-> obj dummy) (the-as (pointer swamp-rat-nest-dummy) #f))
|
||||
(set! (-> obj dummy-type) 0)
|
||||
(set! (-> obj hit-points) 0)
|
||||
(set! (-> obj damaged) #f)
|
||||
(set! (-> obj spawn-period) (* 1200.0 (rand-vu-float-range 0.9 1.1)))
|
||||
(let* ((f30-1 1.0)
|
||||
(f28-0 2.0)
|
||||
(a0-13 *game-info*)
|
||||
(t9-8 (method-of-object a0-13 get-health-percent-lost))
|
||||
)
|
||||
(set! (-> obj spawn-period-scale) (+ f30-1 (* f28-0 (t9-8 a0-13))))
|
||||
)
|
||||
(set! (-> obj spawn-period-scale) (+ 1.0 (* 2.0 (get-health-percent-lost *game-info* #f))))
|
||||
(set! (-> obj test-interval) (the-as uint (rand-vu-int-range 30 60)))
|
||||
(go swamp-rat-nest-idle)
|
||||
(none)
|
||||
|
|
|
@ -214,6 +214,9 @@
|
|||
],
|
||||
"orbit-plat-rotating": [
|
||||
"code"
|
||||
],
|
||||
"slide-control-ride": [
|
||||
"exit" // asm code
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue