[decomp] improve types around enter-state (#923)

* clean up

* restore hack
This commit is contained in:
water111
2021-10-20 20:55:25 -04:00
committed by GitHub
parent 29d15f7fbc
commit b7fe8447e2
104 changed files with 5493 additions and 2733 deletions
+5 -3
View File
@@ -4,14 +4,14 @@
/*!
* Convert a (state <blah> ...) to the function required to go. Must be state.
*/
TypeSpec state_to_go_function(const TypeSpec& state_type) {
TypeSpec state_to_go_function(const TypeSpec& state_type, const TypeSpec& return_type) {
assert(state_type.base_type() == "state");
std::vector<TypeSpec> arg_types;
for (int i = 0; i < (int)state_type.arg_count() - 1; i++) {
arg_types.push_back(state_type.get_arg(i));
}
arg_types.push_back(TypeSpec("none")); // none for the return.
arg_types.push_back(return_type); // for the return.
auto result = TypeSpec("function", arg_types);
result.add_new_tag("behavior", state_type.last_arg().base_type());
return result;
@@ -62,8 +62,10 @@ TypeSpec get_state_handler_type(StateHandler kind, const TypeSpec& state_type) {
TypeSpec result;
switch (kind) {
case StateHandler::CODE:
result = state_to_go_function(state_type, TypeSpec("none"));
break;
case StateHandler::ENTER:
result = state_to_go_function(state_type);
result = state_to_go_function(state_type, TypeSpec("none"));
break;
case StateHandler::TRANS:
+1 -1
View File
@@ -11,7 +11,7 @@ enum class StateHandler { ENTER, EXIT, CODE, TRANS, POST, EVENT };
class TypeSystem;
TypeSpec state_to_go_function(const TypeSpec& state_type);
TypeSpec state_to_go_function(const TypeSpec& state_type, const TypeSpec& return_type);
StateHandler handler_name_to_kind(const std::string& name);
std::string handler_kind_to_name(StateHandler kind);
TypeSpec get_state_handler_type(const std::string& handler_name, const TypeSpec& state_type);
+2 -2
View File
@@ -1051,7 +1051,7 @@ TP_Type LoadVarOp::get_src_type(const TypeState& input,
rd.tokens.front().kind == FieldReverseLookupOutput::Token::Kind::FIELD &&
rd.tokens.front().name == "enter" && rd_in.base_type.arg_count() > 0) {
// special case for accessing the enter field of state
return TP_Type::make_from_ts(state_to_go_function(rd_in.base_type));
return TP_Type::make_from_ts(state_to_go_function(rd_in.base_type, TypeSpec("none")));
} else {
return TP_Type::make_from_ts(coerce_to_reg_type(rd.result_type));
}
@@ -1219,7 +1219,7 @@ TypeState CallOp::propagate_types_internal(const TypeState& input,
"state. The decompiler must know the specific state type.",
m_my_idx));
}
in_type = state_to_go_function(state_type);
in_type = state_to_go_function(state_type, TypeSpec("object"));
}
if (in_tp.kind == TP_Type::Kind::RUN_FUNCTION_IN_PROCESS_FUNCTION ||
+10 -9
View File
@@ -2665,7 +2665,7 @@ void FunctionCallElement::update_from_stack(const Env& env,
}
// modify our type for the go.
function_type = state_to_go_function(next_state_type.typespec());
function_type = state_to_go_function(next_state_type.typespec(), TypeSpec("object"));
// up next, we need to deal with the
// (set! (-> pp next-state) process-drawable-art-error)
@@ -3512,24 +3512,25 @@ void CondWithElseElement::push_to_stack(const Env& env, FormPool& pool, FormStac
// (set! x (if y z (expr))) and z requires a cast, but the move from z to x is
// eliminated by GOAL's register allocator.
// fmt::print("func: {}\n", env.func->name());
// fmt::print("checking:\n");
// for (auto& t : source_types) {
// fmt::print(" {}\n", t.print());
// }
// fmt::print("func: {}\n", env.func->name());
//
// fmt::print("checking:\n");
// for (auto& t : source_types) {
// fmt::print(" {}\n", t.print());
// }
auto expected_type = env.get_variable_type(*last_var, true);
// fmt::print("The expected type is {}\n", expected_type.print());
// fmt::print("The expected type is {}\n", expected_type.print());
auto result_type =
source_types.empty() ? expected_type : env.dts->ts.lowest_common_ancestor(source_types);
// fmt::print("but we actually got {}\n", result_type.print());
// fmt::print("but we actually got {}\n", result_type.print());
Form* result_value = pool.alloc_single_form(nullptr, this);
if (!env.dts->ts.tc(expected_type, result_type)) {
result_value =
pool.alloc_single_element_form<CastElement>(nullptr, expected_type, result_value);
}
// fmt::print("{}\n", result_value->to_string(env));
stack.push_value_to_reg(*last_var, result_value, true,
env.get_variable_type(*last_var, false));
+61 -62
View File
@@ -19636,7 +19636,7 @@
(define-extern target-bonk-event-handler function)
(define-extern target-standard-event-handler function)
(define-extern target-send-attack function)
(define-extern target-attacked (function symbol uint uint process (state target) none :behavior target)) ;; unconfirmed, target-tube::(event target-tube-start)
(define-extern target-attacked (function symbol uint uint process (state target) object :behavior target)) ;; unconfirmed, target-tube::(event target-tube-start)
(define-extern target-apply-tongue function)
(define-extern get-intersect-point function)
(define-extern target-powerup-effect function)
@@ -19649,26 +19649,26 @@
;; - Unknowns
(define-extern target-jump (state target)) ;; unknown type
;;(define-extern target-hit object) ;; unknown type
;;(define-extern target-eco-powerup object) ;; unknown type
;;(define-extern target-load-wait object) ;; unknown type
(define-extern target-jump (state float float symbol target)) ;; unknown type
(define-extern target-hit (state target)) ;; unknown type
(define-extern target-eco-powerup (state target)) ;; unknown type
(define-extern target-load-wait (state target)) ;; unknown type
(define-extern target-grab (state target)) ;; unknown type
;;(define-extern target-look-around object) ;; unknown type
;;(define-extern target-billy-game object) ;; unknown type
;;(define-extern target-racing-start object) ;; unknown type
;;(define-extern target-flut-start object) ;; unknown type
(define-extern target-look-around (state target)) ;; unknown type
(define-extern target-billy-game (state target)) ;; unknown type
(define-extern target-racing-start (state handle target)) ;; unknown type
(define-extern target-flut-start (state handle target)) ;; unknown type
(define-extern target-snowball-start (state handle target)) ;; unknown type
(define-extern target-tube-start (state handle target)) ;; unknown type
(define-extern target-periscope (state target)) ;; unknown type
(define-extern target-fishing (state handle target)) ;; unknown type
(define-extern target-final-door (state basic handle target)) ;; unknown type
;;(define-extern target-play-anim object) ;; unknown type
;;(define-extern target-clone-anim object) ;; unknown type
;;(define-extern target-edge-grab object) ;; unknown type
;;(define-extern target-pole-cycle object) ;; unknown type
;;(define-extern target-swim-stance object) ;; unknown type
;;(define-extern target-wade-stance object) ;; unknown type
(define-extern target-play-anim (state target)) ;; unknown type
(define-extern target-clone-anim (state target)) ;; unknown type
(define-extern target-edge-grab (state target)) ;; unknown type
(define-extern target-pole-cycle (state target)) ;; unknown type
(define-extern target-swim-stance (state target)) ;; unknown type
(define-extern target-wade-stance (state target)) ;; unknown type
;; ----------------------
@@ -19680,46 +19680,45 @@
;; - Functions
(define-extern target-land-effect (function none :behavior target))
(define-extern target-hit-ground-anim function)
(define-extern mod-var-jump function)
(define-extern init-var-jump function)
(define-extern target-falling-anim function)
(define-extern target-falling-trans function)
(define-extern target-hit-ground-anim (function symbol symbol :behavior target))
(define-extern mod-var-jump (function symbol symbol symbol vector vector :behavior target))
(define-extern init-var-jump (function float float vector vector vector vector :behavior target)) ;; 1st and 2nd vectors may be symbols instead?
(define-extern target-falling-anim (function int int symbol :behavior target))
(define-extern target-falling-trans (function basic cpad-list none :behavior target)) ;; todo - power of 2 array access issue (fixed in another PR?)
(define-extern target-falling-anim-trans function)
;; - Unknowns
;;(define-extern target-hit-ground object) ;; unknown type
(define-extern target-hit-ground (state symbol target)) ;; unknown type
(define-extern target-stance (state target)) ;; unknown type
;;(define-extern target-high-jump object) ;; unknown type
;;(define-extern target-attack-air object) ;; unknown type
;;(define-extern target-wheel-flip object) ;; unknown type
(define-extern target-high-jump (state float float symbol target)) ;; unknown type
(define-extern target-attack-air (state symbol target)) ;; unknown type
(define-extern target-wheel-flip (state float float target)) ;; unknown type
(define-extern target-duck-stance (state target)) ;; unknown type
;;(define-extern target-hit-ground-hard object) ;; unknown type
;;(define-extern target-flop-hit-ground object) ;; unknown type
;;(define-extern target-yellow-jump-blast object) ;; unknown type
;;(define-extern target-swim-down object) ;; unknown type
;;(define-extern target-flop object) ;; unknown type
;;(define-extern target-attack-uppercut-jump object) ;; unknown type
(define-extern target-hit-ground-hard (state target)) ;; unknown type
(define-extern target-flop-hit-ground (state symbol target)) ;; unknown type
(define-extern target-yellow-jump-blast (state target)) ;; unknown type
(define-extern target-swim-down (state target)) ;; unknown type
(define-extern target-flop (state float float float target)) ;; unknown type
(define-extern target-attack-uppercut-jump (state float float target)) ;; unknown type
(define-extern target-attack (state target)) ;; unknown type
;;(define-extern target-attack-uppercut object) ;; unknown type
;;(define-extern target-yellow-blast object) ;; unknown type
;;(define-extern target-wade-walk object) ;; unknown type
;;(define-extern target-walk object) ;; unknown type
(define-extern target-attack-uppercut (state float float target)) ;; unknown type
(define-extern target-yellow-blast (state target)) ;; unknown type
(define-extern target-wade-walk (state target)) ;; unknown type
(define-extern target-walk (state target)) ;; unknown type
(define-extern target-running-attack (state target)) ;; unknown type
;;(define-extern target-duck-high-jump-jump object) ;; unknown type
;;(define-extern target-launch object) ;; unknown type
;;(define-extern target-duck-high-jump object) ;; unknown type
;;(define-extern target-double-jump object) ;; unknown type
;;(define-extern target-duck-walk object) ;; unknown type
(define-extern target-duck-high-jump-jump (state float float symbol target)) ;; unknown type
(define-extern target-launch (state target)) ;; unknown type
(define-extern target-duck-high-jump (state float float symbol target)) ;; unknown type
(define-extern target-double-jump (state float float target)) ;; unknown type
(define-extern target-duck-walk (state target)) ;; unknown type
(define-extern target-ice-walk (state target)) ;; unknown type
;;(define-extern target-wheel object) ;; unknown type
;;(define-extern target-turn-around object) ;; unknown type
;;(define-extern target-stance-ambient object) ;; unknown type
(define-extern target-wheel (state target)) ;; unknown type
(define-extern target-turn-around (state target)) ;; unknown type
(define-extern target-stance-ambient (state target)) ;; unknown type
(define-extern target-ice-stance (state target)) ;; unknown type
;;(define-extern target-startup object) ;; unknown type
;;(define-extern target-jump-forward object) ;; unknown type
(define-extern target-startup (state target)) ;; unknown type
(define-extern target-jump-forward (state float float target)) ;; unknown type
;; ----------------------
;; File - target2
@@ -27024,7 +27023,7 @@
(define-extern check-drop-level-lighteco-big-pops (function sparticle-system sparticle-cpuinfo vector none))
(define-extern check-drop-level-lighteco-pops (function sparticle-system sparticle-cpuinfo vector none))
(define-extern light-eco-child-default-event-handler (function process int symbol event-message-block object :behavior light-eco-child))
(define-extern light-eco-mother-default-event-handler (function process int symbol event-message-block object :behavior light-eco-mother))
(define-extern light-eco-mother-default-event-handler (function process int symbol event-message-block int :behavior light-eco-mother))
(define-extern light-eco-mother-init-by-other (function entity vector none :behavior light-eco-mother))
;; - Unknowns
@@ -29658,9 +29657,9 @@
;; - Unknowns
;;(define-extern target-racing-smack object) ;; unknown type
;;(define-extern *racer-mods* object) ;; unknown type
;;(define-extern *racer-air-mods* object) ;; unknown type
(define-extern target-racing-smack (state float symbol target)) ;; unknown type
(define-extern *racer-mods* surface) ;; unknown type
(define-extern *racer-air-mods* surface) ;; unknown type
;; ----------------------
@@ -29680,22 +29679,22 @@
;; - Functions
(define-extern target-racing-smack-check function)
(define-extern target-racing-smack-check (function none :behavior target))
;; - Unknowns
;;(define-extern target-racing object) ;; unknown type
;;(define-extern target-racing-grab object) ;; unknown type
;;(define-extern target-racing-clone-anim object) ;; unknown type
;;(define-extern target-racing-get-off-hit-ground object) ;; unknown type
;;(define-extern target-racing-get-off-jump object) ;; unknown type
;;(define-extern target-racing-death object) ;; unknown type
;;(define-extern target-racing-jump object) ;; unknown type
;;(define-extern target-racing-bounce object) ;; unknown type
;;(define-extern target-racing-falling object) ;; unknown type
;;(define-extern target-racing-get-on object) ;; unknown type
;;(define-extern target-racing-get-off object) ;; unknown type
;;(define-extern target-racing-hit object) ;; unknown type
(define-extern target-racing (state target)) ;; unknown type
(define-extern target-racing-grab (state target)) ;; unknown type
(define-extern target-racing-clone-anim (state handle target)) ;; unknown type
(define-extern target-racing-get-off-hit-ground (state target)) ;; unknown type
(define-extern target-racing-get-off-jump (state handle target)) ;; unknown type
(define-extern target-racing-death (state target)) ;; unknown type
(define-extern target-racing-jump (state float float symbol target)) ;; unknown type
(define-extern target-racing-bounce (state float float symbol target)) ;; unknown type
(define-extern target-racing-falling (state target)) ;; unknown type
(define-extern target-racing-get-on (state handle target)) ;; unknown type
(define-extern target-racing-get-off (state handle target)) ;; unknown type
(define-extern target-racing-hit (state handle attack-info target)) ;; unknown type
;; ----------------------
@@ -2668,5 +2668,9 @@
[16, "vector"]
],
"(event target-racing-start)": [
[16, "event-message-block"]
],
"placeholder-do-not-add-below!": []
}
@@ -4032,5 +4032,15 @@
[[270, 273], "v1", "dma-packet"]
],
"(event target-racing-start)": [
[35, "v1", "float"],
[121, "v1", "attack-info"],
[125, "v1", "attack-info"],
[130, "v1", "attack-info"],
[148, "v1", "float"],
[206, "v1", "float"],
[251, "a0", "process-drawable"]
],
"placeholder-do-not-add-below": []
}
+2 -2
View File
@@ -179,8 +179,8 @@ void TextureConverter::download_rgba8888(u8* result,
int read_width = 64 * goal_tex_width;
// loop over pixels in output texture image
for (int y = 0; y < h; y++) {
for (int x = 0; x < w; x++) {
for (u32 y = 0; y < h; y++) {
for (u32 x = 0; x < w; x++) {
// read as the PSMT8 type. The dest field tells us a block offset.
auto addr8 = psmct16_addr(x, y, read_width) + vram_addr * 256;
u16 value = *(u16*)(m_vram.data() + addr8);
-2
View File
@@ -1318,7 +1318,6 @@ u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
c->copy_vfs_from_other(&sky_regs_vfs);
u32 call_addr = 0;
c->mov64(v1, a0); // or v1, a0, r0
c->load_symbol(v1, cache.math_camera); // lw v1, *math-camera*(s7)
c->lqc2(vf14, 700, v1); // lqc2 vf14, 700(v1)
@@ -1451,7 +1450,6 @@ struct Cache {
u64 execute(void* ctxt) {
auto* c = (ExecutionContext*)ctxt;
bool bc = false;
u32 call_addr = 0;
c->copy_vfs_from_other(&sky_regs_vfs);
c->mov64(v1, a0); // or v1, a0, r0
// c->lui(t4, 28672); // lui t4, 28672
+97 -99
View File
@@ -1659,99 +1659,98 @@
)
)
; TODO - fix me!
; (defun
; cam-layout-save-cam-trans
; ((arg0 symbol) (arg1 string) (arg2 entity-actor))
; (let ((s1-0 (-> arg2 trans))
; (s5-0 (method-of-type res-lump get-property-struct))
; (s2-0 arg2)
; )
; (format (clear *res-key-string*) "~S~S" 'trans '-offset)
; (let
; ((s5-1
; (s5-0
; s2-0
; (string->symbol *res-key-string*)
; 'interp
; (-> (new 'static 'array float 1 -1000000000.0) 0)
; #f
; (the-as (pointer res-tag) #f)
; *res-static-buf*
; )
; )
; )
; (let
; ((s2-1
; (res-lump-struct
; arg2
; 'translation_info
; structure
; :time
; (-> (new 'static 'array float 1 -1000000000.0) 0)
; )
; )
; (s3-1 (new-stack-vector0))
; )
; (if arg0
; (format
; #t
; "setup trans ~M ~M ~M (maya)~%"
; (-> s1-0 x)
; (-> s1-0 y)
; (-> s1-0 z)
; )
; )
; (set! (-> s3-1 quad) (-> s1-0 quad))
; (when s5-1
; (if arg0
; (format
; #t
; "offset ~M ~M ~M (added)~%"
; (-> (the-as vector s5-1) x)
; (-> (the-as vector s5-1) y)
; (-> (the-as vector s5-1) z)
; )
; )
; (vector+! s3-1 s3-1 (the-as vector s5-1))
; )
; (when (the-as vector s2-1)
; (if arg0
; (format
; #t
; "level-trans ~M ~M ~M (subtracted)~%"
; (-> (the-as vector s2-1) x)
; (-> (the-as vector s2-1) y)
; (-> (the-as vector s2-1) z)
; )
; )
; (vector-! s3-1 s3-1 (the-as vector s2-1))
; )
; (set! s2-1 (or (the-as vector s5-1) s2-1))
; (set! arg0 (and (the-as vector s2-1) arg0))
; (if (the-as structure arg0)
; (format
; #t
; "final trans ~M ~M ~M (maya)~%"
; (-> s3-1 x)
; (-> s3-1 y)
; (-> s3-1 z)
; )
; )
; )
; (the-as string (if (the-as vector s5-1)
; (format
; arg1
; " tag trans-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%"
; (-> (the-as vector s5-1) x)
; (-> (the-as vector s5-1) y)
; (-> (the-as vector s5-1) z)
; )
; )
; )
; )
; )
; )
(defun
cam-layout-save-cam-trans
((arg0 symbol) (arg1 string) (arg2 entity-actor))
(let ((s1-0 (-> arg2 trans))
(s5-0 (method-of-type res-lump get-property-struct))
(s2-0 arg2)
)
(format (clear *res-key-string*) "~S~S" 'trans '-offset)
(let
((s5-1
(s5-0
s2-0
(string->symbol *res-key-string*)
'interp
(-> (new 'static 'array float 1 -1000000000.0) 0)
#f
(the-as (pointer res-tag) #f)
*res-static-buf*
)
)
)
(let
((s2-1
(res-lump-struct
arg2
'translation_info
structure
:time
(-> (new 'static 'array float 1 -1000000000.0) 0)
)
)
(s3-1 (new-stack-vector0))
)
(if arg0
(format
#t
"setup trans ~M ~M ~M (maya)~%"
(-> s1-0 x)
(-> s1-0 y)
(-> s1-0 z)
)
)
(set! (-> s3-1 quad) (-> s1-0 quad))
(when s5-1
(if arg0
(format
#t
"offset ~M ~M ~M (added)~%"
(-> (the-as vector s5-1) x)
(-> (the-as vector s5-1) y)
(-> (the-as vector s5-1) z)
)
)
(vector+! s3-1 s3-1 (the-as vector s5-1))
)
(when (the-as vector s2-1)
(if arg0
(format
#t
"level-trans ~M ~M ~M (subtracted)~%"
(-> (the-as vector s2-1) x)
(-> (the-as vector s2-1) y)
(-> (the-as vector s2-1) z)
)
)
(vector-! s3-1 s3-1 (the-as vector s2-1))
)
(set! s2-1 (or (the-as vector s5-1) s2-1))
(set! arg0 (and (the-as symbol s2-1) arg0))
(if (the-as structure arg0)
(format
#t
"final trans ~M ~M ~M (maya)~%"
(-> s3-1 x)
(-> s3-1 y)
(-> s3-1 z)
)
)
)
(the-as string (if (the-as vector s5-1)
(format
arg1
" tag trans-offset METERS(~M) METERS(~M) METERS(~M) 1.0 // vector~%"
(-> (the-as vector s5-1) x)
(-> (the-as vector s5-1) y)
(-> (the-as vector s5-1) z)
)
)
)
)
)
)
(defun cam-layout-save-pivot ((arg0 symbol) (arg1 string) (arg2 entity-actor))
(let
@@ -3040,12 +3039,11 @@
(the-as string s4-2)
(the-as entity-actor arg0)
)
; TODO - fix me!
; (cam-layout-save-cam-trans
; arg1
; (the-as string s4-2)
; (the-as entity-actor arg0)
; )
(cam-layout-save-cam-trans
arg1
(the-as string s4-2)
(the-as entity-actor arg0)
)
(cam-layout-save-pivot arg1 (the-as string s4-2) (the-as entity-actor arg0))
(cam-layout-save-align arg1 (the-as string s4-2) (the-as entity-actor arg0))
(cam-layout-save-interesting
+9 -10
View File
@@ -155,16 +155,15 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'abort)
(when (logtest? (-> self flags) 1)
(logior! (-> self flags) 2)
(if (= (-> self anim-name type) string)
(go-virtual pov-camera-abort)
)
)
)
)
(case arg2
(('abort)
(when (logtest? (-> self flags) 1)
(logior! (-> self flags) 2)
(if (= (-> self anim-name type) string)
(go-virtual pov-camera-abort)
)
)
)
)
)
:enter
+37 -45
View File
@@ -987,54 +987,46 @@
)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
anim-tester-standard-event-handler anim-tester
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'reset)
(process-disconnect self)
(set! (-> self flags) (logand -2 (-> self flags)))
(when (!= (-> *anim-tester* 0 edit-mode) 1)
(set! (-> *debug-menu-context* is-hidden) #f)
(set! (-> *anim-tester* 0 edit-mode) 0)
(set! *camera-read-buttons* #t)
)
(anim-tester-reset)
(go anim-tester-process)
)
((= v1-0 'change-anim)
(go anim-tester-process)
)
((= v1-0 'pick-object)
(set! (-> self edit-mode) 1)
(set! *camera-read-buttons* #f)
#f
)
((= v1-0 'pick-joint-anim)
(set! (-> self edit-mode) 2)
(set! *camera-read-buttons* #f)
#f
)
((= v1-0 'pick-sequence)
(set! (-> self edit-mode) 3)
(set! *camera-read-buttons* #f)
#f
)
((= v1-0 'edit-sequence)
(set! (-> self edit-mode) 4)
(set! *camera-read-buttons* #f)
#f
)
((= v1-0 'save-sequences)
(anim-tester-save-all-objects self)
)
)
(case arg2
(('reset)
(process-disconnect self)
(set! (-> self flags) (logand -2 (-> self flags)))
(when (!= (-> *anim-tester* 0 edit-mode) 1)
(set! (-> *debug-menu-context* is-hidden) #f)
(set! (-> *anim-tester* 0 edit-mode) 0)
(set! *camera-read-buttons* #t)
)
(anim-tester-reset)
(go anim-tester-process)
)
(('change-anim)
(go anim-tester-process)
)
(('pick-object)
(set! (-> self edit-mode) 1)
(set! *camera-read-buttons* #f)
#f
)
(('pick-joint-anim)
(set! (-> self edit-mode) 2)
(set! *camera-read-buttons* #f)
#f
)
(('pick-sequence)
(set! (-> self edit-mode) 3)
(set! *camera-read-buttons* #f)
#f
)
(('edit-sequence)
(set! (-> self edit-mode) 4)
(set! *camera-read-buttons* #f)
#f
)
(('save-sequences)
(anim-tester-save-all-objects self)
)
)
)
+51 -62
View File
@@ -883,68 +883,53 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'touched)
(when (-> self attack-mode)
(when (cond
((= (-> arg0 type) target)
(let
((a1-1
(new 'stack-no-clear 'event-message-block)
)
)
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'attack)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(let
((a0-4 (new 'static 'attack-info :mask #x20)))
(set! (-> a0-4 mode) (-> self attack-mode))
(set! (-> a1-1 param 1) (the-as uint a0-4))
)
(send-event-function arg0 a1-1)
)
)
(else
(let
((a1-2
(new 'stack-no-clear 'event-message-block)
)
)
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 4)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(set!
(-> a1-2 param 1)
(the-as uint (-> self attack-mode))
)
(let ((v1-13 (+ *global-attack-id* 1)))
(set! *global-attack-id* v1-13)
(set! (-> a1-2 param 2) (the-as uint v1-13))
)
(set! (-> a1-2 param 3) (the-as uint 0))
(send-event-function arg0 a1-2)
)
)
)
(let ((v1-14 (-> self notify-handle)))
(if (handle->process v1-14)
(send-event (-> v1-14 process 0) 'notify 'attack arg0)
)
)
(+! (-> self hits) 1)
(if (>= (-> self hits) (-> self max-hits))
(go-virtual projectile-impact)
)
)
)
)
((= v1-0 'die)
(go-virtual projectile-impact)
)
)
(case arg2
(('touched)
(when (-> self attack-mode)
(when (cond
((= (-> arg0 type) target)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'attack)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(let ((a0-4 (new 'static 'attack-info :mask #x20)))
(set! (-> a0-4 mode) (-> self attack-mode))
(set! (-> a1-1 param 1) (the-as uint a0-4))
)
(send-event-function arg0 a1-1)
)
)
(else
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 4)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(set! (-> a1-2 param 1) (the-as uint (-> self attack-mode)))
(let ((v1-13 (+ *global-attack-id* 1)))
(set! *global-attack-id* v1-13)
(set! (-> a1-2 param 2) (the-as uint v1-13))
)
(set! (-> a1-2 param 3) (the-as uint 0))
(send-event-function arg0 a1-2)
)
)
)
(let ((v1-14 (-> self notify-handle)))
(if (handle->process v1-14)
(send-event (-> v1-14 process 0) 'notify 'attack arg0)
)
)
(+! (-> self hits) 1)
(if (>= (-> self hits) (-> self max-hits))
(go-virtual projectile-impact)
)
)
)
)
(('die)
(go-virtual projectile-impact)
)
)
)
@@ -1832,3 +1817,7 @@
(none)
)
)
+46 -39
View File
@@ -1060,46 +1060,53 @@
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'shadow)
(the-as shadow-geo (cond
((-> arg3 param 0)
(let ((v0-0 (-> self shadow-backup)))
(set! (-> self draw shadow) v0-0)
v0-0
)
)
(else
(set! (-> self draw shadow) #f)
(the-as shadow-geo #f)
)
)
)
)
((= v1-0 'shadow-min-max)
(let ((v1-5 (-> self draw shadow-ctrl)))
(let ((a0-5 v1-5))
(set!
(-> a0-5 settings bot-plane w)
(- (the-as float (-> arg3 param 0)))
(the-as shadow-geo (cond
((= v1-0 'shadow)
(the-as shadow-geo (cond
((-> arg3 param 0)
(let
((v0-0 (-> self shadow-backup)))
(set! (-> self draw shadow) v0-0)
v0-0
)
)
(else
(set! (-> self draw shadow) #f)
(the-as shadow-geo #f)
)
)
)
)
((= v1-0 'shadow-min-max)
(let ((v1-5 (-> self draw shadow-ctrl)))
(let ((a0-5 v1-5))
(set!
(-> a0-5 settings bot-plane w)
(- (the-as float (-> arg3 param 0)))
)
)
0
(set!
(-> v1-5 settings top-plane w)
(- (the-as float (-> arg3 param 1)))
)
)
(the-as shadow-geo 0)
)
((= v1-0 'end-mode)
(the-as shadow-geo (if (should-display? self)
(the-as
shadow-geo
(go-virtual idle)
)
(the-as
shadow-geo
(go-virtual hidden)
)
)
)
)
)
)
0
(set!
(-> v1-5 settings top-plane w)
(- (the-as float (-> arg3 param 1)))
)
)
(the-as shadow-geo 0)
)
((= v1-0 'end-mode)
(the-as shadow-geo (if (should-display? self)
(the-as shadow-geo (go-virtual idle))
(the-as shadow-geo (go-virtual hidden))
)
)
)
)
)
)
)
+5 -8
View File
@@ -326,10 +326,10 @@
(none)
)
;; WARN: Stack slot load mismatch: defined as size 4, got size 16
;; WARN: Stack slot load mismatch: defined as size 4, got size 16
;; WARN: Stack slot load mismatch: defined as size 4, got size 16
;; WARN: Stack slot load mismatch: defined as size 4, got size 16
;; WARN: Stack slot load at 160 mismatch: defined as size 4, got size 16
;; WARN: Stack slot load at 176 mismatch: defined as size 4, got size 16
;; WARN: Stack slot load at 160 mismatch: defined as size 4, got size 16
;; WARN: Stack slot load at 176 mismatch: defined as size 4, got size 16
(defun-debug target-print-stats ((arg0 target) (arg1 symbol))
(local-vars
(sv-64 string)
@@ -1218,10 +1218,7 @@
150
)
(!= (-> self next-state name) 'target-walk)
(<
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
150
)
(< (- (-> *display* base-frame-counter) (-> self state-time)) 150)
(<
(- (-> *display* base-frame-counter) (-> self control unknown-dword21))
150
+1
View File
@@ -25,6 +25,7 @@
(define-extern init-sidekick (function none)) ;; TODO - not finished
;; TODO - for logic-target - defined in target-death
(define-extern target-continue (state continue-point none))
(define-extern target-periscope (state target))
(declare-type sidekick basic)
(declare-type collide-cache basic)
+67 -125
View File
@@ -8,7 +8,9 @@
(define-extern *jchar-sg* skeleton-group)
(define-extern target-collide-set! (function symbol float int :behavior target))
;; failed to figure out what this is:
;; note: this file has a modification to let us run with an incompletely constructed target.
;; if you update the decompilation, you will need to restore this hack.
(let
((v1-0
(new 'static 'skeleton-group
@@ -30,14 +32,13 @@
(set! *jchar-sg* v1-0)
)
;; definition for symbol *target-shadow-control*, type shadow-control
(define
*target-shadow-control*
(new 'static 'shadow-control
:settings
(new 'static 'shadow-settings
:center
(new 'static 'vector :w 0.000000000000000000000000000000000000000000003)
(new 'static 'vector :w (the-as float #x2))
:shadow-dir
(new 'static 'vector :x -0.4226 :y -0.9063 :w 409600.0)
:bot-plane (new 'static 'plane :y 1.0 :w 37683.2)
@@ -46,7 +47,6 @@
)
)
;; definition of type target-bank
(deftype target-bank (basic)
((jump-collide-offset meters :offset-assert 4)
(jump-height-min meters :offset-assert 8)
@@ -136,7 +136,7 @@
:flag-assert #x900000258
)
;; definition for symbol *TARGET-bank*, type target-bank
(define
*TARGET-bank*
(new 'static 'target-bank
@@ -215,7 +215,7 @@
:flop-radius (meters 1.4)
:flop0-offset (new 'static 'vector :y 3276.8 :w 1.0)
:flop1-offset (new 'static 'vector :y 9011.2 :w 1.0)
:stuck-time #x5a
:stuck-time (seconds 0.3)
:stuck-timeout (seconds 2)
:stuck-distance (meters 0.05)
:tongue-pull-speed-min 0.15
@@ -224,8 +224,6 @@
)
)
;; definition for function target-start-attack
;; INFO: Return type mismatch int vs none.
(defbehavior target-start-attack target ()
(+! (-> self control unknown-dword50) 1)
(set! (-> self control unknown-dword51) 0)
@@ -233,7 +231,6 @@
(none)
)
;; definition for function target-danger-set!
(defbehavior target-danger-set! target ((arg0 symbol) (arg1 symbol))
(let ((s4-0 (-> self control unknown-sphere00))
(s5-0 (-> self control unknown-sphere01))
@@ -514,7 +511,6 @@
)
)
;; definition for function target-collide-set!
(defbehavior target-collide-set! target ((arg0 symbol) (arg1 float))
(let ((gp-0 (-> self control)))
(set! (-> self control unknown-symbol00) arg0)
@@ -712,12 +708,10 @@
0
)
;; definition for method 27 of type control-info
(defmethod get-quaternion control-info ((obj control-info))
(-> obj unknown-quaternion00)
)
;; definition for function target-align-vel-z-adjust
(defbehavior target-align-vel-z-adjust target ((arg0 float))
(let ((f1-0 (-> self control unknown-float61)))
(* arg0 (if (< 0.0 f1-0)
@@ -728,9 +722,6 @@
)
)
;; definition for method 16 of type target
;; INFO: Return type mismatch control-info vs collide-shape.
;; Used lq/sq
(defmethod
dummy-16
target
@@ -812,7 +803,6 @@
(the-as collide-shape (-> obj control))
)
;; definition for function average-turn-angle
(defun average-turn-angle ((arg0 target))
(let ((f30-0 0.0))
(dotimes (s5-0 8)
@@ -833,13 +823,9 @@
)
)
;; definition for function can-play-stance-amibent?
(defbehavior can-play-stance-amibent? target ()
(and
(>=
(- (-> *display* base-frame-counter) (the-as int (-> self state-time)))
9000
)
(>= (- (-> *display* base-frame-counter) (-> self state-time)) 9000)
(not (-> *setting-control* current talking))
(not (-> *setting-control* current spooling))
(not (-> *setting-control* current movie))
@@ -849,7 +835,6 @@
)
)
;; definition for function can-jump?
(defbehavior can-jump? target ((arg0 symbol))
(and
(or
@@ -878,7 +863,6 @@
)
)
;; definition for function move-legs?
(defbehavior move-legs? target ()
(!=
(->
@@ -891,87 +875,75 @@
)
)
;; definition for function target-height-above-ground
(defbehavior target-height-above-ground target ()
(- (-> self control trans y) (-> self control shadow-pos y))
)
;; definition for function fall-test
;; INFO: Return type mismatch none vs object.
(defbehavior fall-test target ((arg0 symbol) (arg1 symbol))
(the-as
object
(when
(and
(zero? (logand (-> self control status) 1))
(>=
(- (-> *display* base-frame-counter) (-> self control unknown-dword10))
(the-as int (-> *TARGET-bank* ground-timeout))
)
(>=
0.0
(vector-dot
(-> self control dynam gravity-normal)
(-> self control transv)
)
)
(let ((v1-15 (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
)
(or
(not
(or
(= v1-15 (-> self draw art-group data 59))
(= v1-15 (-> self draw art-group data 60))
(= v1-15 (-> self draw art-group data 61))
)
)
(< 4096.0 (target-height-above-ground))
)
)
)
(when
(and
(zero? (logand (-> self control status) 1))
(>=
(- (-> *display* base-frame-counter) (-> self control unknown-dword10))
(<
(-
(-> *display* base-frame-counter)
(the-as int (-> self control rider-time))
)
(the-as int (-> *TARGET-bank* ground-timeout))
)
(>=
0.0
(vector-dot
(-> self control dynam gravity-normal)
(-> self control transv)
)
)
(let ((v1-15 (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
)
(or
(not
(or
(= v1-15 (-> self draw art-group data 59))
(= v1-15 (-> self draw art-group data 60))
(= v1-15 (-> self draw art-group data 61))
)
)
(< 4096.0 (target-height-above-ground))
)
)
(logtest? (-> self control unknown-surface01 flags) #x4000)
)
(when
(and
(<
(-
(-> *display* base-frame-counter)
(the-as int (-> self control rider-time))
)
(the-as int (-> *TARGET-bank* ground-timeout))
)
(logtest? (-> self control unknown-surface01 flags) #x4000)
)
(+! (-> self control transv x) (-> self control rider-last-move x))
(+! (-> self control transv z) (-> self control rider-last-move z))
)
(go target-falling #f)
(+! (-> self control transv x) (-> self control rider-last-move x))
(+! (-> self control transv z) (-> self control rider-last-move z))
)
(go target-falling #f)
)
)
;; definition for function slide-down-test
;; INFO: Return type mismatch none vs object.
(defbehavior slide-down-test target ((arg0 symbol) (arg1 symbol))
(the-as
object
(if
(and
(zero? (logand (-> self control status) 129))
(>=
(- (-> *display* base-frame-counter) (-> self control unknown-dword10))
(the-as int (-> *TARGET-bank* ground-timeout))
)
(logtest? (-> self control status) 4)
(< 0.5 (-> self control surface-angle))
(if
(and
(zero? (logand (-> self control status) 129))
(>=
(- (-> *display* base-frame-counter) (-> self control unknown-dword10))
(the-as int (-> *TARGET-bank* ground-timeout))
)
(go target-slide-down)
(logtest? (-> self control status) 4)
(< 0.5 (-> self control surface-angle))
)
(go target-slide-down)
)
)
;; definition for function smack-surface?
(defbehavior smack-surface? target ((arg0 symbol))
(and
(< 0.7 (-> self control touch-angle))
@@ -983,7 +955,6 @@
)
)
;; definition for function can-wheel?
(defbehavior can-wheel? target ()
(and
(logtest? (-> self control status) 1)
@@ -998,7 +969,6 @@
)
)
;; definition for function can-duck?
(defbehavior can-duck? target ()
(and
(logtest? (-> self control status) 1)
@@ -1020,8 +990,6 @@
)
)
;; definition for function can-exit-duck?
;; Used lq/sq
(defbehavior can-exit-duck? target ()
(let ((gp-0 (new 'stack-no-clear 'collide-using-spheres-params)))
(let ((s5-0 (new 'stack-no-clear 'inline-array 'sphere 2)))
@@ -1048,7 +1016,6 @@
)
)
;; definition for function can-hands?
(defbehavior can-hands? target ((arg0 symbol))
(cond
((or
@@ -1120,7 +1087,6 @@
)
)
;; definition for function can-feet?
(defbehavior can-feet? target ()
(cond
((or
@@ -1145,8 +1111,6 @@
)
)
;; definition for function vector-local+!
;; Used lq/sq
(defbehavior vector-local+! target ((arg0 vector) (arg1 vector))
(let ((s5-0 (new-stack-vector0)))
(vector-matrix*! s5-0 arg1 (-> self control unknown-matrix01))
@@ -1154,8 +1118,6 @@
)
)
;; definition for function move-forward
;; Used lq/sq
(defbehavior move-forward target ((arg0 float))
(let ((a1-0 (new-stack-vector0))
(gp-0 (new-stack-vector0))
@@ -1166,8 +1128,6 @@
)
)
;; definition for function set-forward-vel
;; Used lq/sq
(defbehavior set-forward-vel target ((arg0 float))
(let ((gp-0 (new-stack-vector0)))
(vector-matrix*!
@@ -1185,9 +1145,6 @@
)
)
;; definition for function delete-back-vel
;; INFO: Return type mismatch int vs none.
;; Used lq/sq
(defbehavior delete-back-vel target ((arg0 float))
(let ((s5-0 (new-stack-vector0)))
(vector-z-quaternion! s5-0 (-> self control dir-targ))
@@ -1214,8 +1171,6 @@
(none)
)
;; definition for function set-side-vel
;; Used lq/sq
(defbehavior set-side-vel target ((arg0 float))
(let ((gp-0 (new-stack-vector0)))
(vector-matrix*!
@@ -1233,8 +1188,6 @@
)
)
;; definition for function target-timed-invulnerable
;; INFO: Return type mismatch int vs none.
(defun target-timed-invulnerable ((arg0 uint64) (arg1 target))
(logior! (-> arg1 state-flags) 32)
(set! (-> arg1 control unknown-dword70) (-> *display* base-frame-counter))
@@ -1244,8 +1197,6 @@
(none)
)
;; definition for function target-timed-invulnerable-off
;; INFO: Return type mismatch int vs none.
(defun target-timed-invulnerable-off ((arg0 target))
(set! (-> arg0 draw status) (logand -3 (-> arg0 draw status)))
(set! (-> arg0 state-flags) (logand -33 (-> arg0 state-flags)))
@@ -1254,9 +1205,6 @@
(none)
)
;; definition for method 9 of type attack-info
;; INFO: Return type mismatch attack-info vs none.
;; Used lq/sq
(defmethod dummy-9 attack-info ((obj attack-info) (arg0 attack-info))
(with-pp
(let ((s4-0 (-> arg0 mask)))
@@ -1361,7 +1309,6 @@
)
)
;; definition for function ground-tween-initialize
(defbehavior
ground-tween-initialize target
((arg0 ground-tween-info)
@@ -1392,8 +1339,6 @@
arg0
)
;; definition for function ground-tween-update
;; INFO: Return type mismatch int vs none.
(defbehavior
ground-tween-update target
((arg0 ground-tween-info) (arg1 float) (arg2 float))
@@ -1453,7 +1398,6 @@
(none)
)
;; definition for function target-pos
(defun target-pos ((arg0 int))
(let ((a1-0 *target*))
(cond
@@ -1470,9 +1414,6 @@
)
)
;; definition for function target-cam-pos
;; INFO: Return type mismatch object vs vector.
;; Used lq/sq
(defun target-cam-pos ()
(let ((gp-0 *target*))
(the-as vector (cond
@@ -1534,26 +1475,23 @@
)
)
;; definition for function target-joint-pos
(defun target-joint-pos ()
;; added hack
(when (and *target* (zero? (-> *target* draw)))
;; just return 0, we have the fake target
(return (new 'static 'vector))
)
(let ((v1-0 *target*))
(if v1-0
(vector<-cspace!
(new 'static 'vector)
(-> v1-0 node-list data (-> v1-0 draw origin-joint-index))
)
(camera-pos)
(if v1-0
(vector<-cspace!
(new 'static 'vector)
(-> v1-0 node-list data (-> v1-0 draw origin-joint-index))
)
(camera-pos)
)
)
)
)
;; definition for function target-rot
(defun target-rot ()
(let ((v1-0 *target*))
(if v1-0
@@ -1562,3 +1500,7 @@
)
)
)
+1 -1
View File
@@ -9,4 +9,4 @@
(define-extern target-stance (state target))
;; TODO - for target-snowball
(define-extern target-jump (state target))
(define-extern target-jump (state float float symbol target))
+7 -10
View File
@@ -374,16 +374,13 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'trigger)
(set! (-> self trigger) #t)
(go-virtual falling)
)
((= v1-0 'loading)
(go-virtual loading)
)
)
(case arg2
(('trigger)
(set! (-> self trigger) #t)
(go-virtual falling)
)
(('loading)
(go-virtual loading)
)
)
)
+54 -63
View File
@@ -138,10 +138,6 @@
)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defmethod
dummy-43
lurkercrab
@@ -149,65 +145,60 @@
(let ((s5-0 (-> obj incomming-attack-id)))
(set! (-> obj incomming-attack-id) (the-as handle (-> arg1 param 2)))
(let ((v1-1 (-> arg1 param 1)))
(the-as object (cond
((or (= v1-1 'flop) (= v1-1 'explode) (= v1-1 'darkeco))
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((= v1-1 'punch)
(cond
((logtest? (-> obj nav-enemy-flags) 32)
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((begin
(let ((s4-0 (new 'stack-no-clear 'vector)))
(let ((f30-0 (quaternion-xz-angle (target-rot))))
(set-vector!
s4-0
(* 24576.0 (sin f30-0))
0.0
(* 24576.0 (cos f30-0))
1.0
)
)
(vector+! s4-0 (-> obj collide-info trans) s4-0)
(set! (-> obj nav target-pos quad) (-> s4-0 quad))
)
(go lurkercrab-pushed)
(= s5-0 (-> obj incomming-attack-id))
)
'push
)
(else
#t
)
)
)
((logtest? (-> obj nav-enemy-flags) 32)
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((begin
(let ((s4-1 (new 'stack-no-clear 'vector)))
(vector-!
s4-1
(-> obj collide-info trans)
(target-pos 0)
)
(vector-normalize! s4-1 24576.0)
(vector+! s4-1 (-> obj collide-info trans) s4-1)
(set! (-> obj nav target-pos quad) (-> s4-1 quad))
)
(go lurkercrab-pushed)
(= s5-0 (-> obj incomming-attack-id))
)
'push
)
(else
#t
)
)
(cond
((or (= v1-1 'flop) (= v1-1 'explode) (= v1-1 'darkeco))
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((= v1-1 'punch)
(cond
((logtest? (-> obj nav-enemy-flags) 32)
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((begin
(let ((s4-0 (new 'stack-no-clear 'vector)))
(let ((f30-0 (quaternion-xz-angle (target-rot))))
(set-vector!
s4-0
(* 24576.0 (sin f30-0))
0.0
(* 24576.0 (cos f30-0))
1.0
)
)
(vector+! s4-0 (-> obj collide-info trans) s4-0)
(set! (-> obj nav target-pos quad) (-> s4-0 quad))
)
(go lurkercrab-pushed)
(= s5-0 (-> obj incomming-attack-id))
)
'push
)
(else
#t
)
)
)
((logtest? (-> obj nav-enemy-flags) 32)
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((begin
(let ((s4-1 (new 'stack-no-clear 'vector)))
(vector-! s4-1 (-> obj collide-info trans) (target-pos 0))
(vector-normalize! s4-1 24576.0)
(vector+! s4-1 (-> obj collide-info trans) s4-1)
(set! (-> obj nav target-pos quad) (-> s4-1 quad))
)
(go lurkercrab-pushed)
(= s5-0 (-> obj incomming-attack-id))
)
'push
)
(else
#t
)
)
)
)
+25 -31
View File
@@ -142,22 +142,19 @@
(defstate drop-plat-idle (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'drop)
(logclear! (-> self mask) (process-mask actor-pause))
(go drop-plat-drop)
)
((or (= v1-0 'touch) (= v1-0 'attack))
(send-event *target* 'no-look-around 300)
(send-event
(ppointer->process (-> self parent))
'player-stepped
(-> self color)
)
#f
)
)
(case arg2
(('drop)
(logclear! (-> self mask) (process-mask actor-pause))
(go drop-plat-drop)
)
(('touch 'attack)
(send-event *target* 'no-look-around 300)
(send-event
(ppointer->process (-> self parent))
'player-stepped
(-> self color)
)
#f
)
)
)
@@ -210,11 +207,10 @@
(defstate drop-plat-spawn (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'drop)
(go drop-plat-die)
)
)
(case arg2
(('drop)
(go drop-plat-die)
)
)
)
:code
@@ -248,11 +244,10 @@
(defstate drop-plat-rise (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'drop)
(go drop-plat-drop)
)
)
(case arg2
(('drop)
(go drop-plat-drop)
)
)
)
:code
@@ -719,11 +714,10 @@
(defstate citb-drop-plat-idle (citb-drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'trigger)
(go citb-drop-plat-active)
)
)
(case arg2
(('trigger)
(go citb-drop-plat-active)
)
)
)
:code
+93 -109
View File
@@ -94,49 +94,42 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'attack)
(case (-> arg3 param 1)
(('flop)
(TODO-RENAME-29
self
(-> self event-going-down)
(-> self notify-actor)
)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
)
)
((= v1-0 'trigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
((= v1-0 'move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
(case arg2
(('attack)
(case (-> arg3 param 1)
(('flop)
(TODO-RENAME-29 self (-> self event-going-down) (-> self notify-actor))
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
)
)
(('trigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
(('move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
)
@@ -170,28 +163,25 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'untrigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-up)
)
((= v1-0 'move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
(case arg2
(('untrigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-up)
)
(('move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
)
@@ -251,28 +241,25 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'untrigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-up)
)
((= v1-0 'move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
(case arg2
(('untrigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-up)
)
(('move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
)
@@ -334,28 +321,25 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
((= v1-0 'trigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
)
(case arg2
(('move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
(('trigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
)
)
+26 -37
View File
@@ -84,46 +84,35 @@
#t
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
battlecontroller-default-event-handler battlecontroller
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'child-die)
(+! (-> self die-count) 1)
(when (= (-> self die-count) (-> self max-spawn-count))
(let ((v1-4 (the-as process-drawable arg0)))
(when v1-4
(set!
(-> self final-pickup-spawn-point quad)
(-> v1-4 root trans quad)
)
(case (-> self final-pickup-type)
(((pickup-type fuel-cell))
#f
)
(else
(set!
(-> v1-4 fact pickup-type)
(-> self final-pickup-type)
)
(set! (-> v1-4 fact pickup-amount) 1.0)
(let ((f0-1 0.0))
(set! (-> v1-4 fact pickup-spawn-amount) f0-1)
f0-1
)
)
)
)
)
)
)
((= v1-0 'trigger)
(go-virtual battlecontroller-die)
)
)
(case arg2
(('child-die)
(+! (-> self die-count) 1)
(when (= (-> self die-count) (-> self max-spawn-count))
(let ((v1-4 (the-as process-drawable arg0)))
(when v1-4
(set! (-> self final-pickup-spawn-point quad) (-> v1-4 root trans quad))
(case (-> self final-pickup-type)
(((pickup-type fuel-cell))
#f
)
(else
(set! (-> v1-4 fact pickup-type) (-> self final-pickup-type))
(set! (-> v1-4 fact pickup-amount) 1.0)
(let ((f0-1 0.0))
(set! (-> v1-4 fact pickup-spawn-amount) f0-1)
f0-1
)
)
)
)
)
)
)
(('trigger)
(go-virtual battlecontroller-die)
)
)
)
+7 -9
View File
@@ -7,7 +7,8 @@
(define-extern *ef-plane-sg* skeleton-group)
;; definition of type blocking-plane
;; DECOMP BEGINS
(deftype blocking-plane (process-drawable)
()
:heap-base #x40
@@ -16,7 +17,7 @@
:flag-assert #x14004000b0
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
@@ -33,7 +34,6 @@
(set! *ef-plane-sg* v1-1)
)
;; failed to figure out what this is:
(defstate blocking-plane-idle (blocking-plane)
:code
(behavior ()
@@ -46,8 +46,6 @@
)
)
;; definition for function blocking-plane-init-by-other
;; Used lq/sq
(defbehavior
blocking-plane-init-by-other blocking-plane
((arg0 curve-control) (arg1 int))
@@ -123,8 +121,6 @@
(none)
)
;; definition for function blocking-plane-spawn
;; INFO: Return type mismatch int vs none.
(defun blocking-plane-spawn ((arg0 curve-control))
(with-pp
(cond
@@ -159,8 +155,6 @@
)
)
;; definition for function blocking-plane-destroy
;; INFO: Return type mismatch int vs none.
(defun blocking-plane-destroy ()
(with-pp
(let ((gp-0 (-> pp child)))
@@ -177,3 +171,7 @@
(none)
)
)
+9 -14
View File
@@ -192,24 +192,19 @@
(the-as object 'die)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defmethod
dummy-43
nav-enemy
((obj nav-enemy) (arg0 process) (arg1 event-message-block))
(the-as object (cond
((logtest? (-> obj nav-enemy-flags) 32)
(send-event arg0 'get-attack-count 1)
(logclear!
(-> obj mask)
(process-mask actor-pause attackable)
)
(go (method-of-object obj nav-enemy-die))
)
(else
(dummy-44 obj arg0 arg1)
)
)
(cond
((logtest? (-> obj nav-enemy-flags) 32)
(send-event arg0 'get-attack-count 1)
(logclear! (-> obj mask) (process-mask actor-pause attackable))
(go (method-of-object obj nav-enemy-die))
)
(else
(dummy-44 obj arg0 arg1)
)
)
)
+22 -23
View File
@@ -75,29 +75,28 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(when (can-activate? self)
(if
(and
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(-> self root-override)
(the-as uint 1)
)
(or
(not (-> self should-grab-player?))
(let ((v0-3 (process-grab? *target*)))
(set! (-> self grab-player?) v0-3)
v0-3
)
)
)
(go-virtual plat-button-pressed)
)
)
)
)
(case arg2
(('touch)
(when (can-activate? self)
(if
(and
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(-> self root-override)
(the-as uint 1)
)
(or
(not (-> self should-grab-player?))
(let ((v0-3 (process-grab? *target*)))
(set! (-> self grab-player?) v0-3)
v0-3
)
)
)
(go-virtual plat-button-pressed)
)
)
)
)
)
:code
+5 -6
View File
@@ -90,12 +90,11 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'open)
enter-state
(go-virtual open)
)
)
(case arg2
(('open)
enter-state
(go-virtual open)
)
)
)
:code
+49 -53
View File
@@ -534,18 +534,17 @@
(defbehavior
light-eco-child-default-event-handler light-eco-child
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (or (= v1-0 'touch) (= v1-0 'attack))
(when (= (-> arg0 type) target)
(send-event
(ppointer->process (-> self parent))
'trigger
(-> self angle-bit)
)
(go light-eco-child-grabbed)
)
)
)
(case arg2
(('touch 'attack)
(when (= (-> arg0 type) target)
(send-event
(ppointer->process (-> self parent))
'trigger
(-> self angle-bit)
)
(go light-eco-child-grabbed)
)
)
)
)
@@ -957,49 +956,46 @@
light-eco-mother-default-event-handler light-eco-mother
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'untrigger)
(the-as int (when (= (-> arg0 type) light-eco-child)
(let* ((a1-3 (-> arg3 param 0))
(v0-0
(logxor
(-> self angle-mask)
(ash 1 a1-3)
)
)
)
(set! (-> self angle-mask) v0-0)
v0-0
)
(the-as int (cond
((= v1-0 'untrigger)
(the-as int (when (= (-> arg0 type) light-eco-child)
(let* ((a1-3 (-> arg3 param 0))
(v0-0
(logxor (-> self angle-mask) (ash 1 a1-3))
)
)
(set! (-> self angle-mask) v0-0)
v0-0
)
)
)
)
((= v1-0 'trigger)
(the-as int (when (not (-> self player-got-eco?))
(set! (-> self player-got-eco?) #t)
(let
((a1-5
(new 'stack-no-clear 'event-message-block)
)
)
)
((= v1-0 'trigger)
(the-as int (when (not (-> self player-got-eco?))
(set! (-> self player-got-eco?) #t)
(let
((a1-5
(new 'stack-no-clear 'event-message-block)
)
)
(set! (-> a1-5 from) self)
(set! (-> a1-5 num-params) 0)
(set! (-> a1-5 message) 'white-eco-picked-up)
(the-as
int
(send-event-function
(ppointer->process (-> self parent))
a1-5
)
)
)
)
(set! (-> a1-5 from) self)
(set! (-> a1-5 num-params) 0)
(set! (-> a1-5 message) 'white-eco-picked-up)
(the-as
int
(send-event-function
(ppointer->process (-> self parent))
a1-5
)
)
)
((= v1-0 'beam-off)
(the-as int (go light-eco-mother-discipate))
)
)
)
)
)
)
)
((= v1-0 'beam-off)
(the-as int (go light-eco-mother-discipate))
)
)
)
)
)
+9 -12
View File
@@ -501,18 +501,15 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'open)
(let ((f0-0 (the-as float (-> arg3 param 0))))
(set! (-> self part-opened) f0-0)
f0-0
)
)
((= v1-0 'hide)
(go-virtual hidden)
)
)
(case arg2
(('open)
(let ((f0-0 (the-as float (-> arg3 param 0))))
(set! (-> self part-opened) f0-0)
f0-0
)
)
(('hide)
(go-virtual hidden)
)
)
)
+8 -10
View File
@@ -360,11 +360,10 @@
(defbehavior
darkecobomb-handler darkecobomb
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (or (= v1-0 'touch) (= v1-0 'attack))
(go darkecobomb-explode #t)
)
)
(case arg2
(('touch 'attack)
(go darkecobomb-explode #t)
)
)
)
@@ -1202,11 +1201,10 @@
(defbehavior
redshot-handler redshot
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (or (= v1-0 'attack) (= v1-0 'touch))
(go redshot-explode)
)
)
(case arg2
(('attack 'touch)
(go redshot-explode)
)
)
)
+49 -58
View File
@@ -45,64 +45,55 @@
(defstate bouncer-wait (springbox)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 3)
(set! (-> a1-3 message) 'jump)
(set!
(-> a1-3 param 0)
(the-as uint (-> self spring-height))
)
(set!
(-> a1-3 param 1)
(the-as uint (-> self spring-height))
)
(set! (-> a1-3 param 2) (the-as uint #f))
(when (send-event-function arg0 a1-3)
(sound-play-by-name
(static-sound-name "trampoline")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go bouncer-fire)
)
)
)
((= v1-0 'touch)
(if
(not
(or
(= (-> self next-state name) 'bouncer-smush)
(= (-> self next-state name) 'bouncer-fire)
)
)
(go bouncer-smush)
)
)
((= v1-0 'attack)
(when
(and
(= (-> arg3 param 1) 'flop)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
#f
)
)
(go bouncer-fire)
#f
)
)
)
(case arg2
(('bonk)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 3)
(set! (-> a1-3 message) 'jump)
(set! (-> a1-3 param 0) (the-as uint (-> self spring-height)))
(set! (-> a1-3 param 1) (the-as uint (-> self spring-height)))
(set! (-> a1-3 param 2) (the-as uint #f))
(when (send-event-function arg0 a1-3)
(sound-play-by-name
(static-sound-name "trampoline")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go bouncer-fire)
)
)
)
(('touch)
(if
(not
(or
(= (-> self next-state name) 'bouncer-smush)
(= (-> self next-state name) 'bouncer-fire)
)
)
(go bouncer-smush)
)
)
(('attack)
(when
(and
(= (-> arg3 param 1) 'flop)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
#f
)
)
(go bouncer-fire)
#f
)
)
)
)
File diff suppressed because it is too large Load Diff
+9 -17
View File
@@ -7,7 +7,8 @@
(define-extern *junglefish-sg* skeleton-group)
;; definition of type junglefish
;; DECOMP BEGINS
(deftype junglefish (nav-enemy)
()
:heap-base #x120
@@ -16,7 +17,7 @@
:flag-assert #x4c01200190
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
@@ -39,11 +40,8 @@
(set! *junglefish-sg* v1-1)
)
;; failed to figure out what this is:
nav-enemy-default-event-handler
;; definition for method 39 of type junglefish
;; INFO: Return type mismatch int vs none.
(defmethod common-post junglefish ((obj junglefish))
(dummy-10 (-> obj water))
((the-as (function nav-enemy none) (find-parent-method junglefish 39)) obj)
@@ -51,7 +49,6 @@ nav-enemy-default-event-handler
(none)
)
;; failed to figure out what this is:
(defstate nav-enemy-patrol (junglefish)
:virtual #t
:event
@@ -309,7 +306,6 @@ nav-enemy-default-event-handler
)
)
;; failed to figure out what this is:
(defstate nav-enemy-notice (junglefish)
:virtual #t
:event
@@ -324,7 +320,6 @@ nav-enemy-default-event-handler
)
)
;; failed to figure out what this is:
(defstate nav-enemy-chase (junglefish)
:virtual #t
:event
@@ -352,7 +347,6 @@ nav-enemy-default-event-handler
)
)
;; failed to figure out what this is:
(defstate nav-enemy-stop-chase (junglefish)
:virtual #t
:event
@@ -367,7 +361,6 @@ nav-enemy-default-event-handler
)
)
;; failed to figure out what this is:
(defstate nav-enemy-stare (junglefish)
:virtual #t
:event
@@ -382,7 +375,6 @@ nav-enemy-default-event-handler
)
)
;; failed to figure out what this is:
(defstate nav-enemy-give-up (junglefish)
:virtual #t
:event
@@ -397,7 +389,6 @@ nav-enemy-default-event-handler
)
)
;; failed to figure out what this is:
(defstate nav-enemy-attack (junglefish)
:virtual #t
:event
@@ -458,7 +449,6 @@ nav-enemy-default-event-handler
(the-as (function none :behavior junglefish) nav-enemy-chase-post)
)
;; failed to figure out what this is:
(defstate nav-enemy-victory (junglefish)
:virtual #t
:event
@@ -560,7 +550,6 @@ nav-enemy-default-event-handler
)
)
;; definition for symbol *junglefish-nav-enemy-info*, type nav-enemy-info
(define
*junglefish-nav-enemy-info*
(new 'static 'nav-enemy-info
@@ -579,11 +568,11 @@ nav-enemy-default-event-handler
:run-travel-speed (meters 5.5)
:run-rotate-speed (degrees 720.0)
:run-acceleration (meters 6.0)
:run-turn-time #x2d
:run-turn-time (seconds 0.15)
:walk-travel-speed (meters 4.0)
:walk-rotate-speed (degrees 720.0)
:walk-acceleration (meters 6.0)
:walk-turn-time #x2d
:walk-turn-time (seconds 0.15)
:attack-shove-back (meters 1.0)
:attack-shove-up (meters 0.5)
:shadow-size (meters 2.0)
@@ -616,7 +605,6 @@ nav-enemy-default-event-handler
)
)
;; definition for method 11 of type junglefish
(defmethod copy-defaults! junglefish ((obj junglefish) (arg0 res-lump))
(let
((s4-0
@@ -649,3 +637,7 @@ nav-enemy-default-event-handler
(go (method-of-object obj nav-enemy-idle))
(none)
)
+14 -19
View File
@@ -49,24 +49,19 @@
(none)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defmethod dummy-43 aphid ((obj aphid) (arg0 process) (arg1 event-message-block))
(the-as object (cond
((or
(logtest? (-> obj nav-enemy-flags) 32)
(= arg0 (ppointer->process (-> obj parent)))
)
(send-event arg0 'get-attack-count 1)
(logclear!
(-> obj mask)
(process-mask actor-pause attackable)
)
(go (method-of-object obj nav-enemy-die))
)
(else
(dummy-44 obj arg0 arg1)
)
)
(cond
((or
(logtest? (-> obj nav-enemy-flags) 32)
(= arg0 (ppointer->process (-> obj parent)))
)
(send-event arg0 'get-attack-count 1)
(logclear! (-> obj mask) (process-mask actor-pause attackable))
(go (method-of-object obj nav-enemy-die))
)
(else
(dummy-44 obj arg0 arg1)
)
)
)
@@ -553,11 +548,11 @@
:run-travel-speed (meters 5.0)
:run-rotate-speed (degrees 2880.0)
:run-acceleration (meters 1.0)
:run-turn-time #x1e
:run-turn-time (seconds 0.1)
:walk-travel-speed (meters 3.0)
:walk-rotate-speed (degrees 720.0)
:walk-acceleration (meters 1.0)
:walk-turn-time #x96
:walk-turn-time (seconds 0.5)
:attack-shove-back (meters 3.0)
:attack-shove-up (meters 2.0)
:shadow-size (meters 2.0)
+12 -14
View File
@@ -231,26 +231,24 @@
dummy-44
baby-spider
((obj baby-spider) (arg0 process) (arg1 event-message-block))
(the-as
object
(when
((method-of-type touching-shapes-entry prims-touching?)
(when
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg1 param 0))
(-> obj collide-info)
(the-as uint 1)
)
(if
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg1 param 0))
(-> obj collide-info)
(the-as uint 1)
)
(if
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg1 param 0))
'generic
)
(go (method-of-object obj nav-enemy-victory))
'generic
)
(go (method-of-object obj nav-enemy-victory))
)
)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
baby-spider-default-event-handler baby-spider
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
+53 -66
View File
@@ -70,75 +70,62 @@
(set! *spiderwebs-sg* v1-2)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
spiderwebs-default-event-handler spiderwebs
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 3)
(set! (-> a1-1 message) 'jump)
(set!
(-> a1-1 param 0)
(the-as uint (-> self spring-height))
)
(set!
(-> a1-1 param 1)
(the-as uint (-> self spring-height))
)
(set! (-> a1-1 param 2) (the-as uint *spider-jump-mods*))
(if (send-event-function arg0 a1-1)
(go spiderwebs-bounce)
)
)
)
((= v1-0 'touch)
(when (= (-> arg0 type) target)
(let* ((a0-8 (target-pos 0))
(f1-1 (- (-> a0-8 y) (-> self root trans y)))
)
(if
(and
(>= 2048.0 (fabs f1-1))
(and
(>=
13516.8
(vector-vector-distance a0-8 (-> self root trans))
)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
*spider-jump-mods*
)
)
)
(go spiderwebs-bounce)
)
)
)
)
((= v1-0 'attack)
(if
(and
(= (-> arg3 param 1) 'flop)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
*spider-jump-mods*
)
)
(go spiderwebs-bounce)
)
#f
)
)
(case arg2
(('bonk)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 3)
(set! (-> a1-1 message) 'jump)
(set! (-> a1-1 param 0) (the-as uint (-> self spring-height)))
(set! (-> a1-1 param 1) (the-as uint (-> self spring-height)))
(set! (-> a1-1 param 2) (the-as uint *spider-jump-mods*))
(if (send-event-function arg0 a1-1)
(go spiderwebs-bounce)
)
)
)
(('touch)
(when (= (-> arg0 type) target)
(let* ((a0-8 (target-pos 0))
(f1-1 (- (-> a0-8 y) (-> self root trans y)))
)
(if
(and
(>= 2048.0 (fabs f1-1))
(and
(>= 13516.8 (vector-vector-distance a0-8 (-> self root trans)))
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
*spider-jump-mods*
)
)
)
(go spiderwebs-bounce)
)
)
)
)
(('attack)
(if
(and
(= (-> arg3 param 1) 'flop)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
*spider-jump-mods*
)
)
(go spiderwebs-bounce)
)
#f
)
)
)
+4 -5
View File
@@ -272,11 +272,10 @@
(defstate keg-on-paddle (keg)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'detach)
(go keg-paddle-to-path)
)
)
(case arg2
(('detach)
(go keg-paddle-to-path)
)
)
)
:code
+32 -51
View File
@@ -5,7 +5,14 @@
;; name in dgo: misty-teetertotter
;; dgos: L1, MIS
;; definition of type teetertotter
(declare-type teetertotter process-drawable)
(define-extern teetertotter-idle (state teetertotter))
(define-extern teetertotter-launch (state teetertotter))
(define-extern teetertotter-bend (state teetertotter))
(define-extern *teetertotter-sg* skeleton-group)
;; DECOMP BEGINS
(deftype teetertotter (process-drawable)
((launched-player basic :offset-assert 176)
(in-launch-window basic :offset-assert 180)
@@ -17,22 +24,7 @@
:flag-assert #x14005000bc
)
(define-extern teetertotter-idle (state teetertotter))
(define-extern teetertotter-launch (state teetertotter))
(define-extern teetertotter-bend (state teetertotter))
;; definition for method 3 of type teetertotter
(defmethod inspect teetertotter ((obj teetertotter))
(let ((t9-0 (method-of-type process-drawable inspect)))
(t9-0 obj)
)
(format #t "~T~Tlaunched-player: ~A~%" (-> obj launched-player))
(format #t "~T~Tin-launch-window: ~A~%" (-> obj in-launch-window))
(format #t "~T~Trock-is-dangerous: ~A~%" (-> obj rock-is-dangerous))
obj
)
;; failed to figure out what this is:
(let
((v1-1
(new 'static 'skeleton-group
@@ -51,11 +43,9 @@
(set! (-> v1-1 lod-dist 1) 163840.0)
(set! (-> v1-1 mgeo 2) (the-as uint 3))
(set! (-> v1-1 lod-dist 2) 4095996000.0)
(define *teetertotter-sg* v1-1)
(set! *teetertotter-sg* v1-1)
)
;; definition for function target-on-end-of-teetertotter?
;; Used lq/sq
(defun target-on-end-of-teetertotter? ((arg0 teetertotter))
(let
((gp-1
@@ -79,38 +69,32 @@
)
)
;; failed to figure out what this is:
(defstate teetertotter-idle (teetertotter)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'attack)
(case (-> arg3 param 1)
(('flop)
(when (target-on-end-of-teetertotter? self)
(set! (-> self in-launch-window) #f)
(increment-success-for-hint
(the-as level-hint-control 676)
)
(go teetertotter-launch)
)
)
)
)
((= v1-0 'bonk)
(when (target-on-end-of-teetertotter? self)
(level-hint-spawn
(game-text-id misty-teetertotter-bonk-dax-tutorial)
"sksp0070"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(go teetertotter-bend)
)
)
)
(case arg2
(('attack)
(case (-> arg3 param 1)
(('flop)
(when (target-on-end-of-teetertotter? self)
(set! (-> self in-launch-window) #f)
(increment-success-for-hint (the-as level-hint-control 676))
(go teetertotter-launch)
)
)
)
)
(('bonk)
(when (target-on-end-of-teetertotter? self)
(level-hint-spawn
(game-text-id misty-teetertotter-bonk-dax-tutorial)
"sksp0070"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(go teetertotter-bend)
)
)
)
)
@@ -133,7 +117,6 @@
(the-as (function none :behavior teetertotter) transform-post)
)
;; failed to figure out what this is:
(defstate teetertotter-launch (teetertotter)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -252,7 +235,6 @@
(the-as (function none :behavior teetertotter) rider-post)
)
;; failed to figure out what this is:
(defstate teetertotter-bend (teetertotter)
:code
(behavior ()
@@ -306,7 +288,6 @@
(the-as (function none :behavior teetertotter) rider-post)
)
;; definition for method 11 of type teetertotter
(defmethod copy-defaults! teetertotter ((obj teetertotter) (arg0 res-lump))
(let
((s4-0
+6 -9
View File
@@ -46,15 +46,12 @@
(defstate silostep-idle (silostep)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'trigger)
(go silostep-camera)
)
((= v1-0 'trigger-rise)
(go silostep-rise #f)
)
)
(case arg2
(('trigger)
(go silostep-camera)
)
(('trigger-rise)
(go silostep-rise #f)
)
)
)
+2 -2
View File
@@ -222,11 +222,11 @@
)
(defmethod dummy-44 muse ((obj muse) (arg0 process) (arg1 event-message-block))
(the-as object (go muse-caught))
(go muse-caught)
)
(defmethod dummy-43 muse ((obj muse) (arg0 process) (arg1 event-message-block))
(the-as object (go muse-caught))
(go muse-caught)
)
nav-enemy-default-event-handler
+156 -164
View File
@@ -503,12 +503,11 @@
(defstate plunger-lurker-idle (plunger-lurker)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'plunge)
(logclear! (-> self mask) (process-mask actor-pause))
(go plunger-lurker-plunge)
)
)
(case arg2
(('plunge)
(logclear! (-> self mask) (process-mask actor-pause))
(go plunger-lurker-plunge)
)
)
)
:trans
@@ -1239,94 +1238,90 @@
(defbehavior
flying-lurker-handler flying-lurker
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'fly-away)
(when (-> self link next)
(entity-birth-no-kill (-> self link next))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'fly-away)
(set!
(-> a1-1 param 0)
(the-as uint (/ (the-as int (-> arg3 param 0)) 16))
)
(set! (-> a1-1 param 1) (-> arg3 param 1))
(let ((t9-1 send-event-function)
(v1-11 (-> self link next))
)
(t9-1 (if v1-11
(-> v1-11 extra process)
)
a1-1
)
)
)
)
(let* ((v1-14 (-> arg3 param 0))
(a0-4 (-> arg3 param 1))
(v1-15 (logand v1-14 3))
)
(set! (-> self rank) (the-as int v1-15))
(cond
((< 15 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 33000.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 34500.0)
)
(else
(set! (-> self race-seconds) 36000.0)
)
)
)
((< 10 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 31800.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 33300.0)
)
(else
(set! (-> self race-seconds) 34800.0)
)
)
)
((< 5 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 30600.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 32100.0)
)
(else
(set! (-> self race-seconds) 33600.0)
)
)
)
((zero? v1-15)
(set! (-> self race-seconds) 30000.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 31500.0)
)
(else
(set! (-> self race-seconds) 33000.0)
)
)
)
(logclear! (-> self mask) (process-mask actor-pause))
(set!
(-> self race-start-time)
(-> *display* game-frame-counter)
)
(go flying-lurker-fly)
)
)
(case arg2
(('fly-away)
(when (-> self link next)
(entity-birth-no-kill (-> self link next))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'fly-away)
(set!
(-> a1-1 param 0)
(the-as uint (/ (the-as int (-> arg3 param 0)) 16))
)
(set! (-> a1-1 param 1) (-> arg3 param 1))
(let ((t9-1 send-event-function)
(v1-11 (-> self link next))
)
(t9-1 (if v1-11
(-> v1-11 extra process)
)
a1-1
)
)
)
)
(let* ((v1-14 (-> arg3 param 0))
(a0-4 (-> arg3 param 1))
(v1-15 (logand v1-14 3))
)
(set! (-> self rank) (the-as int v1-15))
(cond
((< 15 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 33000.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 34500.0)
)
(else
(set! (-> self race-seconds) 36000.0)
)
)
)
((< 10 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 31800.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 33300.0)
)
(else
(set! (-> self race-seconds) 34800.0)
)
)
)
((< 5 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 30600.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 32100.0)
)
(else
(set! (-> self race-seconds) 33600.0)
)
)
)
((zero? v1-15)
(set! (-> self race-seconds) 30000.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 31500.0)
)
(else
(set! (-> self race-seconds) 33000.0)
)
)
)
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self race-start-time) (-> *display* game-frame-counter))
(go flying-lurker-fly)
)
)
)
@@ -1629,76 +1624,73 @@
(defstate flying-lurker-idle (flying-lurker)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'saw-player)
(set! (-> self take-off) #t)
(when (-> self link prev)
(entity-birth-no-kill (-> self link prev))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) arg0)
(set! (-> a1-1 num-params) arg1)
(set! (-> a1-1 message) arg2)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(set! (-> a1-1 param 1) (-> arg3 param 1))
(set! (-> a1-1 param 2) (-> arg3 param 2))
(set! (-> a1-1 param 3) (-> arg3 param 3))
(set! (-> a1-1 param 4) (-> arg3 param 4))
(set! (-> a1-1 param 5) (-> arg3 param 5))
(set! (-> a1-1 param 6) (-> arg3 param 6))
(let ((t9-1 send-event-function)
(v1-13 (-> self link prev))
)
(t9-1 (if v1-13
(-> v1-13 extra process)
)
a1-1
)
)
)
)
)
((= v1-0 'clone)
(when (-> self link next)
(entity-birth-no-kill (-> self link next))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'clone)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(set! (-> a1-2 param 1) (+ (-> arg3 param 1) -1))
(let ((t9-3 send-event-function)
(v1-25 (-> self link next))
)
(t9-3 (if v1-25
(-> v1-25 extra process)
)
a1-2
)
)
)
)
(case (-> arg3 param 1)
((2)
(go
flying-lurker-clone
(the-as handle (-> arg3 param 0))
"flying-lurker-b-"
)
)
((1)
(go
flying-lurker-clone
(the-as handle (-> arg3 param 0))
"flying-lurker-c-"
)
)
)
)
(else
(flying-lurker-handler arg0 arg1 arg2 arg3)
)
)
(case arg2
(('saw-player)
(set! (-> self take-off) #t)
(when (-> self link prev)
(entity-birth-no-kill (-> self link prev))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) arg0)
(set! (-> a1-1 num-params) arg1)
(set! (-> a1-1 message) arg2)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(set! (-> a1-1 param 1) (-> arg3 param 1))
(set! (-> a1-1 param 2) (-> arg3 param 2))
(set! (-> a1-1 param 3) (-> arg3 param 3))
(set! (-> a1-1 param 4) (-> arg3 param 4))
(set! (-> a1-1 param 5) (-> arg3 param 5))
(set! (-> a1-1 param 6) (-> arg3 param 6))
(let ((t9-1 send-event-function)
(v1-13 (-> self link prev))
)
(t9-1 (if v1-13
(-> v1-13 extra process)
)
a1-1
)
)
)
)
)
(('clone)
(when (-> self link next)
(entity-birth-no-kill (-> self link next))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'clone)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(set! (-> a1-2 param 1) (+ (-> arg3 param 1) -1))
(let ((t9-3 send-event-function)
(v1-25 (-> self link next))
)
(t9-3 (if v1-25
(-> v1-25 extra process)
)
a1-2
)
)
)
)
(case (-> arg3 param 1)
((2)
(go
flying-lurker-clone
(the-as handle (-> arg3 param 0))
"flying-lurker-b-"
)
)
((1)
(go
flying-lurker-clone
(the-as handle (-> arg3 param 0))
"flying-lurker-c-"
)
)
)
)
(else
(flying-lurker-handler arg0 arg1 arg2 arg3)
)
)
)
+18 -16
View File
@@ -25,6 +25,7 @@
:flag-assert #x900000004
)
(define *SNOWBALL-bank* (new 'static 'snowball-bank))
(defbehavior target-snowball-post target ()
@@ -51,22 +52,23 @@
(defstate target-snowball-start (target)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (cond
((and (= arg2 'query) (= (-> arg3 param 0) 'mode))
'snowball
)
((let ((v1-3 arg2))
(= v1-3 'end-mode)
)
enter-state
(-> *TARGET-bank* duck-jump-height-min)
(-> *TARGET-bank* duck-jump-height-max)
(go target-jump)
)
(else
(target-generic-event-handler arg0 arg1 arg2 arg3)
)
)
(cond
((and (= arg2 'query) (= (-> arg3 param 0) 'mode))
'snowball
)
((let ((v1-3 arg2))
(= v1-3 'end-mode)
)
(go
target-jump
(-> *TARGET-bank* duck-jump-height-min)
(-> *TARGET-bank* duck-jump-height-max)
#f
)
)
(else
(target-generic-event-handler arg0 arg1 arg2 arg3)
)
)
)
:exit
+11 -15
View File
@@ -247,24 +247,20 @@
)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
yeti-slave-default-event-handler yeti-slave
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'attack)
(nav-enemy-set-hit-from-direction arg0)
(go-virtual nav-enemy-die)
)
((= v1-0 'touch)
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg3 param 0))
'generic
)
)
)
(case arg2
(('attack)
(nav-enemy-set-hit-from-direction arg0)
(go-virtual nav-enemy-die)
)
(('touch)
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg3 param 0))
'generic
)
)
)
)
+50 -58
View File
@@ -130,11 +130,10 @@
(defstate qbert-plat-on-mimic (qbert-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'die)
(go qbert-plat-on-die)
)
)
(case arg2
(('die)
(go qbert-plat-on-die)
)
)
)
:code
@@ -500,59 +499,52 @@
(defstate qbert-plat-master-idle (qbert-plat-master)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'trigger)
(start-hint-timer (the-as level-hint-control 842))
(close-specific-task!
(game-task sunken-platforms)
(task-status need-hint)
)
(when (not (-> self puzzle-beaten?))
(let ((v1-2 (-> arg3 param 0)))
(when (!= v1-2 (-> self last-plat-triggered))
(set! (-> self last-plat-triggered) (the-as int v1-2))
(let
((s5-1
(=
(-> self plat-states-needed-to-open-door)
(-> self plat-states)
)
)
)
(let ((v1-3 (ash 1 v1-2)))
(set!
(-> self plat-states)
(logxor (-> self plat-states) (the-as uint v1-3))
)
(if (zero? (logand v1-3 (-> self plat-states)))
(level-hint-spawn
(game-text-id sunken-qbert-hint)
"sksp0130"
(the-as entity #f)
*entity-pool*
(game-task none)
)
)
)
(send-event arg0 'notify)
(let
((a0-13
(=
(-> self plat-states-needed-to-open-door)
(-> self plat-states)
)
)
)
(if (!= s5-1 a0-13)
(go qbert-plat-master-do-door a0-13)
)
)
)
)
)
)
)
)
(case arg2
(('trigger)
(start-hint-timer (the-as level-hint-control 842))
(close-specific-task!
(game-task sunken-platforms)
(task-status need-hint)
)
(when (not (-> self puzzle-beaten?))
(let ((v1-2 (-> arg3 param 0)))
(when (!= v1-2 (-> self last-plat-triggered))
(set! (-> self last-plat-triggered) (the-as int v1-2))
(let
((s5-1
(= (-> self plat-states-needed-to-open-door) (-> self plat-states))
)
)
(let ((v1-3 (ash 1 v1-2)))
(set!
(-> self plat-states)
(logxor (-> self plat-states) (the-as uint v1-3))
)
(if (zero? (logand v1-3 (-> self plat-states)))
(level-hint-spawn
(game-text-id sunken-qbert-hint)
"sksp0130"
(the-as entity #f)
*entity-pool*
(game-task none)
)
)
)
(send-event arg0 'notify)
(let
((a0-13
(= (-> self plat-states-needed-to-open-door) (-> self plat-states))
)
)
(if (!= s5-1 a0-13)
(go qbert-plat-master-do-door a0-13)
)
)
)
)
)
)
)
)
)
:code
+22 -27
View File
@@ -360,20 +360,16 @@
(defstate square-platform-lowered (square-platform)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'trigger)
(if
(and
(= (-> arg0 type) square-platform-master)
(=
(-> (the-as square-platform-master arg0) plat-id)
(-> self plat-id)
)
)
(go square-platform-rising)
)
)
)
(case arg2
(('trigger)
(if
(and
(= (-> arg0 type) square-platform-master)
(= (-> (the-as square-platform-master arg0) plat-id) (-> self plat-id))
)
(go square-platform-rising)
)
)
)
)
:code
@@ -676,19 +672,18 @@
(defstate square-platform-master-idle (square-platform-master)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'trigger)
(when (= (-> arg0 type) square-platform-button)
(set!
(-> self button-id)
(-> (the-as square-platform-button arg0) button-id)
)
(logclear! (-> self mask) (process-mask actor-pause))
(process-entity-status! self (entity-perm-status bit-3) #t)
(go square-platform-master-activate)
)
)
)
(case arg2
(('trigger)
(when (= (-> arg0 type) square-platform-button)
(set!
(-> self button-id)
(-> (the-as square-platform-button arg0) button-id)
)
(logclear! (-> self mask) (process-mask actor-pause))
(process-entity-status! self (entity-perm-status bit-3) #t)
(go square-platform-master-activate)
)
)
)
)
:code
+8 -10
View File
@@ -51,11 +51,10 @@
(defstate wall-plat-retracted (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'trigger)
(go wall-plat-extending)
)
)
(case arg2
(('trigger)
(go wall-plat-extending)
)
)
)
:code
@@ -134,11 +133,10 @@
(defstate wall-plat-extended (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'untrigger)
(go wall-plat-retracting)
)
)
(case arg2
(('untrigger)
(go wall-plat-retracting)
)
)
)
:code
+19 -28
View File
@@ -107,37 +107,28 @@
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
swamp-bat-slave-event-handler swamp-bat-slave
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'attack)
(logclear! (-> self mask) (process-mask actor-pause))
(go swamp-bat-slave-die (process->handle arg0))
)
((= v1-0 'touch)
(level-hint-spawn
(game-text-id swamp-bats-hint)
"sksp0156"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(send-event
arg0
'attack
(-> arg3 param 0)
(new 'static 'attack-info)
)
)
((= v1-0 'launch)
(if (-> self launch-ready)
(go swamp-bat-slave-launch)
)
)
)
(case arg2
(('attack)
(logclear! (-> self mask) (process-mask actor-pause))
(go swamp-bat-slave-die (process->handle arg0))
)
(('touch)
(level-hint-spawn
(game-text-id swamp-bats-hint)
"sksp0156"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info))
)
(('launch)
(if (-> self launch-ready)
(go swamp-bat-slave-launch)
)
)
)
)
+45 -59
View File
@@ -880,55 +880,43 @@
(defbehavior
swamp-rat-nest-dummy-event-handler swamp-rat-nest-dummy
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'shake)
(if (= (-> self next-state name) 'swamp-rat-nest-dummy-idle)
(go swamp-rat-nest-dummy-shake)
)
)
((= v1-0 'attack)
(send-event
(ppointer->process (-> self parent-process))
'hit
)
(let ((v1-7 (-> arg3 param 2)))
(when (!= v1-7 (-> self parent-process 0 player-attack-id))
(set!
(-> self parent-process 0 player-attack-id)
(the-as int v1-7)
)
(cond
((and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow))
(swamp-rat-nest-dummy-take-damage 3)
(if
(<
(vector-vector-distance
(target-pos 0)
(-> self top-sphere)
)
(-> self top-sphere w)
)
(send-event *target* 'no-look-around 75)
)
(go swamp-rat-nest-dummy-hit)
)
(else
(level-hint-spawn
(game-text-id swamp-rats-nest-hint)
"sksp0144"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(swamp-rat-nest-dummy-take-damage 0)
(go swamp-rat-nest-dummy-hit)
)
)
)
)
)
)
(case arg2
(('shake)
(if (= (-> self next-state name) 'swamp-rat-nest-dummy-idle)
(go swamp-rat-nest-dummy-shake)
)
)
(('attack)
(send-event (ppointer->process (-> self parent-process)) 'hit)
(let ((v1-7 (-> arg3 param 2)))
(when (!= v1-7 (-> self parent-process 0 player-attack-id))
(set! (-> self parent-process 0 player-attack-id) (the-as int v1-7))
(cond
((and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow))
(swamp-rat-nest-dummy-take-damage 3)
(if
(<
(vector-vector-distance (target-pos 0) (-> self top-sphere))
(-> self top-sphere w)
)
(send-event *target* 'no-look-around 75)
)
(go swamp-rat-nest-dummy-hit)
)
(else
(level-hint-spawn
(game-text-id swamp-rats-nest-hint)
"sksp0144"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(swamp-rat-nest-dummy-take-damage 0)
(go swamp-rat-nest-dummy-hit)
)
)
)
)
)
)
)
@@ -1192,11 +1180,10 @@
(defbehavior
swamp-rat-nest-default-event-handler swamp-rat-nest
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'victory)
(go swamp-rat-nest-victory)
)
)
(case arg2
(('victory)
(go swamp-rat-nest-victory)
)
)
)
@@ -1430,11 +1417,10 @@ swamp-rat-nest-default-event-handler
(defstate swamp-rat-nest-idle (swamp-rat-nest)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'hit)
(go swamp-rat-nest-active)
)
)
(case arg2
(('hit)
(go swamp-rat-nest-active)
)
)
)
:enter
+18 -22
View File
@@ -53,42 +53,38 @@
(set! *swamp-rat-sg* v1-1)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defmethod
dummy-44
swamp-rat
((obj swamp-rat) (arg0 process) (arg1 event-message-block))
(the-as
object
(when
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg1 param 0))
(-> obj collide-info)
(the-as uint 1)
)
(when
((method-of-type touching-shapes-entry prims-touching?)
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg1 param 0))
(-> obj collide-info)
(the-as uint 1)
'generic
)
(when
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg1 param 0))
'generic
)
(let* ((s5-1 (-> obj parent))
(a0-4
(if (and (nonzero? s5-1) (type-type? pointer process-drawable))
s5-1
)
)
(let* ((s5-1 (-> obj parent))
(a0-4 (if (and (nonzero? s5-1) (type-type? pointer process-drawable))
s5-1
)
)
(if a0-4
(send-event (the-as process a0-4) 'victory)
(go (method-of-object obj nav-enemy-victory))
)
)
(if a0-4
(send-event (the-as process a0-4) 'victory)
(go (method-of-object obj nav-enemy-victory))
)
)
)
)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
swamp-rat-default-event-handler swamp-rat
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
+1
View File
@@ -183,6 +183,7 @@
(set! *yakow-sg* v1-5)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
yakow-default-event-handler yakow
+1 -1
View File
@@ -244,7 +244,7 @@ Val* Compiler::compile_go_hook(const goos::Object& form, const goos::Object& res
// now we have to call the function.
auto enter_state_func = compile_get_symbol_value(form, "enter-state", env);
enter_state_func->set_type(state_to_go_function(state->type()));
enter_state_func->set_type(state_to_go_function(state->type(), TypeSpec("object")));
std::vector<RegVal*> function_arguments;
for (size_t i = 2; i < args.unnamed.size(); i++) {
+1 -1
View File
@@ -731,7 +731,7 @@ Val* Compiler::compile_deref(const goos::Object& form, const goos::Object& _rest
// special case (-> <state> enter) should return the appropriate function type.
if (in_type.arg_count() > 0 && in_type.base_type() == "state") {
if (field_name == "enter") {
result->set_type(state_to_go_function(in_type));
result->set_type(state_to_go_function(in_type, TypeSpec("none")));
}
}
@@ -5301,6 +5301,7 @@
)
;; definition for function cam-layout-init
;; INFO: Return type mismatch object vs none.
(defbehavior cam-layout-init cam-layout ()
(set! (-> self res-key) (-> (new 'static 'array float 1 -1000000000.0) 0))
(set! (-> self num-entities) 0)
+10 -10
View File
@@ -157,16 +157,15 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'abort)
(when (logtest? (-> self flags) 1)
(logior! (-> self flags) 2)
(if (= (-> self anim-name type) string)
(go-virtual pov-camera-abort)
)
)
)
)
(case arg2
(('abort)
(when (logtest? (-> self flags) 1)
(logior! (-> self flags) 2)
(if (= (-> self anim-name type) string)
(go-virtual pov-camera-abort)
)
)
)
)
)
:enter
@@ -328,6 +327,7 @@
)
;; definition for function pov-camera-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
pov-camera-init-by-other pov-camera
+38 -46
View File
@@ -1249,55 +1249,46 @@
)
;; definition for function anim-tester-standard-event-handler
;; INFO: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
anim-tester-standard-event-handler anim-tester
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'reset)
(process-disconnect self)
(set! (-> self flags) (logand -2 (-> self flags)))
(when (!= (-> *anim-tester* 0 edit-mode) 1)
(set! (-> *debug-menu-context* is-hidden) #f)
(set! (-> *anim-tester* 0 edit-mode) 0)
(set! *camera-read-buttons* #t)
)
(anim-tester-reset)
(go anim-tester-process)
)
((= v1-0 'change-anim)
(go anim-tester-process)
)
((= v1-0 'pick-object)
(set! (-> self edit-mode) 1)
(set! *camera-read-buttons* #f)
#f
)
((= v1-0 'pick-joint-anim)
(set! (-> self edit-mode) 2)
(set! *camera-read-buttons* #f)
#f
)
((= v1-0 'pick-sequence)
(set! (-> self edit-mode) 3)
(set! *camera-read-buttons* #f)
#f
)
((= v1-0 'edit-sequence)
(set! (-> self edit-mode) 4)
(set! *camera-read-buttons* #f)
#f
)
((= v1-0 'save-sequences)
(anim-tester-save-all-objects self)
)
)
(case arg2
(('reset)
(process-disconnect self)
(set! (-> self flags) (logand -2 (-> self flags)))
(when (!= (-> *anim-tester* 0 edit-mode) 1)
(set! (-> *debug-menu-context* is-hidden) #f)
(set! (-> *anim-tester* 0 edit-mode) 0)
(set! *camera-read-buttons* #t)
)
(anim-tester-reset)
(go anim-tester-process)
)
(('change-anim)
(go anim-tester-process)
)
(('pick-object)
(set! (-> self edit-mode) 1)
(set! *camera-read-buttons* #f)
#f
)
(('pick-joint-anim)
(set! (-> self edit-mode) 2)
(set! *camera-read-buttons* #f)
#f
)
(('pick-sequence)
(set! (-> self edit-mode) 3)
(set! *camera-read-buttons* #f)
#f
)
(('edit-sequence)
(set! (-> self edit-mode) 4)
(set! *camera-read-buttons* #f)
#f
)
(('save-sequences)
(anim-tester-save-all-objects self)
)
)
)
@@ -3259,6 +3250,7 @@
)
;; definition for function initialize-anim-tester
;; INFO: Return type mismatch object vs none.
(defbehavior initialize-anim-tester anim-tester ()
(glst-init-list! (-> self obj-list))
(logclear! (-> self mask) (process-mask menu))
+47 -62
View File
@@ -927,68 +927,53 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'touched)
(when (-> self attack-mode)
(when (cond
((= (-> arg0 type) target)
(let
((a1-1
(new 'stack-no-clear 'event-message-block)
)
)
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'attack)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(let
((a0-4 (new 'static 'attack-info :mask #x20)))
(set! (-> a0-4 mode) (-> self attack-mode))
(set! (-> a1-1 param 1) (the-as uint a0-4))
)
(send-event-function arg0 a1-1)
)
)
(else
(let
((a1-2
(new 'stack-no-clear 'event-message-block)
)
)
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 4)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(set!
(-> a1-2 param 1)
(the-as uint (-> self attack-mode))
)
(let ((v1-13 (+ *global-attack-id* 1)))
(set! *global-attack-id* v1-13)
(set! (-> a1-2 param 2) (the-as uint v1-13))
)
(set! (-> a1-2 param 3) (the-as uint 0))
(send-event-function arg0 a1-2)
)
)
)
(let ((v1-14 (-> self notify-handle)))
(if (handle->process v1-14)
(send-event (-> v1-14 process 0) 'notify 'attack arg0)
)
)
(+! (-> self hits) 1)
(if (>= (-> self hits) (-> self max-hits))
(go-virtual projectile-impact)
)
)
)
)
((= v1-0 'die)
(go-virtual projectile-impact)
)
)
(case arg2
(('touched)
(when (-> self attack-mode)
(when (cond
((= (-> arg0 type) target)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'attack)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(let ((a0-4 (new 'static 'attack-info :mask #x20)))
(set! (-> a0-4 mode) (-> self attack-mode))
(set! (-> a1-1 param 1) (the-as uint a0-4))
)
(send-event-function arg0 a1-1)
)
)
(else
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 4)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(set! (-> a1-2 param 1) (the-as uint (-> self attack-mode)))
(let ((v1-13 (+ *global-attack-id* 1)))
(set! *global-attack-id* v1-13)
(set! (-> a1-2 param 2) (the-as uint v1-13))
)
(set! (-> a1-2 param 3) (the-as uint 0))
(send-event-function arg0 a1-2)
)
)
)
(let ((v1-14 (-> self notify-handle)))
(if (handle->process v1-14)
(send-event (-> v1-14 process 0) 'notify 'attack arg0)
)
)
(+! (-> self hits) 1)
(if (>= (-> self hits) (-> self max-hits))
(go-virtual projectile-impact)
)
)
)
)
(('die)
(go-virtual projectile-impact)
)
)
)
@@ -332,6 +332,7 @@
)
;; definition for method 38 of type process-taskable
;; INFO: Return type mismatch object vs none.
(defmethod dummy-38 process-taskable ((obj process-taskable))
(if (nonzero? (-> obj cell-for-task))
(go (method-of-object obj give-cell))
@@ -945,6 +946,7 @@
)
;; definition for function process-taskable-hide-handler
;; INFO: Return type mismatch object vs none.
(defbehavior
process-taskable-hide-handler process-taskable
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -1103,46 +1105,53 @@
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'shadow)
(the-as shadow-geo (cond
((-> arg3 param 0)
(let ((v0-0 (-> self shadow-backup)))
(set! (-> self draw shadow) v0-0)
v0-0
)
)
(else
(set! (-> self draw shadow) #f)
(the-as shadow-geo #f)
)
)
)
)
((= v1-0 'shadow-min-max)
(let ((v1-5 (-> self draw shadow-ctrl)))
(let ((a0-5 v1-5))
(set!
(-> a0-5 settings bot-plane w)
(- (the-as float (-> arg3 param 0)))
(the-as shadow-geo (cond
((= v1-0 'shadow)
(the-as shadow-geo (cond
((-> arg3 param 0)
(let
((v0-0 (-> self shadow-backup)))
(set! (-> self draw shadow) v0-0)
v0-0
)
)
(else
(set! (-> self draw shadow) #f)
(the-as shadow-geo #f)
)
)
)
)
((= v1-0 'shadow-min-max)
(let ((v1-5 (-> self draw shadow-ctrl)))
(let ((a0-5 v1-5))
(set!
(-> a0-5 settings bot-plane w)
(- (the-as float (-> arg3 param 0)))
)
)
0
(set!
(-> v1-5 settings top-plane w)
(- (the-as float (-> arg3 param 1)))
)
)
(the-as shadow-geo 0)
)
((= v1-0 'end-mode)
(the-as shadow-geo (if (should-display? self)
(the-as
shadow-geo
(go-virtual idle)
)
(the-as
shadow-geo
(go-virtual hidden)
)
)
)
)
)
)
0
(set!
(-> v1-5 settings top-plane w)
(- (the-as float (-> arg3 param 1)))
)
)
(the-as shadow-geo 0)
)
((= v1-0 'end-mode)
(the-as shadow-geo (if (should-display? self)
(the-as shadow-geo (go-virtual idle))
(the-as shadow-geo (go-virtual hidden))
)
)
)
)
)
)
)
@@ -1559,6 +1568,7 @@
)
;; definition for method 42 of type process-taskable
;; INFO: Return type mismatch object vs none.
(defmethod dummy-42 process-taskable ((obj process-taskable))
(cond
((not (should-display? obj))
@@ -2722,6 +2722,7 @@
)
;; definition for function init-target
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior init-target target ((arg0 continue-point))
(set-setting! *setting-control* self 'allow-pause #f 0.0 0)
+49 -57
View File
@@ -1103,77 +1103,69 @@
)
;; definition for function fall-test
;; INFO: Return type mismatch none vs object.
(defbehavior fall-test target ((arg0 symbol) (arg1 symbol))
(the-as
object
(when
(and
(zero? (logand (-> self control status) 1))
(>=
(- (-> *display* base-frame-counter) (-> self control unknown-dword10))
(the-as int (-> *TARGET-bank* ground-timeout))
)
(>=
0.0
(vector-dot
(-> self control dynam gravity-normal)
(-> self control transv)
)
)
(let ((v1-15 (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
)
(or
(not
(or
(= v1-15 (-> self draw art-group data 59))
(= v1-15 (-> self draw art-group data 60))
(= v1-15 (-> self draw art-group data 61))
)
)
(< 4096.0 (target-height-above-ground))
)
)
)
(when
(and
(zero? (logand (-> self control status) 1))
(>=
(- (-> *display* base-frame-counter) (-> self control unknown-dword10))
(<
(-
(-> *display* base-frame-counter)
(the-as int (-> self control rider-time))
)
(the-as int (-> *TARGET-bank* ground-timeout))
)
(>=
0.0
(vector-dot
(-> self control dynam gravity-normal)
(-> self control transv)
)
)
(let ((v1-15 (if (> (-> self skel active-channels) 0)
(-> self skel root-channel 0 frame-group)
)
)
)
(or
(not
(or
(= v1-15 (-> self draw art-group data 59))
(= v1-15 (-> self draw art-group data 60))
(= v1-15 (-> self draw art-group data 61))
)
)
(< 4096.0 (target-height-above-ground))
)
)
(logtest? (-> self control unknown-surface01 flags) #x4000)
)
(when
(and
(<
(-
(-> *display* base-frame-counter)
(the-as int (-> self control rider-time))
)
(the-as int (-> *TARGET-bank* ground-timeout))
)
(logtest? (-> self control unknown-surface01 flags) #x4000)
)
(+! (-> self control transv x) (-> self control rider-last-move x))
(+! (-> self control transv z) (-> self control rider-last-move z))
)
(go target-falling #f)
(+! (-> self control transv x) (-> self control rider-last-move x))
(+! (-> self control transv z) (-> self control rider-last-move z))
)
(go target-falling #f)
)
)
;; definition for function slide-down-test
;; INFO: Return type mismatch none vs object.
(defbehavior slide-down-test target ((arg0 symbol) (arg1 symbol))
(the-as
object
(if
(and
(zero? (logand (-> self control status) 129))
(>=
(- (-> *display* base-frame-counter) (-> self control unknown-dword10))
(the-as int (-> *TARGET-bank* ground-timeout))
)
(logtest? (-> self control status) 4)
(< 0.5 (-> self control surface-angle))
(if
(and
(zero? (logand (-> self control status) 129))
(>=
(- (-> *display* base-frame-counter) (-> self control unknown-dword10))
(the-as int (-> *TARGET-bank* ground-timeout))
)
(go target-slide-down)
(logtest? (-> self control status) 4)
(< 0.5 (-> self control surface-angle))
)
(go target-slide-down)
)
)
+8 -10
View File
@@ -394,16 +394,13 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'trigger)
(set! (-> self trigger) #t)
(go-virtual falling)
)
((= v1-0 'loading)
(go-virtual loading)
)
)
(case arg2
(('trigger)
(set! (-> self trigger) #t)
(go-virtual falling)
)
(('loading)
(go-virtual loading)
)
)
)
@@ -635,6 +632,7 @@
)
;; definition for method 11 of type beach-rock
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! beach-rock ((obj beach-rock) (arg0 res-lump))
(set! (-> obj link) (new 'process 'actor-link-info obj))
(set! (-> obj align) (new 'process 'align-control obj))
@@ -263,6 +263,7 @@
)
;; definition for method 11 of type bird-lady
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! bird-lady ((obj bird-lady) (arg0 res-lump))
(dummy-40
obj
+55 -64
View File
@@ -146,11 +146,6 @@
)
;; definition for method 43 of type lurkercrab
;; INFO: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; Used lq/sq
(defmethod
dummy-43
@@ -159,65 +154,60 @@
(let ((s5-0 (-> obj incomming-attack-id)))
(set! (-> obj incomming-attack-id) (the-as handle (-> arg1 param 2)))
(let ((v1-1 (-> arg1 param 1)))
(the-as object (cond
((or (= v1-1 'flop) (= v1-1 'explode) (= v1-1 'darkeco))
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((= v1-1 'punch)
(cond
((logtest? (-> obj nav-enemy-flags) 32)
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((begin
(let ((s4-0 (new 'stack-no-clear 'vector)))
(let ((f30-0 (quaternion-xz-angle (target-rot))))
(set-vector!
s4-0
(* 24576.0 (sin f30-0))
0.0
(* 24576.0 (cos f30-0))
1.0
)
)
(vector+! s4-0 (-> obj collide-info trans) s4-0)
(set! (-> obj nav target-pos quad) (-> s4-0 quad))
)
(go lurkercrab-pushed)
(= s5-0 (-> obj incomming-attack-id))
)
'push
)
(else
#t
)
)
)
((logtest? (-> obj nav-enemy-flags) 32)
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((begin
(let ((s4-1 (new 'stack-no-clear 'vector)))
(vector-!
s4-1
(-> obj collide-info trans)
(target-pos 0)
)
(vector-normalize! s4-1 24576.0)
(vector+! s4-1 (-> obj collide-info trans) s4-1)
(set! (-> obj nav target-pos quad) (-> s4-1 quad))
)
(go lurkercrab-pushed)
(= s5-0 (-> obj incomming-attack-id))
)
'push
)
(else
#t
)
)
(cond
((or (= v1-1 'flop) (= v1-1 'explode) (= v1-1 'darkeco))
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((= v1-1 'punch)
(cond
((logtest? (-> obj nav-enemy-flags) 32)
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((begin
(let ((s4-0 (new 'stack-no-clear 'vector)))
(let ((f30-0 (quaternion-xz-angle (target-rot))))
(set-vector!
s4-0
(* 24576.0 (sin f30-0))
0.0
(* 24576.0 (cos f30-0))
1.0
)
)
(vector+! s4-0 (-> obj collide-info trans) s4-0)
(set! (-> obj nav target-pos quad) (-> s4-0 quad))
)
(go lurkercrab-pushed)
(= s5-0 (-> obj incomming-attack-id))
)
'push
)
(else
#t
)
)
)
((logtest? (-> obj nav-enemy-flags) 32)
(logclear! (-> obj mask) (process-mask actor-pause))
(go (method-of-object obj nav-enemy-die))
)
((begin
(let ((s4-1 (new 'stack-no-clear 'vector)))
(vector-! s4-1 (-> obj collide-info trans) (target-pos 0))
(vector-normalize! s4-1 24576.0)
(vector+! s4-1 (-> obj collide-info trans) s4-1)
(set! (-> obj nav target-pos quad) (-> s4-1 quad))
)
(go lurkercrab-pushed)
(= s5-0 (-> obj incomming-attack-id))
)
'push
)
(else
#t
)
)
)
)
@@ -1170,6 +1160,7 @@ nav-enemy-default-event-handler
)
;; definition for method 11 of type lurkercrab
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! lurkercrab ((obj lurkercrab) (arg0 res-lump))
(let
((s4-0
@@ -141,22 +141,19 @@
(defstate drop-plat-idle (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'drop)
(logclear! (-> self mask) (process-mask actor-pause))
(go drop-plat-drop)
)
((or (= v1-0 'touch) (= v1-0 'attack))
(send-event *target* 'no-look-around 300)
(send-event
(ppointer->process (-> self parent))
'player-stepped
(-> self color)
)
#f
)
)
(case arg2
(('drop)
(logclear! (-> self mask) (process-mask actor-pause))
(go drop-plat-drop)
)
(('touch 'attack)
(send-event *target* 'no-look-around 300)
(send-event
(ppointer->process (-> self parent))
'player-stepped
(-> self color)
)
#f
)
)
)
@@ -212,11 +209,10 @@
(defstate drop-plat-spawn (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'drop)
(go drop-plat-die)
)
)
(case arg2
(('drop)
(go drop-plat-die)
)
)
)
:code
@@ -251,11 +247,10 @@
(defstate drop-plat-rise (drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'drop)
(go drop-plat-drop)
)
)
(case arg2
(('drop)
(go drop-plat-drop)
)
)
)
:code
@@ -511,6 +506,7 @@
)
;; definition for function drop-plat-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
drop-plat-init-by-other drop-plat
@@ -770,11 +766,10 @@
(defstate citb-drop-plat-idle (citb-drop-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'trigger)
(go citb-drop-plat-active)
)
)
(case arg2
(('trigger)
(go citb-drop-plat-active)
)
)
)
:code
@@ -847,6 +842,7 @@
)
;; definition for method 11 of type citb-drop-plat
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod copy-defaults! citb-drop-plat ((obj citb-drop-plat) (arg0 res-lump))
(set! (-> obj root) (new 'process 'trsqv))
@@ -683,6 +683,7 @@ nav-enemy-default-event-handler
)
;; definition for method 11 of type babak-with-cannon
;; INFO: Return type mismatch object vs none.
(defmethod
copy-defaults!
babak-with-cannon
+95 -109
View File
@@ -111,49 +111,42 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'attack)
(case (-> arg3 param 1)
(('flop)
(TODO-RENAME-29
self
(-> self event-going-down)
(-> self notify-actor)
)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
)
)
((= v1-0 'trigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
((= v1-0 'move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
(case arg2
(('attack)
(case (-> arg3 param 1)
(('flop)
(TODO-RENAME-29 self (-> self event-going-down) (-> self notify-actor))
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
)
)
(('trigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
(('move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
)
@@ -188,28 +181,25 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'untrigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-up)
)
((= v1-0 'move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
(case arg2
(('untrigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-up)
)
(('move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
)
@@ -270,28 +260,25 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'untrigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-up)
)
((= v1-0 'move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
(case arg2
(('untrigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-up)
)
(('move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
)
)
@@ -354,28 +341,25 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
((= v1-0 'trigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
)
(case arg2
(('move-to)
(move-to-vec-or-quat!
self
(the-as vector (-> arg3 param 0))
(the-as quaternion (-> arg3 param 1))
)
)
(('trigger)
(sound-play-by-name
(static-sound-name "silo-button")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go-virtual basebutton-going-down)
)
)
)
@@ -611,6 +595,7 @@
)
;; definition for method 11 of type basebutton
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! basebutton ((obj basebutton) (arg0 res-lump))
(reset! obj)
(set! (-> obj spawned-by-other?) #f)
@@ -664,6 +649,7 @@
)
;; definition for function basebutton-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
basebutton-init-by-other basebutton
@@ -526,6 +526,7 @@ eco-door-event-handler
)
;; definition for method 11 of type eco-door
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! eco-door ((obj eco-door) (arg0 res-lump))
(TODO-RENAME-24 obj)
(process-drawable-from-entity! obj arg0)
@@ -143,48 +143,36 @@
)
;; definition for function battlecontroller-default-event-handler
;; INFO: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
;; Used lq/sq
(defbehavior
battlecontroller-default-event-handler battlecontroller
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'child-die)
(+! (-> self die-count) 1)
(when (= (-> self die-count) (-> self max-spawn-count))
(let ((v1-4 (the-as process-drawable arg0)))
(when v1-4
(set!
(-> self final-pickup-spawn-point quad)
(-> v1-4 root trans quad)
)
(case (-> self final-pickup-type)
(((pickup-type fuel-cell))
#f
)
(else
(set!
(-> v1-4 fact pickup-type)
(-> self final-pickup-type)
)
(set! (-> v1-4 fact pickup-amount) 1.0)
(let ((f0-1 0.0))
(set! (-> v1-4 fact pickup-spawn-amount) f0-1)
f0-1
)
)
)
)
)
)
)
((= v1-0 'trigger)
(go-virtual battlecontroller-die)
)
)
(case arg2
(('child-die)
(+! (-> self die-count) 1)
(when (= (-> self die-count) (-> self max-spawn-count))
(let ((v1-4 (the-as process-drawable arg0)))
(when v1-4
(set! (-> self final-pickup-spawn-point quad) (-> v1-4 root trans quad))
(case (-> self final-pickup-type)
(((pickup-type fuel-cell))
#f
)
(else
(set! (-> v1-4 fact pickup-type) (-> self final-pickup-type))
(set! (-> v1-4 fact pickup-amount) 1.0)
(let ((f0-1 0.0))
(set! (-> v1-4 fact pickup-spawn-amount) f0-1)
f0-1
)
)
)
)
)
)
)
(('trigger)
(go-virtual battlecontroller-die)
)
)
)
@@ -49,6 +49,7 @@
)
;; definition for function blocking-plane-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
blocking-plane-init-by-other blocking-plane
@@ -179,7 +180,3 @@
(none)
)
)
+11 -15
View File
@@ -202,25 +202,19 @@
)
;; definition for method 43 of type nav-enemy
;; INFO: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defmethod
dummy-43
nav-enemy
((obj nav-enemy) (arg0 process) (arg1 event-message-block))
(the-as object (cond
((logtest? (-> obj nav-enemy-flags) 32)
(send-event arg0 'get-attack-count 1)
(logclear!
(-> obj mask)
(process-mask actor-pause attackable)
)
(go (method-of-object obj nav-enemy-die))
)
(else
(dummy-44 obj arg0 arg1)
)
)
(cond
((logtest? (-> obj nav-enemy-flags) 32)
(send-event arg0 'get-attack-count 1)
(logclear! (-> obj mask) (process-mask actor-pause attackable))
(go (method-of-object obj nav-enemy-die))
)
(else
(dummy-44 obj arg0 arg1)
)
)
)
@@ -250,6 +244,7 @@
)
;; definition for function nav-enemy-default-event-handler
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
nav-enemy-default-event-handler nav-enemy
@@ -3110,6 +3105,7 @@ nav-enemy-default-event-handler
)
;; definition for function nav-enemy-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
nav-enemy-init-by-other nav-enemy
+22 -23
View File
@@ -92,29 +92,28 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'touch)
(when (can-activate? self)
(if
(and
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(-> self root-override)
(the-as uint 1)
)
(or
(not (-> self should-grab-player?))
(let ((v0-3 (process-grab? *target*)))
(set! (-> self grab-player?) v0-3)
v0-3
)
)
)
(go-virtual plat-button-pressed)
)
)
)
)
(case arg2
(('touch)
(when (can-activate? self)
(if
(and
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg3 param 0))
(-> self root-override)
(the-as uint 1)
)
(or
(not (-> self should-grab-player?))
(let ((v0-3 (process-grab? *target*)))
(set! (-> self grab-player?) v0-3)
v0-3
)
)
)
(go-virtual plat-button-pressed)
)
)
)
)
)
:code
+1
View File
@@ -379,6 +379,7 @@
)
;; definition for method 11 of type plat
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! plat ((obj plat) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(dummy-24 obj)
@@ -1219,6 +1219,7 @@ nav-enemy-default-event-handler
)
;; definition for method 11 of type sharkey
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod copy-defaults! sharkey ((obj sharkey) (arg0 res-lump))
(set! (-> obj scale) (res-lump-float arg0 'scale :default 1.0))
@@ -121,12 +121,11 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'open)
enter-state
(go-virtual open)
)
)
(case arg2
(('open)
enter-state
(go-virtual open)
)
)
)
:code
@@ -267,6 +266,7 @@
)
;; definition for method 11 of type final-door
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! final-door ((obj final-door) (arg0 res-lump))
(let
((s4-0
@@ -557,6 +557,7 @@
)
;; definition for function powercellalt-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
powercellalt-init-by-other powercellalt
@@ -1261,6 +1261,7 @@
)
;; definition for function green-eco-lurker-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
green-eco-lurker-init-by-other green-eco-lurker
@@ -1343,6 +1344,7 @@
)
;; definition for function green-eco-lurker-gen-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
green-eco-lurker-gen-init-by-other green-eco-lurker-gen
+52 -55
View File
@@ -574,22 +574,20 @@
)
;; definition for function light-eco-child-default-event-handler
;; INFO: Return type mismatch none vs object.
(defbehavior
light-eco-child-default-event-handler light-eco-child
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (or (= v1-0 'touch) (= v1-0 'attack))
(when (= (-> arg0 type) target)
(send-event
(ppointer->process (-> self parent))
'trigger
(-> self angle-bit)
)
(go light-eco-child-grabbed)
)
)
)
(case arg2
(('touch 'attack)
(when (= (-> arg0 type) target)
(send-event
(ppointer->process (-> self parent))
'trigger
(-> self angle-bit)
)
(go light-eco-child-grabbed)
)
)
)
)
@@ -826,6 +824,7 @@
)
;; definition for function light-eco-child-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
light-eco-child-init-by-other light-eco-child
@@ -1010,54 +1009,51 @@
)
;; definition for function light-eco-mother-default-event-handler
;; INFO: Return type mismatch none vs object.
;; INFO: Return type mismatch object vs int.
(defbehavior
light-eco-mother-default-event-handler light-eco-mother
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'untrigger)
(the-as int (when (= (-> arg0 type) light-eco-child)
(let* ((a1-3 (-> arg3 param 0))
(v0-0
(logxor
(-> self angle-mask)
(ash 1 a1-3)
)
)
)
(set! (-> self angle-mask) v0-0)
v0-0
)
(the-as int (cond
((= v1-0 'untrigger)
(the-as int (when (= (-> arg0 type) light-eco-child)
(let* ((a1-3 (-> arg3 param 0))
(v0-0
(logxor (-> self angle-mask) (ash 1 a1-3))
)
)
(set! (-> self angle-mask) v0-0)
v0-0
)
)
)
)
((= v1-0 'trigger)
(the-as int (when (not (-> self player-got-eco?))
(set! (-> self player-got-eco?) #t)
(let
((a1-5
(new 'stack-no-clear 'event-message-block)
)
)
)
((= v1-0 'trigger)
(the-as int (when (not (-> self player-got-eco?))
(set! (-> self player-got-eco?) #t)
(let
((a1-5
(new 'stack-no-clear 'event-message-block)
)
)
(set! (-> a1-5 from) self)
(set! (-> a1-5 num-params) 0)
(set! (-> a1-5 message) 'white-eco-picked-up)
(the-as
int
(send-event-function
(ppointer->process (-> self parent))
a1-5
)
)
)
)
(set! (-> a1-5 from) self)
(set! (-> a1-5 num-params) 0)
(set! (-> a1-5 message) 'white-eco-picked-up)
(the-as
int
(send-event-function
(ppointer->process (-> self parent))
a1-5
)
)
)
((= v1-0 'beam-off)
(the-as int (go light-eco-mother-discipate))
)
)
)
)
)
)
)
((= v1-0 'beam-off)
(the-as int (go light-eco-mother-discipate))
)
)
)
)
)
@@ -1202,6 +1198,7 @@
)
;; definition for function light-eco-mother-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
light-eco-mother-init-by-other light-eco-mother
@@ -469,6 +469,7 @@
)
;; definition for method 11 of type ecoclaw
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! ecoclaw ((obj ecoclaw) (arg0 res-lump))
(set! (-> obj root) (new 'process 'trsqv))
(process-drawable-from-entity! obj arg0)
@@ -527,18 +528,15 @@
:virtual #t
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'open)
(let ((f0-0 (the-as float (-> arg3 param 0))))
(set! (-> self part-opened) f0-0)
f0-0
)
)
((= v1-0 'hide)
(go-virtual hidden)
)
)
(case arg2
(('open)
(let ((f0-0 (the-as float (-> arg3 param 0))))
(set! (-> self part-opened) f0-0)
f0-0
)
)
(('hide)
(go-virtual hidden)
)
)
)
@@ -625,6 +623,7 @@
)
;; definition for method 11 of type silodoor
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! silodoor ((obj silodoor) (arg0 res-lump))
(let
((s4-0
@@ -897,6 +896,7 @@
)
;; definition for function finalbosscam-init-by-other
;; INFO: Return type mismatch object vs none.
(defbehavior finalbosscam-init-by-other finalbosscam ((arg0 entity))
(set! (-> self entity) arg0)
(dummy-40 self arg0 *finalbosscam-sg* 4 4 (new 'static 'vector :w 4096.0) 4)
@@ -406,19 +406,18 @@
)
;; definition for function darkecobomb-handler
;; INFO: Return type mismatch none vs object.
(defbehavior
darkecobomb-handler darkecobomb
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (or (= v1-0 'touch) (= v1-0 'attack))
(go darkecobomb-explode #t)
)
)
(case arg2
(('touch 'attack)
(go darkecobomb-explode #t)
)
)
)
;; definition for function darkecobomb-explode-if-player-high-enough
;; INFO: Return type mismatch object vs none.
(defbehavior darkecobomb-explode-if-player-high-enough darkecobomb ()
(if
(and
@@ -836,6 +835,7 @@
)
;; definition for function darkecobomb-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
darkecobomb-init-by-other darkecobomb
@@ -1016,6 +1016,7 @@
)
;; definition for function greenshot-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
greenshot-init-by-other greenshot
@@ -1292,15 +1293,13 @@
)
;; definition for function redshot-handler
;; INFO: Return type mismatch none vs object.
(defbehavior
redshot-handler redshot
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (or (= v1-0 'attack) (= v1-0 'touch))
(go redshot-explode)
)
)
(case arg2
(('attack 'touch)
(go redshot-explode)
)
)
)
@@ -1383,6 +1382,7 @@
)
;; definition for function redshot-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
redshot-init-by-other redshot
@@ -1537,6 +1537,7 @@
)
;; definition for function yellowshot-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
yellowshot-init-by-other yellowshot
@@ -5706,6 +5706,7 @@
)
;; definition for method 11 of type robotboss
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod copy-defaults! robotboss ((obj robotboss) (arg0 res-lump))
(stack-size-set! (-> obj main-thread) 512)
@@ -509,6 +509,7 @@
)
;; definition for method 11 of type flutflut
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! flutflut ((obj flutflut) (arg0 res-lump))
(let
((s4-0
+50 -58
View File
@@ -46,64 +46,55 @@
(defstate bouncer-wait (springbox)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 3)
(set! (-> a1-3 message) 'jump)
(set!
(-> a1-3 param 0)
(the-as uint (-> self spring-height))
)
(set!
(-> a1-3 param 1)
(the-as uint (-> self spring-height))
)
(set! (-> a1-3 param 2) (the-as uint #f))
(when (send-event-function arg0 a1-3)
(sound-play-by-name
(static-sound-name "trampoline")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go bouncer-fire)
)
)
)
((= v1-0 'touch)
(if
(not
(or
(= (-> self next-state name) 'bouncer-smush)
(= (-> self next-state name) 'bouncer-fire)
)
)
(go bouncer-smush)
)
)
((= v1-0 'attack)
(when
(and
(= (-> arg3 param 1) 'flop)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
#f
)
)
(go bouncer-fire)
#f
)
)
)
(case arg2
(('bonk)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) self)
(set! (-> a1-3 num-params) 3)
(set! (-> a1-3 message) 'jump)
(set! (-> a1-3 param 0) (the-as uint (-> self spring-height)))
(set! (-> a1-3 param 1) (the-as uint (-> self spring-height)))
(set! (-> a1-3 param 2) (the-as uint #f))
(when (send-event-function arg0 a1-3)
(sound-play-by-name
(static-sound-name "trampoline")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(go bouncer-fire)
)
)
)
(('touch)
(if
(not
(or
(= (-> self next-state name) 'bouncer-smush)
(= (-> self next-state name) 'bouncer-fire)
)
)
(go bouncer-smush)
)
)
(('attack)
(when
(and
(= (-> arg3 param 1) 'flop)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
#f
)
)
(go bouncer-fire)
#f
)
)
)
)
@@ -245,6 +236,7 @@
)
;; definition for method 11 of type springbox
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! springbox ((obj springbox) (arg0 res-lump))
(let
((s4-0
+30 -38
View File
@@ -1447,6 +1447,7 @@
)
;; definition for function fisher-fish-init-by-other
;; INFO: Return type mismatch object vs none.
(defbehavior
fisher-fish-init-by-other fisher-fish
((arg0 symbol) (arg1 float) (arg2 float))
@@ -2255,44 +2256,35 @@
(defstate fisher-playing (fisher)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-2 none))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'fisher-fish-die)
(sound-play-by-name
(static-sound-name "fish-miss")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(set!
v0-2
(the-as none (+ (-> self missed) (-> arg3 param 0)))
)
(set! (-> self missed) (the-as int v0-2))
v0-2
)
((= v1-0 'fisher-fish-caught)
(send-event *target* 'bounce)
(set!
v0-2
(the-as none (+ (-> self caught) (-> arg3 param 0)))
)
(set! (-> self caught) (the-as int v0-2))
v0-2
)
((= v1-0 'deadly)
(go fisher-done)
)
((= v1-0 'bad)
(set! v0-2 (the-as none (seekl (-> self caught) 0 10)))
(set! (-> self caught) (the-as int v0-2))
v0-2
)
)
(local-vars (v0-2 object))
(case arg2
(('fisher-fish-die)
(sound-play-by-name
(static-sound-name "fish-miss")
(new-sound-id)
1024
0
0
(the-as uint 1)
(the-as vector #t)
)
(set! v0-2 (+ (-> self missed) (-> arg3 param 0)))
(set! (-> self missed) (the-as int v0-2))
v0-2
)
(('fisher-fish-caught)
(send-event *target* 'bounce)
(set! v0-2 (+ (-> self caught) (-> arg3 param 0)))
(set! (-> self caught) (the-as int v0-2))
v0-2
)
(('deadly)
(go fisher-done)
)
(('bad)
(set! v0-2 (seekl (-> self caught) 0 10))
(set! (-> self caught) (the-as int v0-2))
v0-2
)
)
)
@@ -619,6 +619,7 @@ nav-enemy-default-event-handler
)
;; definition for method 11 of type junglefish
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! junglefish ((obj junglefish) (arg0 res-lump))
(let
((s4-0
+13 -18
View File
@@ -54,25 +54,19 @@
)
;; definition for method 43 of type aphid
;; INFO: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defmethod dummy-43 aphid ((obj aphid) (arg0 process) (arg1 event-message-block))
(the-as object (cond
((or
(logtest? (-> obj nav-enemy-flags) 32)
(= arg0 (ppointer->process (-> obj parent)))
)
(send-event arg0 'get-attack-count 1)
(logclear!
(-> obj mask)
(process-mask actor-pause attackable)
)
(go (method-of-object obj nav-enemy-die))
)
(else
(dummy-44 obj arg0 arg1)
)
)
(cond
((or
(logtest? (-> obj nav-enemy-flags) 32)
(= arg0 (ppointer->process (-> obj parent)))
)
(send-event arg0 'get-attack-count 1)
(logclear! (-> obj mask) (process-mask actor-pause attackable))
(go (method-of-object obj nav-enemy-die))
)
(else
(dummy-44 obj arg0 arg1)
)
)
)
@@ -647,6 +641,7 @@
)
;; definition for function aphid-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
aphid-init-by-other aphid
@@ -225,6 +225,7 @@
)
;; definition for method 11 of type plat-flip
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod copy-defaults! plat-flip ((obj plat-flip) (arg0 res-lump))
(local-vars (sv-16 res-tag) (sv-32 res-tag) (sv-48 res-tag))
+14 -15
View File
@@ -272,33 +272,30 @@
)
;; definition for method 44 of type baby-spider
;; INFO: Return type mismatch none vs object.
(defmethod
dummy-44
baby-spider
((obj baby-spider) (arg0 process) (arg1 event-message-block))
(the-as
object
(when
((method-of-type touching-shapes-entry prims-touching?)
(when
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> arg1 param 0))
(-> obj collide-info)
(the-as uint 1)
)
(if
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg1 param 0))
(-> obj collide-info)
(the-as uint 1)
)
(if
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg1 param 0))
'generic
)
(go (method-of-object obj nav-enemy-victory))
'generic
)
(go (method-of-object obj nav-enemy-victory))
)
)
)
;; definition for function baby-spider-default-event-handler
;; INFO: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
baby-spider-default-event-handler baby-spider
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -1213,6 +1210,7 @@ baby-spider-default-event-handler
)
;; definition for function baby-spider-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
baby-spider-init-by-other baby-spider
@@ -1264,6 +1262,7 @@ baby-spider-default-event-handler
)
;; definition for method 11 of type baby-spider
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! baby-spider ((obj baby-spider) (arg0 res-lump))
(set! (-> obj die-if-not-visible?) #f)
(set! (-> obj delay-before-dying-if-not-visible) 600)
+54 -67
View File
@@ -74,76 +74,62 @@
)
;; definition for function spiderwebs-default-event-handler
;; INFO: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
spiderwebs-default-event-handler spiderwebs
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'bonk)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 3)
(set! (-> a1-1 message) 'jump)
(set!
(-> a1-1 param 0)
(the-as uint (-> self spring-height))
)
(set!
(-> a1-1 param 1)
(the-as uint (-> self spring-height))
)
(set! (-> a1-1 param 2) (the-as uint *spider-jump-mods*))
(if (send-event-function arg0 a1-1)
(go spiderwebs-bounce)
)
)
)
((= v1-0 'touch)
(when (= (-> arg0 type) target)
(let* ((a0-8 (target-pos 0))
(f1-1 (- (-> a0-8 y) (-> self root trans y)))
)
(if
(and
(>= 2048.0 (fabs f1-1))
(and
(>=
13516.8
(vector-vector-distance a0-8 (-> self root trans))
)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
*spider-jump-mods*
)
)
)
(go spiderwebs-bounce)
)
)
)
)
((= v1-0 'attack)
(if
(and
(= (-> arg3 param 1) 'flop)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
*spider-jump-mods*
)
)
(go spiderwebs-bounce)
)
#f
)
)
(case arg2
(('bonk)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 3)
(set! (-> a1-1 message) 'jump)
(set! (-> a1-1 param 0) (the-as uint (-> self spring-height)))
(set! (-> a1-1 param 1) (the-as uint (-> self spring-height)))
(set! (-> a1-1 param 2) (the-as uint *spider-jump-mods*))
(if (send-event-function arg0 a1-1)
(go spiderwebs-bounce)
)
)
)
(('touch)
(when (= (-> arg0 type) target)
(let* ((a0-8 (target-pos 0))
(f1-1 (- (-> a0-8 y) (-> self root trans y)))
)
(if
(and
(>= 2048.0 (fabs f1-1))
(and
(>= 13516.8 (vector-vector-distance a0-8 (-> self root trans)))
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
*spider-jump-mods*
)
)
)
(go spiderwebs-bounce)
)
)
)
)
(('attack)
(if
(and
(= (-> arg3 param 1) 'flop)
(send-event
arg0
'jump
(-> self spring-height)
(-> self spring-height)
*spider-jump-mods*
)
)
(go spiderwebs-bounce)
)
#f
)
)
)
@@ -264,6 +250,7 @@
)
;; definition for method 11 of type spiderwebs
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! spiderwebs ((obj spiderwebs) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
@@ -301,11 +301,10 @@
(defstate keg-on-paddle (keg)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'detach)
(go keg-paddle-to-path)
)
)
(case arg2
(('detach)
(go keg-paddle-to-path)
)
)
)
:code
@@ -690,6 +689,7 @@
)
;; definition for function keg-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior keg-init-by-other keg ((arg0 keg) (arg1 int))
(stack-size-set! (-> self main-thread) 512)
@@ -944,6 +944,7 @@
)
;; definition for function keg-conveyor-paddle-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
keg-conveyor-paddle-init-by-other keg-conveyor-paddle
@@ -1017,6 +1018,7 @@
)
;; definition for method 11 of type keg-conveyor
;; INFO: Return type mismatch object vs none.
;; WARN: Expression building failed: Function (method 11 keg-conveyor) has a return type of none, but the expression builder found a return statement.
;; Used lq/sq
(defmethod copy-defaults! keg-conveyor ((obj keg-conveyor) (arg0 res-lump))
@@ -75,34 +75,29 @@
(defstate teetertotter-idle (teetertotter)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'attack)
(case (-> arg3 param 1)
(('flop)
(when (target-on-end-of-teetertotter? self)
(set! (-> self in-launch-window) #f)
(increment-success-for-hint
(the-as level-hint-control 676)
)
(go teetertotter-launch)
)
)
)
)
((= v1-0 'bonk)
(when (target-on-end-of-teetertotter? self)
(level-hint-spawn
(game-text-id misty-teetertotter-bonk-dax-tutorial)
"sksp0070"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(go teetertotter-bend)
)
)
)
(case arg2
(('attack)
(case (-> arg3 param 1)
(('flop)
(when (target-on-end-of-teetertotter? self)
(set! (-> self in-launch-window) #f)
(increment-success-for-hint (the-as level-hint-control 676))
(go teetertotter-launch)
)
)
)
)
(('bonk)
(when (target-on-end-of-teetertotter? self)
(level-hint-spawn
(game-text-id misty-teetertotter-bonk-dax-tutorial)
"sksp0070"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(go teetertotter-bend)
)
)
)
)
@@ -299,6 +294,7 @@
)
;; definition for method 11 of type teetertotter
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! teetertotter ((obj teetertotter) (arg0 res-lump))
(let
((s4-0
@@ -44,15 +44,12 @@
(defstate silostep-idle (silostep)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'trigger)
(go silostep-camera)
)
((= v1-0 'trigger-rise)
(go silostep-rise #f)
)
)
(case arg2
(('trigger)
(go silostep-camera)
)
(('trigger-rise)
(go silostep-rise #f)
)
)
)
@@ -216,6 +213,7 @@
)
;; definition for method 11 of type silostep
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! silostep ((obj silostep) (arg0 res-lump))
(logior! (-> obj mask) (process-mask movie-subject))
(let
+3 -4
View File
@@ -258,15 +258,13 @@
)
;; definition for method 44 of type muse
;; INFO: Return type mismatch none vs object.
(defmethod dummy-44 muse ((obj muse) (arg0 process) (arg1 event-message-block))
(the-as object (go muse-caught))
(go muse-caught)
)
;; definition for method 43 of type muse
;; INFO: Return type mismatch none vs object.
(defmethod dummy-43 muse ((obj muse) (arg0 process) (arg1 event-message-block))
(the-as object (go muse-caught))
(go muse-caught)
)
;; failed to figure out what this is:
@@ -917,6 +915,7 @@ nav-enemy-default-event-handler
)
;; definition for method 11 of type muse
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod copy-defaults! muse ((obj muse) (arg0 res-lump))
(stack-size-set! (-> obj main-thread) 512)
+158 -165
View File
@@ -506,12 +506,11 @@
(defstate plunger-lurker-idle (plunger-lurker)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'plunge)
(logclear! (-> self mask) (process-mask actor-pause))
(go plunger-lurker-plunge)
)
)
(case arg2
(('plunge)
(logclear! (-> self mask) (process-mask actor-pause))
(go plunger-lurker-plunge)
)
)
)
:trans
@@ -596,6 +595,7 @@
)
;; definition for method 11 of type plunger-lurker
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! plunger-lurker ((obj plunger-lurker) (arg0 res-lump))
(stack-size-set! (-> obj main-thread) 512)
(let
@@ -1287,98 +1287,93 @@
)
;; definition for function flying-lurker-handler
;; INFO: Return type mismatch none vs object.
(defbehavior
flying-lurker-handler flying-lurker
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'fly-away)
(when (-> self link next)
(entity-birth-no-kill (-> self link next))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'fly-away)
(set!
(-> a1-1 param 0)
(the-as uint (/ (the-as int (-> arg3 param 0)) 16))
)
(set! (-> a1-1 param 1) (-> arg3 param 1))
(let ((t9-1 send-event-function)
(v1-11 (-> self link next))
)
(t9-1 (if v1-11
(-> v1-11 extra process)
)
a1-1
)
)
)
)
(let* ((v1-14 (-> arg3 param 0))
(a0-4 (-> arg3 param 1))
(v1-15 (logand v1-14 3))
)
(set! (-> self rank) (the-as int v1-15))
(cond
((< 15 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 33000.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 34500.0)
)
(else
(set! (-> self race-seconds) 36000.0)
)
)
)
((< 10 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 31800.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 33300.0)
)
(else
(set! (-> self race-seconds) 34800.0)
)
)
)
((< 5 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 30600.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 32100.0)
)
(else
(set! (-> self race-seconds) 33600.0)
)
)
)
((zero? v1-15)
(set! (-> self race-seconds) 30000.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 31500.0)
)
(else
(set! (-> self race-seconds) 33000.0)
)
)
)
(logclear! (-> self mask) (process-mask actor-pause))
(set!
(-> self race-start-time)
(-> *display* game-frame-counter)
)
(go flying-lurker-fly)
)
)
(case arg2
(('fly-away)
(when (-> self link next)
(entity-birth-no-kill (-> self link next))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'fly-away)
(set!
(-> a1-1 param 0)
(the-as uint (/ (the-as int (-> arg3 param 0)) 16))
)
(set! (-> a1-1 param 1) (-> arg3 param 1))
(let ((t9-1 send-event-function)
(v1-11 (-> self link next))
)
(t9-1 (if v1-11
(-> v1-11 extra process)
)
a1-1
)
)
)
)
(let* ((v1-14 (-> arg3 param 0))
(a0-4 (-> arg3 param 1))
(v1-15 (logand v1-14 3))
)
(set! (-> self rank) (the-as int v1-15))
(cond
((< 15 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 33000.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 34500.0)
)
(else
(set! (-> self race-seconds) 36000.0)
)
)
)
((< 10 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 31800.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 33300.0)
)
(else
(set! (-> self race-seconds) 34800.0)
)
)
)
((< 5 (the-as int a0-4))
(cond
((zero? v1-15)
(set! (-> self race-seconds) 30600.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 32100.0)
)
(else
(set! (-> self race-seconds) 33600.0)
)
)
)
((zero? v1-15)
(set! (-> self race-seconds) 30000.0)
)
((= v1-15 1)
(set! (-> self race-seconds) 31500.0)
)
(else
(set! (-> self race-seconds) 33000.0)
)
)
)
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self race-start-time) (-> *display* game-frame-counter))
(go flying-lurker-fly)
)
)
)
@@ -1686,76 +1681,73 @@
(defstate flying-lurker-idle (flying-lurker)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'saw-player)
(set! (-> self take-off) #t)
(when (-> self link prev)
(entity-birth-no-kill (-> self link prev))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) arg0)
(set! (-> a1-1 num-params) arg1)
(set! (-> a1-1 message) arg2)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(set! (-> a1-1 param 1) (-> arg3 param 1))
(set! (-> a1-1 param 2) (-> arg3 param 2))
(set! (-> a1-1 param 3) (-> arg3 param 3))
(set! (-> a1-1 param 4) (-> arg3 param 4))
(set! (-> a1-1 param 5) (-> arg3 param 5))
(set! (-> a1-1 param 6) (-> arg3 param 6))
(let ((t9-1 send-event-function)
(v1-13 (-> self link prev))
)
(t9-1 (if v1-13
(-> v1-13 extra process)
)
a1-1
)
)
)
)
)
((= v1-0 'clone)
(when (-> self link next)
(entity-birth-no-kill (-> self link next))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'clone)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(set! (-> a1-2 param 1) (+ (-> arg3 param 1) -1))
(let ((t9-3 send-event-function)
(v1-25 (-> self link next))
)
(t9-3 (if v1-25
(-> v1-25 extra process)
)
a1-2
)
)
)
)
(case (-> arg3 param 1)
((2)
(go
flying-lurker-clone
(the-as handle (-> arg3 param 0))
"flying-lurker-b-"
)
)
((1)
(go
flying-lurker-clone
(the-as handle (-> arg3 param 0))
"flying-lurker-c-"
)
)
)
)
(else
(flying-lurker-handler arg0 arg1 arg2 arg3)
)
)
(case arg2
(('saw-player)
(set! (-> self take-off) #t)
(when (-> self link prev)
(entity-birth-no-kill (-> self link prev))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) arg0)
(set! (-> a1-1 num-params) arg1)
(set! (-> a1-1 message) arg2)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(set! (-> a1-1 param 1) (-> arg3 param 1))
(set! (-> a1-1 param 2) (-> arg3 param 2))
(set! (-> a1-1 param 3) (-> arg3 param 3))
(set! (-> a1-1 param 4) (-> arg3 param 4))
(set! (-> a1-1 param 5) (-> arg3 param 5))
(set! (-> a1-1 param 6) (-> arg3 param 6))
(let ((t9-1 send-event-function)
(v1-13 (-> self link prev))
)
(t9-1 (if v1-13
(-> v1-13 extra process)
)
a1-1
)
)
)
)
)
(('clone)
(when (-> self link next)
(entity-birth-no-kill (-> self link next))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'clone)
(set! (-> a1-2 param 0) (-> arg3 param 0))
(set! (-> a1-2 param 1) (+ (-> arg3 param 1) -1))
(let ((t9-3 send-event-function)
(v1-25 (-> self link next))
)
(t9-3 (if v1-25
(-> v1-25 extra process)
)
a1-2
)
)
)
)
(case (-> arg3 param 1)
((2)
(go
flying-lurker-clone
(the-as handle (-> arg3 param 0))
"flying-lurker-b-"
)
)
((1)
(go
flying-lurker-clone
(the-as handle (-> arg3 param 0))
"flying-lurker-c-"
)
)
)
)
(else
(flying-lurker-handler arg0 arg1 arg2 arg3)
)
)
)
@@ -1899,6 +1891,7 @@
)
;; definition for method 11 of type flying-lurker
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod copy-defaults! flying-lurker ((obj flying-lurker) (arg0 res-lump))
(stack-size-set! (-> obj main-thread) 512)
+17 -16
View File
@@ -61,22 +61,23 @@
(defstate target-snowball-start (target)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (cond
((and (= arg2 'query) (= (-> arg3 param 0) 'mode))
'snowball
)
((let ((v1-3 arg2))
(= v1-3 'end-mode)
)
enter-state
(-> *TARGET-bank* duck-jump-height-min)
(-> *TARGET-bank* duck-jump-height-max)
(go target-jump)
)
(else
(target-generic-event-handler arg0 arg1 arg2 arg3)
)
)
(cond
((and (= arg2 'query) (= (-> arg3 param 0) 'mode))
'snowball
)
((let ((v1-3 arg2))
(= v1-3 'end-mode)
)
(go
target-jump
(-> *TARGET-bank* duck-jump-height-min)
(-> *TARGET-bank* duck-jump-height-max)
#f
)
)
(else
(target-generic-event-handler arg0 arg1 arg2 arg3)
)
)
)
:exit
+13 -16
View File
@@ -260,25 +260,20 @@
)
;; definition for function yeti-slave-default-event-handler
;; INFO: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
yeti-slave-default-event-handler yeti-slave
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'attack)
(nav-enemy-set-hit-from-direction arg0)
(go-virtual nav-enemy-die)
)
((= v1-0 'touch)
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg3 param 0))
'generic
)
)
)
(case arg2
(('attack)
(nav-enemy-set-hit-from-direction arg0)
(go-virtual nav-enemy-die)
)
(('touch)
(nav-enemy-send-attack
arg0
(the-as touching-shapes-entry (-> arg3 param 0))
'generic
)
)
)
)
@@ -1234,6 +1229,7 @@
)
;; definition for function yeti-slave-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
yeti-slave-init-by-other yeti-slave
@@ -1463,6 +1459,7 @@
)
;; definition for method 11 of type yeti
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! yeti ((obj yeti) (arg0 res-lump))
(set! (-> obj spawn-delay) 0)
(set! (-> obj root) (new 'process 'trsqv))
+53 -58
View File
@@ -160,11 +160,10 @@
(defstate qbert-plat-on-mimic (qbert-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'die)
(go qbert-plat-on-die)
)
)
(case arg2
(('die)
(go qbert-plat-on-die)
)
)
)
:code
@@ -203,6 +202,7 @@
)
;; definition for function qbert-plat-on-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
qbert-plat-on-init-by-other qbert-plat
@@ -529,6 +529,7 @@
)
;; definition for method 11 of type qbert-plat
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! qbert-plat ((obj qbert-plat) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(TODO-RENAME-30 obj)
@@ -550,59 +551,52 @@
(defstate qbert-plat-master-idle (qbert-plat-master)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'trigger)
(start-hint-timer (the-as level-hint-control 842))
(close-specific-task!
(game-task sunken-platforms)
(task-status need-hint)
)
(when (not (-> self puzzle-beaten?))
(let ((v1-2 (-> arg3 param 0)))
(when (!= v1-2 (-> self last-plat-triggered))
(set! (-> self last-plat-triggered) (the-as int v1-2))
(let
((s5-1
(=
(-> self plat-states-needed-to-open-door)
(-> self plat-states)
)
)
)
(let ((v1-3 (ash 1 v1-2)))
(set!
(-> self plat-states)
(logxor (-> self plat-states) (the-as uint v1-3))
)
(if (zero? (logand v1-3 (-> self plat-states)))
(level-hint-spawn
(game-text-id sunken-qbert-hint)
"sksp0130"
(the-as entity #f)
*entity-pool*
(game-task none)
)
)
)
(send-event arg0 'notify)
(let
((a0-13
(=
(-> self plat-states-needed-to-open-door)
(-> self plat-states)
)
)
)
(if (!= s5-1 a0-13)
(go qbert-plat-master-do-door a0-13)
)
)
)
)
)
)
)
)
(case arg2
(('trigger)
(start-hint-timer (the-as level-hint-control 842))
(close-specific-task!
(game-task sunken-platforms)
(task-status need-hint)
)
(when (not (-> self puzzle-beaten?))
(let ((v1-2 (-> arg3 param 0)))
(when (!= v1-2 (-> self last-plat-triggered))
(set! (-> self last-plat-triggered) (the-as int v1-2))
(let
((s5-1
(= (-> self plat-states-needed-to-open-door) (-> self plat-states))
)
)
(let ((v1-3 (ash 1 v1-2)))
(set!
(-> self plat-states)
(logxor (-> self plat-states) (the-as uint v1-3))
)
(if (zero? (logand v1-3 (-> self plat-states)))
(level-hint-spawn
(game-text-id sunken-qbert-hint)
"sksp0130"
(the-as entity #f)
*entity-pool*
(game-task none)
)
)
)
(send-event arg0 'notify)
(let
((a0-13
(= (-> self plat-states-needed-to-open-door) (-> self plat-states))
)
)
(if (!= s5-1 a0-13)
(go qbert-plat-master-do-door a0-13)
)
)
)
)
)
)
)
)
)
:code
@@ -958,6 +952,7 @@
)
;; definition for method 11 of type qbert-plat-master
;; INFO: Return type mismatch object vs none.
(defmethod
copy-defaults!
qbert-plat-master
@@ -403,20 +403,16 @@
(defstate square-platform-lowered (square-platform)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'trigger)
(if
(and
(= (-> arg0 type) square-platform-master)
(=
(-> (the-as square-platform-master arg0) plat-id)
(-> self plat-id)
)
)
(go square-platform-rising)
)
)
)
(case arg2
(('trigger)
(if
(and
(= (-> arg0 type) square-platform-master)
(= (-> (the-as square-platform-master arg0) plat-id) (-> self plat-id))
)
(go square-platform-rising)
)
)
)
)
:code
@@ -627,6 +623,7 @@
)
;; definition for method 11 of type square-platform
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod copy-defaults! square-platform ((obj square-platform) (arg0 res-lump))
(local-vars (sv-16 res-tag) (sv-32 res-tag))
@@ -728,19 +725,18 @@
(defstate square-platform-master-idle (square-platform-master)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'trigger)
(when (= (-> arg0 type) square-platform-button)
(set!
(-> self button-id)
(-> (the-as square-platform-button arg0) button-id)
)
(logclear! (-> self mask) (process-mask actor-pause))
(process-entity-status! self (entity-perm-status bit-3) #t)
(go square-platform-master-activate)
)
)
)
(case arg2
(('trigger)
(when (= (-> arg0 type) square-platform-button)
(set!
(-> self button-id)
(-> (the-as square-platform-button arg0) button-id)
)
(logclear! (-> self mask) (process-mask actor-pause))
(process-entity-status! self (entity-perm-status bit-3) #t)
(go square-platform-master-activate)
)
)
)
)
:code
@@ -956,6 +952,7 @@
)
;; definition for method 11 of type square-platform-master
;; INFO: Return type mismatch object vs none.
(defmethod
copy-defaults!
square-platform-master
+2 -4
View File
@@ -587,6 +587,7 @@
)
;; definition for function sunkenfisha-init-by-other
;; INFO: Return type mismatch object vs none.
(defbehavior sunkenfisha-init-by-other sunkenfisha ((arg0 entity))
(set! (-> self entity) arg0)
(TODO-RENAME-26 self)
@@ -596,6 +597,7 @@
)
;; definition for method 11 of type sunkenfisha
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! sunkenfisha ((obj sunkenfisha) (arg0 res-lump))
(TODO-RENAME-26 obj)
(TODO-RENAME-27 obj)
@@ -634,7 +636,3 @@
(go sunkenfisha-idle)
(none)
)
+9 -10
View File
@@ -51,11 +51,10 @@
(defstate wall-plat-retracted (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'trigger)
(go wall-plat-extending)
)
)
(case arg2
(('trigger)
(go wall-plat-extending)
)
)
)
:code
@@ -136,11 +135,10 @@
(defstate wall-plat-extended (wall-plat)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'untrigger)
(go wall-plat-retracting)
)
)
(case arg2
(('untrigger)
(go wall-plat-retracting)
)
)
)
:code
@@ -284,6 +282,7 @@
)
;; definition for method 11 of type wall-plat
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! wall-plat ((obj wall-plat) (arg0 res-lump))
(set! (-> obj extended-amount) 0.0)
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
@@ -76,6 +76,7 @@
)
;; definition for method 11 of type wedge-plat-master
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defmethod
copy-defaults!
@@ -334,6 +335,7 @@
)
;; definition for method 11 of type wedge-plat
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! wedge-plat ((obj wedge-plat) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask platform) (-> obj mask)))
(let
@@ -616,6 +618,7 @@
)
;; definition for method 11 of type wedge-plat-outer
;; INFO: Return type mismatch object vs none.
(defmethod
copy-defaults!
wedge-plat-outer
+21 -29
View File
@@ -139,38 +139,28 @@
)
;; definition for function swamp-bat-slave-event-handler
;; INFO: Return type mismatch none vs object.
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code?
(defbehavior
swamp-bat-slave-event-handler swamp-bat-slave
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'attack)
(logclear! (-> self mask) (process-mask actor-pause))
(go swamp-bat-slave-die (process->handle arg0))
)
((= v1-0 'touch)
(level-hint-spawn
(game-text-id swamp-bats-hint)
"sksp0156"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(send-event
arg0
'attack
(-> arg3 param 0)
(new 'static 'attack-info)
)
)
((= v1-0 'launch)
(if (-> self launch-ready)
(go swamp-bat-slave-launch)
)
)
)
(case arg2
(('attack)
(logclear! (-> self mask) (process-mask actor-pause))
(go swamp-bat-slave-die (process->handle arg0))
)
(('touch)
(level-hint-spawn
(game-text-id swamp-bats-hint)
"sksp0156"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info))
)
(('launch)
(if (-> self launch-ready)
(go swamp-bat-slave-launch)
)
)
)
)
@@ -697,6 +687,7 @@ swamp-bat-slave-event-handler
)
;; definition for function swamp-bat-slave-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
swamp-bat-slave-init-by-other swamp-bat-slave
@@ -968,6 +959,7 @@ swamp-bat-slave-event-handler
)
;; definition for method 11 of type swamp-bat
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! swamp-bat ((obj swamp-bat) (arg0 res-lump))
(let
((s4-0 (new 'process 'collide-shape obj (collide-list-enum hit-by-player))))
+47 -61
View File
@@ -941,59 +941,46 @@
)
;; definition for function swamp-rat-nest-dummy-event-handler
;; INFO: Return type mismatch none vs object.
(defbehavior
swamp-rat-nest-dummy-event-handler swamp-rat-nest-dummy
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'shake)
(if (= (-> self next-state name) 'swamp-rat-nest-dummy-idle)
(go swamp-rat-nest-dummy-shake)
)
)
((= v1-0 'attack)
(send-event
(ppointer->process (-> self parent-process))
'hit
)
(let ((v1-7 (-> arg3 param 2)))
(when (!= v1-7 (-> self parent-process 0 player-attack-id))
(set!
(-> self parent-process 0 player-attack-id)
(the-as int v1-7)
)
(cond
((and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow))
(swamp-rat-nest-dummy-take-damage 3)
(if
(<
(vector-vector-distance
(target-pos 0)
(-> self top-sphere)
)
(-> self top-sphere w)
)
(send-event *target* 'no-look-around 75)
)
(go swamp-rat-nest-dummy-hit)
)
(else
(level-hint-spawn
(game-text-id swamp-rats-nest-hint)
"sksp0144"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(swamp-rat-nest-dummy-take-damage 0)
(go swamp-rat-nest-dummy-hit)
)
)
)
)
)
)
(case arg2
(('shake)
(if (= (-> self next-state name) 'swamp-rat-nest-dummy-idle)
(go swamp-rat-nest-dummy-shake)
)
)
(('attack)
(send-event (ppointer->process (-> self parent-process)) 'hit)
(let ((v1-7 (-> arg3 param 2)))
(when (!= v1-7 (-> self parent-process 0 player-attack-id))
(set! (-> self parent-process 0 player-attack-id) (the-as int v1-7))
(cond
((and (>= arg1 2) (= (-> arg3 param 1) 'eco-yellow))
(swamp-rat-nest-dummy-take-damage 3)
(if
(<
(vector-vector-distance (target-pos 0) (-> self top-sphere))
(-> self top-sphere w)
)
(send-event *target* 'no-look-around 75)
)
(go swamp-rat-nest-dummy-hit)
)
(else
(level-hint-spawn
(game-text-id swamp-rats-nest-hint)
"sksp0144"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(swamp-rat-nest-dummy-take-damage 0)
(go swamp-rat-nest-dummy-hit)
)
)
)
)
)
)
)
@@ -1222,6 +1209,7 @@
)
;; definition for function swamp-rat-nest-dummy-init-by-other
;; INFO: Return type mismatch object vs none.
;; Used lq/sq
(defbehavior
swamp-rat-nest-dummy-init-by-other swamp-rat-nest-dummy
@@ -1261,15 +1249,13 @@
)
;; definition for function swamp-rat-nest-default-event-handler
;; INFO: Return type mismatch none vs object.
(defbehavior
swamp-rat-nest-default-event-handler swamp-rat-nest
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'victory)
(go swamp-rat-nest-victory)
)
)
(case arg2
(('victory)
(go swamp-rat-nest-victory)
)
)
)
@@ -1511,11 +1497,10 @@ swamp-rat-nest-default-event-handler
(defstate swamp-rat-nest-idle (swamp-rat-nest)
:event
(behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'hit)
(go swamp-rat-nest-active)
)
)
(case arg2
(('hit)
(go swamp-rat-nest-active)
)
)
)
:enter
@@ -1686,6 +1671,7 @@ swamp-rat-nest-default-event-handler
)
;; definition for method 11 of type swamp-rat-nest
;; INFO: Return type mismatch object vs none.
(defmethod copy-defaults! swamp-rat-nest ((obj swamp-rat-nest) (arg0 res-lump))
(set! (-> obj mask) (logior (process-mask enemy) (-> obj mask)))
(set! (-> obj root) (new 'process 'trsqv))

Some files were not shown because too many files have changed in this diff Show More