[opengoal] make none a child of object (#3001)

Previously, `object` and `none` were both top-level types. This made
decompilation rather messy as they have no LCA and resulted in a lot of
variables coming out as type `none` which is very very wrong and
additionally there were plenty of casts to `object`. This changes it so
`none` becomes a child of `object` (it is still represented by
`NullType` which remains unusable in compilation).

This change makes `object` the sole top-level type, and the type that
can represent *any* GOAL object. I believe this matches the original
GOAL built-in type structure. A function that has a return type of
`object` can now return an integer or a `none` at the same time.
However, keep in mind that the return value of `(none)` is still
undefined, just as before. This also makes a cast to `object`
meaningless in 90% of the situations it showed up in (as every single
thing is already an `object`) and the decompiler will no longer emit
them. Casts to `none` are also reduced. Yay!

Additionally, state handlers also don't get the final `(none)` printed
out anymore. The return type of a state handler is completely
meaningless outside the event handler (which is return type `object`
anyway) so there are no limitations on what the last form needs to be. I
did this instead of making them return `object` to trick the decompiler
into not trying to output a variable to be used as a return value
(internally, in the decompiler they still have return type `none`, but
they have `object` elsewhere).

Fixes #1703 
Fixes #830 
Fixes #928
This commit is contained in:
ManDude
2023-09-22 10:54:49 +01:00
committed by GitHub
parent 697b07abd5
commit fe491c2b5e
964 changed files with 24949 additions and 39444 deletions
+3 -3
View File
@@ -344,7 +344,7 @@ std::string Type::common_type_info_diff(const Type& other) const {
* parents.
*/
bool Type::has_parent() const {
return m_name != "object" && !m_parent.empty();
return m_name != "object";
}
/*!
@@ -485,7 +485,7 @@ std::string Type::diff(const Type& other) const {
// Special Type for both "none" and "_type_" types
// it's an error to try to do anything with Null.
NullType::NullType(std::string name) : Type("", std::move(name), false, 0) {}
NullType::NullType(std::string name) : Type("object", std::move(name), false, 0) {}
bool NullType::is_reference() const {
throw std::runtime_error("is_reference called on NullType");
@@ -496,7 +496,7 @@ int NullType::get_load_size() const {
}
bool NullType::get_load_signed() const {
throw std::runtime_error("get_load_size called on NullType");
throw std::runtime_error("get_load_signed called on NullType");
}
int NullType::get_size_in_memory() const {
+1 -1
View File
@@ -133,7 +133,7 @@ class Type {
bool m_new_method_info_defined = false;
bool m_generate_inspect = true;
std::string m_parent; // the parent type (is empty for none and object)
std::string m_parent; // the parent type (is empty for object)
std::string m_name;
bool m_allow_in_runtime = true;
std::string m_runtime_name;
+3 -7
View File
@@ -84,7 +84,7 @@ Type* TypeSystem::add_type(const std::string& name, std::unique_ptr<Type> type)
} else {
// newly defined!
// none/object get to skip these checks because they are roots.
// objects get to skip these checks because it is the root
if (name != "object" && name != "none" && name != "_type_" && name != "_varargs_") {
if (m_forward_declared_types.find(type->get_parent()) != m_forward_declared_types.end()) {
throw_typesystem_error(
@@ -1538,8 +1538,8 @@ void TypeSystem::builtin_structure_inherit(StructureType* st) {
st->inherit(get_type_of_type<StructureType>(st->get_parent()));
}
bool TypeSystem::tc(const TypeSpec& expected, const TypeSpec& actual) const {
return typecheck_and_throw(expected, actual, "", false, false);
bool TypeSystem::tc(const TypeSpec& less_specific, const TypeSpec& more_specific) const {
return typecheck_and_throw(less_specific, more_specific, "", false, false);
}
/*!
@@ -1715,10 +1715,6 @@ std::string TypeSystem::lca_base(const std::string& a, const std::string& b) con
return a;
}
if (a == "none" || b == "none") {
return "none";
}
auto a_up = get_path_up_tree(a);
auto b_up = get_path_up_tree(b);
+1 -1
View File
@@ -228,7 +228,7 @@ class TypeSystem {
bool print_on_error = true,
bool throw_on_error = true,
bool allow_type_alias = false) const;
bool tc(const TypeSpec& expected, const TypeSpec& actual) const;
bool tc(const TypeSpec& less_specific, const TypeSpec& more_specific) const;
std::vector<std::string> get_path_up_tree(const std::string& type) const;
int get_next_method_id(const Type* type) const;
+1 -3
View File
@@ -68,8 +68,6 @@ 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, TypeSpec("none"));
break;
@@ -102,7 +100,7 @@ std::vector<std::string> get_state_handler_arg_names(StateHandler kind) {
case StateHandler::EXIT:
return {};
case StateHandler::EVENT:
return {"proc", "arg1", "event-type", "event"};
return {"proc", "argc", "message", "block"};
default:
ASSERT(false);
}
+1
View File
@@ -188,6 +188,7 @@ class Function {
std::string debug_form_string;
bool print_debug_forms = false;
bool expressions_succeeded = false;
bool skip_final_none = false;
} ir2;
std::optional<std::string> mips2c_output;
+1 -1
View File
@@ -2962,7 +2962,7 @@ goos::Object DefstateElement::to_form_internal(const Env& env) const {
}
////////////////////////////////
// DefskelgroupElement
// WithDmaBufferAddBucketElement
////////////////////////////////
WithDmaBufferAddBucketElement::WithDmaBufferAddBucketElement(RegisterAccess dma_buf,
+26 -14
View File
@@ -91,21 +91,31 @@ bool convert_to_expressions(
needs_cast = true;
} else {
bool found_early_return = false;
for (auto e : new_entries) {
e->apply([&](FormElement* elt) {
auto as_ret = dynamic_cast<ReturnElement*>(elt);
if (as_ret) {
found_early_return = true;
// note : a return type of "object" will accept ANYTHING as a return value
// "object" is the parent type of everything, including "none" (as of sep 2023)
// if a function wants to return an object, we can safely discard the cast
// since there is no possible level of polymorphism at this highest level.
if (f.type.last_arg() != TypeSpec("object")) {
bool found_early_return = false;
for (auto e : new_entries) {
e->apply([&](FormElement* elt) {
auto as_ret = dynamic_cast<ReturnElement*>(elt);
if (as_ret) {
found_early_return = true;
}
});
if (found_early_return) {
break;
}
});
if (found_early_return) {
break;
}
}
if (!found_early_return && f.type.last_arg() != return_type) {
needs_cast = true;
// the return value of this function is not an exact match
// we cast it to avoid complicated issues with polymorphism (e.g. methods)
// we don't run this if we find a (return statement because we do not handle
// type checking on those at the moment.
if (!found_early_return && f.type.last_arg() != return_type) {
needs_cast = true;
}
}
}
@@ -124,8 +134,10 @@ bool convert_to_expressions(
} else {
// or just get all the expressions
new_entries = stack.rewrite(pool, f.ir2.env);
new_entries.push_back(
pool.alloc_element<GenericElement>(GenericOperator::make_fixed(FixedOperatorKind::NONE)));
if (!f.ir2.skip_final_none) {
new_entries.push_back(pool.alloc_element<GenericElement>(
GenericOperator::make_fixed(FixedOperatorKind::NONE)));
}
}
// if we are a totally empty function, insert a placeholder so we don't have to handle
+3
View File
@@ -146,6 +146,9 @@ std::vector<DefstateElement::Entry> get_defstate_entries(
// scary part - modify the function type!
handler_func->type = get_state_handler_type(handler_kind, state_type);
// hack - lets pretend every handler (except event) returns none but remove the (none) at the
// end since the 'real' return type is object and thus anything is valid in the final form
handler_func->ir2.skip_final_none = true;
} else if (handler_atom && handler_atom->is_sym_val()) {
auto sym_type = env.dts->lookup_symbol_type(handler_atom->get_str());
auto expected_type = get_state_handler_type(handler_kind, state_type);
+5 -4
View File
@@ -1147,13 +1147,13 @@ FormElement* rewrite_as_case_with_else(LetElement* in, const Env& env, FormPool&
return pool.alloc_element<CaseElement>(in->entries().at(0).src, entries, cond->else_ir);
}
bool var_equal(const Env& env, const RegisterAccess& a, std::optional<RegisterAccess> b) {
bool var_equal(const Env& env, RegisterAccess a, std::optional<RegisterAccess> b) {
ASSERT(b);
return env.get_variable_name_name_only(*b) == env.get_variable_name_name_only(a);
}
Form* match_ja_set(const Env& env,
const RegisterAccess& ch_var,
RegisterAccess ch_var,
const std::string& field_name,
int arr_idx,
Form* in,
@@ -1712,8 +1712,9 @@ FormElement* rewrite_attack_info(LetElement* in, const Env& env, FormPool& pool)
enum AttackInfoFieldKind { DEFAULT, VECTOR, METERS, DEGREES };
const static std::map<std::string, std::pair<int, AttackInfoFieldKind>> possible_args_jak1 = {
{"vector", {1, VECTOR}}, {"mode", {5, DEFAULT}}, {"shove-back", {6, DEFAULT}},
{"shove-up", {7, DEFAULT}}, {"control", {10, DEFAULT}}, {"angle", {11, DEFAULT}},
{"vector", {1, VECTOR}}, {"attacker", {3, DEFAULT}}, {"mode", {5, DEFAULT}},
{"shove-back", {6, DEFAULT}}, {"shove-up", {7, DEFAULT}}, {"control", {10, DEFAULT}},
{"angle", {11, DEFAULT}},
};
const static std::map<std::string, std::pair<int, AttackInfoFieldKind>> possible_args_jak2 = {
{"vector", {1, VECTOR}},
+11 -46
View File
@@ -655,34 +655,23 @@ namespace {
TP_Type lca_for_var_types(const TP_Type& existing,
const TP_Type& add,
const DecompilerTypeSystem& dts,
bool event_handler_hack) {
const DecompilerTypeSystem& dts) {
bool changed;
auto normal = dts.tp_lca(existing, add, &changed);
if (!event_handler_hack || normal.typespec().base_type() != "none") {
return normal;
}
if (existing.typespec().base_type() == "none") {
return add;
} else if (add.typespec().base_type() == "none") {
return existing;
} else {
return normal;
}
return normal;
}
void update_var_info(VariableNames::VarInfo* info,
Register reg,
const TypeState& ts,
int var_id,
const DecompilerTypeSystem& dts,
bool event_handler_hack) {
const DecompilerTypeSystem& dts) {
auto& type = ts.get(reg);
if (info->initialized) {
ASSERT(info->reg_id.id == var_id);
ASSERT(info->reg_id.reg == reg);
info->type = lca_for_var_types(info->type, type, dts, event_handler_hack);
info->type = lca_for_var_types(info->type, type, dts);
} else {
info->reg_id.id = var_id;
@@ -695,10 +684,9 @@ void update_var_info(VariableNames::VarInfo* info,
bool merge_infos(VariableNames::VarInfo* info1,
VariableNames::VarInfo* info2,
const DecompilerTypeSystem& dts,
bool event_handler_hack) {
const DecompilerTypeSystem& dts) {
if (info1->initialized && info2->initialized) {
auto new_type = lca_for_var_types(info1->type, info2->type, dts, event_handler_hack);
auto new_type = lca_for_var_types(info1->type, info2->type, dts);
info1->type = new_type;
info2->type = new_type;
@@ -710,13 +698,12 @@ bool merge_infos(VariableNames::VarInfo* info1,
void merge_infos(
std::unordered_map<Register, std::vector<VariableNames::VarInfo>, Register::hash>& info1,
std::unordered_map<Register, std::vector<VariableNames::VarInfo>, Register::hash>& info2,
const DecompilerTypeSystem& dts,
bool event_handler_hack) {
const DecompilerTypeSystem& dts) {
for (auto& [reg, infos] : info1) {
auto other = info2.find(reg);
if (other != info2.end()) {
for (size_t i = 0; i < std::min(other->second.size(), infos.size()); i++) {
merge_infos(&infos.at(i), &other->second.at(i), dts, event_handler_hack);
merge_infos(&infos.at(i), &other->second.at(i), dts);
}
}
}
@@ -730,28 +717,6 @@ void merge_infos(
* the none variables
*/
void SSA::make_vars(const Function& function, const DecompilerTypeSystem& dts) {
bool event_handler_hack = false;
if (function.ir2.env.version == GameVersion::Jak2) {
event_handler_hack = function.guessed_name.is_event_handler() ||
function.guessed_name.to_string() == "target-generic-event-handler" ||
function.guessed_name.to_string() == "target-standard-event-handler" ||
function.guessed_name.to_string() == "target-board-handler" ||
function.guessed_name.to_string() == "(method 74 pegasus)" ||
function.guessed_name.to_string() == "(method 74 crimson-guard-level)" ||
function.guessed_name.to_string() == "widow-handler" ||
function.guessed_name.to_string() == "(method 74 hal)" ||
function.guessed_name.to_string() == "water-anim-event-handler" ||
function.guessed_name.to_string() == "(method 74 civilian)" ||
function.guessed_name.to_string() == "(method 74 crimson-guard)" ||
function.guessed_name.to_string() == "metalkor-handler";
}
if (function.ir2.env.version == GameVersion::Jak1) {
event_handler_hack = function.guessed_name.is_event_handler() ||
function.guessed_name.to_string() == "target-generic-event-handler";
}
for (int block_id = 0; block_id < int(blocks.size()); block_id++) {
const auto& block = blocks.at(block_id);
const TypeState* init_types = &function.ir2.env.get_types_at_block_entry(block_id);
@@ -766,13 +731,13 @@ void SSA::make_vars(const Function& function, const DecompilerTypeSystem& dts) {
if (instr.dst.has_value()) {
auto var_id = map.var_id(*instr.dst);
auto* info = &program_write_vars[instr.dst->reg()].at(var_id);
update_var_info(info, instr.dst->reg(), *end_types, var_id, dts, event_handler_hack);
update_var_info(info, instr.dst->reg(), *end_types, var_id, dts);
}
for (auto& src : instr.src) {
auto var_id = map.var_id(src);
auto* info = &program_read_vars[src.reg()].at(var_id);
update_var_info(info, src.reg(), *init_types, var_id, dts, event_handler_hack);
update_var_info(info, src.reg(), *init_types, var_id, dts);
}
init_types = end_types;
@@ -793,7 +758,7 @@ void SSA::make_vars(const Function& function, const DecompilerTypeSystem& dts) {
}
}
merge_infos(program_write_vars, program_read_vars, dts, event_handler_hack);
merge_infos(program_write_vars, program_read_vars, dts);
// copy types from input argument coloring moves:
for (auto& instr : blocks.at(0).ins) {
+12 -12
View File
@@ -1858,10 +1858,10 @@
)
(deftype protect-frame (stack-frame)
((exit (function none) :offset-assert 12)
((exit (function object) :offset-assert 12)
)
(:methods
(new (symbol type (function none)) protect-frame)
(new (symbol type (function object)) protect-frame)
)
:method-count-assert 9
:size-assert #x10
@@ -1879,16 +1879,16 @@
(declare-type event-message-block structure)
(deftype state (protect-frame)
((code function :offset-assert 16)
(trans (function none) :offset-assert 20)
(trans (function object) :offset-assert 20)
(post function :offset-assert 24)
(enter function :offset-assert 28)
(event (function process int symbol event-message-block object) :offset-assert 32)
)
(:methods
(new (symbol type symbol function
(function none)
(function object)
function
(function none)
(function object)
(function process int symbol event-message-block object)) _type_ 0)
)
:method-count-assert 9
@@ -16696,7 +16696,7 @@
(define-extern joint-control-channel-group-eval! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int))
(define-extern joint-control-channel-group! (function joint-control-channel art-joint-anim (function joint-control-channel float float float) int))
(define-extern joint-control-copy! (function joint-control joint-control joint-control))
(define-extern joint-control-remap! (function joint-control art-group art-group pair int string object))
(define-extern joint-control-remap! (function joint-control art-group art-group pair int string symbol))
(define-extern cspace<-cspace! (function cspace cspace matrix))
(define-extern cspace<-rot-yxy! (function cspace transform matrix)) ;; unused
(define-extern cspace<-transform-yxy! (function cspace transform matrix)) ;; unused
@@ -20562,7 +20562,7 @@
(define-extern rider-post (function int :behavior process-drawable))
(define-extern pusher-post (function int :behavior process-drawable))
(define-extern process-drawable-delay-player (function time-frame int :behavior process-drawable))
(define-extern process-drawable-fuel-cell-handler (function process int symbol event-message-block none :behavior process-drawable))
(define-extern process-drawable-fuel-cell-handler (function process int symbol event-message-block object :behavior process-drawable))
(define-extern process-drawable-birth-fuel-cell (function entity vector symbol none :behavior process-drawable))
(define-extern process-drawable-valid? (function process-drawable symbol))
@@ -22063,7 +22063,7 @@
(define-extern process-taskable-anim-loop (function none :behavior process-taskable))
(define-extern process-taskable-play-anim-enter (function symbol :behavior process-taskable))
(define-extern process-taskable-play-anim-exit (function none :behavior process-taskable))
(define-extern process-taskable-hide-handler (function process int symbol event-message-block none :behavior process-taskable))
(define-extern process-taskable-hide-handler (function process int symbol event-message-block object :behavior process-taskable))
(define-extern process-taskable-hide-enter (function int :behavior process-taskable))
;; - Unknowns
@@ -23386,7 +23386,7 @@
;; - Functions
(define-extern matrix-3x3-triple-transpose-product (function matrix matrix matrix matrix))
(define-extern rigid-body-platform-event-handler (function process int symbol event-message-block vector :behavior rigid-body-platform))
(define-extern rigid-body-platform-event-handler (function process int symbol event-message-block object :behavior rigid-body-platform))
(define-extern rigid-body-platform-post (function int :behavior rigid-body-platform))
;; - Unknowns
@@ -23627,9 +23627,9 @@
(define-extern nav-enemy-rnd-int-count (function int int))
(define-extern nav-enemy-rnd-float (function float))
(define-extern nav-enemy-rnd-percent? (function float symbol))
(define-extern nav-enemy-default-event-handler (function process int symbol event-message-block none :behavior nav-enemy)) ;; TODO - last arg is definitely a vector...but also not?
(define-extern nav-enemy-default-event-handler (function process int symbol event-message-block object :behavior nav-enemy))
(define-extern nav-enemy-jump-event-handler (function process int symbol event-message-block object :behavior nav-enemy))
(define-extern process-drawable-death-event-handler (function process int symbol event-message-block none :behavior process-drawable)) ;; First two args are unused
(define-extern process-drawable-death-event-handler (function process int symbol event-message-block object :behavior process-drawable))
(define-extern nav-enemy-patrol-post (function none :behavior nav-enemy))
(define-extern nav-enemy-chase-post (function none :behavior nav-enemy))
(define-extern nav-enemy-flee-post (function none :behavior nav-enemy))
@@ -26396,7 +26396,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 int :behavior light-eco-mother))
(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-init-by-other (function entity-actor vector none :behavior light-eco-mother))
;; - Unknowns
@@ -564,10 +564,10 @@
[77, "(function symbol debug-menu-msg int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems
[78, "(function symbol debug-menu-msg int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems
[79, "(function symbol debug-menu-msg int basic object)"], // TODO - i don't know the first (is a basic/struct with an int32 at offset 0) and a3 is a default return value it seems
[80, "(function object)"],
[81, "(function object)"],
[80, "(function object object)"],
[81, "(function object object)"],
[82, "(function symbol debug-menu-msg float float none)"],
[84, "(function symbol debug-menu-msg none)"],
[84, "(function symbol debug-menu-msg object)"],
[88, "(function debug-menu debug-menu symbol)"], // not 100% sure about the debug-menu, but it has a string at offset 0
[89, "(function debug-menu debug-menu symbol)"], // not 100% sure about the debug-menu, but it has a string at offset 0
[90, "(function debug-menu debug-menu symbol)"] // not 100% sure about the debug-menu, but it has a string at offset 0
+22 -22
View File
@@ -505,10 +505,10 @@
)
(deftype protect-frame (stack-frame)
((exit (function none) :offset-assert 12) ;; guessed by decompiler
((exit (function object) :offset-assert 12) ;; guessed by decompiler
)
(:methods
(new (symbol type (function none)) protect-frame)
(new (symbol type (function object)) protect-frame)
)
:method-count-assert 9
:size-assert #x10
@@ -526,16 +526,16 @@
(deftype state (protect-frame)
((code function :offset-assert 16) ;; guessed by decompiler
(trans (function none) :offset-assert 20) ;; guessed by decompiler
(trans (function object) :offset-assert 20) ;; guessed by decompiler
(post function :offset-assert 24) ;; guessed by decompiler
(enter function :offset-assert 28) ;; guessed by decompiler
(event (function process int symbol event-message-block object) :offset-assert 32) ;; guessed by decompiler
)
(:methods
(new (symbol type symbol function
(function none)
(function object)
function
(function none)
(function object)
(function process int symbol event-message-block object)) _type_ 0)
)
:method-count-assert 9
@@ -18755,7 +18755,7 @@
(target-board-jump meters meters symbol)
target-board-jump-kick
(target-board-pegasus handle)
(target-board-ride-edge symbol object object float)
(target-board-ride-edge symbol)
target-board-stance
(target-board-start object)
(target-board-trickx float float symbol)
@@ -23966,7 +23966,7 @@
(define-extern joint-control-channel-group-eval! (function joint-control-channel art-joint-anim (function joint-control-channel float float float float) int))
(define-extern joint-control-channel-group! (function joint-control-channel art-joint-anim (function joint-control-channel float float float float) int))
(define-extern joint-control-copy! (function joint-control joint-control joint-control))
(define-extern joint-control-remap! (function joint-control art-group art-group pair int string object))
(define-extern joint-control-remap! (function joint-control art-group art-group pair int string symbol))
(define-extern flatten-joint-control-to-spr (function joint-control int))
(define-extern matrix-from-joint-anim-frame (function joint-anim-compressed-control int int matrix))
(define-extern matrix-from-control-channel! (function matrix joint joint-control-channel matrix))
@@ -27733,7 +27733,7 @@
(define-extern cam-slave-init-vars (function none :behavior camera-slave))
(define-extern cam-slave-go (function (state camera-slave) none :behavior camera-slave))
(define-extern cam-slave-init (function (state camera-slave) entity none :behavior camera-slave))
(define-extern cam-standard-event-handler (function process int symbol event-message-block none :behavior camera-slave))
(define-extern cam-standard-event-handler (function process int symbol event-message-block object :behavior camera-slave))
(define-extern cam-curve-pos (function vector vector curve symbol vector :behavior camera-slave))
(define-extern cam-curve-setup (function vector none :behavior camera-slave))
(define-extern cam-calc-follow! (function cam-rotation-tracker vector symbol vector))
@@ -33297,15 +33297,15 @@
(enemy-method-63 (_type_ process-focusable enemy-aware) symbol 63)
(enemy-method-64 (_type_) none 64)
(enemy-method-65 (_type_) none 65)
(go-ambush (_type_) none 66)
(go-stare (_type_) none 67)
(go-stare2 (_type_) none 68)
(go-directed (_type_) none 69)
(go-hostile (_type_) none 70)
(go-flee (_type_) none 71)
(go-ambush (_type_) object 66)
(go-stare (_type_) object 67)
(go-stare2 (_type_) object 68)
(go-directed (_type_) object 69)
(go-hostile (_type_) object 70)
(go-flee (_type_) object 71)
(react-to-focus
"@TODO - flesh out docs"
(_type_) none 72)
(_type_) object 72)
(kill-prefer-falling
"If available in `enemy-info`, [[go]] to the [[die-falling]] state, if not, [[die]]"
(_type_) object 73)
@@ -34627,7 +34627,7 @@
)
)
(define-extern simple-nav-sphere-event-handler (function process int symbol event-message-block none :behavior simple-nav-sphere))
(define-extern simple-nav-sphere-event-handler (function process int symbol event-message-block object :behavior simple-nav-sphere))
(define-extern simple-nav-sphere-init-by-other (function float vector nav-mesh int none :behavior simple-nav-sphere))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -36247,7 +36247,7 @@
:flag-assert #x13003000a8
(:methods
(idle () _type_ :state 14)
(spawning (object object process pointer) _type_ :state 15)
(spawning () _type_ :state 15)
(die () _type_ :state 16)
(hover-enemy-manager-init! "Initialize this [[hover-enemy-manager]]." (_type_ (array hover-enemy-battle-command)) none 17)
(spawn-enemy (_type_ uint) none 18)
@@ -47044,8 +47044,8 @@
)
(define-extern tomb-boss-catwalk-init-by-other (function vector int none :behavior tomb-boss-catwalk))
(define-extern widow-bomb-handler (function process int symbol event-message-block none :behavior widow-bomb))
(define-extern widow-bomb-back-handler (function process int symbol event-message-block none :behavior widow-bomb))
(define-extern widow-bomb-handler (function process int symbol event-message-block object :behavior widow-bomb))
(define-extern widow-bomb-back-handler (function process int symbol event-message-block object :behavior widow-bomb))
(define-extern widow-bomb-reaction (function control-info collide-query vector vector collide-status :behavior widow))
(define-extern widow-bomb-init-by-other (function vector vector float float vector none :behavior widow-bomb))
(define-extern heart-mar-init-by-other (function vector none :behavior heart-mar))
@@ -50342,7 +50342,7 @@
)
)
(define-extern vehicle-rider-event-handler (function process int symbol event-message-block none :behavior vehicle-rider))
(define-extern vehicle-rider-event-handler (function process int symbol event-message-block object :behavior vehicle-rider))
(define-extern vehicle-rider-init-by-other (function traffic-object-spawn-params none :behavior vehicle-rider))
(define-extern vehicle-rider-spawn (function vehicle type traffic-object-spawn-params process))
@@ -50496,7 +50496,7 @@
;; vehicle-states ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern vehicle-event-handler (function process int symbol event-message-block none :behavior vehicle))
(define-extern vehicle-event-handler (function process int symbol event-message-block object :behavior vehicle))
(define-extern vehicle-explode-post (function none :behavior vehicle))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@@ -51751,7 +51751,7 @@
(move-to-vehicle () _type_ :state 209)
(board-vehicle () _type_ :state 210)
(ride () _type_ :state 211)
(exit-vehicle (object object int symbol event-message-block) _type_ :state 212)
(exit-vehicle () _type_ :state 212)
(wait-at-dest () _type_ :state 213)
(civilian-method-214 (_type_ nav-branch int vector float) float 214)
(civilian-method-215 (_type_ vector) none 215)
@@ -278,7 +278,7 @@
[55, "(function pair symbol)"]
],
"script": [
[0, "(function script-context none)"],
[0, "(function script-context object)"],
[1, "(function script-context int)"],
[2, "(function script-context int)"],
[3, "(function script-context int)"],
@@ -286,10 +286,10 @@
[5, "(function script-context int)"],
[6, "(function script-context object)"],
[7, "(function script-context object :behavior process)"],
[8, "(function script-context none :behavior process)"],
[9, "(function script-context none :behavior process)"],
[10, "(function script-context none :behavior process)"],
[11, "(function script-context none :behavior process)"],
[8, "(function script-context object :behavior process)"],
[9, "(function script-context object :behavior process)"],
[10, "(function script-context object :behavior process)"],
[11, "(function script-context object :behavior process)"],
[12, "(function script-context symbol)"],
[13, "(function script-context symbol)"],
[14, "(function script-context symbol)"],
@@ -298,50 +298,50 @@
[18, "(function script-context symbol)"],
[19, "(function script-context symbol)"],
[20, "(function script-context symbol)"],
[21, "(function script-context none)"],
[22, "(function script-context none)"],
[21, "(function script-context object)"],
[22, "(function script-context object)"],
[23, "(function script-context symbol)"],
[24, "(function script-context none)"],
[24, "(function script-context object)"],
[25, "(function script-context symbol)"],
[26, "(function script-context none)"],
[26, "(function script-context object)"],
[27, "(function script-context entity-perm-status)"],
[28, "(function script-context (pointer process))"],
[29, "(function script-context symbol)"],
[30, "(function script-context none)"],
[31, "(function script-context none)"],
[32, "(function script-context none)"],
[30, "(function script-context object)"],
[31, "(function script-context object)"],
[32, "(function script-context object)"],
[33, "(function script-context object)"],
[34, "(function script-context region)"],
[35, "(function script-context drawable-region-prim)"],
[36, "(function script-context symbol :behavior time-of-day-proc)"],
[37, "(function script-context object :behavior time-of-day-proc)"],
[38, "(function script-context none)"],
[38, "(function script-context object)"],
// TODO - ugly time-frame casts
[39, "(function script-context none)"],
[39, "(function script-context object)"],
// TODO - ugly time-frame casts
[40, "(function script-context none)"],
[40, "(function script-context object)"],
[41, "(function script-context sound-id)"],
[42, "(function script-context sound-id)"],
[43, "(function script-context none)"],
[43, "(function script-context object)"],
[44, "(function script-context object)"],
[45, "(function script-context none)"],
[46, "(function script-context none)"],
[47, "(function script-context none)"],
[48, "(function script-context none)"],
[45, "(function script-context object)"],
[46, "(function script-context object)"],
[47, "(function script-context object)"],
[48, "(function script-context object)"],
[49, "(function script-context symbol)"],
[50, "(function script-context symbol)"],
[51, "(function script-context none)"],
[51, "(function script-context object)"],
[52, "(function script-context symbol)"],
[53, "(function script-context symbol)"],
[54, "(function script-context symbol)"],
[55, "(function script-context none)"],
[56, "(function script-context none)"],
[57, "(function script-context none)"],
[58, "(function script-context none)"],
[59, "(function script-context none)"],
[60, "(function script-context none)"],
[61, "(function script-context none)"],
[62, "(function script-context none)"],
[55, "(function script-context object)"],
[56, "(function script-context object)"],
[57, "(function script-context object)"],
[58, "(function script-context object)"],
[59, "(function script-context object)"],
[60, "(function script-context object)"],
[61, "(function script-context object)"],
[62, "(function script-context object)"],
[64, "(function script-context object)"],
[65, "(function script-context symbol)"],
[66, "(function script-context symbol)"],
@@ -367,10 +367,10 @@
[15, "(function script-context pair :behavior process)"] // NOTE - an interesting one
],
"entity": [
[16, "(function process none)"],
[11, "(function process none)"],
[59, "(function process none)"],
[56, "(function process-drawable none)"]
[16, "(function process object)"],
[11, "(function process object)"],
[59, "(function process object)"],
[56, "(function process-drawable object)"]
],
"memory-usage": [
[2, "(function process-drawable symbol)"],
+2 -2
View File
@@ -75,7 +75,7 @@
["ocean-frames", "ocean-frames", 3, ["GAME", "ENGINE"], "engine/gfx/ocean"],
["sky-h", "sky-h", 3, ["GAME", "ENGINE"], "engine/gfx/sky"],
["mood-h", "mood-h", 3, ["GAME", "ENGINE"], "engine/gfx"],
["time-of-day-h", "time-of-day-h", 3, ["GAME", "ENGINE"], "engine/gfx"],
["time-of-day-h", "time-of-day-h", 3, ["GAME", "ENGINE"], "engine/gfx/mood"],
["art-h", "art-h", 3, ["GAME", "ENGINE"], "engine/data"],
["generic-vu1-h", "generic-vu1-h", 3, ["GAME", "ENGINE"], "engine/gfx/generic"],
["merc-h", "merc-h", 3, ["GAME", "ENGINE"], "engine/gfx/merc"],
@@ -200,7 +200,7 @@
["mood-tables", "mood-tables", 3, ["GAME", "ENGINE"], "engine/gfx/mood"],
["mood", "mood", 3, ["GAME", "ENGINE"], "engine/gfx/mood"],
["weather-part", "weather-part", 3, ["GAME", "ENGINE"], "engine/gfx/mood"],
["time-of-day", "time-of-day", 3, ["GAME", "ENGINE"], "engine/gfx"],
["time-of-day", "time-of-day", 3, ["GAME", "ENGINE"], "engine/gfx/mood"],
["sky-utils", "sky-utils", 3, ["GAME", "ENGINE"], "engine/gfx/sky"],
["sky", "sky", 3, ["GAME", "ENGINE"], "engine/gfx/sky"],
["sky-tng", "sky-tng", 3, ["GAME", "ENGINE"], "engine/gfx/sky"],
+11 -24
View File
@@ -7,8 +7,8 @@
;; DECOMP BEGINS
;; WARN: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)]
;; WARN: Unsupported inline assembly instruction kind - [jr ra]
;; ERROR: Unsupported inline assembly instruction kind - [lw ra, return-from-thread(s7)]
;; ERROR: Unsupported inline assembly instruction kind - [jr ra]
(defmethod compute-alignment! align-control ((obj align-control))
(local-vars (a0-9 symbol) (s7-0 none) (ra-0 int))
(with-pp
@@ -24,23 +24,13 @@
((or a2-0 (begin (set! a1-0 'stack1) (= a0-4 a1-0)))
)
(else
; TODO - support decompiling the return-from-thread
; TODO - properly decompile the `go`to
; (when (!= (-> v1-5 type) art-joint-anim)
; (let
; ((t9-0 (the-as (function object object object object) enter-state))
; (a0-7 "align joint-anim")
; )
; (set! (-> pp next-state) process-drawable-art-error)
; (t9-0 a0-7 (the-as none a1-0) a2-0)
; )
; (.lw ra-0 return-from-thread s7-0)
; (.jr ra-0)
; (nop!)
; 0
; )
0
)
(when (!= (-> v1-5 type) art-joint-anim)
;; og:preserve-this
(go process-drawable-art-error "align joint-anim")
(abandon-thread)
0
)
)
)
)
)
@@ -133,7 +123,7 @@
)
(defmethod align! align-control ((obj align-control) (arg0 align-opts) (arg1 float) (arg2 float) (arg3 float))
(when (zero? (logand (-> obj flags) (align-flags disabled)))
(when (not (logtest? (-> obj flags) (align-flags disabled)))
(let* ((a0-1 (-> obj process))
(t9-0 (method-of-object a0-1 apply-alignment))
(v1-4 (-> obj delta))
@@ -163,7 +153,7 @@
)
(defmethod align-vel-and-quat-only! align-control ((obj align-control) (arg0 align-opts) (arg1 vector) (arg2 int) (arg3 float) (arg4 float))
(when (zero? (logand (-> obj flags) (align-flags disabled)))
(when (not (logtest? (-> obj flags) (align-flags disabled)))
(let ((s5-0 (-> obj delta)))
(let ((s3-0 (-> obj process root transv)))
(if (logtest? arg0 (align-opts adjust-y-vel))
@@ -190,6 +180,3 @@
)
(-> obj process root)
)
+1 -4
View File
@@ -459,7 +459,6 @@
(defstate joint-exploder-shatter (joint-exploder)
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans (behavior ()
(let* ((f1-0 (the float (- (-> *display* base-frame-counter) (-> self state-time))))
@@ -516,7 +515,6 @@
)
)
0
(none)
)
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -524,7 +522,6 @@
(suspend)
(ja :num! (loop!))
)
(none)
)
:post (the-as (function none :behavior joint-exploder) ja-post)
)
@@ -644,7 +641,7 @@
(set! (-> a0-6 pre-moved?) #f)
)
)
(set! (-> self mask) (logior (process-mask enemy) (-> self mask)))
(logior! (-> self mask) (process-mask enemy))
(set! (-> self root) (new 'process 'trsqv))
(set! (-> self root trans quad) (-> self parent-override 0 root trans quad))
(quaternion-copy! (-> self root quat) (-> self parent-override 0 root quat))
+1 -1
View File
@@ -698,7 +698,7 @@
)
)
)
(the-as object sv-24)
sv-24
)
(defun flatten-joint-control-to-spr ((arg0 joint-control))
+136 -145
View File
@@ -8,164 +8,156 @@
;; DECOMP BEGINS
(defstate cam-combiner-active (camera-combiner)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as
object
(case event-type
(('point-of-interest)
(cond
((-> event param 0)
(set! (-> self tracking use-point-of-interest) #t)
(set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> event param 0)) quad))
(set! (-> self tracking point-of-interest-blend target) 1.0)
)
(else
(set! (-> self tracking use-point-of-interest) #f)
(set! (-> self tracking point-of-interest-blend target) 0.0)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('point-of-interest)
(cond
((-> block param 0)
(set! (-> self tracking use-point-of-interest) #t)
(set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> block param 0)) quad))
(set! (-> self tracking point-of-interest-blend target) 1.0)
)
(else
(set! (-> self tracking use-point-of-interest) #f)
(set! (-> self tracking point-of-interest-blend target) 0.0)
)
)
(('set-interpolation)
(set! (-> self interp-val) 0.0)
(set! (-> self interp-step) (/ 5.0 (the float (-> event param 0))))
)
(('teleport)
(when (nonzero? (-> self tracking-status))
(cam-calc-follow! (-> self tracking) (-> self trans) #f)
(the-as object (slave-set-rotation!
(-> self tracking)
(-> self trans)
(the-as float (-> self tracking-options))
(-> self fov)
#f
)
)
)
(('set-interpolation)
(set! (-> self interp-val) 0.0)
(set! (-> self interp-step) (/ 5.0 (the float (-> block param 0))))
)
(('teleport)
(when (nonzero? (-> self tracking-status))
(cam-calc-follow! (-> self tracking) (-> self trans) #f)
(slave-set-rotation!
(-> self tracking)
(-> self trans)
(the-as float (-> self tracking-options))
(-> self fov)
#f
)
)
(('stop-tracking)
(set! (-> self tracking-status) (the-as uint 0))
0
)
(('stop-tracking)
(set! (-> self tracking-status) (the-as uint 0))
0
)
(('start-tracking)
(cond
((< argc 1)
(let ((t9-2 format)
(a0-15 0)
(a1-3 "ERROR <GMJ>: missing camera-slave parameter to *camera-combiner* start-tracking~%")
)
(let ((v1-7 (-> block param 0)))
(rtype-of v1-7)
)
(t9-2 a0-15 a1-3)
)
)
((let ((t9-3 type-type?)
(v1-8 (-> block param 0))
)
(not (t9-3 (rtype-of v1-8) camera-slave))
)
(let ((t9-4 format)
(a0-18 0)
(a1-5 "ERROR <GMJ>: invalid type '~A' to *camera-combiner* start-tracking~%")
(v1-10 (-> block param 0))
)
(t9-4 a0-18 a1-5 (rtype-of v1-10))
)
)
((zero? (-> self tracking-status))
(set! (-> self tracking-status) (the-as uint 1))
(let ((gp-1 (the-as object (-> block param 0))))
(set! (-> self tracking-options) (the-as int (-> (the-as camera-slave gp-1) options)))
(set! (-> self tracking no-follow) (-> (the-as camera-slave gp-1) tracking no-follow))
(copy-cam-float-seeker (-> self tracking tilt-adjust) (-> (the-as camera-slave gp-1) tracking tilt-adjust))
(copy-cam-float-seeker
(-> self tracking underwater-blend)
(-> (the-as camera-slave gp-1) tracking underwater-blend)
)
(set! (-> self tracking use-point-of-interest) (-> (the-as camera-slave gp-1) tracking use-point-of-interest))
(set! (-> self tracking point-of-interest quad)
(-> (the-as camera-slave gp-1) tracking point-of-interest quad)
)
(copy-cam-float-seeker
(-> self tracking point-of-interest-blend)
(-> (the-as camera-slave gp-1) tracking point-of-interest-blend)
)
(let ((gp-2 (+ (the-as uint gp-1) 108)))
(cam-calc-follow! (-> self tracking) (the-as vector gp-2) #f)
(slave-set-rotation!
(-> self tracking)
(the-as vector gp-2)
(the-as float (-> self tracking-options))
(-> self fov)
#f
)
)
)
)
)
(('start-tracking)
(cond
((< arg1 1)
(let ((t9-2 format)
(a0-15 0)
(a1-3 "ERROR <GMJ>: missing camera-slave parameter to *camera-combiner* start-tracking~%")
)
(let ((v1-7 (-> event param 0)))
(rtype-of v1-7)
)
(('copy-tracking)
(cond
((< argc 1)
(let ((t9-10 format)
(a0-27 0)
(a1-11 "ERROR <GMJ>: missing camera-slave parameter to *camera-combiner* copy-tracking~%")
)
(t9-2 a0-15 a1-3)
(let ((v1-23 (-> block param 0)))
(rtype-of v1-23)
)
(t9-10 a0-27 a1-11)
)
((let ((t9-3 type-type?)
(v1-8 (-> event param 0))
)
(not (t9-3 (rtype-of v1-8) camera-slave))
)
(let ((t9-4 format)
(a0-18 0)
(a1-5 "ERROR <GMJ>: invalid type '~A' to *camera-combiner* start-tracking~%")
(v1-10 (-> event param 0))
)
(t9-4 a0-18 a1-5 (rtype-of v1-10))
)
)
((zero? (-> self tracking-status))
(set! (-> self tracking-status) (the-as uint 1))
(let ((gp-1 (the-as object (-> event param 0))))
(set! (-> self tracking-options) (the-as int (-> (the-as camera-slave gp-1) options)))
(set! (-> self tracking no-follow) (-> (the-as camera-slave gp-1) tracking no-follow))
(copy-cam-float-seeker (-> self tracking tilt-adjust) (-> (the-as camera-slave gp-1) tracking tilt-adjust))
(copy-cam-float-seeker
(-> self tracking underwater-blend)
(-> (the-as camera-slave gp-1) tracking underwater-blend)
)
((let ((t9-11 type-type?)
(v1-24 (-> block param 0))
)
(set! (-> self tracking use-point-of-interest) (-> (the-as camera-slave gp-1) tracking use-point-of-interest))
(set! (-> self tracking point-of-interest quad)
(-> (the-as camera-slave gp-1) tracking point-of-interest quad)
(not (t9-11 (rtype-of v1-24) camera-slave))
)
(let ((t9-12 format)
(a0-30 0)
(a1-13 "ERROR <GMJ>: invalid type '~A' to *camera-combiner* copy-tracking~%")
(v1-25 (-> block param 0))
)
(t9-12 a0-30 a1-13 (rtype-of v1-25))
)
)
((nonzero? (-> self tracking-status))
#f
)
(else
(set! (-> self tracking-status) (the-as uint 1))
(let ((gp-3 (the-as camera-slave (-> block param 0))))
(set! (-> self tracking-options) (the-as int (-> gp-3 options)))
(set! (-> self tracking no-follow) (-> gp-3 tracking no-follow))
(copy-cam-float-seeker (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust))
(copy-cam-float-seeker (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend))
(set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad))
(set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad))
(let* ((a2-17 (-> self tracking))
(a3-3 (-> gp-3 tracking))
(v1-36 (-> a3-3 inv-mat vector 0 quad))
(a0-37 (-> a3-3 inv-mat vector 1 quad))
(a1-16 (-> a3-3 inv-mat vector 2 quad))
(a3-4 (-> a3-3 inv-mat vector 3 quad))
)
(copy-cam-float-seeker
(-> self tracking point-of-interest-blend)
(-> (the-as camera-slave gp-1) tracking point-of-interest-blend)
)
(let ((gp-2 (+ (the-as uint gp-1) 108)))
(cam-calc-follow! (-> self tracking) (the-as vector gp-2) #f)
(the-as object (slave-set-rotation!
(-> self tracking)
(the-as vector gp-2)
(the-as float (-> self tracking-options))
(-> self fov)
#f
)
)
)
)
)
)
)
(('copy-tracking)
(cond
((< arg1 1)
(let ((t9-10 format)
(a0-27 0)
(a1-11 "ERROR <GMJ>: missing camera-slave parameter to *camera-combiner* copy-tracking~%")
)
(let ((v1-23 (-> event param 0)))
(rtype-of v1-23)
)
(t9-10 a0-27 a1-11)
)
)
((let ((t9-11 type-type?)
(v1-24 (-> event param 0))
)
(not (t9-11 (rtype-of v1-24) camera-slave))
)
(let ((t9-12 format)
(a0-30 0)
(a1-13 "ERROR <GMJ>: invalid type '~A' to *camera-combiner* copy-tracking~%")
(v1-25 (-> event param 0))
)
(t9-12 a0-30 a1-13 (rtype-of v1-25))
)
)
((nonzero? (-> self tracking-status))
#f
)
(else
(set! (-> self tracking-status) (the-as uint 1))
(let ((gp-3 (the-as camera-slave (-> event param 0))))
(set! (-> self tracking-options) (the-as int (-> gp-3 options)))
(set! (-> self tracking no-follow) (-> gp-3 tracking no-follow))
(copy-cam-float-seeker (-> self tracking tilt-adjust) (-> gp-3 tracking tilt-adjust))
(copy-cam-float-seeker (-> self tracking underwater-blend) (-> gp-3 tracking underwater-blend))
(set! (-> self tracking follow-off quad) (-> gp-3 tracking follow-off quad))
(set! (-> self tracking follow-pt quad) (-> gp-3 tracking follow-pt quad))
(let* ((a2-17 (-> self tracking))
(a3-3 (-> gp-3 tracking))
(v1-36 (-> a3-3 inv-mat vector 0 quad))
(a0-37 (-> a3-3 inv-mat vector 1 quad))
(a1-16 (-> a3-3 inv-mat vector 2 quad))
(a3-4 (-> a3-3 inv-mat vector 3 quad))
)
(set! (-> a2-17 inv-mat vector 0 quad) v1-36)
(set! (-> a2-17 inv-mat vector 1 quad) a0-37)
(set! (-> a2-17 inv-mat vector 2 quad) a1-16)
(set! (-> a2-17 inv-mat vector 3 quad) a3-4)
)
(set! (-> self tracking use-point-of-interest) (-> gp-3 tracking use-point-of-interest))
(set! (-> self tracking point-of-interest quad) (-> gp-3 tracking point-of-interest quad))
(the-as
object
(copy-cam-float-seeker (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend))
)
(set! (-> a2-17 inv-mat vector 0 quad) v1-36)
(set! (-> a2-17 inv-mat vector 1 quad) a0-37)
(set! (-> a2-17 inv-mat vector 2 quad) a1-16)
(set! (-> a2-17 inv-mat vector 3 quad) a3-4)
)
(set! (-> self tracking use-point-of-interest) (-> gp-3 tracking use-point-of-interest))
(set! (-> self tracking point-of-interest quad) (-> gp-3 tracking point-of-interest quad))
(copy-cam-float-seeker (-> self tracking point-of-interest-blend) (-> gp-3 tracking point-of-interest-blend))
)
)
)
)
)
)
)
:code (behavior ()
@@ -414,7 +406,6 @@
)
(suspend)
)
(none)
)
)
@@ -3506,7 +3506,6 @@
(cam-layout-do-menu *clm*)
(suspend)
)
(none)
)
)
+78 -86
View File
@@ -628,13 +628,9 @@
)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 166]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 176]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 196]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 220]
(defbehavior master-switch-to-entity camera-master ((arg0 entity))
(local-vars
(v0-21 none)
(v0-21 object)
(gp-0 (pointer process))
(sv-16 res-tag)
(sv-112 process)
@@ -830,11 +826,11 @@
)
(defstate cam-master-active (camera-master)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-0 object))
(rlet ((vf0 :class vf))
(init-vf0-vector)
(let ((v1-0 event-type))
(let ((v1-0 message))
(cond
((= v1-0 'dist-from-interp-src)
(set! v0-0 (cond
@@ -865,7 +861,7 @@
)
)
((= v1-0 'level-deactivate)
(set! v0-0 (if (and (-> self cam-entity) (= (-> (get-level (-> self cam-entity)) name) (-> event param 0)))
(set! v0-0 (if (and (-> self cam-entity) (= (-> (get-level (-> self cam-entity)) name) (-> block param 0)))
(master-unset-region)
)
)
@@ -879,12 +875,12 @@
)
((= v1-0 'force-blend)
(set! (-> self force-blend) (the-as uint 3))
(set! v0-0 (-> event param 0))
(set! v0-0 (-> block param 0))
(set! (-> self force-blend-time) (the-as uint v0-0))
)
((= v1-0 'teleport-to-transformq)
(set! v0-0 (when (> arg1 0)
(let ((gp-1 (the-as object (-> event param 0))))
(set! v0-0 (when (> argc 0)
(let ((gp-1 (the-as object (-> block param 0))))
(send-event self 'change-state cam-free-floating 0)
(dotimes (s5-1 (-> self num-slaves))
(set! (-> self slave s5-1 0 trans quad) (-> (the-as matrix gp-1) vector 0 quad))
@@ -918,8 +914,8 @@
)
((= v1-0 'teleport-to-vector-start-string)
(set! v0-0
(when (> arg1 0)
(let ((v1-43 (the-as object (-> event param 0)))
(when (> argc 0)
(let ((v1-43 (the-as object (-> block param 0)))
(gp-3 (new 'stack-no-clear 'vector))
)
(set! (-> *camera-combiner* trans quad) (-> (the-as vector v1-43) quad))
@@ -933,14 +929,14 @@
)
)
((= v1-0 'change-pov)
(let ((v1-52 (the-as object (-> event param 0))))
(let ((v1-52 (the-as object (-> block param 0))))
(cond
((< arg1 2)
((< argc 2)
(set! (-> self pov-bone) 0)
0
)
(else
(set! (-> self pov-bone) (the-as int (-> event param 1)))
(set! (-> self pov-bone) (the-as int (-> block param 1)))
)
)
(set! v0-0 (cond
@@ -958,18 +954,18 @@
)
)
((= v1-0 'change-target-bone)
(set! v0-0 (-> event param 0))
(set! v0-0 (-> block param 0))
(set! (-> self which-bone) (the-as int v0-0))
)
((= v1-0 'change-target)
(let ((v1-56 (the-as object (-> event param 0))))
(let ((v1-56 (the-as object (-> block param 0))))
(cond
((< arg1 2)
((< argc 2)
(set! (-> self which-bone) 0)
0
)
(else
(set! (-> self which-bone) (the-as int (-> event param 1)))
(set! (-> self which-bone) (the-as int (-> block param 1)))
)
)
(cond
@@ -1001,9 +997,9 @@
(set! v0-0 (matrix-identity! (the-as matrix (-> *camera-combiner* tracking))))
)
((= v1-0 'set-fov)
(set! (-> *camera-combiner* fov) (the-as float (-> event param 0)))
(set! (-> *camera-combiner* fov) (the-as float (-> block param 0)))
(dotimes (v1-86 (-> self num-slaves))
(set! (-> self slave v1-86 0 fov) (the-as float (-> event param 0)))
(set! (-> self slave v1-86 0 fov) (the-as float (-> block param 0)))
)
(set! v0-0 #f)
)
@@ -1024,18 +1020,18 @@
)
((= v1-0 'query-state)
(let ((v1-95 (+ (-> self num-slaves) -1)))
(while (not (or (< v1-95 0) (= (-> self slave v1-95 0 next-state) (-> event param 0))))
(while (not (or (< v1-95 0) (= (-> self slave v1-95 0 next-state) (-> block param 0))))
(+! v1-95 -1)
)
(set! v0-0 (and (>= v1-95 0) (= (-> self slave v1-95 0 next-state) (-> event param 0))))
(set! v0-0 (and (>= v1-95 0) (= (-> self slave v1-95 0 next-state) (-> block param 0))))
)
)
((= v1-0 'change-to-entity-by-name)
(let ((a0-75 (entity-by-name (the-as string (-> event param 0)))))
(let ((a0-75 (entity-by-name (the-as string (-> block param 0)))))
(set! v0-0
(if a0-75
(master-switch-to-entity a0-75)
(format 0 "ERROR <GMJ>: camera entity '~S' not found for change-to-entity-by-name~%" (-> event param 0))
(format 0 "ERROR <GMJ>: camera entity '~S' not found for change-to-entity-by-name~%" (-> block param 0))
)
)
)
@@ -1049,24 +1045,24 @@
(s4-1 (the-as (pointer camera-slave) #f))
)
(let ((t9-22 type-type?)
(v1-101 (-> event param 0))
(v1-101 (-> block param 0))
)
(cond
((t9-22 (rtype-of v1-101) state)
(set! s1-0 (-> event param 0))
(set! s1-0 (-> block param 0))
)
((let ((t9-23 type-type?)
(v1-103 (-> event param 0))
(v1-103 (-> block param 0))
)
(t9-23 (rtype-of v1-103) camera-slave)
)
(set! s2-0 (process->ppointer (the-as process (-> event param 0))))
(set! s2-0 (process->ppointer (the-as process (-> block param 0))))
)
(else
(let ((t9-24 format)
(a0-82 0)
(a1-25 "ERROR <GMJ>: invalid type '~A' to *camera* change-state~%")
(v1-106 (-> event param 0))
(v1-106 (-> block param 0))
)
(t9-24 a0-82 a1-25 (rtype-of v1-106))
)
@@ -1127,7 +1123,7 @@
)
)
)
((zero? (-> event param 1))
((zero? (-> block param 1))
(if *math-camera*
(set! (-> *math-camera* reset) 1)
)
@@ -1199,7 +1195,7 @@
)
(when (< 0.0 (-> self slave 0 0 intro-t-step))
(set! (-> self outro-t) (-> self slave 0 0 intro-t))
(set! (-> self outro-t-step) (/ -5.0 (the float (-> event param 1))))
(set! (-> self outro-t-step) (/ -5.0 (the float (-> block param 1))))
(set! (-> self outro-exit-value) (-> self slave 0 0 outro-exit-value))
(curve-copy! (-> self outro-curve) (-> self slave 0 0 intro-curve))
)
@@ -1244,7 +1240,7 @@
)
)
(when s2-0
(send-event *camera-combiner* 'set-interpolation (-> event param 1))
(send-event *camera-combiner* 'set-interpolation (-> block param 1))
(set! s4-1 (-> self slave 0))
(cond
((zero? (-> self slave 0 0 blend-from-type))
@@ -1350,36 +1346,36 @@
(cond
((< (-> self num-slaves) 2)
(set! (-> self slave (-> self num-slaves))
(the-as (pointer camera-slave) (process->ppointer (the-as process (-> event param 0))))
(the-as (pointer camera-slave) (process->ppointer (the-as process (-> block param 0))))
)
(+! (-> self num-slaves) 1)
(logior! (-> self master-options) 8)
(set! (-> *camera-combiner* tracking tilt-adjust target) (-> (the-as projectile (-> event param 0)) max-turn))
(set! (-> *camera-combiner* tracking tilt-adjust target) (-> (the-as projectile (-> block param 0)) max-turn))
)
(else
(format 0 "ERROR: ERROR <GMJ>: Exceeded maximum number of camera slaves!~%")
(the-as object (deactivate (the-as camera-slave (-> event param 0))))
(deactivate (the-as camera-slave (-> block param 0)))
)
)
)
)
((= v1-0 'ease-in)
(cond
((< arg1 1)
((< argc 1)
(set! (-> self ease-t) 0.0)
(logand! (-> self master-options) -33)
)
((< arg1 2)
(if (< (the-as float (-> event param 0)) (-> self ease-t))
(set! (-> self ease-t) (the-as float (-> event param 0)))
((< argc 2)
(if (< (the-as float (-> block param 0)) (-> self ease-t))
(set! (-> self ease-t) (the-as float (-> block param 0)))
)
(logand! (-> self master-options) -33)
)
(else
(if (< (the-as float (-> event param 0)) (-> self ease-t))
(set! (-> self ease-t) (the-as float (-> event param 0)))
(if (< (the-as float (-> block param 0)) (-> self ease-t))
(set! (-> self ease-t) (the-as float (-> block param 0)))
)
(set! (-> self ease-to quad) (-> (the-as vector (-> event param 1)) quad))
(set! (-> self ease-to quad) (-> (the-as vector (-> block param 1)) quad))
(logior! (-> self master-options) 32)
)
)
@@ -1410,25 +1406,25 @@
)
)
(countdown (gp-6 (-> self num-slaves))
(send-event (ppointer->process (-> self slave gp-6)) event-type)
(send-event (ppointer->process (-> self slave gp-6)) message)
)
(let ((a1-54 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-54 from) self)
(set! (-> a1-54 num-params) 0)
(set! (-> a1-54 message) event-type)
(set! (-> a1-54 message) message)
(set! v0-0 (send-event-function *camera-combiner* a1-54))
)
)
((= v1-0 'toggle-slave-option)
(logxor! (-> self slave-options) (-> event param 0))
(logxor! (-> self slave-options) (-> block param 0))
(let ((a0-193 (-> self slave 0))
(v1-360 (-> self slave 1))
)
(if a0-193
(logxor! (-> a0-193 0 options) (-> event param 0))
(logxor! (-> a0-193 0 options) (-> block param 0))
)
(set! v0-0 (when v1-360
(set! v0-0 (logxor (-> v1-360 0 options) (-> event param 0)))
(set! v0-0 (logxor (-> v1-360 0 options) (-> block param 0)))
(set! (-> v1-360 0 options) (the-as uint v0-0))
v0-0
)
@@ -1440,19 +1436,19 @@
(cond
((= v1-0 'slave-option?)
(if (nonzero? (-> self num-slaves))
(logtest? (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> event param 0))
(logtest? (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> block param 0))
)
)
((= v1-0 'set-slave-option)
(when (nonzero? (-> self num-slaves))
(set! v0-0 (logior (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> event param 0)))
(set! v0-0 (logior (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> block param 0)))
(set! (-> self slave (+ (-> self num-slaves) -1) 0 options) (the-as uint v0-0))
v0-0
)
)
((= v1-0 'clear-slave-option)
(when (nonzero? (-> self num-slaves))
(set! v0-0 (logclear (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> event param 0)))
(set! v0-0 (logclear (-> self slave (+ (-> self num-slaves) -1) 0 options) (-> block param 0)))
(set! (-> self slave (+ (-> self num-slaves) -1) 0 options) (the-as uint v0-0))
v0-0
)
@@ -1484,50 +1480,50 @@
(when (nonzero? (-> self num-slaves))
(let ((a1-60 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-60 from) proc)
(set! (-> a1-60 num-params) arg1)
(set! (-> a1-60 message) event-type)
(set! (-> a1-60 param 0) (-> event param 0))
(set! (-> a1-60 param 1) (-> event param 1))
(set! (-> a1-60 param 2) (-> event param 2))
(set! (-> a1-60 param 3) (-> event param 3))
(set! (-> a1-60 param 4) (-> event param 4))
(set! (-> a1-60 param 5) (-> event param 5))
(set! (-> a1-60 param 6) (-> event param 6))
(set! (-> a1-60 num-params) argc)
(set! (-> a1-60 message) message)
(set! (-> a1-60 param 0) (-> block param 0))
(set! (-> a1-60 param 1) (-> block param 1))
(set! (-> a1-60 param 2) (-> block param 2))
(set! (-> a1-60 param 3) (-> block param 3))
(set! (-> a1-60 param 4) (-> block param 4))
(set! (-> a1-60 param 5) (-> block param 5))
(set! (-> a1-60 param 6) (-> block param 6))
(send-event-function (ppointer->process (-> self slave (+ (-> self num-slaves) -1))) a1-60)
)
)
(let ((a1-61 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-61 from) proc)
(set! (-> a1-61 num-params) arg1)
(set! (-> a1-61 message) event-type)
(set! (-> a1-61 param 0) (-> event param 0))
(set! (-> a1-61 param 1) (-> event param 1))
(set! (-> a1-61 param 2) (-> event param 2))
(set! (-> a1-61 param 3) (-> event param 3))
(set! (-> a1-61 param 4) (-> event param 4))
(set! (-> a1-61 param 5) (-> event param 5))
(set! (-> a1-61 param 6) (-> event param 6))
(set! (-> a1-61 num-params) argc)
(set! (-> a1-61 message) message)
(set! (-> a1-61 param 0) (-> block param 0))
(set! (-> a1-61 param 1) (-> block param 1))
(set! (-> a1-61 param 2) (-> block param 2))
(set! (-> a1-61 param 3) (-> block param 3))
(set! (-> a1-61 param 4) (-> block param 4))
(set! (-> a1-61 param 5) (-> block param 5))
(set! (-> a1-61 param 6) (-> block param 6))
(send-event-function *camera-combiner* a1-61)
)
)
((= v1-0 'part-water-drip)
(set! (-> self water-drip-time) (-> *display* base-frame-counter))
(set! (-> self water-drip-mult) (the-as float (-> event param 0)))
(set! (-> self water-drip-speed) (the-as float (-> event param 1)))
(set! (-> self water-drip-mult) (the-as float (-> block param 0)))
(set! (-> self water-drip-speed) (the-as float (-> block param 1)))
)
(else
(countdown (s3-1 (-> self num-slaves))
(let ((a1-62 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-62 from) proc)
(set! (-> a1-62 num-params) arg1)
(set! (-> a1-62 message) event-type)
(set! (-> a1-62 param 0) (-> event param 0))
(set! (-> a1-62 param 1) (-> event param 1))
(set! (-> a1-62 param 2) (-> event param 2))
(set! (-> a1-62 param 3) (-> event param 3))
(set! (-> a1-62 param 4) (-> event param 4))
(set! (-> a1-62 param 5) (-> event param 5))
(set! (-> a1-62 param 6) (-> event param 6))
(set! (-> a1-62 num-params) argc)
(set! (-> a1-62 message) message)
(set! (-> a1-62 param 0) (-> block param 0))
(set! (-> a1-62 param 1) (-> block param 1))
(set! (-> a1-62 param 2) (-> block param 2))
(set! (-> a1-62 param 3) (-> block param 3))
(set! (-> a1-62 param 4) (-> block param 4))
(set! (-> a1-62 param 5) (-> block param 5))
(set! (-> a1-62 param 6) (-> block param 6))
(send-event-function (ppointer->process (-> self slave s3-1)) a1-62)
)
)
@@ -1538,14 +1534,13 @@
)
)
)
(the-as object v0-0)
v0-0
)
)
:enter (behavior ()
(if (and (nonzero? camera-master-debug) *debug-segment*)
(add-connection *debug-engine* self camera-master-debug self #f #f)
)
(none)
)
:trans (behavior ()
(when (not (paused?))
@@ -1555,7 +1550,6 @@
)
(cam-master-effect)
)
(none)
)
:code (behavior ()
(loop
@@ -1600,7 +1594,6 @@
)
(suspend)
)
(none)
)
)
@@ -1620,7 +1613,6 @@
(change-to-last-brother self)
(suspend)
)
(none)
)
)
+9 -16
View File
@@ -20,13 +20,13 @@
(define *CAM_POINT_WATCH-bank* (new 'static 'cam-point-watch-bank :speed 1600.0 :rot-speed (degrees 0.6)))
(defstate cam-point-watch (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -36,7 +36,6 @@
(set! (-> self blend-from-type) (the-as uint 1))
(set! (-> self blend-to-type) (the-as uint 1))
)
(none)
)
:code (behavior ()
(loop
@@ -84,7 +83,6 @@
(suspend)
0
)
(none)
)
)
@@ -390,13 +388,13 @@
)
(defstate cam-free-floating (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -406,7 +404,6 @@
(set! (-> self blend-to-type) (the-as uint 1))
(send-event *camera-combiner* 'stop-tracking)
)
(none)
)
:code (behavior ()
(loop
@@ -423,7 +420,6 @@
)
(suspend)
)
(none)
)
)
@@ -469,13 +465,13 @@
(set! (-> *camera-orbit-info* orbit-off y) 4096.0)
(defstate cam-orbit (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -491,11 +487,9 @@
(set! (-> self blend-from-type) (the-as uint 1))
(set! (-> self blend-to-type) (the-as uint 1))
)
(none)
)
:exit (behavior ()
'()
(none)
)
:code (behavior ()
(loop
@@ -586,6 +580,5 @@
)
(suspend)
)
(none)
)
)
+41 -91
View File
@@ -10,13 +10,13 @@
;; DECOMP BEGINS
(defstate cam-fixed (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -27,7 +27,6 @@
(set! (-> self blend-to-type) (the-as uint 0))
0
)
(none)
)
:code (behavior ()
(loop
@@ -43,18 +42,17 @@
)
(suspend)
)
(none)
)
)
(defstate cam-fixed-read-entity (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -79,25 +77,23 @@
)
)
(go cam-fixed)
(none)
)
:code (behavior ()
(loop
(format *stdcon* "ERROR <GMJ>: stayed in cam-fixed-read-entity~%")
(suspend)
)
(none)
)
)
(defstate cam-pov (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -106,14 +102,12 @@
(set! (-> self blend-from-type) (the-as uint 1))
(set! (-> self blend-to-type) (the-as uint 1))
)
(none)
)
:trans (behavior ()
(when (not (handle->process (-> *camera* pov-handle)))
(set! (-> self blend-from-type) (the-as uint 0))
(cam-slave-go cam-fixed)
)
(none)
)
:code (behavior ()
(loop
@@ -145,18 +139,17 @@
)
(suspend)
)
(none)
)
)
(defstate cam-pov180 (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -165,14 +158,12 @@
(set! (-> self blend-from-type) (the-as uint 1))
(set! (-> self blend-to-type) (the-as uint 1))
)
(none)
)
:trans (behavior ()
(when (not (handle->process (-> *camera* pov-handle)))
(set! (-> self blend-from-type) (the-as uint 0))
(cam-slave-go cam-fixed)
)
(none)
)
:code (behavior ()
(let ((gp-0 (new 'stack-no-clear 'vector))
@@ -244,7 +235,6 @@
(suspend)
)
)
(none)
)
)
@@ -260,13 +250,11 @@
(send-event *camera* 'point-of-interest gp-0)
)
)
(none)
)
:trans (behavior ()
(if (or (not (handle->process (-> *camera* pov-handle))) (not (logtest? (-> *camera* master-options) 2)))
(cam-slave-go cam-free-floating)
)
(none)
)
:code (behavior ()
(loop
@@ -278,7 +266,6 @@
)
(suspend)
)
(none)
)
)
@@ -290,10 +277,10 @@
)
(defstate cam-standoff (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('set-standoff-dist)
(vector-normalize! (-> self pivot-pt) (the-as float (-> event param 0)))
(vector-normalize! (-> self pivot-pt) (the-as float (-> block param 0)))
(cam-standoff-calc-trans)
)
(('set-standoff-height)
@@ -302,12 +289,12 @@
(-> self pivot-pt)
(-> self pivot-pt)
(-> *camera* local-down)
(the-as float (-> event param 0))
(the-as float (-> block param 0))
)
(cam-standoff-calc-trans)
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -327,13 +314,11 @@
)
)
(cam-calc-follow! (-> self tracking) (-> self trans) #f)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(cam-slave-go cam-free-floating)
)
(none)
)
:code (behavior ()
(loop
@@ -343,7 +328,6 @@
)
(suspend)
)
(none)
)
)
@@ -382,14 +366,12 @@
)
)
(go cam-standoff)
(none)
)
:code (behavior ()
(loop
(format *stdcon* "ERROR <GMJ>: stayed in cam-standoff-read-entity~%")
(suspend)
)
(none)
)
)
@@ -412,13 +394,13 @@
;; main first-person camera
;; og:preserve-this modified for high fps
(defstate cam-eye (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -432,7 +414,6 @@
0
)
(set! (-> self fov) 11650.845)
(none)
)
:exit (behavior ()
(if (and *target*
@@ -441,13 +422,11 @@
)
(send-event *target* 'end-mode)
)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(go cam-free-floating)
)
(none)
)
:code (behavior ()
(let ((gp-0 (-> *display* base-frame-counter)))
@@ -564,7 +543,6 @@
(suspend)
)
)
(none)
)
)
@@ -580,15 +558,14 @@
(define *CAM_BILLY-bank* (new 'static 'cam-billy-bank :rot-speed 364.0889 :tilt-degrees -1820.4445))
;; first person camera for rat game
(defstate cam-billy (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -603,17 +580,14 @@
)
(set! (-> self fov) 9830.4)
(matrix-rotate-y! (the-as matrix (-> self tracking)) (the-as float -32768.0))
(none)
)
:exit (behavior ()
'()
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(go cam-free-floating)
)
(none)
)
:code (behavior ()
(loop
@@ -693,7 +667,6 @@
(vector--float*! (-> self trans) (-> *camera* tpos-curr) (-> *camera* local-down) (-> *camera* target-height))
(suspend)
)
(none)
)
)
@@ -776,13 +749,11 @@
(send-event *camera* 'point-of-interest gp-2)
)
)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(cam-slave-go cam-free-floating)
)
(none)
)
:code (behavior ()
(loop
@@ -794,18 +765,17 @@
)
(suspend)
)
(none)
)
)
(defstate cam-decel (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -813,7 +783,6 @@
(if (not (-> self enter-has-run))
(set! (-> self saved-pt quad) (-> self trans quad))
)
(none)
)
:code (behavior ()
(loop
@@ -846,18 +815,17 @@
)
(suspend)
)
(none)
)
)
(defstate cam-endlessfall (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -866,7 +834,6 @@
(set! (-> self blend-from-type) (the-as uint 2))
(set! (-> self blend-to-type) (the-as uint 2))
)
(none)
)
:code (behavior ()
(let ((gp-0 (new 'stack-no-clear 'cam-vector-seeker))
@@ -901,11 +868,9 @@
(suspend)
)
)
(none)
)
)
;; third person cam used to focus on various entities
(defbehavior cam-circular-position-into-max-angle camera-slave ((arg0 vector) (arg1 vector) (arg2 float))
(let* ((f30-0 (vector-normalize-ret-len! arg0 (the-as float 1.0)))
(f26-0 (vector-normalize-ret-len! arg1 (the-as float 1.0)))
@@ -1082,8 +1047,8 @@
)
(defstate cam-circular (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
@@ -1092,7 +1057,7 @@
(cam-circular-position #f)
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -1168,13 +1133,11 @@
(send-event *camera* 'point-of-interest gp-3)
)
)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(cam-slave-go cam-free-floating)
)
(none)
)
:code (behavior ()
(loop
@@ -1183,7 +1146,6 @@
)
(suspend)
)
(none)
)
)
@@ -1194,19 +1156,16 @@
(set! (-> self blend-from-type) (the-as uint 2))
(set! (-> self blend-to-type) (the-as uint 2))
)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(cam-slave-go cam-free-floating)
)
(none)
)
:code (behavior ()
(loop
(suspend)
)
(none)
)
)
@@ -2279,9 +2238,9 @@
(#if PC_PORT
(* (if (-> *pc-settings* third-camera-v-inverted?) 1.0 -1.0) f0-0)
f0-0
)
)
)
)
;; main third-person camera
(defbehavior cam-string-joystick camera-slave ()
@@ -2743,8 +2702,8 @@
)
(defstate cam-string (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
(let ((gp-0 (new-stack-vector0)))
(cam-string-find-position-rel! gp-0)
@@ -2752,8 +2711,8 @@
)
)
(('joystick)
(set! (-> self phony-joystick-x) (the-as float (-> event param 0)))
(set! (-> self phony-joystick-y) (the-as float (-> event param 1)))
(set! (-> self phony-joystick-x) (the-as float (-> block param 0)))
(set! (-> self phony-joystick-y) (the-as float (-> block param 1)))
(let ((v0-1 (the-as object #t)))
(set! (-> self have-phony-joystick) (the-as symbol v0-1))
v0-1
@@ -2761,10 +2720,10 @@
)
(('set-dist)
(cond
((-> event param 0)
((-> block param 0)
(set! (-> self string-val-locked) #t)
(set! (-> self string-min-val quad) (-> (the-as vector (-> event param 0)) quad))
(set! (-> self string-max-val quad) (-> (the-as vector (-> event param 1)) quad))
(set! (-> self string-min-val quad) (-> (the-as vector (-> block param 0)) quad))
(set! (-> self string-max-val quad) (-> (the-as vector (-> block param 1)) quad))
(set! (-> self string-max-val x) (fmax (-> self string-max-val x) (-> self string-min-val x)))
(set! (-> self string-max-val y) (fmax (-> self string-max-val y) (-> self string-min-val y)))
(set! (-> self string-max-val z) (fmax (-> self string-max-val z) (-> self string-min-val z)))
@@ -2779,7 +2738,7 @@
(-> self los-state)
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -2930,13 +2889,11 @@
(set! (-> self blend-from-type) (the-as uint 2))
(set! (-> self blend-to-type) (the-as uint 2))
)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(cam-slave-go cam-free-floating)
)
(none)
)
:code (behavior ()
(loop
@@ -2948,7 +2905,6 @@
)
(suspend)
)
(none)
)
)
@@ -3091,7 +3047,6 @@
(set! (-> self blend-to-type) (the-as uint 2))
(slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f)
)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
@@ -3168,7 +3123,6 @@
)
)
)
(none)
)
:code (behavior ()
(loop
@@ -3177,7 +3131,6 @@
)
(suspend)
)
(none)
)
)
@@ -3325,13 +3278,11 @@
(cam-calc-bike-follow! (-> self tracking) (-> self trans) #f)
(slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f)
)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(cam-slave-go cam-free-floating)
)
(none)
)
:code (behavior ()
(loop
@@ -3340,7 +3291,6 @@
)
(suspend)
)
(none)
)
)
+40 -47
View File
@@ -1030,58 +1030,51 @@
(none)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 7]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 31]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 45]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 50]
(defbehavior cam-standard-event-handler camera-slave ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as
object
(case arg2
(('go)
(let ((v1-1 (-> arg3 param 0))
(t9-0 (the-as (function object) enter-state))
(case arg2
(('go)
(let ((v1-1 (-> arg3 param 0))
(t9-0 (the-as (function object) enter-state))
)
(set! (-> self next-state) (the-as state v1-1))
(t9-0)
)
)
(('change-state 'change-state-no-go)
(let ((s5-0 (the-as object (-> arg3 param 0))))
(cam-slave-init-vars)
(let ((t9-2 (the-as (function object) (-> (the-as state s5-0) enter))))
(if t9-2
(t9-2)
)
(set! (-> self next-state) (the-as state v1-1))
(t9-0)
)
)
(('change-state 'change-state-no-go)
(let ((s5-0 (the-as object (-> arg3 param 0))))
(cam-slave-init-vars)
(let ((t9-2 (the-as (function object) (-> (the-as state s5-0) enter))))
(if t9-2
(t9-2)
)
)
(set! (-> self enter-has-run) #t)
(set! (-> self event-hook) (-> (the-as state s5-0) event))
(when (= arg2 'change-state)
(let ((t9-3 (the-as (function object) enter-state)))
(set! (-> self next-state) (the-as state s5-0))
(t9-3)
)
(set! (-> self enter-has-run) #t)
(set! (-> self event-hook) (-> (the-as state s5-0) event))
(when (= arg2 'change-state)
(let ((t9-3 (the-as (function object) enter-state)))
(set! (-> self next-state) (the-as state s5-0))
(t9-3)
)
)
)
(('point-of-interest)
(cond
((-> arg3 param 0)
(set! (-> self tracking use-point-of-interest) #t)
(set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> arg3 param 0)) quad))
(set! (-> self tracking point-of-interest-blend target) 1.0)
)
(else
(set! (-> self tracking use-point-of-interest) #f)
(set! (-> self tracking point-of-interest-blend target) 0.0)
)
)
(('point-of-interest)
(cond
((-> arg3 param 0)
(set! (-> self tracking use-point-of-interest) #t)
(set! (-> self tracking point-of-interest quad) (-> (the-as vector (-> arg3 param 0)) quad))
(set! (-> self tracking point-of-interest-blend target) 1.0)
)
(else
(set! (-> self tracking use-point-of-interest) #f)
(set! (-> self tracking point-of-interest-blend target) 0.0)
)
)
(('teleport)
(cam-calc-follow! (-> self tracking) (-> self trans) #f)
(slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f)
)
)
)
(('teleport)
(cam-calc-follow! (-> self tracking) (-> self trans) #f)
(slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f)
)
)
)
@@ -1500,9 +1493,9 @@
)
)
;; WARN: Unsupported inline assembly instruction kind - [mula.s f0, f3]
;; WARN: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; WARN: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
;; ERROR: Unsupported inline assembly instruction kind - [mula.s f0, f3]
;; ERROR: Unsupported inline assembly instruction kind - [madda.s f1, f4]
;; ERROR: Unsupported inline assembly instruction kind - [madd.s f0, f2, f5]
(defun slave-set-rotation! ((arg0 cam-rotation-tracker) (arg1 vector) (arg2 float) (arg3 float) (arg4 symbol))
(local-vars
(f0-8 float)
+15 -37
View File
@@ -34,7 +34,6 @@
:virtual #t
:code (behavior ()
(go-virtual pov-camera-start-playing)
(none)
)
)
@@ -56,7 +55,6 @@
)
)
(go-virtual pov-camera-playing)
(none)
)
)
@@ -80,8 +78,8 @@
(defstate pov-camera-playing (pov-camera)
:virtual #t
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('abort)
(when (logtest? (-> self flags) (pov-camera-flag notify-of-abort))
(logior! (-> self flags) (pov-camera-flag allow-abort))
@@ -97,7 +95,6 @@
(if (= (-> self anim-name type) string)
(backup-load-state-and-set-cmds *load-state* (-> self command-list))
)
(none)
)
:exit (behavior ()
(if (= (-> self anim-name type) string)
@@ -105,7 +102,6 @@
)
(remove-setting! 'music-volume)
(remove-setting! 'sfx-volume)
(none)
)
:code (behavior ()
(add-setting! 'music-volume 'rel (-> self music-volume-movie) 0)
@@ -129,14 +125,12 @@
)
)
(go-virtual pov-camera-done-playing)
(none)
)
:post (behavior ()
(if (= (-> self anim-name type) string)
(execute-commands-up-to *load-state* (ja-aframe-num 0))
)
(ja-post)
(none)
)
)
@@ -144,14 +138,12 @@
:virtual #t
:enter (behavior ()
(logior! (-> self flags) (pov-camera-flag allow-abort))
(none)
)
:code (behavior ()
(set-blackout-frames (seconds 0.035))
(suspend)
(suspend)
(go-virtual pov-camera-done-playing)
(none)
)
)
@@ -166,7 +158,6 @@
(suspend)
(cleanup-for-death self)
(deactivate self)
(none)
)
)
@@ -224,28 +215,19 @@
(set! (-> self mask-to-clear) (process-mask movie enemy platform projectile))
(set! (-> self event-hook) (lambda :behavior pov-camera
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'mask)
(let ((v0-0 (the-as number (-> arg3 param 0))))
(set! (-> self mask-to-clear) (the-as process-mask v0-0))
v0-0
)
)
((= v1-0 'music-movie-volume)
(let ((f0-0 (the-as float (-> arg3 param 0))))
(set! (-> self music-volume-movie) f0-0)
f0-0
)
)
((= v1-0 'sfx-movie-volume)
(let ((f0-1 (the-as float (-> arg3 param 0))))
(set! (-> self sfx-volume-movie) f0-1)
f0-1
)
)
)
)
(case arg2
(('mask)
(let ((v0-0 (the-as number (-> arg3 param 0))))
(set! (-> self mask-to-clear) (the-as process-mask v0-0))
v0-0
)
)
(('music-movie-volume)
(set! (-> self music-volume-movie) (the-as float (-> arg3 param 0)))
)
(('sfx-movie-volume)
(set! (-> self sfx-volume-movie) (the-as float (-> arg3 param 0)))
)
)
)
)
@@ -253,7 +235,3 @@
(go-virtual pov-camera-startup)
(none)
)
+2 -8
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype babak (nav-enemy)
()
:heap-base #x120
@@ -44,7 +43,6 @@
)
)
((the-as (function none) (-> (method-of-type nav-enemy nav-enemy-patrol) code)))
(none)
)
)
@@ -77,7 +75,6 @@
(ja :num! (loop! f30-0))
)
)
(none)
)
)
@@ -128,7 +125,6 @@
)
)
)
(none)
)
)
@@ -167,7 +163,6 @@
(ja :num! (seek!))
)
(go-virtual nav-enemy-patrol)
(none)
)
)
@@ -186,7 +181,6 @@
(ja :num! (seek! (ja-aframe 32.0 0) 0.5))
)
(go-virtual nav-enemy-chase)
(none)
)
)
@@ -204,11 +198,11 @@
:neck-joint 5
:player-look-at-joint 5
:run-travel-speed (meters 6)
:run-rotate-speed (degrees 2880.0)
:run-rotate-speed (degrees 2880)
:run-acceleration (meters 1)
:run-turn-time (seconds 0.1)
:walk-travel-speed (meters 3)
:walk-rotate-speed (degrees 720.0)
:walk-rotate-speed (degrees 720)
:walk-acceleration (meters 1)
:walk-turn-time (seconds 0.5)
:attack-shove-back (meters 3)
+16 -36
View File
@@ -8,7 +8,6 @@
;; DECOMP BEGINS
(deftype basebutton (process-drawable)
((root-override collide-shape-moving :offset 112)
(down? symbol :offset-assert 176)
@@ -70,16 +69,15 @@
(go-virtual basebutton-down-idle)
(go-virtual basebutton-up-idle)
)
(none)
)
)
(defstate basebutton-up-idle (basebutton)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(case (-> event param 1)
(case (-> block param 1)
(('flop)
(basebutton-method-29 self (-> self event-going-down) (-> self notify-actor))
(sound-play "silo-button")
@@ -92,19 +90,17 @@
(go-virtual basebutton-going-down)
)
(('move-to)
(move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))
(move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))
)
)
)
:enter (behavior ()
(press! self #f)
(none)
)
:trans (behavior ()
(if (-> self move-to?)
(rider-trans)
)
(none)
)
:code (the-as (function none :behavior basebutton) anim-loop)
:post (behavior ()
@@ -114,26 +110,24 @@
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(rider-post)
)
(none)
)
)
(defstate basebutton-going-down (basebutton)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('untrigger)
(sound-play "silo-button")
(go-virtual basebutton-going-up)
)
(('move-to)
(move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))
(move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))
)
)
)
:enter (behavior ()
(press! self #t)
(none)
)
:trans (the-as (function none :behavior basebutton) rider-trans)
:code (behavior ()
@@ -144,7 +138,6 @@
)
(basebutton-method-29 self (-> self event-down) (-> self notify-actor))
(go-virtual basebutton-down-idle)
(none)
)
:post (behavior ()
(when (-> self move-to?)
@@ -153,32 +146,29 @@
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
)
(rider-post)
(none)
)
)
(defstate basebutton-down-idle (basebutton)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('untrigger)
(sound-play "silo-button")
(go-virtual basebutton-going-up)
)
(('move-to)
(move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))
(move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))
)
)
)
:enter (behavior ()
(press! self #t)
(none)
)
:trans (behavior ()
(if (-> self move-to?)
(rider-trans)
)
(none)
)
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -195,7 +185,6 @@
(go-virtual basebutton-going-up)
)
)
(none)
)
:post (behavior ()
(when (-> self move-to?)
@@ -204,16 +193,15 @@
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
(rider-post)
)
(none)
)
)
(defstate basebutton-going-up (basebutton)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('move-to)
(move-to-vec-or-quat! self (the-as vector (-> event param 0)) (the-as quaternion (-> event param 1)))
(move-to-vec-or-quat! self (the-as vector (-> block param 0)) (the-as quaternion (-> block param 1)))
)
(('trigger)
(sound-play "silo-button")
@@ -223,7 +211,6 @@
)
:enter (behavior ()
(press! self #f)
(none)
)
:trans (the-as (function none :behavior basebutton) rider-trans)
:code (behavior ()
@@ -234,7 +221,6 @@
)
(basebutton-method-29 self (-> self event-up) (-> self notify-actor))
(go-virtual basebutton-up-idle)
(none)
)
:post (behavior ()
(when (-> self move-to?)
@@ -243,7 +229,6 @@
(quaternion-copy! (-> self root-override quat) (-> self move-to-quat))
)
(rider-post)
(none)
)
)
@@ -473,7 +458,6 @@
:virtual #t
:trans (behavior ()
(send-event *camera* 'joystick 0.0 0.0)
(none)
)
:code (behavior ((arg0 int) (arg1 level))
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -522,7 +506,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
(none)
)
)
@@ -551,8 +534,8 @@
)
(defstate target-warp-out (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('death-end)
(let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden)))))
(set! (-> self draw status) (the-as draw-status v0-0))
@@ -560,7 +543,7 @@
)
)
(else
(target-generic-event-handler proc arg1 event-type event)
(target-generic-event-handler proc argc message block)
)
)
)
@@ -575,11 +558,9 @@
(vector-reset! (-> self control transv))
(logior! (-> self state-flags) (state-flags use-alt-cam-pos))
(set! (-> self alt-cam-pos quad) (-> arg1 quad))
(none)
)
:exit (behavior ()
(logclear! (-> self state-flags) (state-flags use-alt-cam-pos))
(none)
)
:code (behavior ((arg0 vector) (arg1 vector))
(send-event *camera* 'change-state cam-fixed 0)
@@ -668,7 +649,6 @@
(ja :num! (seek! (ja-aframe 40.0 0)))
)
(anim-loop)
(none)
)
:post target-no-stick-post
)
+21 -27
View File
@@ -139,12 +139,11 @@
)
(defbehavior plat-event baseplat ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (case arg2
(('bonk)
(baseplat-method-22 self)
)
)
)
(case arg2
(('bonk)
(baseplat-method-22 self)
)
)
)
(deftype eco-door (process-drawable)
@@ -178,23 +177,22 @@
(defbehavior eco-door-event-handler eco-door ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (case arg2
(('trigger)
(set! (-> self locked) (not (-> self locked)))
(cond
((-> self locked)
(if (= (-> self next-state name) 'door-closed)
(sound-play "door-lock")
)
)
(else
(sound-play "door-unlock")
)
)
#t
)
)
)
(case arg2
(('trigger)
(set! (-> self locked) (not (-> self locked)))
(cond
((-> self locked)
(if (= (-> self next-state name) 'door-closed)
(sound-play "door-lock")
)
)
(else
(sound-play "door-unlock")
)
)
#t
)
)
)
eco-door-event-handler
@@ -225,7 +223,6 @@ eco-door-event-handler
)
(suspend)
)
(none)
)
)
@@ -253,7 +250,6 @@ eco-door-event-handler
)
)
(go-virtual door-open)
(none)
)
:post (the-as (function none :behavior eco-door) transform-post)
)
@@ -287,7 +283,6 @@ eco-door-event-handler
)
(suspend)
)
(none)
)
)
@@ -313,7 +308,6 @@ eco-door-event-handler
(sound-play "door-lock")
)
(go-virtual door-closed)
(none)
)
:post (the-as (function none :behavior eco-door) transform-post)
)
+134 -181
View File
@@ -22,7 +22,6 @@
;; DECOMP BEGINS
(define *eco-pill-count* 0)
(deftype collectable (process-drawable)
@@ -391,7 +390,6 @@
(if (task-complete? *game-info* (-> self entity extra perm task))
(go-virtual wait)
)
(none)
)
:code (the-as (function none :behavior eco-collectable) anim-loop)
)
@@ -435,15 +433,14 @@
(logior! (-> self mask) (process-mask actor-pause))
)
(go-virtual wait)
(none)
)
)
(defstate wait (eco-collectable)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-3 object))
(when (and (or (= event-type 'touch) (= event-type 'attack))
(when (and (or (= message 'touch) (= message 'attack))
(and (logtest? (-> self flags) (collectable-flags can-collect))
(>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout))
(!= (-> self next-state name) 'pickup)
@@ -453,71 +450,68 @@
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (process->handle proc))
)
(the-as
object
(cond
((= event-type 'eco-blue)
(when (and (not (logtest? (-> self flags) (collectable-flags fading ignore-blue)))
(!= (-> self next-state name) 'pickup)
(begin (check-blue-suck (the-as process-drawable proc)) #t)
(logtest? (-> self flags) (collectable-flags can-collect))
(>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout))
)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual notice-blue (process->handle proc))
)
)
((= event-type 'trans)
(set! (-> self root-override trans quad) (-> (the-as vector (-> event param 0)) quad))
(update-transforms! (-> self root-override))
(the-as object (ja-post))
)
((= event-type 'jump)
(cond
((= message 'eco-blue)
(when (and (not (logtest? (-> self flags) (collectable-flags fading ignore-blue)))
(!= (-> self next-state name) 'pickup)
(begin (check-blue-suck (the-as process-drawable proc)) #t)
(logtest? (-> self flags) (collectable-flags can-collect))
(>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout))
)
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self jump-pos quad) (-> (the-as vector (-> event param 0)) quad))
(go-virtual jump)
(go-virtual notice-blue (process->handle proc))
)
((= event-type 'pickup)
(when (!= (-> self next-state name) 'pickup)
(if (and (> arg1 0) (-> event param 0))
(move-to-point! (-> self root-override) (the-as vector (-> event param 0)))
)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (the-as handle #f))
)
)
((= event-type 'die)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual die)
)
((= event-type 'movie-pos)
(set! v0-3 (-> event param 0))
(set! (-> self movie-pos-index) (the-as int v0-3))
v0-3
)
((= event-type 'actor-pause)
(cond
((-> event param 0)
(logior! (-> self mask) (process-mask actor-pause))
(set! v0-3 #t)
(set! (-> self actor-pause) (the-as symbol v0-3))
v0-3
)
(else
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self actor-pause) #f)
#f
)
((= message 'trans)
(set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad))
(update-transforms! (-> self root-override))
(ja-post)
)
((= message 'jump)
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self jump-pos quad) (-> (the-as vector (-> block param 0)) quad))
(go-virtual jump)
)
((= message 'pickup)
(when (!= (-> self next-state name) 'pickup)
(if (and (> argc 0) (-> block param 0))
(move-to-point! (-> self root-override) (the-as vector (-> block param 0)))
)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (the-as handle #f))
)
)
((= message 'die)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual die)
)
((= message 'movie-pos)
(set! v0-3 (-> block param 0))
(set! (-> self movie-pos-index) (the-as int v0-3))
v0-3
)
((= message 'actor-pause)
(cond
((-> block param 0)
(logior! (-> self mask) (process-mask actor-pause))
(set! v0-3 #t)
(set! (-> self actor-pause) (the-as symbol v0-3))
v0-3
)
(else
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self actor-pause) #f)
#f
)
)
((= event-type 'fade)
(logior! (-> self flags) (collectable-flags fade))
(set! (-> self fadeout-timeout) (seconds 0.1))
(set! v0-3 (-> *display* base-frame-counter))
(set! (-> self birth-time) (the-as time-frame v0-3))
v0-3
)
)
)
((= message 'fade)
(logior! (-> self flags) (collectable-flags fade))
(set! (-> self fadeout-timeout) (seconds 0.1))
(set! v0-3 (-> *display* base-frame-counter))
(set! (-> self birth-time) (the-as time-frame v0-3))
v0-3
)
)
)
:enter (behavior ()
@@ -528,7 +522,6 @@
)
(go-virtual pickup #f (process->handle *target*))
)
(none)
)
:trans (behavior ()
(cond
@@ -572,7 +565,6 @@
)
)
(update-transforms! (-> self root-override))
(none)
)
:code (behavior ()
(loop
@@ -608,14 +600,13 @@
)
(suspend)
)
(none)
)
)
(defstate notice-blue (eco-collectable)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(when (and (or (= event-type 'touch) (= event-type 'attack))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (and (or (= message 'touch) (= message 'attack))
(and (logtest? (-> self flags) (collectable-flags can-collect))
(>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout))
(!= (-> self next-state name) 'pickup)
@@ -637,13 +628,11 @@
)
(set! (-> self suck-y-offset) 0.0)
(logclear! (-> self mask) (process-mask actor-pause))
(none)
)
:exit (behavior ()
(if (-> self actor-pause)
(logior! (-> self mask) (process-mask actor-pause))
)
(none)
)
:trans (behavior ()
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
@@ -656,7 +645,6 @@
(go-virtual wait)
)
)
(none)
)
:code (behavior ((arg0 handle))
(loop
@@ -678,20 +666,19 @@
)
(suspend)
)
(none)
)
)
(defstate pickup (eco-collectable)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(the-as
object
(case event-type
symbol
(case message
(('set-movie-pos)
(let ((v1-3 (res-lump-struct (-> self entity) 'movie-pos vector :time (the-as float -1000000000.0))))
(the-as symbol (when v1-3
(set! (-> v1-3 quad) (-> (the-as vector (-> event param 0)) quad))
(set! (-> v1-3 quad) (-> (the-as vector (-> block param 0)) quad))
(the-as symbol v1-3)
)
)
@@ -699,7 +686,7 @@
)
(('actor-pause)
(the-as symbol (cond
((-> event param 0)
((-> block param 0)
(logior! (-> self mask) (process-mask actor-pause))
(let ((v0-1 #t))
(set! (-> self actor-pause) v0-1)
@@ -742,7 +729,6 @@
)
)
(logclear! (-> self mask) (process-mask actor-pause))
(none)
)
:code (behavior ((arg0 object) (arg1 handle))
(clear-collide-with-as (-> self root-override))
@@ -846,7 +832,6 @@
(suspend)
)
(go-virtual die)
(none)
)
)
@@ -854,7 +839,6 @@
:virtual #t
:code (behavior ()
(process-entity-status! self (entity-perm-status dead) #t)
(none)
)
)
@@ -882,24 +866,22 @@
(defstate die (eco)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('fade)
(process-entity-status! self (entity-perm-status dead) #t)
(the-as object (deactivate self))
)
(('die)
(go-virtual die)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('fade)
(process-entity-status! self (entity-perm-status dead) #t)
(deactivate self)
)
(('die)
(go-virtual die)
)
)
)
:exit (behavior ()
(process-entity-status! self (entity-perm-status bit-3) #f)
(if (-> self actor-pause)
(logior! (-> self mask) (process-mask actor-pause))
)
(none)
)
:code (behavior ()
(process-entity-status! self (entity-perm-status bit-3) #t)
@@ -928,7 +910,6 @@
(set! (-> self root-override trans quad) (-> self base quad))
(restore-collide-with-as (-> self root-override))
(go-virtual wait)
(none)
)
)
@@ -1139,7 +1120,6 @@
(spawn (-> self part) (-> self root-override root-prim world-sphere))))
(suspend)
)
(none)
)
)
@@ -1177,7 +1157,6 @@
(spawn (-> self part) (-> self root-override root-prim world-sphere))))
(suspend)
)
(none)
)
)
@@ -1191,7 +1170,6 @@
(clear-collide-with-as (-> self root-override))
(process-entity-status! self (entity-perm-status dead) #t)
(convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* money))))
(none)
)
)
@@ -1425,9 +1403,9 @@
(defstate wait (fuel-cell)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-3 object))
(when (and (or (= event-type 'touch) (= event-type 'attack))
(when (and (or (= message 'touch) (= message 'attack))
(and (logtest? (-> self flags) (collectable-flags can-collect))
(>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout))
(and (not (handle->process (-> *game-info* other-camera-handle)))
@@ -1443,47 +1421,46 @@
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (process->handle proc))
)
(the-as object (cond
((= event-type 'trans)
(set! (-> self root-override trans quad) (-> (the-as vector (-> event param 0)) quad))
(set! (-> self base quad) (-> self root-override trans quad))
(update-transforms! (-> self root-override))
)
((= event-type 'pickup)
(when (!= (-> self next-state name) 'pickup)
(if (and (> arg1 0) (-> event param 0))
(move-to-point! (-> self root-override) (the-as vector (-> event param 0)))
)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (process->handle *target*))
)
)
((= event-type 'collide-shape)
(if (-> event param 0)
(the-as object (restore-collide-with-as (-> self root-override)))
(the-as object (clear-collide-with-as (-> self root-override)))
)
)
((= event-type 'movie-pos)
(set! v0-3 (-> event param 0))
(set! (-> self movie-pos-index) (the-as int v0-3))
v0-3
)
((= event-type 'anim)
(cond
((-> event param 0)
(set! v0-3 (logclear (-> self flags) (collectable-flags anim)))
(set! (-> self flags) (the-as collectable-flags v0-3))
)
(else
(set! v0-3 (logior (-> self flags) (collectable-flags anim)))
(set! (-> self flags) (the-as collectable-flags v0-3))
)
)
v0-3
)
)
)
(cond
((= message 'trans)
(set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad))
(set! (-> self base quad) (-> self root-override trans quad))
(update-transforms! (-> self root-override))
)
((= message 'pickup)
(when (!= (-> self next-state name) 'pickup)
(if (and (> argc 0) (-> block param 0))
(move-to-point! (-> self root-override) (the-as vector (-> block param 0)))
)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (process->handle *target*))
)
)
((= message 'collide-shape)
(if (-> block param 0)
(restore-collide-with-as (-> self root-override))
(clear-collide-with-as (-> self root-override))
)
)
((= message 'movie-pos)
(set! v0-3 (-> block param 0))
(set! (-> self movie-pos-index) (the-as int v0-3))
v0-3
)
((= message 'anim)
(cond
((-> block param 0)
(set! v0-3 (logclear (-> self flags) (collectable-flags anim)))
(set! (-> self flags) (the-as collectable-flags v0-3))
)
(else
(set! v0-3 (logior (-> self flags) (collectable-flags anim)))
(set! (-> self flags) (the-as collectable-flags v0-3))
)
)
v0-3
)
)
)
:code (behavior ()
0.5
@@ -1510,7 +1487,6 @@
)
)
)
(none)
)
)
@@ -1524,7 +1500,6 @@
(t9-1)
)
)
(none)
)
:trans (behavior ()
(let ((f30-0 (the-as float (cond
@@ -1581,7 +1556,6 @@
)
)
)
(none)
)
:code (behavior ((arg0 object) (arg1 handle))
(local-vars (sv-96 res-tag))
@@ -1933,14 +1907,12 @@
)
)
(convert-to-hud-object self (the-as hud (ppointer->process (-> *hud-parts* fuel-cell))))
(none)
)
:post (behavior ()
(transform-post)
(if (-> self state-object)
(spawn (-> self part) (the-as vector (-> self root-override root-prim prim-core)))
)
(none)
)
)
@@ -2034,19 +2006,19 @@
)
(defstate fuel-cell-clone-anim (fuel-cell)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('pickup)
(when (!= (-> self next-state name) 'pickup)
(if (and (> arg1 0) (-> event param 0))
(move-to-point! (-> self root-override) (the-as vector (-> event param 0)))
(if (and (> argc 0) (-> block param 0))
(move-to-point! (-> self root-override) (the-as vector (-> block param 0)))
)
(logclear! (-> self mask) (process-mask actor-pause))
(go-virtual pickup #f (the-as handle #f))
)
)
(('trans)
(set! (-> self root-override trans quad) (-> (the-as vector (-> event param 0)) quad))
(set! (-> self root-override trans quad) (-> (the-as vector (-> block param 0)) quad))
(set! (-> self base quad) (-> self root-override trans quad))
(update-transforms! (-> self root-override))
)
@@ -2066,19 +2038,16 @@
(logior! (-> self mask) (process-mask actor-pause))
)
(logclear! (-> self skel status) (janim-status spool))
(none)
)
:code (behavior ((arg0 handle))
(logclear! (-> self mask) (process-mask actor-pause))
(clone-anim arg0 3 #t "")
(format #t "ERROR<GMJ>: clone-anim returned in fuel-cell~%")
(deactivate self)
(none)
)
:post (behavior ()
(update-transforms! (-> self root-override))
(animate self)
(none)
)
)
@@ -2148,24 +2117,21 @@
(animate self)
(suspend)
)
(none)
)
)
(defstate pickup (buzzer)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('notify)
(process-entity-status! self (entity-perm-status dead) #t)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('notify)
(process-entity-status! self (entity-perm-status dead) #t)
)
)
)
:enter (behavior ((arg0 object) (arg1 handle))
(set! (-> self pickup-handle) arg1)
(logclear! (-> self mask) (process-mask actor-pause))
(none)
)
:code (behavior ((arg0 object) (arg1 handle))
(logclear! (-> self mask) (process-mask actor-pause))
@@ -2260,7 +2226,6 @@
)
)
)
(none)
)
)
@@ -2367,14 +2332,6 @@
(none)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 190]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 221]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 252]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 284]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 320]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 356]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 363]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 122]
(defbehavior birth-pickup-at-point process ((arg0 vector) (arg1 pickup-type) (arg2 float) (arg3 symbol) (arg4 process-tree) (arg5 fact-info))
(local-vars
(v1-2 basic)
@@ -2688,7 +2645,6 @@
)
(suspend)
)
(none)
)
)
@@ -2857,8 +2813,8 @@
)
(defstate vent-wait-for-touch (vent)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(if (and (or (= event-type 'touch) (= event-type 'attack))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(if (and (or (= message 'touch) (= message 'attack))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) self)
(set! (-> a1-1 num-params) 2)
@@ -2872,7 +2828,7 @@
)
(go vent-pickup (process->handle proc))
)
(vent-standard-event-handler proc arg1 event-type event)
(vent-standard-event-handler proc argc message block)
)
:code (behavior ()
(loop
@@ -2889,13 +2845,12 @@
)
(suspend)
)
(none)
)
)
(defstate vent-blocked (vent)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('show)
(go vent-wait-for-touch)
)
@@ -2908,7 +2863,6 @@
)
(suspend)
)
(none)
)
)
@@ -2960,7 +2914,6 @@
)
)
(go vent-wait-for-touch)
(none)
)
)
+34 -48
View File
@@ -10,7 +10,6 @@
;; DECOMP BEGINS
(defskelgroup *crate-barrel-sg* crate crate-barrel-lod0-jg crate-barrel-idle-ja
((crate-barrel-lod0-mg (meters 20)) (crate-barrel-lod1-mg (meters 40)) (crate-barrel-lod2-mg (meters 999999)))
:bounds (static-spherem 0 1 0 1.6)
@@ -664,7 +663,6 @@
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior crate) ja-post)
)
@@ -677,7 +675,6 @@
(suspend)
)
(go-virtual wait)
(none)
)
:post (the-as (function none :behavior crate) crate-post)
)
@@ -697,7 +694,6 @@
(logclear! (-> self mask) (process-mask sleep-code))
)
)
(none)
)
:code (behavior ((arg0 handle))
(set! (-> self target) arg0)
@@ -754,28 +750,27 @@
)
(suspend)
)
(none)
)
:post (the-as (function none :behavior crate) crate-post)
)
(defstate die (crate)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touched)
(case (-> self defense)
(('darkeco)
(cond
((= (-> proc type) target)
(send-event proc 'attack (-> event param 0) (static-attack-info ((mode 'darkeco))))
(send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'darkeco))))
)
(else
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) self)
(set! (-> a1-5 num-params) 4)
(set! (-> a1-5 message) 'attack)
(set! (-> a1-5 param 0) (-> event param 0))
(set! (-> a1-5 param 0) (-> block param 0))
(set! (-> a1-5 param 1) (the-as uint 'darkeco))
(let ((v1-12 (+ *global-attack-id* 1)))
(set! *global-attack-id* v1-12)
@@ -799,19 +794,17 @@
)
)
)
(none)
)
:code (behavior ((arg0 symbol) (arg1 int))
(clear-collide-with-as (-> self root-override))
(if (nonzero? (-> self sound))
(stop! (-> self sound))
)
(if (and *target* (and (logtest? (-> *target* control root-prim prim-core action)
(collide-action racer snowball tube flut)
)
(!= (-> self fact pickup-type) 6)
(not arg0)
)
(if (and *target*
(and (logtest? (-> *target* control root-prim prim-core action) (collide-action racer snowball tube flut))
(!= (-> self fact pickup-type) 6)
(not arg0)
)
)
(logior! (-> self fact options) (fact-options instant-collect))
)
@@ -915,39 +908,37 @@
(suspend)
)
)
(none)
)
)
(defstate special-contents-die (crate)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('notify)
(case (-> event param 0)
(('pickup)
(let ((gp-0 (-> self entity extra perm)))
(logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage))
(set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1)))
(+! (-> self child-count) -1)
(when (<= (-> self child-count) 0)
(if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel))
(process-entity-status! self (entity-perm-status bit-4) #f)
)
(process-entity-status! self (entity-perm-status dead) #t)
(process-entity-status! self (entity-perm-status complete) #t)
(set! (-> gp-0 user-int8 0) 2)
(let ((v0-0 (logclear (-> self mask) (process-mask sleep))))
(set! (-> self mask) v0-0)
v0-0
)
)
)
)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('notify)
(case (-> block param 0)
(('pickup)
(let ((gp-0 (-> self entity extra perm)))
(logior! (-> gp-0 status) (entity-perm-status user-set-from-cstage))
(set! (-> gp-0 user-int8 1) (min 127 (+ (-> gp-0 user-int8 1) 1)))
(+! (-> self child-count) -1)
(when (<= (-> self child-count) 0)
(if (or (= (-> self defense) 'iron) (= (-> self defense) 'steel))
(process-entity-status! self (entity-perm-status bit-4) #f)
)
(process-entity-status! self (entity-perm-status dead) #t)
(process-entity-status! self (entity-perm-status complete) #t)
(set! (-> gp-0 user-int8 0) 2)
(let ((v0-0 (logclear (-> self mask) (process-mask sleep))))
(set! (-> self mask) v0-0)
v0-0
)
)
)
)
)
)
)
)
:trans (-> (method-of-type crate die) trans)
:code (behavior ()
@@ -983,7 +974,6 @@
(suspend)
)
)
(none)
)
)
@@ -1272,7 +1262,6 @@
(if (and *target* (>= (-> *target* fact-info-target buzzer) 6.0))
(spool-push *art-control* (-> self victory-anim name) 0 self -99.0)
)
(none)
)
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -1302,7 +1291,6 @@
)
(set! (-> self root-override trans y) (-> self base y))
)
(none)
)
:post (the-as (function none :behavior crate-buzzer) #f)
)
@@ -1315,7 +1303,6 @@
(suspend)
)
(go-virtual wait)
(none)
)
)
@@ -1356,6 +1343,5 @@
)
(suspend)
)
(none)
)
)
@@ -380,6 +380,5 @@
)
)
)
(none)
)
)
+309 -335
View File
@@ -120,7 +120,6 @@
)
(suspend)
)
(none)
)
)
@@ -136,7 +135,6 @@
)
)
(go swingpole-stance)
(none)
)
)
@@ -186,202 +184,197 @@
(defstate manipy-idle (manipy)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-0 object))
(let ((v1-0 event-type))
(the-as
object
(cond
((= v1-0 'attackable)
(cond
((-> event param 0)
(set! v0-0 (logior (process-mask attackable) (-> self mask)))
(set! (-> self mask) (the-as process-mask v0-0))
)
(else
(set! v0-0 (logclear (-> self mask) (process-mask attackable)))
(set! (-> self mask) (the-as process-mask v0-0))
)
)
v0-0
(case message
(('attackable)
(cond
((-> block param 0)
(set! v0-0 (logior (process-mask attackable) (-> self mask)))
(set! (-> self mask) (the-as process-mask v0-0))
)
(else
(set! v0-0 (logclear (-> self mask) (process-mask attackable)))
(set! (-> self mask) (the-as process-mask v0-0))
)
((= v1-0 'blend-shape)
(cond
((-> event param 0)
(set! v0-0 (logior (-> self skel status) (janim-status blerc eye)))
(set! (-> self skel status) (the-as janim-status v0-0))
)
(else
(set! v0-0 (logclear (-> self skel status) (janim-status blerc eye)))
(set! (-> self skel status) (the-as janim-status v0-0))
)
)
v0-0
)
v0-0
)
(('blend-shape)
(cond
((-> block param 0)
(set! v0-0 (logior (-> self skel status) (janim-status blerc eye)))
(set! (-> self skel status) (the-as janim-status v0-0))
)
(else
(set! v0-0 (logclear (-> self skel status) (janim-status blerc eye)))
(set! (-> self skel status) (the-as janim-status v0-0))
)
((= v1-0 'shadow)
(cond
((-> event param 0)
(set! v0-0 (-> self shadow-backup))
(set! (-> self draw shadow) (the-as shadow-geo v0-0))
v0-0
)
(else
(set! (-> self draw shadow) #f)
#f
)
)
)
((= v1-0 'trans-hook)
(set! v0-0 (-> event param 0))
(set! (-> self new-trans-hook) (the-as (function none) v0-0))
v0-0
)
((= v1-0 'post-hook)
(set! v0-0 (-> event param 0))
(set! (-> self new-post-hook) (the-as (function none) v0-0))
v0-0
)
((= v1-0 'eval)
(the-as object ((the-as (function manipy none) (-> event param 0)) self))
)
((= v1-0 'become-hud-object)
(the-as object (convert-to-hud-object self (the-as hud (-> event param 0))))
)
((= v1-0 'event-hook)
(set! v0-0 (-> event param 0))
(set! (-> self cur-event-hook) (the-as (function none) v0-0))
v0-0
)
((= v1-0 'art-joint-anim)
(set! (-> self new-joint-anim)
(the-as
art-joint-anim
(lookup-art (-> self draw art-group) (the-as string (-> event param 0)) art-joint-anim)
)
)
(set! v0-0 (-> event param 1))
(set! (-> self new-joint-anim-blend) (the-as uint v0-0))
v0-0
)
((= v1-0 'anim-mode)
(when (nonzero? (-> self skel))
(set! (-> self anim-mode) (the-as symbol (-> event param 0)))
(if (= (-> self anim-mode) 'clone-anim)
(ja-post)
)
(-> self anim-mode)
)
)
((or (= v1-0 'origin-joint-index) (= v1-0 'center-joint))
(set! (-> self draw origin-joint-index) (-> event param 0))
(set! v0-0 (-> event param 0))
(set! (-> self draw shadow-joint-index) (the-as uint v0-0))
v0-0
)
((= v1-0 'max-vis-dist)
(set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> event param 0)))
)
((= v1-0 'grab)
(set! (-> self cur-grab-handle) (process->handle (the-as process (-> event param 0))))
(let ((v1-30 (handle->process (-> self cur-grab-handle))))
(when v1-30
(set! v0-0 (-> self old-grab-pos))
(set! (-> (the-as vector v0-0) quad) (-> (the-as process-drawable v1-30) root trans quad))
v0-0
)
)
)
((= v1-0 'target)
(set! v0-0 (process->handle (the-as process (-> event param 0))))
(set! (-> self cur-target-handle) (the-as handle v0-0))
v0-0
)
((= v1-0 'trans)
(cond
((type-type? (-> self root type) collide-shape)
(the-as object (move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> event param 0))))
)
(else
(set! v0-0 (-> self root trans))
(set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad))
v0-0
)
)
)
((= v1-0 'rot)
(let ((s5-0 (new 'stack-no-clear 'matrix)))
(matrix-rotate-y! s5-0 (the-as float (-> event param 0)))
(matrix->quaternion (-> self root quat) s5-0)
)
)
((= v1-0 'rot-quat)
(quaternion-copy! (-> self root quat) (the-as quaternion (-> event param 0)))
)
((= v1-0 'clone-copy-trans)
(set! v0-0 (-> event param 0))
(set! (-> self clone-copy-trans) (the-as symbol v0-0))
v0-0
)
((= v1-0 'release)
(set! (-> self cur-grab-handle) (the-as handle #f))
)
v0-0
)
(('shadow)
(cond
((-> block param 0)
(set! v0-0 (-> self shadow-backup))
(set! (-> self draw shadow) (the-as shadow-geo v0-0))
v0-0
)
(else
(set! (-> self draw shadow) #f)
#f
)
((= v1-0 'draw)
(set! (-> self draw?) (the-as symbol (-> event param 0)))
(cond
((-> event param 0)
(let ((v1-47 (logtest? (-> self draw status) (draw-status hidden))))
(logclear! (-> self draw status) (draw-status hidden))
(when v1-47
(cond
((nonzero? (-> self skel))
(let ((gp-1 (-> self skel status)))
(logior! (-> self skel status) (janim-status inited))
(set! v0-0 (the-as object (ja-post)))
(set! (-> self skel status) gp-1)
)
v0-0
)
(else
(the-as object (ja-post))
)
)
)
)
(('trans-hook)
(set! v0-0 (-> block param 0))
(set! (-> self new-trans-hook) (the-as (function none) v0-0))
v0-0
)
(('post-hook)
(set! v0-0 (-> block param 0))
(set! (-> self new-post-hook) (the-as (function none) v0-0))
v0-0
)
(('eval)
((the-as (function manipy none) (-> block param 0)) self)
)
(('become-hud-object)
(convert-to-hud-object self (the-as hud (-> block param 0)))
)
(('event-hook)
(set! v0-0 (-> block param 0))
(set! (-> self cur-event-hook) (the-as (function none) v0-0))
v0-0
)
(('art-joint-anim)
(set! (-> self new-joint-anim)
(the-as
art-joint-anim
(lookup-art (-> self draw art-group) (the-as string (-> block param 0)) art-joint-anim)
)
)
(set! v0-0 (-> block param 1))
(set! (-> self new-joint-anim-blend) (the-as uint v0-0))
v0-0
)
(('anim-mode)
(when (nonzero? (-> self skel))
(set! (-> self anim-mode) (the-as symbol (-> block param 0)))
(if (= (-> self anim-mode) 'clone-anim)
(ja-post)
)
(-> self anim-mode)
)
)
(('origin-joint-index 'center-joint)
(set! (-> self draw origin-joint-index) (-> block param 0))
(set! v0-0 (-> block param 0))
(set! (-> self draw shadow-joint-index) (the-as uint v0-0))
v0-0
)
(('max-vis-dist)
(set! (-> self draw lod-set lod (-> self draw lod-set max-lod) dist) (the-as float (-> block param 0)))
)
(('grab)
(set! (-> self cur-grab-handle) (process->handle (the-as process (-> block param 0))))
(let ((v1-30 (handle->process (-> self cur-grab-handle))))
(when v1-30
(set! v0-0 (-> self old-grab-pos))
(set! (-> (the-as vector v0-0) quad) (-> (the-as process-drawable v1-30) root trans quad))
v0-0
)
)
)
(('target)
(set! v0-0 (process->handle (the-as process (-> block param 0))))
(set! (-> self cur-target-handle) (the-as handle v0-0))
v0-0
)
(('trans)
(cond
((type-type? (-> self root type) collide-shape)
(move-to-point! (the-as collide-shape (-> self root)) (the-as vector (-> block param 0)))
)
(else
(set! v0-0 (-> self root trans))
(set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad))
v0-0
)
)
)
(('rot)
(let ((s5-0 (new 'stack-no-clear 'matrix)))
(matrix-rotate-y! s5-0 (the-as float (-> block param 0)))
(matrix->quaternion (-> self root quat) s5-0)
)
)
(('rot-quat)
(quaternion-copy! (-> self root quat) (the-as quaternion (-> block param 0)))
)
(('clone-copy-trans)
(set! v0-0 (-> block param 0))
(set! (-> self clone-copy-trans) (the-as symbol v0-0))
v0-0
)
(('release)
(set! (-> self cur-grab-handle) (the-as handle #f))
#f
)
(('draw)
(set! (-> self draw?) (the-as symbol (-> block param 0)))
(cond
((-> block param 0)
(let ((v1-47 (logtest? (-> self draw status) (draw-status hidden))))
(logclear! (-> self draw status) (draw-status hidden))
(when v1-47
(cond
((nonzero? (-> self skel))
(let ((gp-1 (-> self skel status)))
(logior! (-> self skel status) (janim-status inited))
(set! v0-0 (ja-post))
(set! (-> self skel status) gp-1)
)
v0-0
)
(else
(ja-post)
)
)
)
(else
(set! v0-0 (logior (-> self draw status) (draw-status hidden)))
(set! (-> self draw status) (the-as draw-status v0-0))
v0-0
)
)
)
((= v1-0 'query)
(case (-> event param 0)
(('grab)
(handle->process (-> self cur-grab-handle))
)
(('done)
(case (-> self anim-mode)
(('play1 'play)
(>= (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -2)))
)
)
)
)
)
((= v1-0 'set-frame-num)
(let ((v1-73 (-> self skel root-channel 0)))
(set! (-> v1-73 num-func) num-func-identity)
(set! (-> v1-73 frame-num) (the-as float (-> event param 0)))
)
)
(else
(if (-> self cur-event-hook)
(the-as object ((-> self cur-event-hook)))
)
)
)
(else
(set! v0-0 (logior (-> self draw status) (draw-status hidden)))
(set! (-> self draw status) (the-as draw-status v0-0))
v0-0
)
)
)
(('query)
(case (-> block param 0)
(('grab)
(handle->process (-> self cur-grab-handle))
)
(('done)
(case (-> self anim-mode)
(('play1 'play)
(>= (ja-frame-num 0) (the float (+ (-> (ja-group) data 0 length) -2)))
)
)
)
)
)
(('set-frame-num)
(let ((v1-73 (-> self skel root-channel 0)))
(set! (-> v1-73 num-func) num-func-identity)
(set! (-> v1-73 frame-num) (the-as float (-> block param 0)))
)
)
(else
(if (-> self cur-event-hook)
((-> self cur-event-hook))
)
)
)
)
@@ -418,7 +411,6 @@
)
)
((-> self cur-trans-hook))
(none)
)
:code (behavior ()
(logclear! (-> self mask) (process-mask heap-shrunk))
@@ -476,7 +468,6 @@
)
)
)
(none)
)
)
@@ -611,7 +602,6 @@
(part-tracker-notify)
(suspend)
0
(none)
)
)
@@ -647,6 +637,7 @@
(none)
)
;; ERROR: Failed load: (set! a0-1 (l.wu (+ a0-0 -4))) at op 11
;; WARN: disable def twice: 68. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
;; WARN: disable def twice: 82. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
;; WARN: disable def twice: 96. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare.
@@ -1085,26 +1076,25 @@
)
(defstate camera-tracker-process (camera-tracker)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-0 uint))
(the-as object (case event-type
(('message)
(set! v0-0 (-> event param 0))
(set! (-> self message) (the-as basic v0-0))
v0-0
)
(('mask)
(set! v0-0 (-> event param 0))
(set! (-> self mask-to-clear) (the-as process-mask v0-0))
v0-0
)
(('border)
(set! v0-0 (-> event param 0))
(set! (-> self border-value) (the-as basic v0-0))
v0-0
)
)
)
(case message
(('message)
(set! v0-0 (-> block param 0))
(set! (-> self message) (the-as basic v0-0))
v0-0
)
(('mask)
(set! v0-0 (-> block param 0))
(set! (-> self mask-to-clear) (the-as process-mask v0-0))
v0-0
)
(('border)
(set! v0-0 (-> block param 0))
(set! (-> self border-value) (the-as basic v0-0))
v0-0
)
)
)
:enter (behavior ()
(if (-> self entity)
@@ -1116,14 +1106,12 @@
(add-setting! 'process-mask 'set 0.0 (-> self mask-to-clear))
(add-setting! 'movie (process->ppointer self) 0.0 0)
(hide-hud-quick)
(none)
)
:exit (behavior ()
(if (-> self entity)
(set-or-clear-status! (-> self entity) (entity-perm-status bit-3) #f)
)
(send-event *camera* 'clear-entity)
(none)
)
:code (behavior ()
(cond
@@ -1143,10 +1131,10 @@
(suspend)
(suspend)
0
(none)
)
)
;; ERROR: Failed load: (set! a0-3 (l.wu (+ a0-0 -4))) at op 42
(defbehavior camera-tracker-init camera-tracker ((arg0 object))
(stack-size-set! (-> self main-thread) 512)
(logclear! (-> self mask) (process-mask actor-pause movie enemy platform projectile))
@@ -1257,7 +1245,6 @@
;; og:preserve-this
(init-vf0-vector)
)
(none)
)
)
:post (the-as (function none :behavior med-res-level) ja-post)
@@ -1335,8 +1322,8 @@
)
(defstate part-spawner-active (part-spawner)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('stop)
(process-entity-status! self (entity-perm-status complete) #t)
(set! (-> self enable) #f)
@@ -1348,7 +1335,7 @@
#t
)
(('trans)
(let ((v0-1 (the-as object (-> (the-as vector (-> event param 0)) quad))))
(let ((v0-1 (the-as object (-> (the-as vector (-> block param 0)) quad))))
(set! (-> self root trans quad) (the-as uint128 v0-1))
v0-1
)
@@ -1365,7 +1352,6 @@
)
(suspend)
)
(none)
)
)
@@ -1709,13 +1695,13 @@
)
(defstate cam-launcher-shortfall (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -1738,13 +1724,11 @@
(set! (-> self blend-to-type) (the-as uint 0))
0
)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(cam-slave-go cam-free-floating)
)
(none)
)
:code (behavior ()
(let ((gp-0 (-> *display* base-frame-counter)))
@@ -1759,7 +1743,6 @@
(suspend)
)
)
(none)
)
)
@@ -1783,13 +1766,13 @@
)
(defstate cam-launcher-longfall (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('teleport)
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -1805,14 +1788,12 @@
(cam-calc-follow! (-> self tracking) (-> self trans) #f)
(slave-set-rotation! (-> self tracking) (-> self trans) (the-as float (-> self options)) (-> self fov) #f)
)
(none)
)
:trans (behavior ()
(if (not (logtest? (-> *camera* master-options) 2))
(cam-slave-go cam-free-floating)
)
(cam-launcher-long-joystick)
(none)
)
:code (behavior ()
(let ((gp-0 (-> *display* base-frame-counter)))
@@ -1873,18 +1854,17 @@
(suspend)
)
)
(none)
)
)
(defstate launcher-idle (launcher)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('instant-death)
(go launcher-deactivated)
)
(('trans)
(move-to-point! (-> self root-override) (the-as vector (-> event param 0)))
(move-to-point! (-> self root-override) (the-as vector (-> block param 0)))
(update-transforms! (-> self root-override))
)
)
@@ -1918,23 +1898,22 @@
)
)
)
(none)
)
:code (the-as (function none :behavior launcher) anim-loop)
)
(defstate launcher-active (launcher)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(when (or (= event-type 'touch) (= event-type 'attack))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (or (= message 'touch) (= message 'attack))
(set! (-> self state-time) (-> *display* base-frame-counter))
(send-event proc 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time))
)
(cond
((= event-type 'instant-death)
((= message 'instant-death)
(go launcher-deactivated)
)
((= event-type 'trans)
(move-to-point! (-> self root-override) (the-as vector (-> event param 0)))
((= message 'trans)
(move-to-point! (-> self root-override) (the-as vector (-> block param 0)))
(update-transforms! (-> self root-override))
)
)
@@ -1949,7 +1928,6 @@
(set! (-> v1-0 parms mask) (sound-mask volume time))
(-> v1-0 id)
)
(none)
)
:trans (behavior ()
(if (or (or (not *target*) (< (-> self active-distance)
@@ -1970,12 +1948,10 @@
)
(send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time))
)
(none)
)
:code (behavior ()
(sound-play "launch-start")
(anim-loop)
(none)
)
)
@@ -2103,100 +2079,99 @@
)
(defstate touch-tracker-idle (touch-tracker)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-0 object))
(the-as object (case event-type
(('touched)
(let ((v1-1 (ppointer->process (-> self parent))))
(when (!= v1-1 proc)
(cond
((= (-> self event) 'attack)
(cond
((= (-> proc type) target)
(send-event
proc
(-> self event)
:from (the-as process v1-1)
#f
(static-attack-info ((mode (the-as symbol (-> self event-mode)))))
)
)
((= (-> v1-1 type) target)
(send-event
proc
(-> self event)
:from (the-as process v1-1)
#f
(-> self event-mode)
(-> *target* control unknown-dword50)
(-> *target* control unknown-dword51)
)
)
(else
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) (the-as process v1-1))
(set! (-> a1-5 num-params) 4)
(set! (-> a1-5 message) (-> self event))
(set! (-> a1-5 param 0) (the-as uint #f))
(set! (-> a1-5 param 1) (the-as uint (-> self event-mode)))
(let ((v1-19 (+ *global-attack-id* 1)))
(set! *global-attack-id* v1-19)
(set! (-> a1-5 param 2) (the-as uint v1-19))
)
(set! (-> a1-5 param 3) (the-as uint 0))
(send-event-function proc a1-5)
)
)
)
)
((-> self event)
(send-event proc (-> self event) :from (the-as process v1-1))
)
(else
(let ((t0-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> t0-5 from) proc)
(set! (-> t0-5 num-params) arg1)
(set! (-> t0-5 message) event-type)
(set! (-> t0-5 param 0) (-> event param 0))
(set! (-> t0-5 param 1) (-> event param 1))
(set! (-> t0-5 param 2) (-> event param 2))
(set! (-> t0-5 param 3) (-> event param 3))
(set! (-> t0-5 param 4) (-> event param 4))
(set! (-> t0-5 param 5) (-> event param 5))
(set! (-> t0-5 param 6) (-> event param 6))
(send-event-function v1-1 t0-5)
)
)
)
)
)
(case message
(('touched)
(let ((v1-1 (ppointer->process (-> self parent))))
(when (!= v1-1 proc)
(cond
((= (-> self event) 'attack)
(cond
((= (-> proc type) target)
(send-event
proc
(-> self event)
:from (the-as process v1-1)
#f
(static-attack-info ((mode (the-as symbol (-> self event-mode)))))
)
)
((= (-> v1-1 type) target)
(send-event
proc
(-> self event)
:from (the-as process v1-1)
#f
(-> self event-mode)
(-> *target* control unknown-dword50)
(-> *target* control unknown-dword51)
)
)
(else
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) (the-as process v1-1))
(set! (-> a1-5 num-params) 4)
(set! (-> a1-5 message) (-> self event))
(set! (-> a1-5 param 0) (the-as uint #f))
(set! (-> a1-5 param 1) (the-as uint (-> self event-mode)))
(let ((v1-19 (+ *global-attack-id* 1)))
(set! *global-attack-id* v1-19)
(set! (-> a1-5 param 2) (the-as uint v1-19))
)
(('target)
(set! v0-0 (process->handle (the-as process (-> event param 0))))
(set! (-> self target) (the-as handle v0-0))
v0-0
)
(('event)
(set! (-> self event) (the-as symbol (-> event param 0)))
(set! v0-0 (-> event param 1))
(set! (-> self event-mode) (the-as basic v0-0))
v0-0
)
(('exit)
(set! v0-0 (-> event param 0))
(set! (-> self run-function) (the-as (function object) v0-0))
v0-0
)
(('eval)
(the-as object ((the-as (function touch-tracker none) (-> event param 0)) self))
)
(('function)
(set! v0-0 (-> event param 0))
(set! (-> self callback) (the-as (function touch-tracker none) v0-0))
v0-0
)
)
)
(set! (-> a1-5 param 3) (the-as uint 0))
(send-event-function proc a1-5)
)
)
)
)
((-> self event)
(send-event proc (-> self event) :from (the-as process v1-1))
)
(else
(let ((t0-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> t0-5 from) proc)
(set! (-> t0-5 num-params) argc)
(set! (-> t0-5 message) message)
(set! (-> t0-5 param 0) (-> block param 0))
(set! (-> t0-5 param 1) (-> block param 1))
(set! (-> t0-5 param 2) (-> block param 2))
(set! (-> t0-5 param 3) (-> block param 3))
(set! (-> t0-5 param 4) (-> block param 4))
(set! (-> t0-5 param 5) (-> block param 5))
(set! (-> t0-5 param 6) (-> block param 6))
(send-event-function v1-1 t0-5)
)
)
)
)
)
)
(('target)
(set! v0-0 (process->handle (the-as process (-> block param 0))))
(set! (-> self target) (the-as handle v0-0))
v0-0
)
(('event)
(set! (-> self event) (the-as symbol (-> block param 0)))
(set! v0-0 (-> block param 1))
(set! (-> self event-mode) (the-as basic v0-0))
v0-0
)
(('exit)
(set! v0-0 (-> block param 0))
(set! (-> self run-function) (the-as (function object) v0-0))
v0-0
)
(('eval)
((the-as (function touch-tracker none) (-> block param 0)) self)
)
(('function)
(set! v0-0 (-> block param 0))
(set! (-> self callback) (the-as (function touch-tracker none) v0-0))
v0-0
)
)
)
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -2236,7 +2211,6 @@
(clear-collide-with-as (-> self root-override))
(suspend)
0
(none)
)
)
+32 -114
View File
@@ -141,7 +141,7 @@
(send-event arg0 'get-attack-count 1)
(logclear! (-> obj mask) (process-mask actor-pause attackable))
(go (method-of-object obj nav-enemy-die))
(the-as object 'die)
'die
)
(defmethod attack-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block))
@@ -158,20 +158,17 @@
)
(defbehavior nav-enemy-send-attack nav-enemy ((arg0 process) (arg1 touching-shapes-entry) (arg2 symbol))
(the-as
object
(when (send-event
arg0
'attack
arg1
(static-attack-info
((shove-back (-> self nav-info attack-shove-back)) (shove-up (-> self nav-info attack-shove-up)) (mode arg2))
)
(when (send-event
arg0
'attack
arg1
(static-attack-info
((shove-back (-> self nav-info attack-shove-back)) (shove-up (-> self nav-info attack-shove-up)) (mode arg2))
)
(set-collide-offense (-> self collide-info) 2 (collide-offense no-offense))
(logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))
#t
)
)
(set-collide-offense (-> self collide-info) 2 (collide-offense no-offense))
(logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf8))
#t
)
)
@@ -205,7 +202,10 @@
(('cue-jump-to-point)
(when (logtest? (-> self nav-enemy-flags) (nav-enemy-flags navenmf11))
(set! (-> self event-param-point quad) (-> (the-as vector (-> arg3 param 0)) quad))
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11))
(let ((v0-0 (the-as object (logclear (-> self nav-enemy-flags) (nav-enemy-flags navenmf11)))))
(set! (-> self nav-enemy-flags) (the-as nav-enemy-flags v0-0))
v0-0
)
)
)
(('cue-chase)
@@ -218,7 +218,6 @@
(go-virtual nav-enemy-wait-for-cue)
)
)
(none)
)
(defbehavior nav-enemy-jump-event-handler nav-enemy ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
@@ -240,10 +239,12 @@
(drop-pickup (-> self fact) #t *entity-pool* (-> self fact) 0)
)
(('death-end)
(logior! (-> self draw status) (draw-status hidden))
(let ((v0-0 (the-as object (logior (-> self draw status) (draw-status hidden)))))
(set! (-> self draw status) (the-as draw-status v0-0))
v0-0
)
)
)
(none)
)
nav-enemy-default-event-handler
@@ -739,10 +740,7 @@ nav-enemy-default-event-handler
(defstate nav-enemy-idle (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(nav-enemy-neck-control-inactive)
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -751,7 +749,6 @@ nav-enemy-default-event-handler
)
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1 navenmf2))
(set! (-> self state-timeout) (seconds 1))
(none)
)
:trans (behavior ()
(if (and (and *target* (>= (-> self enemy-info idle-distance)
@@ -764,7 +761,6 @@ nav-enemy-default-event-handler
)
(go-virtual nav-enemy-patrol)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
@@ -776,17 +772,13 @@ nav-enemy-default-event-handler
(ja :num! (loop! f30-0))
)
)
(none)
)
:post (the-as (function none :behavior nav-enemy) ja-post)
)
(defstate nav-enemy-patrol (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(set! (-> self nav flags)
@@ -799,11 +791,9 @@ nav-enemy-default-event-handler
(set! (-> self acceleration) (-> self nav-info walk-acceleration))
(set! (-> self rotate-speed) (-> self nav-info walk-rotate-speed))
(set! (-> self turn-time) (-> self nav-info walk-turn-time))
(none)
)
:exit (behavior ()
(logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))
(none)
)
:trans (behavior ()
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1))
@@ -836,7 +826,6 @@ nav-enemy-default-event-handler
(go-virtual nav-enemy-notice)
)
)
(none)
)
:code (behavior ()
(let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)))
@@ -887,17 +876,13 @@ nav-enemy-default-event-handler
)
)
)
(none)
)
:post nav-enemy-patrol-post
)
(defstate nav-enemy-notice (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
(nav-enemy-neck-control-look-at)
@@ -913,7 +898,6 @@ nav-enemy-default-event-handler
(nav-control-method-11 (-> self nav) (-> self nav target-pos))
(set! (-> self rotate-speed) (-> self nav-info run-rotate-speed))
(set! (-> self turn-time) (-> self nav-info run-turn-time))
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
@@ -934,7 +918,6 @@ nav-enemy-default-event-handler
)
)
(go-virtual nav-enemy-chase)
(none)
)
:post nav-enemy-simple-post
)
@@ -945,13 +928,9 @@ nav-enemy-default-event-handler
(defstate nav-enemy-flee (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans (behavior ()
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time))
@@ -966,7 +945,6 @@ nav-enemy-default-event-handler
(go-virtual nav-enemy-patrol)
)
)
(none)
)
:code (behavior ()
(let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1)))
@@ -991,7 +969,6 @@ nav-enemy-default-event-handler
)
)
)
(none)
)
:post nav-enemy-face-player-post
)
@@ -1020,10 +997,7 @@ nav-enemy-default-event-handler
(defstate nav-enemy-chase (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(nav-enemy-neck-control-look-at)
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -1034,7 +1008,6 @@ nav-enemy-default-event-handler
(set! (-> self rotate-speed) (-> self nav-info run-rotate-speed))
(set! (-> self turn-time) (-> self nav-info run-turn-time))
(nav-enemy-reset-frustration)
(none)
)
:trans (behavior ()
(if (logtest? (-> *target* state-flags) (state-flags do-not-notice))
@@ -1072,7 +1045,6 @@ nav-enemy-default-event-handler
)
)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
@@ -1084,17 +1056,13 @@ nav-enemy-default-event-handler
(ja :num! (loop! f30-0))
)
)
(none)
)
:post nav-enemy-chase-post
)
(defstate nav-enemy-stop-chase (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(let* ((f30-0 (vector-vector-distance (-> self collide-info trans) (target-pos 0)))
@@ -1109,7 +1077,6 @@ nav-enemy-default-event-handler
(set! (-> self acceleration) (-> self nav-info walk-acceleration))
(set! (-> self rotate-speed) (-> self nav-info walk-rotate-speed))
(set! (-> self turn-time) (-> self nav-info walk-turn-time))
(none)
)
:trans (behavior ()
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1))
@@ -1129,7 +1096,6 @@ nav-enemy-default-event-handler
(go-virtual nav-enemy-stare)
)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
@@ -1141,17 +1107,13 @@ nav-enemy-default-event-handler
(ja :num! (loop! f30-0))
)
)
(none)
)
:post nav-enemy-chase-post
)
(defstate nav-enemy-stare (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))
@@ -1166,11 +1128,9 @@ nav-enemy-default-event-handler
(set! (-> self rotate-speed) (-> self nav-info run-rotate-speed))
(set! (-> self turn-time) (-> self nav-info run-turn-time))
(set! (-> self collide-info transv quad) (-> *null-vector* quad))
(none)
)
:exit (behavior ()
(logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))
(none)
)
:trans (behavior ()
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1))
@@ -1212,26 +1172,20 @@ nav-enemy-default-event-handler
(go-virtual nav-enemy-give-up)
)
)
(none)
)
:code (behavior ()
(go-virtual nav-enemy-give-up)
(none)
)
:post nav-enemy-face-player-post
)
(defstate nav-enemy-give-up (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(nav-enemy-neck-control-inactive)
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf2))
(none)
)
:trans (behavior ()
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1))
@@ -1239,37 +1193,27 @@ nav-enemy-default-event-handler
(go-virtual nav-enemy-chase)
)
)
(none)
)
:code (behavior ()
(go-virtual nav-enemy-patrol)
(none)
)
:post nav-enemy-simple-post
)
(defstate nav-enemy-attack (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:code (behavior ()
(go-virtual nav-enemy-victory)
(none)
)
:post nav-enemy-simple-post
)
(defstate nav-enemy-victory (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(set! (-> self collide-info transv quad) (-> *null-vector* quad))
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
@@ -1284,7 +1228,6 @@ nav-enemy-default-event-handler
)
)
(go-virtual nav-enemy-stare)
(none)
)
:post nav-enemy-simple-post
)
@@ -1297,7 +1240,6 @@ nav-enemy-default-event-handler
)
:enter (behavior ()
(send-event (ppointer->process (-> self parent)) 'child-die)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
@@ -1317,7 +1259,6 @@ nav-enemy-default-event-handler
(suspend)
)
(cleanup-for-death self)
(none)
)
:post nav-enemy-death-post
)
@@ -1352,7 +1293,6 @@ nav-enemy-default-event-handler
)
)
(cleanup-for-death self)
(none)
)
)
@@ -1509,11 +1449,9 @@ nav-enemy-default-event-handler
(go-virtual nav-enemy-jump-blocked)
)
(nav-enemy-initialize-jump (-> self event-param-point))
(none)
)
:exit (behavior ()
(logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel))
(none)
)
:code (behavior ()
(nav-enemy-execute-jump)
@@ -1526,7 +1464,6 @@ nav-enemy-default-event-handler
)
)
(go-virtual nav-enemy-jump-land)
(none)
)
:post nav-enemy-jump-post
)
@@ -1582,10 +1519,7 @@ nav-enemy-default-event-handler
(defstate nav-enemy-jump-land (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(logclear! (-> self nav flags) (nav-control-flags navcf19))
@@ -1597,7 +1531,6 @@ nav-enemy-default-event-handler
(vector-xz-normalize! gp-0 16384.0)
(vector+! (-> self nav target-pos) (-> self collide-info trans) gp-0)
)
(none)
)
:trans (behavior ()
(if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5))
@@ -1605,31 +1538,24 @@ nav-enemy-default-event-handler
)
(go-virtual nav-enemy-chase)
)
(none)
)
:code (behavior ()
(nav-enemy-jump-land-anim)
(go (-> self jump-return-state))
(none)
)
:post nav-enemy-jump-land-post
)
(defstate nav-enemy-jump-blocked (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans (behavior ()
(if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5))
(go (-> self jump-return-state))
)
(none)
)
:code (behavior ()
(when (not (ja-group? (-> self draw art-group data (-> self nav-info idle-anim))))
@@ -1644,17 +1570,13 @@ nav-enemy-default-event-handler
(ja :num! (loop! f30-0))
)
)
(none)
)
:post nav-enemy-simple-post
)
(defstate nav-enemy-wait-for-cue (nav-enemy)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior nav-enemy)
nav-enemy-default-event-handler
)
:event nav-enemy-default-event-handler
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf11))
@@ -1678,7 +1600,6 @@ nav-enemy-default-event-handler
)
)
(go-virtual nav-enemy-jump-to-point)
(none)
)
:post nav-enemy-simple-post
)
@@ -1688,11 +1609,9 @@ nav-enemy-default-event-handler
:event nav-enemy-jump-event-handler
:exit (behavior ()
(logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate enable-travel))
(none)
)
:trans (behavior ()
0
(none)
)
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -1709,7 +1628,6 @@ nav-enemy-default-event-handler
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))
(nav-enemy-jump-land-anim)
(go-virtual nav-enemy-wait-for-cue)
(none)
)
:post nav-enemy-jump-post
)
+3 -9
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype orb-cache-top (baseplat)
((active-distance float :offset-assert 228)
(inactive-distance float :offset-assert 232)
@@ -41,8 +40,8 @@
)
(defstate orb-cache-top-idle (orb-cache-top)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('eco-blue)
(process-entity-status! self (entity-perm-status complete) #t)
(dotimes (gp-0 5)
@@ -52,7 +51,7 @@
(go orb-cache-top-activate #f)
)
(else
(plat-event proc arg1 event-type event)
(plat-event proc argc message block)
)
)
)
@@ -68,7 +67,6 @@
(game-task none)
)
)
(none)
)
:code (behavior ((arg0 symbol))
(if (and (not arg0) (-> self child))
@@ -85,7 +83,6 @@
(ja :group! (-> self draw art-group data 3) :num! (identity (ja-aframe 0.0 0)))
(transform-post)
(anim-loop)
(none)
)
)
@@ -196,7 +193,6 @@
:event (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event)
:exit (behavior ()
(process-entity-status! self (entity-perm-status bit-3) #f)
(none)
)
:trans (the-as (function none :behavior orb-cache-top) plat-trans)
:code (behavior ((arg0 symbol))
@@ -264,7 +260,6 @@
(go orb-cache-top-idle arg0)
)
)
(none)
)
:post (the-as (function none :behavior orb-cache-top) plat-post)
)
@@ -280,7 +275,6 @@
(new 'stack-no-clear 'vector)
(set! (-> self basetrans y) (+ 2048.0 (-> self root-pos)))
(anim-loop)
(none)
)
:post (the-as (function none :behavior orb-cache-top) plat-post)
)
+13 -26
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype plat-button (process-drawable)
((root-override collide-shape-moving :offset 112)
(go-back-if-lost-player? symbol :offset-assert 176)
@@ -57,12 +56,12 @@
(defstate plat-button-idle (plat-button)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touch)
(when (can-activate? self)
(if (and ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(-> self root-override)
(the-as uint 1)
)
@@ -104,7 +103,6 @@
(suspend)
)
)
(none)
)
)
@@ -124,7 +122,6 @@
)
(ja-post)
(go-virtual plat-button-idle)
(none)
)
)
@@ -143,7 +140,6 @@
(go-virtual plat-button-move-downward)
(go-virtual plat-button-move-upward)
)
(none)
)
:post (the-as (function none :behavior plat-button) rider-post)
)
@@ -166,24 +162,21 @@
(defstate plat-button-move-downward (plat-button)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (when (or (= event-type 'touch) (= event-type 'attack))
(set! (-> self state-time) (-> *display* base-frame-counter))
#f
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (or (= message 'touch) (= message 'attack))
(set! (-> self state-time) (-> *display* base-frame-counter))
#f
)
)
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(process-entity-status! self (entity-perm-status bit-3) #t)
(plat-button-camera-on)
(set-setting! 'allow-look-around #f 0.0 0)
(none)
)
:exit (behavior ()
(plat-button-camera-off)
(remove-setting! 'allow-look-around)
(none)
)
:trans (behavior ()
(if (= (-> self path-pos) 1.0)
@@ -232,7 +225,6 @@
(if (and (-> self grab-player?) (< 0.2 (-> self path-pos)))
(set! (-> self grab-player?) (not (process-release? *target*)))
)
(none)
)
:code (the-as (function none :behavior plat-button) anim-loop)
:post (the-as (function none :behavior plat-button) rider-post)
@@ -240,24 +232,21 @@
(defstate plat-button-move-upward (plat-button)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (when (or (= event-type 'touch) (= event-type 'attack))
(set! (-> self state-time) (-> *display* base-frame-counter))
#f
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (or (= message 'touch) (= message 'attack))
(set! (-> self state-time) (-> *display* base-frame-counter))
#f
)
)
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(process-entity-status! self (entity-perm-status bit-3) #t)
(plat-button-camera-on)
(set-setting! 'allow-look-around #f 0.0 0)
(none)
)
:exit (behavior ()
(plat-button-camera-off)
(remove-setting! 'allow-look-around)
(none)
)
:trans (behavior ()
(if (= (-> self path-pos) 0.0)
@@ -306,7 +295,6 @@
(if (and (-> self grab-player?) (< (-> self path-pos) 0.8))
(set! (-> self grab-player?) (not (process-release? *target*)))
)
(none)
)
:code (the-as (function none :behavior plat-button) anim-loop)
:post (the-as (function none :behavior plat-button) rider-post)
@@ -328,7 +316,6 @@
)
(suspend)
)
(none)
)
)
+4 -13
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype plat-eco (plat)
((notice-dist float :offset-assert 264)
(sync-offset-dest float :offset-assert 268)
@@ -39,8 +38,8 @@
(defstate plat-idle (plat-eco)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('wake)
(go-virtual plat-path-active (the-as plat #f))
)
@@ -57,7 +56,6 @@
)
:enter (behavior ()
(lods-assign! (-> self draw) (-> self unlit-look))
(none)
)
:trans (behavior ()
(when (and (and *target*
@@ -73,21 +71,19 @@
)
(level-hint-spawn (text-id misty-eco-plat) "sksp0073" (the-as entity #f) *entity-pool* (game-task none))
)
(none)
)
:code (behavior ()
(ja-post)
(update-transforms! (-> self root-override))
(anim-loop)
(none)
)
:post (the-as (function none :behavior plat-eco) ja-post)
)
(defstate notice-blue (plat-eco)
:virtual override
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('wake)
(sound-play "blue-eco-on" :position (the-as symbol (-> self root-override trans)))
(go-virtual plat-path-active (the-as plat #f))
@@ -114,7 +110,6 @@
(go-virtual plat-idle)
)
)
(none)
)
:code (behavior ((arg0 handle))
(set! (-> self target) arg0)
@@ -168,12 +163,10 @@
)
(suspend)
)
(none)
)
:post (behavior ()
(plat-trans)
(plat-post)
(none)
)
)
@@ -207,7 +200,6 @@
)
)
)
(none)
)
:trans (behavior ()
(when (!= (-> self sync-offset-faux) (-> self sync-offset-dest))
@@ -219,7 +211,6 @@
)
)
((-> (method-of-type plat plat-path-active) trans))
(none)
)
)
-6
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(defpartgroup group-standard-plat
:id 107
:bounds (static-bspherem 0 -12 0 14)
@@ -188,7 +187,6 @@
(go-virtual plat-idle)
)
)
(none)
)
)
@@ -197,7 +195,6 @@
:event (the-as (function process int symbol event-message-block object :behavior plat) plat-event)
:trans (behavior ()
(baseplat-method-20 self)
(none)
)
:code (behavior ()
(plat-trans)
@@ -217,7 +214,6 @@
(suspend)
)
)
(none)
)
)
@@ -226,7 +222,6 @@
:event (the-as (function process int symbol event-message-block object :behavior plat) plat-event)
:exit (behavior ()
(sound-stop (-> self sound-id))
(none)
)
:trans (behavior ()
(set! (-> self path-pos) (if (logtest? (-> self fact options) (fact-options wrap-phase))
@@ -239,7 +234,6 @@
(sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans)))
)
(plat-trans)
(none)
)
:code (the-as (function plat none :behavior plat) anim-loop)
:post (the-as (function none :behavior plat) plat-post)
@@ -300,7 +300,6 @@
)
(process-taskable-method-33 self)
((-> self cur-trans-hook))
(none)
)
:code process-taskable-anim-loop
:post (the-as (function none :behavior process-taskable) ja-post)
@@ -333,7 +332,6 @@
(go-virtual release)
(process-taskable-method-33 self)
((-> self cur-trans-hook))
(none)
)
:code process-taskable-anim-loop
:post (the-as (function none :behavior process-taskable) ja-post)
@@ -343,7 +341,6 @@
:virtual #t
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans (behavior ()
(if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 5))
@@ -354,7 +351,6 @@
(go-virtual idle)
)
((-> self cur-trans-hook))
(none)
)
:code process-taskable-anim-loop
:post (the-as (function none :behavior process-taskable) ja-post)
@@ -501,7 +497,6 @@
:trans (behavior ()
(process-taskable-play-anim-trans)
((-> self cur-trans-hook))
(none)
)
:code (behavior ()
(process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-accept-anim self #t))
@@ -509,7 +504,6 @@
(suspend)
)
(go-virtual enter-playing)
(none)
)
:post (the-as (function none :behavior process-taskable) ja-post)
)
@@ -521,12 +515,10 @@
:trans (behavior ()
(process-taskable-play-anim-trans)
((-> self cur-trans-hook))
(none)
)
:code (behavior ()
(process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-reject-anim self #t))
(go-virtual release)
(none)
)
:post (the-as (function none :behavior process-taskable) ja-post)
)
@@ -543,7 +535,6 @@
#f
(lookup-text! *common-text* (text-id quit) #f)
)
(none)
)
:exit process-taskable-play-anim-exit
:trans (behavior ()
@@ -575,7 +566,6 @@
(push-reject-anim self)
(set! *camera-look-through-other* 2)
((-> self cur-trans-hook))
(none)
)
:code process-taskable-anim-loop
:post (the-as (function none :behavior process-taskable) ja-post)
@@ -583,11 +573,11 @@
(defstate play-anim (process-taskable)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('shadow)
(cond
((-> event param 0)
((-> block param 0)
(let ((v0-0 (the-as object (-> self shadow-backup))))
(set! (-> self draw shadow) (the-as shadow-geo v0-0))
v0-0
@@ -602,10 +592,10 @@
(('shadow-min-max)
(let ((v1-5 (-> self draw shadow-ctrl)))
(let ((a0-4 v1-5))
(set! (-> a0-4 settings bot-plane w) (- (the-as float (-> event param 0))))
(set! (-> a0-4 settings bot-plane w) (- (the-as float (-> block param 0))))
)
0
(set! (-> v1-5 settings top-plane w) (- (the-as float (-> event param 1))))
(set! (-> v1-5 settings top-plane w) (- (the-as float (-> block param 1))))
)
0
)
@@ -621,12 +611,10 @@
)
)
((-> self cur-trans-hook))
(none)
)
:code (behavior ()
(process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (play-anim! self #t))
(process-taskable-method-38 self)
(none)
)
:post (the-as (function none :behavior process-taskable) ja-post)
)
@@ -657,7 +645,6 @@
(go-virtual hidden-other)
)
)
(none)
)
(defbehavior process-taskable-hide-enter process-taskable ()
@@ -693,14 +680,10 @@
(defstate hidden (process-taskable)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior process-taskable)
process-taskable-hide-handler
)
:event process-taskable-hide-handler
:enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter)
:exit (behavior ()
(process-taskable-hide-exit (= (-> self next-state name) 'hidden))
(none)
)
:trans (behavior ()
(if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1))
@@ -709,7 +692,6 @@
(if (or (-> self been-kicked) (should-display? self))
(go-virtual idle)
)
(none)
)
:code (the-as (function none :behavior process-taskable) anim-loop)
)
@@ -728,14 +710,10 @@
(defstate hidden-other (process-taskable)
:virtual #t
:event (the-as
(function process int symbol event-message-block object :behavior process-taskable)
process-taskable-hide-handler
)
:event process-taskable-hide-handler
:enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter)
:exit (behavior ()
(process-taskable-hide-exit (= (-> self next-state name) 'hidden-other))
(none)
)
:trans (behavior ()
(if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1))
@@ -752,18 +730,17 @@
)
)
)
(none)
)
:code (the-as (function none :behavior process-taskable) anim-loop)
)
(defstate be-clone (process-taskable)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as shadow-geo (case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(the-as shadow-geo (case message
(('shadow)
(the-as shadow-geo (cond
((-> event param 0)
((-> block param 0)
(let ((v0-0 (-> self shadow-backup)))
(set! (-> self draw shadow) v0-0)
v0-0
@@ -779,10 +756,10 @@
(('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 (-> event param 0))))
(set! (-> a0-5 settings bot-plane w) (- (the-as float (-> block param 0))))
)
0
(set! (-> v1-5 settings top-plane w) (- (the-as float (-> event param 1))))
(set! (-> v1-5 settings top-plane w) (- (the-as float (-> block param 1))))
)
(the-as shadow-geo 0)
)
@@ -800,7 +777,6 @@
(logior! (-> self skel status) (janim-status blerc))
(logclear! (-> self mask) (process-mask actor-pause))
(set-vector! (-> self draw bounds) 0.0 (-> self draw-bounds-y-offset) 0.0 (-> self draw bounds w))
(none)
)
:exit (behavior ()
(logclear! (-> self skel status) (janim-status blerc spool))
@@ -811,18 +787,15 @@
)
)
(ja-channel-set! 0)
(none)
)
:trans (behavior ()
(draw-npc-shadow self)
((-> self cur-trans-hook))
(none)
)
:code (behavior ((arg0 handle))
(clone-anim arg0 (-> self center-joint-index) #t "")
(format #t "ERROR<GMJ>: handle invalid while ~S is cloning~%" (-> self name))
(go-virtual hidden)
(none)
)
)
@@ -832,10 +805,10 @@
(defstate idle (process-taskable)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(the-as
object
(case event-type
symbol
(case message
(('attack)
(the-as
symbol
@@ -851,7 +824,7 @@
(the-as symbol (send-shove-back
(-> self root-override)
proc
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
0.7
6144.0
16384.0
@@ -859,7 +832,7 @@
)
)
(('clone)
(the-as symbol (go-virtual be-clone (the-as handle (-> event param 0))))
(the-as symbol (go-virtual be-clone (the-as handle (-> block param 0))))
)
(('play-anim)
(logclear! (-> self mask) (process-mask actor-pause))
@@ -877,7 +850,6 @@
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(process-taskable-clean-up-after-talking)
(none)
)
:exit (behavior ()
(cond
@@ -894,7 +866,6 @@
(apply-settings *setting-control*)
)
)
(none)
)
:trans (behavior ()
(when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))
@@ -982,7 +953,6 @@
(go-virtual play-anim)
)
((-> self cur-trans-hook))
(none)
)
:code process-taskable-anim-loop
:post (behavior ()
@@ -997,7 +967,6 @@
)
)
(transform-post)
(none)
)
)
@@ -1123,9 +1092,9 @@
)
(defstate othercam-running (othercam)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-0 object))
(case event-type
(case message
(('die)
(set! v0-0 #t)
(set! (-> self die?) (the-as symbol v0-0))
@@ -1133,13 +1102,13 @@
)
(('joint)
(let ((t9-0 type-type?)
(v1-1 (-> event param 0))
(v1-1 (-> block param 0))
)
(cond
((t9-0 (rtype-of v1-1) string)
(let ((v1-8 (lookup-art
(-> (the-as process-taskable (-> self hand process 0)) draw jgeo)
(the-as string (-> event param 0))
(the-as string (-> block param 0))
(the-as type #f)
)
)
@@ -1151,8 +1120,8 @@
)
)
)
((not (logtest? (-> event param 0) 7))
(set! v0-0 (-> event param 0))
((not (logtest? (-> block param 0) 7))
(set! v0-0 (-> block param 0))
(set! (-> self cam-joint-index) (the-as int v0-0))
v0-0
)
@@ -1160,7 +1129,7 @@
)
)
(('mask)
(set! v0-0 (-> event param 0))
(set! v0-0 (-> block param 0))
(set! (-> self mask-to-clear) (the-as process-mask v0-0))
v0-0
)
@@ -1190,12 +1159,10 @@
)
)
(apply-settings *setting-control*)
(none)
)
:exit (behavior ()
(remove-setting! 'process-mask)
(apply-settings *setting-control*)
(none)
)
:code (behavior ()
(loop
@@ -1259,7 +1226,6 @@
)
)
)
(none)
)
)
@@ -621,13 +621,11 @@
)
(go-virtual rigid-body-platform-float)
)
(none)
)
:code (behavior ()
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior rigid-body-platform) ja-post)
)
@@ -642,13 +640,11 @@
)
(go-virtual rigid-body-platform-idle)
)
(none)
)
:code (behavior ()
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior rigid-body-platform) rigid-body-platform-post)
)
+25 -31
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype ropebridge-tuning (structure)
((num-springs int32 :offset-assert 0)
(num-spring-points int32 :offset-assert 4)
@@ -544,20 +543,20 @@
)
(defstate ropebridge-idle (ropebridge)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(let ((f0-0 -1.0))
(cond
((= event-type 'bonk)
((= message 'bonk)
(when (>= (- (-> *display* base-frame-counter) (-> self bonk-time-stamp)) (seconds 0.2))
(set! (-> self bonk-time-stamp) (-> *display* base-frame-counter))
(set! f0-0 (the-as float (-> event param 1)))
(set! f0-0 (the-as float (-> block param 1)))
(if (>= f0-0 (-> self tuning rider-bonk-max))
(set! f0-0 (-> self tuning rider-bonk-max))
)
)
)
((and (= event-type 'attack) (= (-> event param 1) 'flop))
(let ((v1-17 (-> event param 2)))
((and (= message 'attack) (= (-> block param 1) 'flop))
(let ((v1-17 (-> block param 2)))
(when (!= v1-17 (-> self player-attack-id))
(set! (-> self player-attack-id) v1-17)
(set! (-> self attack-flop-time-stamp) (-> *display* base-frame-counter))
@@ -566,30 +565,27 @@
)
)
)
(the-as
object
(when (and (>= f0-0 (-> self tuning rider-bonk-min)) (-> event param 0))
(set! (-> self agitated-time-stamp) (-> *display* base-frame-counter))
(let* ((f30-0 (/ (* (- f0-0 (-> self tuning rider-bonk-min)) (-> self tuning rider-bonk-force))
(- (-> self tuning rider-bonk-max) (-> self tuning rider-bonk-min))
)
)
(gp-0 (the-as object (-> event param 0)))
(a0-7 (-> (the-as touching-shapes-entry gp-0) head))
(s4-0 (-> self root-override))
(s5-0 (get-touched-prim a0-7 s4-0 (the-as touching-shapes-entry gp-0)))
(v1-33 ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s4-0))
(gp-1 (new 'stack-no-clear 'vector))
)
(vector-matrix*! gp-1 (-> v1-33 trans) (-> self inv-world-matrix))
(let ((s5-1 (-> s5-0 prim-id)))
(let ((v1-37 (-> self spring-point s5-1)))
(new 'stack-no-clear 'vector)
(&+ v1-37 48)
)
(set-vel-from-impact self s5-1 gp-1 -1 f30-0)
(set-vel-from-impact self (+ s5-1 1) gp-1 1 f30-0)
(when (and (>= f0-0 (-> self tuning rider-bonk-min)) (-> block param 0))
(set! (-> self agitated-time-stamp) (-> *display* base-frame-counter))
(let* ((f30-0 (/ (* (- f0-0 (-> self tuning rider-bonk-min)) (-> self tuning rider-bonk-force))
(- (-> self tuning rider-bonk-max) (-> self tuning rider-bonk-min))
)
)
(gp-0 (the-as object (-> block param 0)))
(a0-7 (-> (the-as touching-shapes-entry gp-0) head))
(s4-0 (-> self root-override))
(s5-0 (get-touched-prim a0-7 s4-0 (the-as touching-shapes-entry gp-0)))
(v1-33 ((method-of-type touching-shapes-entry get-touched-shape) (the-as touching-shapes-entry gp-0) s4-0))
(gp-1 (new 'stack-no-clear 'vector))
)
(vector-matrix*! gp-1 (-> v1-33 trans) (-> self inv-world-matrix))
(let ((s5-1 (-> s5-0 prim-id)))
(let ((v1-37 (-> self spring-point s5-1)))
(new 'stack-no-clear 'vector)
(&+ v1-37 48)
)
(set-vel-from-impact self s5-1 gp-1 -1 f30-0)
(set-vel-from-impact self (+ s5-1 1) gp-1 1 f30-0)
)
)
)
@@ -619,7 +615,6 @@
)
)
)
(none)
)
:post (behavior ()
(ja-post)
@@ -631,7 +626,6 @@
)
)
0
(none)
)
)
+2 -22
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(defpartgroup group-sharkey-splash
:id 106
:duration (seconds 0.4)
@@ -63,11 +62,11 @@
)
(defmethod touch-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block))
(the-as object #t)
#t
)
(defmethod attack-handler sharkey ((obj sharkey) (arg0 process) (arg1 event-message-block))
(the-as object #t)
#t
)
nav-enemy-default-event-handler
@@ -216,11 +215,9 @@ nav-enemy-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf0))
(none)
)
:exit (behavior ()
(logclear! (-> self draw status) (draw-status hidden))
(none)
)
:trans (behavior ()
(cond
@@ -257,7 +254,6 @@ nav-enemy-default-event-handler
)
)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
@@ -273,7 +269,6 @@ nav-enemy-default-event-handler
)
(logior! (-> self draw status) (draw-status hidden))
(anim-loop)
(none)
)
:post (the-as (function none :behavior sharkey) #f)
)
@@ -288,7 +283,6 @@ nav-enemy-default-event-handler
(if (sharkey-notice-player?)
(go-virtual nav-enemy-chase)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
@@ -314,11 +308,9 @@ nav-enemy-default-event-handler
(ja :num! (seek! max (-> self anim-speed)))
)
)
(none)
)
:post (behavior ()
(nav-enemy-travel-post)
(none)
)
)
@@ -330,11 +322,9 @@ nav-enemy-default-event-handler
)
:enter (behavior ()
(go-virtual nav-enemy-chase)
(none)
)
:code (behavior ()
(go-virtual nav-enemy-chase)
(none)
)
)
@@ -413,11 +403,9 @@ nav-enemy-default-event-handler
(sharkey-reset-position)
(logior! (-> self draw status) (draw-status hidden))
(go-virtual nav-enemy-idle)
(none)
)
:post (behavior ()
(nav-enemy-simple-post)
(none)
)
)
@@ -429,7 +417,6 @@ nav-enemy-default-event-handler
)
:exit (behavior ()
(sound-stop (-> self sound-id))
(none)
)
:trans (behavior ()
(if (not *target*)
@@ -479,7 +466,6 @@ nav-enemy-default-event-handler
(set! (-> self target-speed) (-> self chase-speed))
)
)
(none)
)
:code (behavior ()
(set! (-> self player-water-time) (-> *display* base-frame-counter))
@@ -496,7 +482,6 @@ nav-enemy-default-event-handler
(ja :num! (seek! max (-> self anim-speed)))
)
)
(none)
)
:post (behavior ()
(sharkey-get-player-position (-> self nav target-pos))
@@ -512,7 +497,6 @@ nav-enemy-default-event-handler
:position (the-as symbol (-> self collide-info trans))
)
)
(none)
)
)
@@ -536,7 +520,6 @@ nav-enemy-default-event-handler
(ja :num! (seek! max (-> self anim-speed)))
)
)
(none)
)
)
@@ -553,7 +536,6 @@ nav-enemy-default-event-handler
(if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout))
(go-virtual nav-enemy-patrol)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.17))
@@ -565,7 +547,6 @@ nav-enemy-default-event-handler
(seek! (-> self collide-info trans y) (-> self y-max) (* (-> self y-speed) (-> *display* seconds-per-frame)))
(suspend)
)
(none)
)
)
@@ -588,7 +569,6 @@ nav-enemy-default-event-handler
)
)
(go-virtual nav-enemy-stare)
(none)
)
)
+3 -13
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype camera-voicebox (camera-slave)
()
:heap-base #x9a0
@@ -112,8 +111,8 @@
(defstate enter (voicebox)
:virtual #t
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('die)
(go-virtual exit)
)
@@ -124,7 +123,6 @@
(if (< 0.1 (-> self blend))
(point-toward-point-clear-roll-pitch! (-> self root) (target-pos 0))
)
(none)
)
:code (behavior ()
(set-setting! 'sound-flava #f 20.0 (music-flava assistant))
@@ -151,7 +149,6 @@
)
(set! (-> self blend) 0.0)
(go-virtual idle)
(none)
)
:post (the-as (function none :behavior voicebox) ja-post)
)
@@ -165,7 +162,6 @@
(suspend)
(ja :num! (loop!))
)
(none)
)
:post (the-as (function none :behavior voicebox) ja-post)
)
@@ -192,7 +188,6 @@
(send-event (ppointer->process (-> self parent-override)) 'go empty-state)
(suspend)
0
(none)
)
:post (the-as (function none :behavior voicebox) ja-post)
)
@@ -212,10 +207,9 @@
:event (-> cam-string event)
:enter (-> cam-string enter)
:trans (behavior ()
(if (zero? (logand (-> *camera* master-options) 2))
(if (not (logtest? (-> *camera* master-options) 2))
(deactivate self)
)
(none)
)
:code (-> cam-string code)
)
@@ -230,7 +224,3 @@
)
)
)
+14 -18
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype water-anim (water-vol)
((ppointer-water-anim (pointer water-anim) :offset 24)
(look int32 :offset-assert 212)
@@ -474,21 +473,20 @@
(defstate water-vol-idle (water-anim)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('move-to)
(set! (-> self root trans quad) (-> (the-as vector (-> event param 0)) quad))
(set! (-> self water-height) (-> self root trans y))
(if (nonzero? (-> self sound))
(update-trans! (-> self sound) (-> self root trans))
)
(let ((v0-0 (logclear (-> self mask) (process-mask sleep-code))))
(set! (-> self mask) v0-0)
v0-0
)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('move-to)
(set! (-> self root trans quad) (-> (the-as vector (-> block param 0)) quad))
(set! (-> self water-height) (-> self root trans y))
(if (nonzero? (-> self sound))
(update-trans! (-> self sound) (-> self root trans))
)
(let ((v0-0 (logclear (-> self mask) (process-mask sleep-code))))
(set! (-> self mask) v0-0)
v0-0
)
)
)
)
:trans (behavior ()
(let ((t9-0 (-> (method-of-type water-vol water-vol-idle) trans)))
@@ -503,7 +501,6 @@
(if (and (-> self play-ambient-sound?) (nonzero? (-> self sound)))
(update! (-> self sound))
)
(none)
)
:code (behavior ()
(loop
@@ -511,7 +508,6 @@
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
(none)
)
)
+7 -11
View File
@@ -48,7 +48,7 @@
(sp-kill-particle arg0 arg1)
(set-vector! s5-0 (-> arg2 x) (-> arg1 user-float) (-> arg2 z) 1.0)
(sound-play "water-drop" :position (the-as symbol s5-0))
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 108) s5-0 :rate 1.0)
(launch-particles :system *sp-particle-system-3d* (-> *part-id-table* 108) s5-0)
)
)
0
@@ -1228,27 +1228,23 @@
:virtual #t
:code (behavior ()
(go-virtual water-vol-idle)
(none)
)
)
(defstate water-vol-idle (water-vol)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('update)
(the-as symbol (update! self))
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('update)
(update! self)
)
)
)
:exit (behavior ()
(on-exit-water self)
(none)
)
:trans (behavior ()
(update! self)
(none)
)
:code (the-as (function none :behavior water-vol) anim-loop)
)
@@ -1470,9 +1470,6 @@
(none)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 893]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 938]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 1045]
(defun anim-test-edit-sequence-list-handler ((arg0 int) (arg1 list-control))
(local-vars
(sv-192 (function string dma-buffer int int font-color font-flags float))
@@ -2223,7 +2220,6 @@
:event anim-tester-standard-event-handler
:enter (behavior ()
(logior! (-> self flags) (anim-tester-flags fanimt1))
(none)
)
:trans (behavior ()
(if (and (not (logtest? (-> self flags) (anim-tester-flags fanimt1))) (= *master-mode* 'menu))
@@ -2239,7 +2235,6 @@
(new 'static 'rgba :r #xff :g #xff :b #xff :a #x80)
)
)
(none)
)
:code (behavior ()
(local-vars (s4-0 glst-node) (s5-1 anim-test-seq-item) (gp-2 anim-test-sequence))
@@ -2398,7 +2393,6 @@
)
)
)
(none)
)
:post anim-tester-post
)
+137 -121
View File
@@ -31,63 +31,102 @@
(defun dm-cam-settings-func ((arg0 int) (arg1 debug-menu-msg))
(when (and (= arg1 (debug-menu-msg press)) *camera*)
(case arg0
(((cam-slave-options))
(cond
((zero? arg0)
(send-event *camera* 'toggle-slave-option 1)
)
((= arg0 13)
(send-event *camera* 'toggle-slave-option 8192)
)
((= arg0 1)
(send-event *camera* 'toggle-slave-option 2)
)
((= arg0 2)
(send-event *camera* 'toggle-slave-option 4)
)
((= arg0 3)
(send-event *camera* 'toggle-slave-option 128)
)
((= arg0 4)
(send-event *camera* 'toggle-slave-option 8)
)
((= arg0 7)
(send-event *camera* 'toggle-slave-option 16)
)
((= arg0 8)
(send-event *camera* 'toggle-slave-option 64)
)
((= arg0 6)
(send-event *camera* 'reset-root)
)
(((cam-slave-options BUTT_CAM)
(cam-slave-options SAME_SIDE)
(cam-slave-options MOVE_SPHERICAL)
(cam-slave-options ALLOW_Z_ROT)
(cam-slave-options JUMP_PITCHES)
(cam-slave-options COLLIDE)
(cam-slave-options FIND_HIDDEN_TARGET)
(cam-slave-options DRAG)
(cam-slave-options LINE_OF_SIGHT)
(cam-slave-options BLOCK_SHIFT_BUTTONS)
(cam-slave-options NO_ROTATE)
(cam-slave-options STICKY_ANGLE)
)
(send-event *camera* 'toggle-slave-option arg0)
)
((9) ;; ignore regions
((= arg0 9)
(logxor! (-> *camera* master-options) 1)
)
((10) ;; switch only on ground
((= arg0 10)
(logxor! (-> *camera* master-options) 4)
)
(else
(format 0 "Unrecognized camera settings menu item selected: ~I~%" arg0)
((= arg0 11)
(send-event *camera* 'toggle-slave-option 32)
)
((= arg0 12)
(send-event *camera* 'toggle-slave-option 512)
)
((= arg0 14)
(send-event *camera* 'toggle-slave-option #x8000)
)
((= arg0 15)
(send-event *camera* 'toggle-slave-option #x10000)
)
)
)
(cond
(*camera*
(case arg0
(((cam-slave-options BUTT_CAM)
(cam-slave-options SAME_SIDE)
(cam-slave-options MOVE_SPHERICAL)
(cam-slave-options ALLOW_Z_ROT)
(cam-slave-options JUMP_PITCHES)
(cam-slave-options COLLIDE)
(cam-slave-options FIND_HIDDEN_TARGET)
(cam-slave-options DRAG)
(cam-slave-options LINE_OF_SIGHT)
(cam-slave-options BLOCK_SHIFT_BUTTONS)
(cam-slave-options NO_ROTATE)
(cam-slave-options STICKY_ANGLE)
)
(logtest? (-> *camera* slave-options) arg0)
)
((9) ;; ignore regions
(logtest? (-> *camera* master-options) 1)
)
((10) ;; switch only on ground
(logtest? (-> *camera* master-options) 4)
)
(else
#f
(cond
((zero? arg0)
(logtest? (-> *camera* slave-options) 1)
)
((= arg0 13)
(logtest? (-> *camera* slave-options) 8192)
)
((= arg0 1)
(logtest? (-> *camera* slave-options) 2)
)
((= arg0 2)
(logtest? (-> *camera* slave-options) 4)
)
((= arg0 3)
(logtest? (-> *camera* slave-options) 128)
)
((= arg0 4)
(logtest? (-> *camera* slave-options) 8)
)
((= arg0 7)
(logtest? (-> *camera* slave-options) 16)
)
((= arg0 8)
(logtest? (-> *camera* slave-options) 64)
)
((= arg0 11)
(logtest? (-> *camera* slave-options) 32)
)
((= arg0 12)
(logtest? (-> *camera* slave-options) 512)
)
((= arg0 14)
(logtest? (-> *camera* slave-options) #x8000)
)
((= arg0 15)
(logtest? #x10000 (-> *camera* slave-options))
)
((= arg0 9)
(logtest? (-> *camera* master-options) 1)
)
((= arg0 10)
(logtest? (-> *camera* master-options) 4)
)
(else
#f
)
)
)
(else
@@ -557,13 +596,7 @@
(let ((s3-0 (-> (the-as drawable-tree-instance-shrub v1-7) info prototype-inline-array-shrub)))
(dotimes (s2-0 (-> s3-0 length))
(let ((a1-4
(new
'debug ;; was global
'debug-menu-item-flag
(the-as string (-> s3-0 data s2-0 name))
(-> s3-0 data s2-0 name)
dm-instance-pick-func
)
(new 'debug 'debug-menu-item-flag (-> s3-0 data s2-0 name) (-> s3-0 data s2-0 name) dm-instance-pick-func)
)
)
(debug-menu-append-item *instance-shrub-menu* a1-4)
@@ -780,7 +813,7 @@
(debug-menu-append-item arg1 a1-41)
)
(let ((a1-43
(new 'debug 'debug-menu-item-function "Reset Free" (cam-slave-options) (the-as (function object object) dm-cam-settings-func))
(new 'debug 'debug-menu-item-function "Reset Free" 6 (the-as (function object object) dm-cam-settings-func))
)
)
(debug-menu-append-item arg1 a1-43)
@@ -846,28 +879,28 @@
(let ((a1-29 (new 'debug 'debug-menu-item-submenu "Settings" s4-1)))
(debug-menu-append-item gp-0 a1-29)
)
(let ((a1-31 (new 'debug 'debug-menu-item-flag "Butt cam" (cam-slave-options BUTT_CAM) dm-cam-settings-func)))
(let ((a1-31 (new 'debug 'debug-menu-item-flag "Butt cam" 0 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-31)
)
(let ((a1-33 (new 'debug 'debug-menu-item-flag "Block shift buttons" (cam-slave-options BLOCK_SHIFT_BUTTONS) dm-cam-settings-func)))
(let ((a1-33 (new 'debug 'debug-menu-item-flag "Block shift buttons" 13 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-33)
)
(let ((a1-35 (new 'debug 'debug-menu-item-flag "Same side" (cam-slave-options SAME_SIDE) dm-cam-settings-func)))
(let ((a1-35 (new 'debug 'debug-menu-item-flag "Same side" 1 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-35)
)
(let ((a1-37 (new 'debug 'debug-menu-item-flag "Move spherical" (cam-slave-options MOVE_SPHERICAL) dm-cam-settings-func)))
(let ((a1-37 (new 'debug 'debug-menu-item-flag "Move spherical" 2 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-37)
)
(let ((a1-39 (new 'debug 'debug-menu-item-flag "Drag" (cam-slave-options DRAG) dm-cam-settings-func)))
(let ((a1-39 (new 'debug 'debug-menu-item-flag "Drag" 3 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-39)
)
(let ((a1-41 (new 'debug 'debug-menu-item-flag "Allow Z rot" (cam-slave-options ALLOW_Z_ROT) dm-cam-settings-func)))
(let ((a1-41 (new 'debug 'debug-menu-item-flag "Allow Z rot" 4 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-41)
)
(let ((a1-43 (new 'debug 'debug-menu-item-flag "Pitch for jump" (cam-slave-options JUMP_PITCHES) dm-cam-settings-func)))
(let ((a1-43 (new 'debug 'debug-menu-item-flag "Pitch for jump" 7 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-43)
)
(let ((a1-45 (new 'debug 'debug-menu-item-flag "Find hidden target" (cam-slave-options FIND_HIDDEN_TARGET) dm-cam-settings-func)))
(let ((a1-45 (new 'debug 'debug-menu-item-flag "Find hidden target" 8 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-45)
)
(let ((a1-47
@@ -882,16 +915,16 @@
(let ((a1-51 (new 'debug 'debug-menu-item-flag "Switch only on ground" 10 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-51)
)
(let ((a1-53 (new 'debug 'debug-menu-item-flag "Collide" (cam-slave-options COLLIDE) dm-cam-settings-func)))
(let ((a1-53 (new 'debug 'debug-menu-item-flag "Collide" 11 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-53)
)
(let ((a1-55 (new 'debug 'debug-menu-item-flag "Line of Sight" (cam-slave-options LINE_OF_SIGHT) dm-cam-settings-func)))
(let ((a1-55 (new 'debug 'debug-menu-item-flag "Line of Sight" 12 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-55)
)
(let ((a1-57 (new 'debug 'debug-menu-item-flag "No Rotate" (cam-slave-options NO_ROTATE) dm-cam-settings-func)))
(let ((a1-57 (new 'debug 'debug-menu-item-flag "No Rotate" 14 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-57)
)
(let ((a1-59 (new 'debug 'debug-menu-item-flag "Sticky Angle" (cam-slave-options STICKY_ANGLE) dm-cam-settings-func)))
(let ((a1-59 (new 'debug 'debug-menu-item-flag "Sticky Angle" 15 dm-cam-settings-func)))
(debug-menu-append-item s4-1 a1-59)
)
(let ((s3-2 (new 'debug 'debug-menu-item-var "Interp Frms" 40 80)))
@@ -961,22 +994,16 @@
(debug-menu-append-item s4-1 a1-87)
)
)
(let ((a1-89 (new
'debug
'debug-menu-item-flag
"Edit"
'*cam-layout*
(the-as (function object debug-menu-msg object) (lambda ((arg0 symbol) (arg1 debug-menu-msg))
(when (= arg1 (debug-menu-msg press))
(if (-> arg0 value)
(cam-layout-stop)
(cam-layout-start)
)
)
(-> arg0 value)
)
)
)
(let ((a1-89 (new 'debug 'debug-menu-item-flag "Edit" '*cam-layout* (lambda ((arg0 symbol) (arg1 debug-menu-msg))
(when (= arg1 (debug-menu-msg press))
(if (-> arg0 value)
(cam-layout-stop)
(cam-layout-start)
)
)
(-> arg0 value)
)
)
)
)
(debug-menu-append-item gp-0 a1-89)
@@ -1064,10 +1091,7 @@
'debug-menu-item-function
"all tweak+"
#f
(the-as
(function object object)
(lambda () (the-as object (all-texture-tweak-adjust *texture-page-dir* (the-as float 0.1))))
)
(lambda ((arg0 object)) (all-texture-tweak-adjust *texture-page-dir* (the-as float 0.1)))
)
)
)
@@ -1078,10 +1102,7 @@
'debug-menu-item-function
"all tweak-"
#f
(the-as
(function object object)
(lambda () (the-as object (all-texture-tweak-adjust *texture-page-dir* (the-as float -0.1))))
)
(lambda ((arg0 object)) (all-texture-tweak-adjust *texture-page-dir* (the-as float -0.1)))
)
)
)
@@ -1923,10 +1944,7 @@
(debug-menu-append-item gp-0 a1-7)
)
)
(let ((a1-9
(new 'debug 'debug-menu-item-function "Refresh" #f (the-as (function object object) build-instance-list))
)
)
(let ((a1-9 (new 'debug 'debug-menu-item-function "Refresh" #f build-instance-list)))
(debug-menu-append-item gp-0 a1-9)
)
(let ((s3-0 (new 'debug 'debug-menu-item-var "near" (the-as int '*edit-instance*) 80)))
@@ -1936,20 +1954,19 @@
(function int debug-menu-msg float float float)
(lambda ((arg0 debug-menu) (arg1 debug-menu-msg) (arg2 float) (arg3 float))
(let ((gp-0 (find-instance-by-name (-> arg0 name))))
(the-as object (cond
(gp-0
(when (= arg1 (debug-menu-msg press))
(set! (-> gp-0 dists x) (* 4096.0 arg2))
(prototype-bucket-recalc-fields gp-0)
)
(* 0.00024414062 (-> gp-0 dists x))
)
(else
(empty)
arg3
)
)
)
(cond
(gp-0
(when (= arg1 (debug-menu-msg press))
(set! (-> gp-0 dists x) (* 4096.0 arg2))
(prototype-bucket-recalc-fields gp-0)
)
(* 0.00024414062 (-> gp-0 dists x))
)
(else
(empty)
arg3
)
)
)
)
)
@@ -1968,20 +1985,19 @@
(function int debug-menu-msg float float float)
(lambda ((arg0 debug-menu) (arg1 debug-menu-msg) (arg2 float) (arg3 float))
(let ((gp-0 (find-instance-by-name (-> arg0 name))))
(the-as object (cond
(gp-0
(when (= arg1 (debug-menu-msg press))
(set! (-> gp-0 dists w) (* 4096.0 arg2))
(prototype-bucket-recalc-fields gp-0)
)
(* 0.00024414062 (-> gp-0 dists w))
)
(else
(empty)
arg3
)
)
)
(cond
(gp-0
(when (= arg1 (debug-menu-msg press))
(set! (-> gp-0 dists w) (* 4096.0 arg2))
(prototype-bucket-recalc-fields gp-0)
)
(* 0.00024414062 (-> gp-0 dists w))
)
(else
(empty)
arg3
)
)
)
)
)
@@ -94,7 +94,6 @@
)
(suspend)
)
(none)
)
)
@@ -120,6 +119,3 @@
)
(none)
)
+1 -6
View File
@@ -47,7 +47,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior viewer) ja-post)
)
@@ -228,9 +227,5 @@
viewer
(t9-0 arg0 arg1)
)
(the-as object #t)
#t
)
+32 -52
View File
@@ -229,7 +229,7 @@
)
(and *target*
(!= (-> *target* next-state name) 'target-look-around)
(zero? (logand (-> *target* state-flags) (state-flags being-attacked dying)))
(not (logtest? (-> *target* state-flags) (state-flags being-attacked dying)))
(= *master-mode* 'game)
)
)
@@ -272,10 +272,9 @@
(kill-current-level-hint '() '() 'exit)
)
)
(the-as object (and (not *hint-semaphore*)
(process-spawn level-hint :init ambient-hint-init-by-other arg0 arg1 arg3 :to arg2)
)
)
(and (not *hint-semaphore*)
(process-spawn level-hint :init ambient-hint-init-by-other arg0 arg1 arg3 :to arg2)
)
)
(defun kill-current-level-hint ((arg0 pair) (arg1 pair) (arg2 symbol))
@@ -350,14 +349,13 @@
(apply-settings *setting-control*)
(set! (-> self event-hook) (lambda :behavior level-hint
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (or (= v1-0 'die) (= v1-0 'exit))
(if (= (ppointer->process *hint-semaphore*) self)
(set! *hint-semaphore* (the-as (pointer level-hint) #f))
)
(deactivate self)
)
)
(case arg2
(('die 'exit)
(if (= (ppointer->process *hint-semaphore*) self)
(set! *hint-semaphore* (the-as (pointer level-hint) #f))
)
(deactivate self)
)
)
)
)
@@ -391,24 +389,20 @@
)
(defstate level-hint-normal (level-hint)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'exit)
(go level-hint-exit)
)
((= v1-0 'die)
(deactivate self)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('exit)
(go level-hint-exit)
)
(('die)
(deactivate self)
)
)
)
:exit (behavior ()
(if (= (ppointer->process *hint-semaphore*) self)
(set! *hint-semaphore* (the-as (pointer level-hint) #f))
)
(none)
)
:code (behavior ()
(cond
@@ -445,27 +439,23 @@
)
)
(go level-hint-exit)
(none)
)
)
(defstate level-hint-sidekick (level-hint)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (cond
((= v1-0 'exit)
(when (nonzero? (-> self sound-id))
(sound-stop (-> self sound-id))
(set! (-> self sound-id) (new 'static 'sound-id))
0
)
(go level-hint-exit)
)
((= v1-0 'die)
(deactivate self)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('exit)
(when (nonzero? (-> self sound-id))
(sound-stop (-> self sound-id))
(set! (-> self sound-id) (new 'static 'sound-id))
0
)
(go level-hint-exit)
)
(('die)
(deactivate self)
)
)
)
:exit (behavior ()
@@ -480,7 +470,6 @@
(set! *hint-semaphore* (the-as (pointer level-hint) #f))
)
(send-event (handle->process (-> self voicebox)) 'die)
(none)
)
:code (behavior ((arg0 string))
(#when PC_PORT (set! *level-hint-spool-name* arg0))
@@ -548,7 +537,6 @@
)
)
(go level-hint-exit)
(none)
)
)
@@ -563,7 +551,6 @@
(if (= (ppointer->process *hint-semaphore*) self)
(set! *hint-semaphore* (the-as (pointer level-hint) #f))
)
(none)
)
:code (behavior ((arg0 string))
(while (not *sound-player-enable*)
@@ -631,7 +618,6 @@
)
)
(go level-hint-exit)
(none)
)
)
@@ -663,7 +649,6 @@
)
)
(go level-hint-exit)
(none)
)
)
@@ -672,7 +657,6 @@
(if (= (ppointer->process *hint-semaphore*) self)
(set! *hint-semaphore* (the-as (pointer level-hint) #f))
)
(none)
)
)
@@ -1242,7 +1226,3 @@
0
(none)
)
+14 -15
View File
@@ -1102,21 +1102,20 @@
)
(iterate-process-tree
*active-pool*
(the-as (function object object) (lambda ((arg0 process-drawable))
(when (type-type? (-> arg0 type) process-drawable)
(if (nonzero? (-> arg0 nav))
(debug-draw (-> arg0 nav))
)
(if (nonzero? (-> arg0 path))
(debug-draw (-> arg0 path))
)
(if (nonzero? (-> arg0 vol))
(init! (-> arg0 vol))
)
)
(none)
)
(lambda ((arg0 process-drawable))
(when (type-type? (-> arg0 type) process-drawable)
(if (nonzero? (-> arg0 nav))
(debug-draw (-> arg0 nav))
)
(if (nonzero? (-> arg0 path))
(debug-draw (-> arg0 path))
)
(if (nonzero? (-> arg0 vol))
(init! (-> arg0 vol))
)
)
(none)
)
*null-kernel-context*
)
)
@@ -1581,7 +1580,7 @@
)
(iterate-process-tree
*entity-pool*
(the-as (function object object) (lambda ((arg0 process-drawable)) (deactivate arg0) (none)))
(lambda ((arg0 process-drawable)) (deactivate arg0) (none))
*null-kernel-context*
)
(if (= arg0 'game)
+7 -12
View File
@@ -45,23 +45,18 @@
(flop-hit-ground) ;; set when ground pound hit ground
)
(defmacro static-attack-info (&key (mask ()) &rest args)
(when (!= (length args) 1)
(error "static-attack-info can only have 1 arg"))
(let ((mask-actual mask)
(arg (car args))
(defmacro static-attack-info (&key (mask ()) args)
(let ((mask-actual mask))
(dolist (it args)
(when (not (member (caar it) mask-actual))
(cons! mask-actual (caar it))
)
(when (assoc 'shove-up arg) (cons! mask-actual 'shove-up))
(when (assoc 'shove-back arg) (cons! mask-actual 'shove-back))
(when (assoc 'mode arg) (cons! mask-actual 'mode))
(when (assoc 'vector arg) (cons! mask-actual 'vector))
(when (assoc 'angle arg) (cons! mask-actual 'angle))
(when (assoc 'control arg) (cons! mask-actual 'control))
)
`(let ((atk (new 'static 'attack-info :mask (attack-mask ,@mask-actual))))
,@(apply (lambda (x) (if (eq? (car x) 'vector)
`(vector-copy! (-> atk ,(car x)) ,(cadr x))
`(set! (-> atk ,(car x)) ,(cadr x))
)) arg)
)) args)
atk)
)
)
+9 -19
View File
@@ -1364,7 +1364,6 @@
(set! (-> self buffer) a0-1)
)
(go-virtual get-card)
(none)
)
)
@@ -1415,7 +1414,6 @@
(go-virtual done)
)
)
(none)
)
)
@@ -1455,7 +1453,6 @@
)
)
(go-virtual done)
(none)
)
)
@@ -1486,7 +1483,6 @@
)
(label cfg-11)
(go-virtual done)
(none)
)
)
@@ -1536,7 +1532,6 @@
)
)
(go-virtual done)
(none)
)
)
@@ -1613,7 +1608,6 @@
)
(label cfg-21)
(go-virtual done)
(none)
)
)
@@ -1686,22 +1680,20 @@
(suspend)
)
(go-virtual done)
(none)
)
)
(defstate error (auto-save)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('progress-allowed?)
#t
)
(('die)
(the-as symbol (deactivate self))
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('progress-allowed?)
#t
)
(('die)
(deactivate self)
)
)
)
:code (behavior ((arg0 mc-status-code))
(if (-> self buffer)
@@ -1732,7 +1724,6 @@
)
)
)
(none)
)
)
@@ -1771,7 +1762,6 @@
)
)
)
(none)
)
)
+4 -11
View File
@@ -600,20 +600,20 @@
(defstate projectile-moving (projectile)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touched)
(when (-> self attack-mode)
(when (cond
((= (-> proc type) target)
(send-event proc 'attack (-> event param 0) (static-attack-info ((mode (-> self attack-mode)))))
(send-event proc 'attack (-> block param 0) (static-attack-info ((mode (-> self attack-mode)))))
)
(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) (-> event param 0))
(set! (-> a1-2 param 0) (-> block 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)
@@ -643,7 +643,6 @@
)
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:code (behavior ()
(let ((gp-0 #f))
@@ -700,7 +699,6 @@
)
)
(go-virtual projectile-dissipate)
(none)
)
)
@@ -760,7 +758,6 @@
(sound-play "yellow-explode")
(suspend)
(go-virtual projectile-die)
(none)
)
)
@@ -784,7 +781,6 @@
(sound-play "yellow-fizzle")
(suspend)
(go-virtual projectile-die)
(none)
)
)
@@ -833,7 +829,6 @@
)
)
(cleanup-for-death self)
(none)
)
)
@@ -1229,7 +1224,6 @@
:virtual #t
:code (behavior ()
(cleanup-for-death self)
(none)
)
)
@@ -1237,6 +1231,5 @@
:virtual #t
:code (behavior ()
(go-virtual projectile-die)
(none)
)
)
+5 -7
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(define *sidekick-remap* '(("run-to-stance-left" "run-to-stance")
("run-to-stance-loop-left" "run-to-stance-loop")
("stance-loop-left" "stance-loop")
@@ -63,11 +62,11 @@
)
(defstate sidekick-clone (sidekick)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-0 object))
(case event-type
(case message
(('matrix)
(case (-> event param 0)
(case (-> block param 0)
(('play-anim)
(set! v0-0 (-> self node-list data))
(set! (-> (the-as (inline-array cspace) v0-0) 0 param0) cspace<-cspace+quaternion!)
@@ -100,13 +99,13 @@
v0-0
)
(('shadow)
(set! v0-0 (-> event param 0))
(set! v0-0 (-> block param 0))
(set! (-> self shadow-in-movie?) (the-as symbol v0-0))
v0-0
)
(('blend-shape)
(cond
((-> event param 0)
((-> block param 0)
(set! v0-0 (logior (-> self skel status) (janim-status blerc)))
(set! (-> self skel status) (the-as janim-status v0-0))
)
@@ -214,7 +213,6 @@
(if (logtest? (-> self skel status) (janim-status eye-done eye))
(merc-eye-anim self)
)
(none)
)
)
+34 -45
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(defskelgroup *deathcam-sg* deathcam deathcam-lod0-jg deathcam-idle-ja
((deathcam-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 4)
@@ -56,7 +55,6 @@
(remove-setting! 'sfx-volume)
(remove-setting! 'ambient-volume)
(remove-setting! 'music)
(none)
)
:code (behavior ((arg0 continue-point))
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -455,7 +453,6 @@
(suspend)
(logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf))
(go target-stance)
(none)
)
:post target-no-move-post
)
@@ -822,7 +819,6 @@
(logclear! (-> self state-flags) (state-flags being-attacked dying))
)
(target-exit)
(none)
)
:trans (behavior ()
(when (= *cheat-mode* 'debug)
@@ -831,7 +827,6 @@
(go target-stance)
)
)
(none)
)
:code (behavior ((arg0 symbol) (arg1 attack-info))
(logclear! (-> self water flags) (water-flags wt16))
@@ -969,7 +964,6 @@
)
)
(go target-hit-ground #f)
(none)
)
:post target-post
)
@@ -1030,43 +1024,40 @@
)
(defstate target-death (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(let ((v1-0 event-type))
(the-as object (cond
((= v1-0 'end-mode)
(let ((v0-0 (the-as object #t)))
(set! (-> self control unknown-uint20) (the-as uint v0-0))
v0-0
)
)
((= v1-0 'change-mode)
(case (-> event param 0)
(('grab)
#t
)
)
)
((= v1-0 'notify)
(when (type-type? (-> proc type) pov-camera)
(case (-> event param 0)
(('die 'abort-request)
(set! (-> self control unknown-uint20) (the-as uint #t))
(the-as object (set-blackout-frames (seconds 0.2)))
)
)
)
)
((= v1-0 'get-pickup)
#f
)
((= v1-0 'touched)
#f
)
(else
(target-generic-event-handler proc arg1 event-type event)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('end-mode)
(let ((v0-0 (the-as object #t)))
(set! (-> self control unknown-uint20) (the-as uint v0-0))
v0-0
)
)
(('change-mode)
(case (-> block param 0)
(('grab)
#t
)
)
)
(('notify)
(when (type-type? (-> proc type) pov-camera)
(case (-> block param 0)
(('die 'abort-request)
(set! (-> self control unknown-uint20) (the-as uint #t))
(set-blackout-frames (seconds 0.2))
)
)
)
)
(('get-pickup)
#f
)
(('touched)
#f
)
(else
(target-generic-event-handler proc argc message block)
)
)
)
:exit (behavior ()
@@ -1078,7 +1069,6 @@
(set! (-> self control pat-ignore-mask) (new 'static 'pat-surface :noentity #x1))
(set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max))
(set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length))
(none)
)
:trans (-> target-hit trans)
:code (behavior ((arg0 symbol))
@@ -1405,7 +1395,6 @@
(initialize! (-> self game) 'dead (the-as game-save #f) (the-as string #f))
(set! (-> self state-time) (-> *display* base-frame-counter))
(anim-loop)
(none)
)
:post target-no-stick-post
)
+250 -253
View File
@@ -11,279 +11,276 @@
(defbehavior target-generic-event-handler target ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-0 object))
(the-as
object
(case arg2
(('get-pickup)
(when (not (logtest? (-> self state-flags) (state-flags dying)))
(let ((s4-0 (-> arg3 param 0))
(f28-0 (the-as float (-> arg3 param 1)))
)
(if (!= (pickup-collectable!
(-> self fact-info-target)
(the-as pickup-type s4-0)
(the-as float 0.0)
(the-as handle #f)
)
(pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0))
(case arg2
(('get-pickup)
(when (not (logtest? (-> self state-flags) (state-flags dying)))
(let ((s4-0 (-> arg3 param 0))
(f28-0 (the-as float (-> arg3 param 1)))
)
(if (!= (pickup-collectable!
(-> self fact-info-target)
(the-as pickup-type s4-0)
(the-as float 0.0)
(the-as handle #f)
)
#t
'full
)
)
(pickup-collectable! (-> self fact-info-target) (the-as pickup-type s4-0) f28-0 (process->handle arg0))
)
#t
'full
)
)
)
(('reset-pickup)
(the-as object (reset! (-> self fact-info-target) (the-as symbol (-> arg3 param 0))))
)
(('reset-pickup)
(reset! (-> self fact-info-target) (the-as symbol (-> arg3 param 0)))
)
(('reset-collide)
(cond
((-> self control unknown-symbol00)
(target-collide-set! (-> self control unknown-symbol00) (-> self control unknown-float90))
)
((-> self control unknown-symbol30)
(target-danger-set! (-> self control unknown-symbol30) #f)
)
)
(('reset-collide)
(cond
((-> self control unknown-symbol00)
(target-collide-set! (-> self control unknown-symbol00) (-> self control unknown-float90))
)
((-> self control unknown-symbol30)
(target-danger-set! (-> self control unknown-symbol30) #f)
)
)
)
(('level-deactivate)
#f
)
(('level-enter)
(let ((v1-21 (level-get *level* (the-as symbol (-> arg3 param 0)))))
(when v1-21
(let ((s5-1 (-> v1-21 info)))
(let ((v1-22 (-> s5-1 buzzer)))
(if (zero? v1-22)
(set! (-> self fact-info-target buzzer) 0.0)
(set! (-> self fact-info-target buzzer) (pickup-collectable!
(-> self fact-info-target)
(pickup-type buzzer)
(the float (logior -65536 v1-22))
(the-as handle #f)
)
)
)
)
(if (and (zero? (-> *game-info* enter-level-time (-> s5-1 index)))
(>= (-> *level-task-data-remap* length) (-> s5-1 index))
)
(set! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1)))
(-> *display* base-frame-counter)
)
(('level-deactivate)
#f
)
(('level-enter)
(let ((v1-21 (level-get *level* (the-as symbol (-> arg3 param 0)))))
(when v1-21
(let ((s5-1 (-> v1-21 info)))
(let ((v1-22 (-> s5-1 buzzer)))
(if (zero? v1-22)
(set! (-> self fact-info-target buzzer) 0.0)
(set! (-> self fact-info-target buzzer) (pickup-collectable!
(-> self fact-info-target)
(pickup-type buzzer)
(the float (logior -65536 v1-22))
(the-as handle #f)
)
)
)
)
(send-event (ppointer->process (-> *hud-parts* buzzers)) 'sync)
(format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0))
(if (and (zero? (-> *game-info* enter-level-time (-> s5-1 index)))
(>= (-> *level-task-data-remap* length) (-> s5-1 index))
)
(set! (-> *game-info* enter-level-time (-> *level-task-data-remap* (+ (-> s5-1 index) -1)))
(-> *display* base-frame-counter)
)
)
)
(send-event (ppointer->process (-> *hud-parts* buzzers)) 'sync)
(format #t "GAMEPLAY: enter ~A~%" (-> arg3 param 0))
)
)
)
(('get-attack-count)
(set! v0-0 (+ (-> self control unknown-dword51) (-> arg3 param 0)))
(set! (-> self control unknown-dword51) (the-as int v0-0))
v0-0
)
(('continue)
(go target-continue (the-as continue-point (-> arg3 param 0)))
)
(('query)
(case (-> arg3 param 0)
(('powerup)
(and (= (-> self fact-info-target eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact-info-target eco-level)))
)
(('pickup)
(pickup-collectable!
(-> self fact-info-target)
(the-as pickup-type (-> arg3 param 1))
(the-as float 0.0)
(the-as handle #f)
)
)
(('ground-height)
(target-height-above-ground)
)
)
)
(('trans)
(case (-> arg3 param 0)
(('save)
(set! (-> self alt-cam-pos quad) (-> self control trans quad))
(logior! (-> self state-flags) (state-flags has-saved-position))
(mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48)
)
(('restore)
(logclear! (-> self state-flags) (state-flags has-saved-position))
(let ((gp-1 (-> arg3 param 1)))
(move-to-point! (-> self control) (the-as vector (+ gp-1 0)))
(quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16)))
)
(rot->dir-targ! (-> self control))
(logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf))
(set! v0-0 (-> *display* base-frame-counter))
(set! (-> self control unknown-dword11) (the-as time-frame v0-0))
v0-0
)
(('reset)
(set! v0-0 (logclear (-> self state-flags) (state-flags has-saved-position)))
(set! (-> self state-flags) (the-as state-flags v0-0))
v0-0
)
)
)
(('effect)
(target-powerup-effect (the-as symbol (-> arg3 param 0)))
)
(('do-effect)
(effect-control-method-10
(-> self skel effect)
(the-as symbol (-> arg3 param 0))
(the-as float (-> arg3 param 1))
-1
)
(if (-> self sidekick)
(effect-control-method-10
(-> self sidekick 0 skel effect)
(the-as symbol (-> arg3 param 0))
(the-as float (-> arg3 param 1))
-1
)
)
)
(('get-attack-count)
(set! v0-0 (+ (-> self control unknown-dword51) (-> arg3 param 0)))
(set! (-> self control unknown-dword51) (the-as int v0-0))
v0-0
)
(('continue)
(go target-continue (the-as continue-point (-> arg3 param 0)))
)
(('query)
(case (-> arg3 param 0)
(('powerup)
(and (= (-> self fact-info-target eco-type) (-> arg3 param 1)) (< 0.0 (-> self fact-info-target eco-level)))
)
(('pickup)
(pickup-collectable!
(-> self fact-info-target)
(the-as pickup-type (-> arg3 param 1))
(the-as float 0.0)
(the-as handle #f)
)
)
(('ground-height)
(target-height-above-ground)
)
)
(('neck)
(set! (-> self neck flex-blend) (the-as float (-> arg3 param 0)))
(cond
((-> arg3 param 1)
(logior! (-> self state-flags) (state-flags looking-at-enemy))
(set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad))
(look-at-enemy! (-> self neck) (-> self alt-neck-pos) 'force arg0)
)
(else
(set! v0-0 (logclear (-> self state-flags) (state-flags looking-at-enemy)))
(set! (-> self state-flags) (the-as state-flags v0-0))
v0-0
)
)
(('trans)
(case (-> arg3 param 0)
(('save)
(set! (-> self alt-cam-pos quad) (-> self control trans quad))
(logior! (-> self state-flags) (state-flags has-saved-position))
(mem-copy! (the-as pointer (-> arg3 param 1)) (the-as pointer (-> self control trans)) 48)
)
(('restore)
(logclear! (-> self state-flags) (state-flags has-saved-position))
(let ((gp-1 (-> arg3 param 1)))
(move-to-point! (-> self control) (the-as vector (+ gp-1 0)))
(quaternion-copy! (-> self control quat) (the-as quaternion (+ gp-1 16)))
)
(rot->dir-targ! (-> self control))
(logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf))
(set! v0-0 (-> *display* base-frame-counter))
(set! (-> self control unknown-dword11) (the-as time-frame v0-0))
v0-0
)
(('reset)
(set! v0-0 (logclear (-> self state-flags) (state-flags has-saved-position)))
(set! (-> self state-flags) (the-as state-flags v0-0))
v0-0
)
)
)
(('effect)
(the-as object (target-powerup-effect (the-as symbol (-> arg3 param 0))))
)
(('do-effect)
(effect-control-method-10
(-> self skel effect)
(the-as symbol (-> arg3 param 0))
(the-as float (-> arg3 param 1))
-1
)
(if (-> self sidekick)
(effect-control-method-10
(-> self sidekick 0 skel effect)
(the-as symbol (-> arg3 param 0))
(the-as float (-> arg3 param 1))
-1
)
)
)
(('neck)
(set! (-> self neck flex-blend) (the-as float (-> arg3 param 0)))
(cond
((-> arg3 param 1)
(logior! (-> self state-flags) (state-flags looking-at-enemy))
(set! (-> self alt-neck-pos quad) (-> (the-as vector (-> arg3 param 1)) quad))
(the-as object (look-at-enemy! (-> self neck) (-> self alt-neck-pos) 'force arg0))
)
(else
(set! v0-0 (logclear (-> self state-flags) (state-flags looking-at-enemy)))
(set! (-> self state-flags) (the-as state-flags v0-0))
v0-0
)
)
)
(('sidekick)
(cond
((and (-> arg3 param 0) (not (-> self sidekick)))
(let ((gp-2 (get-process *default-dead-pool* sidekick #x4000)))
(set! v0-0 (when gp-2
(let ((t9-21 (method-of-type sidekick activate)))
(t9-21 (the-as sidekick gp-2) self 'sidekick (the-as pointer #x70004000))
)
(run-now-in-process gp-2 init-sidekick)
(-> gp-2 ppointer)
)
(('sidekick)
(cond
((and (-> arg3 param 0) (not (-> self sidekick)))
(let ((gp-2 (get-process *default-dead-pool* sidekick #x4000)))
(set! v0-0 (when gp-2
(let ((t9-21 (method-of-type sidekick activate)))
(t9-21 (the-as sidekick gp-2) self 'sidekick (the-as pointer #x70004000))
)
)
)
(set! (-> self sidekick) (the-as (pointer sidekick) v0-0))
v0-0
(run-now-in-process gp-2 init-sidekick)
(-> gp-2 ppointer)
)
)
)
((and (not (-> arg3 param 0)) (-> self sidekick))
(deactivate (-> self sidekick 0))
(set! (-> self sidekick) (the-as (pointer sidekick) #f))
#f
(set! (-> self sidekick) (the-as (pointer sidekick) v0-0))
v0-0
)
((and (not (-> arg3 param 0)) (-> self sidekick))
(deactivate (-> self sidekick 0))
(set! (-> self sidekick) (the-as (pointer sidekick) #f))
#f
)
)
)
(('blend-shape)
(if (-> arg3 param 0)
(logior! (-> self skel status) (janim-status blerc))
(logclear! (-> self skel status) (janim-status blerc))
)
(let ((v1-105 (new 'stack-no-clear 'event-message-block)))
(set! (-> v1-105 from) arg0)
(set! (-> v1-105 num-params) arg1)
(set! (-> v1-105 message) arg2)
(set! (-> v1-105 param 0) (-> arg3 param 0))
(set! (-> v1-105 param 1) (-> arg3 param 1))
(set! (-> v1-105 param 2) (-> arg3 param 2))
(set! (-> v1-105 param 3) (-> arg3 param 3))
(set! (-> v1-105 param 4) (-> arg3 param 4))
(set! (-> v1-105 param 5) (-> arg3 param 5))
(set! (-> v1-105 param 6) (-> arg3 param 6))
(send-event-function (ppointer->process (-> self sidekick)) v1-105)
)
)
(('shadow)
(cond
((-> arg3 param 0)
(let ((v1-108 (-> self draw shadow-ctrl)))
(logclear! (-> v1-108 settings flags) (shadow-flags disable-draw))
)
)
)
(('blend-shape)
(if (-> arg3 param 0)
(logior! (-> self skel status) (janim-status blerc))
(logclear! (-> self skel status) (janim-status blerc))
0
)
(else
(let ((v1-110 (-> self draw shadow-ctrl)))
(logior! (-> v1-110 settings flags) (shadow-flags disable-draw))
)
(let ((v1-105 (new 'stack-no-clear 'event-message-block)))
(set! (-> v1-105 from) arg0)
(set! (-> v1-105 num-params) arg1)
(set! (-> v1-105 message) arg2)
(set! (-> v1-105 param 0) (-> arg3 param 0))
(set! (-> v1-105 param 1) (-> arg3 param 1))
(set! (-> v1-105 param 2) (-> arg3 param 2))
(set! (-> v1-105 param 3) (-> arg3 param 3))
(set! (-> v1-105 param 4) (-> arg3 param 4))
(set! (-> v1-105 param 5) (-> arg3 param 5))
(set! (-> v1-105 param 6) (-> arg3 param 6))
(send-event-function (ppointer->process (-> self sidekick)) v1-105)
0
)
)
(('shadow)
(cond
((-> arg3 param 0)
(let ((v1-108 (-> self draw shadow-ctrl)))
(logclear! (-> v1-108 settings flags) (shadow-flags disable-draw))
)
0
)
(else
(let ((v1-110 (-> self draw shadow-ctrl)))
(logior! (-> v1-110 settings flags) (shadow-flags disable-draw))
)
0
)
(('rotate-y-angle)
(quaternion-rotate-y!
(-> self control unknown-quaternion00)
(-> self control unknown-quaternion00)
(the-as float (-> arg3 param 0))
)
(if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0)
(rot->dir-targ! (-> self control))
)
)
(('touched)
(send-event arg0 'touch (-> arg3 param 0))
)
(('dry)
(set! (-> self water drip-wetness) 0.0)
)
(('reset-height)
(set! (-> self control unknown-vector52 quad) (-> self control trans quad))
#f
)
(('draw)
(if (-> arg3 param 0)
(logclear! (-> self draw status) (draw-status skip-bones))
(logior! (-> self draw status) (draw-status skip-bones))
)
(let ((v1-132 (new 'stack-no-clear 'event-message-block)))
(set! (-> v1-132 from) arg0)
(set! (-> v1-132 num-params) arg1)
(set! (-> v1-132 message) arg2)
(set! (-> v1-132 param 0) (-> arg3 param 0))
(set! (-> v1-132 param 1) (-> arg3 param 1))
(set! (-> v1-132 param 2) (-> arg3 param 2))
(set! (-> v1-132 param 3) (-> arg3 param 3))
(set! (-> v1-132 param 4) (-> arg3 param 4))
(set! (-> v1-132 param 5) (-> arg3 param 5))
(set! (-> v1-132 param 6) (-> arg3 param 6))
(send-event-function (ppointer->process (-> self manipy)) v1-132)
)
)
(('no-load-wait)
(set! v0-0 (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0))))
(set! (-> self no-load-wait) (the-as time-frame v0-0))
v0-0
)
(('no-look-around)
(set! (-> self no-look-around-wait)
(+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))
)
(if (= (-> self next-state name) 'target-look-around)
(send-event self 'end-mode)
)
)
(('change-state)
(go
(the-as (state object object object object target) (-> arg3 param 0))
(-> arg3 param 1)
(-> arg3 param 2)
(-> arg3 param 3)
(-> arg3 param 4)
)
(('rotate-y-angle)
(quaternion-rotate-y!
(-> self control unknown-quaternion00)
(-> self control unknown-quaternion00)
(the-as float (-> arg3 param 0))
)
(if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0)
(rot->dir-targ! (-> self control))
)
)
(('touched)
(send-event arg0 'touch (-> arg3 param 0))
)
(('dry)
(set! (-> self water drip-wetness) 0.0)
)
(('reset-height)
(set! (-> self control unknown-vector52 quad) (-> self control trans quad))
#f
)
(('draw)
(if (-> arg3 param 0)
(logclear! (-> self draw status) (draw-status skip-bones))
(logior! (-> self draw status) (draw-status skip-bones))
)
(let ((v1-132 (new 'stack-no-clear 'event-message-block)))
(set! (-> v1-132 from) arg0)
(set! (-> v1-132 num-params) arg1)
(set! (-> v1-132 message) arg2)
(set! (-> v1-132 param 0) (-> arg3 param 0))
(set! (-> v1-132 param 1) (-> arg3 param 1))
(set! (-> v1-132 param 2) (-> arg3 param 2))
(set! (-> v1-132 param 3) (-> arg3 param 3))
(set! (-> v1-132 param 4) (-> arg3 param 4))
(set! (-> v1-132 param 5) (-> arg3 param 5))
(set! (-> v1-132 param 6) (-> arg3 param 6))
(send-event-function (ppointer->process (-> self manipy)) v1-132)
)
)
(('no-load-wait)
(set! v0-0 (+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0))))
(set! (-> self no-load-wait) (the-as time-frame v0-0))
v0-0
)
(('no-look-around)
(set! (-> self no-look-around-wait)
(+ (-> *display* base-frame-counter) (the-as time-frame (-> arg3 param 0)))
)
(if (= (-> self next-state name) 'target-look-around)
(send-event self 'end-mode)
)
)
(('change-state)
(go
(the-as (state object object object object target) (-> arg3 param 0))
(-> arg3 param 1)
(-> arg3 param 2)
(-> arg3 param 3)
(-> arg3 param 4)
)
)
)
)
)
)
+20 -94
View File
@@ -340,7 +340,6 @@
(suspend)
(suspend)
(go target-stance)
(none)
)
:post target-no-move-post
)
@@ -350,12 +349,10 @@
:enter (behavior ()
(set! (-> self control unknown-surface00) *walk-mods*)
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:exit (behavior ()
(set! (-> self control unknown-float81) 0.0)
(target-state-hook-exit)
(none)
)
:trans (behavior ()
((-> self state-hook))
@@ -404,7 +401,6 @@
)
(slide-down-test)
(fall-test)
(none)
)
:code (behavior ()
(let ((s5-0 22)
@@ -577,7 +573,6 @@
)
)
)
(none)
)
:post target-post
)
@@ -587,12 +582,10 @@
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(set! (-> self control unknown-surface00) *walk-mods*)
(none)
)
:exit (behavior ()
(target-effect-exit)
(target-state-hook-exit)
(none)
)
:trans (behavior ()
((-> self state-hook))
@@ -658,7 +651,6 @@
)
(slide-down-test)
(fall-test)
(none)
)
:code (behavior ()
(let ((f28-0 0.0)
@@ -964,7 +956,6 @@
)
)
)
(none)
)
:post target-post
)
@@ -975,7 +966,6 @@
(vector-turn-to (-> self control transv))
(set! (-> self control unknown-surface00) *turn-around-mods*)
(set! (-> self control unknown-float81) 1.0)
(none)
)
:exit (behavior ()
(target-state-hook-exit)
@@ -983,7 +973,6 @@
(set! (-> self control unknown-float01) 0.0)
(set-quaternion! (-> self control) (-> self control dir-targ))
(set! (-> self control unknown-float81) 0.0)
(none)
)
:trans (behavior ()
((-> self state-hook))
@@ -1010,7 +999,6 @@
(go target-falling #f)
)
(slide-down-test)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.04))
@@ -1029,7 +1017,6 @@
(set! (-> self control unknown-float01) 40960.0)
(target-state-hook-exit)
(go target-walk)
(none)
)
:post target-no-stick-post
)
@@ -1038,11 +1025,9 @@
:event target-walk-event-handler
:enter (behavior ()
(set! (-> self control unknown-surface00) *jump-mods*)
(none)
)
:exit (behavior ()
(set! (-> self control unknown-dword35) (-> *display* base-frame-counter))
(none)
)
:trans (behavior ()
(when (or (logtest? (-> self control status) (cshape-moving-flags onsurf))
@@ -1053,7 +1038,6 @@
(logior! (-> self control status) (cshape-moving-flags onsurf))
(go target-duck-stance)
)
(none)
)
:code (behavior ()
(if (not (ja-group? eichar-duck-stance-ja))
@@ -1066,7 +1050,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post target-post
)
@@ -1208,7 +1191,6 @@
(set! (-> self control unknown-float81) 1.0)
(set! (-> self control unknown-surface00) *duck-mods*)
(target-collide-set! 'duck (the-as float 1.0))
(none)
)
:exit (behavior ()
(if (not (or (= (-> self next-state name) 'target-duck-walk)
@@ -1222,7 +1204,6 @@
)
(target-exit)
(target-collide-set! 'normal (the-as float 0.0))
(none)
)
:trans (behavior ()
((-> self state-hook))
@@ -1261,7 +1242,6 @@
)
(fall-test)
(slide-down-test)
(none)
)
:code (behavior ()
(cond
@@ -1293,7 +1273,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post target-post
)
@@ -1306,7 +1285,6 @@
(if (not (ja-group? eichar-duck-roll-ja))
(set! (-> self control unknown-surface00) *duck-mods*)
)
(none)
)
:exit (-> target-duck-stance exit)
:trans (behavior ()
@@ -1347,7 +1325,6 @@
)
(fall-test)
(slide-down-test)
(none)
)
:code (behavior ()
(cond
@@ -1374,7 +1351,6 @@
)
(suspend)
)
(none)
)
:post target-post
)
@@ -1421,7 +1397,6 @@
(set! (-> self control unknown-float122)
(fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01)))))
)
(none)
)
:exit target-exit
:trans (behavior ()
@@ -1475,7 +1450,6 @@
(fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01)))))
(-> *display* seconds-per-frame)
)
(none)
)
:code (behavior ((arg0 float) (arg1 float) (arg2 surface))
(ja-channel-push! 2 (seconds 0.05))
@@ -1508,7 +1482,6 @@
(suspend)
)
(target-falling-anim -1 (seconds 0.2))
(none)
)
:post target-post
)
@@ -1518,7 +1491,6 @@
:enter (behavior ((arg0 float) (arg1 float))
((-> target-jump enter) arg0 arg1 (the-as surface #f))
(set! (-> self control unknown-surface00) *forward-jump-mods*)
(none)
)
:exit target-exit
:trans (-> target-jump trans)
@@ -1535,7 +1507,6 @@
(suspend)
(ja :group! eichar-jump-loop-ja :num! (loop!))
)
(none)
)
:post target-post
)
@@ -1557,7 +1528,6 @@
(init-var-jump arg0 arg1 (the-as vector #t) (the-as vector #t) (-> self control transv))
(logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf))
(set! (-> self control unknown-surface00) *double-jump-mods*)
(none)
)
:exit target-exit
:trans (behavior ()
@@ -1597,7 +1567,6 @@
(fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01)))))
(-> *display* seconds-per-frame)
)
(none)
)
:code (behavior ((arg0 float) (arg1 float))
(ja-channel-push! 2 (seconds 0.05))
@@ -1610,7 +1579,6 @@
(ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122))
)
(target-falling-anim -1 (seconds 0.2))
(none)
)
:post target-post
)
@@ -1651,7 +1619,6 @@
(set! (-> self control unknown-float122)
(fmax 0.0 (fmin 0.5 (* 0.00008138021 (+ -409.6 (-> self control unknown-float01)))))
)
(none)
)
:exit target-exit
:trans (behavior ()
@@ -1695,7 +1662,6 @@
(fmax 0.0 (fmin 1.0 (* 0.00012207031 (+ -2048.0 (-> self control unknown-float01)))))
(-> *display* seconds-per-frame)
)
(none)
)
:code (-> target-jump code)
:post target-post
@@ -1707,7 +1673,6 @@
(set! (-> self state-time) (-> *display* base-frame-counter))
(logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf))
(set! (-> self control unknown-surface00) *turn-around-mods*)
(none)
)
:exit target-exit
:code (behavior ((arg0 float) (arg1 float) (arg2 symbol))
@@ -1750,7 +1715,6 @@
)
)
(go target-duck-high-jump-jump arg0 arg1 arg2)
(none)
)
:post target-post
)
@@ -1771,7 +1735,6 @@
(set! (-> self control unknown-surface00) *high-jump-mods*)
)
)
(none)
)
:exit target-exit
;; og:preserve-this PAL patch here
@@ -1798,7 +1761,6 @@
)
)
)
(none)
)
:code (behavior ((arg0 float) (arg1 float) (arg2 symbol))
(let ((f30-0 (the-as float (if (= arg2 'launch)
@@ -1853,7 +1815,6 @@
)
)
(the-as none 0)
(none)
)
:post target-post
)
@@ -1864,7 +1825,6 @@
(set! (-> self control unknown-surface00) *jump-mods*)
(set! (-> self control unknown-uint20) (the-as uint arg0))
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans (behavior ()
(target-falling-trans
@@ -1875,11 +1835,9 @@
)
)
)
(none)
)
:code (behavior ((arg0 symbol))
(target-falling-anim -1 (seconds 0.33))
(none)
)
:post target-post
)
@@ -1939,7 +1897,6 @@
600
1500
)
(none)
)
:trans (behavior ()
(if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
@@ -1973,12 +1930,10 @@
)
(fall-test)
(slide-down-test)
(none)
)
:code (behavior ((arg0 symbol))
(target-hit-ground-anim #f)
(go target-stance)
(none)
)
:post target-post
)
@@ -1992,12 +1947,10 @@
(set! (-> self control unknown-surface00) *attack-mods*)
(set! (-> self water drip-mult) 4.0)
(set! (-> self neck flex-blend) 0.0)
(none)
)
:exit (behavior ()
(set! (-> self control unknown-dword33) (-> *display* base-frame-counter))
(target-exit)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.05))
@@ -2034,25 +1987,24 @@
(ja :num! (seek! max (-> self control unknown-surface01 align-speed)))
)
(go target-stance)
(none)
)
:post target-post
)
(defstate target-running-attack (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touched)
(cond
(((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(-> self control)
(the-as uint 224)
)
(let ((gp-1 (target-send-attack
proc
(the-as uint (-> self control unknown-symbol30))
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(-> self control unknown-dword50)
(-> self control unknown-dword51)
)
@@ -2091,12 +2043,12 @@
)
)
(else
(target-dangerous-event-handler proc arg1 event-type event)
(target-dangerous-event-handler proc argc message block)
)
)
)
(else
(target-dangerous-event-handler proc arg1 event-type event)
(target-dangerous-event-handler proc argc message block)
)
)
)
@@ -2120,7 +2072,6 @@
(if (or (< (fabs (-> self control unknown-float62)) 0.3) (< 0.3 (fabs (-> self control unknown-float61))))
(set! (-> self control unknown-float81) 1.0)
)
(none)
)
:exit (behavior ()
(set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max))
@@ -2129,7 +2080,6 @@
(set! (-> *run-attack-mods* turnvv) 0.0)
(set! (-> self control unknown-dword31) (-> *display* base-frame-counter))
(target-exit)
(none)
)
:trans (behavior ()
(when (!= (-> self state-time) (-> *display* base-frame-counter))
@@ -2216,7 +2166,6 @@
)
)
)
(none)
)
:code (behavior ()
(if (logtest? (-> self water flags) (water-flags wt09))
@@ -2313,21 +2262,20 @@
(go target-falling #f)
)
(go target-stance)
(none)
)
:post target-post
)
(defstate target-attack-air (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(let ((v0-0 (target-bonk-event-handler proc arg1 event-type event)))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(let ((v0-0 (target-bonk-event-handler proc argc message block)))
(cond
(v0-0
(empty)
v0-0
)
(else
(target-dangerous-event-handler proc arg1 event-type event)
(target-dangerous-event-handler proc argc message block)
)
)
)
@@ -2397,13 +2345,11 @@
)
(set! (-> self control dynam gravity-length) 122880.0)
(set! (-> self control unknown-vector52 quad) (-> self control trans quad))
(none)
)
:exit (behavior ()
(set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max))
(set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length))
((-> target-attack exit))
(none)
)
:trans (behavior ()
(when (logtest? (-> self control status) (cshape-moving-flags onsurf))
@@ -2442,7 +2388,6 @@
(game-task none)
)
)
(none)
)
:code (behavior ((arg0 symbol))
(ja-channel-push! 1 (seconds 0.075))
@@ -2504,7 +2449,6 @@
)
)
(go target-falling #f)
(none)
)
:post target-post
)
@@ -2516,7 +2460,6 @@
(target-start-attack)
(target-danger-set! 'uppercut #f)
(set! (-> self control unknown-surface00) *turn-around-mods*)
(none)
)
:exit target-exit
:code (behavior ((arg0 float) (arg1 float))
@@ -2535,7 +2478,6 @@
(ja :num! (seek! (ja-aframe (the-as float 7.0) 0)))
)
(go target-attack-uppercut-jump arg0 arg1)
(none)
)
:post target-post
)
@@ -2554,7 +2496,6 @@
(set! (-> self control unknown-surface00) *uppercut-jump-mods*)
(target-start-attack)
(target-danger-set! 'uppercut #f)
(none)
)
:exit target-exit
:trans (behavior ()
@@ -2605,7 +2546,6 @@
(target-danger-set! 'harmless #f)
)
(slide-down-test)
(none)
)
:code (behavior ((arg0 float) (arg1 float))
(compute-alignment! (-> self align))
@@ -2633,20 +2573,19 @@
)
)
(go target-falling #f)
(none)
)
:post target-post
)
(defstate target-flop (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(let ((v0-0 (target-bonk-event-handler proc arg1 event-type event)))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(let ((v0-0 (target-bonk-event-handler proc argc message block)))
(cond
(v0-0
(empty)
v0-0
)
((let ((v1-0 event-type))
((let ((v1-0 message))
(= v1-0 'swim)
)
(cond
@@ -2668,7 +2607,7 @@
)
)
(else
(target-dangerous-event-handler proc arg1 event-type event)
(target-dangerous-event-handler proc argc message block)
)
)
)
@@ -2705,14 +2644,12 @@
)
)
)
(none)
)
:exit (behavior ()
(target-danger-set! 'harmless #f)
(set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max))
(set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length))
(set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad))
(none)
)
:trans (behavior ()
(delete-back-vel)
@@ -2727,7 +2664,7 @@
)
(and (logtest? (-> self control status) (cshape-moving-flags twall)) (< 0.7 (-> self control poly-angle)))
)
(zero? (logand (-> self control status) (cshape-moving-flags t-act)))
(not (logtest? (-> self control status) (cshape-moving-flags t-act)))
(>= (-> self control unknown-uint20) (the-as uint 2))
)
(set! (-> self control unknown-dword36) (-> *display* base-frame-counter))
@@ -2781,7 +2718,6 @@
(target-start-attack)
(target-danger-set! 'flop #f)
)
(none)
)
:code (behavior ((arg0 float) (arg1 float) (arg2 float))
(ja-channel-set! 2)
@@ -2881,19 +2817,18 @@
(suspend)
)
)
(none)
)
:post target-post
)
(defstate target-flop-hit-ground (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('swim)
#f
)
(else
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
)
)
@@ -2916,7 +2851,6 @@
(set! (-> self control unknown-surface00) *flop-land-mods*)
(logclear! (-> *flop-land-mods* flags) (surface-flags allow-edge-grab))
(logior! (-> self state-flags) (state-flags flop-hit-ground))
(none)
)
:exit target-exit
:trans (behavior ()
@@ -2949,22 +2883,20 @@
)
)
(slide-down-test)
(none)
)
:code (behavior ((arg0 symbol))
(target-hit-ground-anim arg0)
(go target-falling #f)
(none)
)
:post target-post
)
(defstate target-wheel (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(if (= event-type 'touched)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(if (= message 'touched)
(send-event proc 'roll)
)
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -2981,7 +2913,6 @@
(set! (-> self control unknown-uint20) (the-as uint 0))
(set! (-> self control unknown-int21) 0)
0
(none)
)
:exit (behavior ()
(when (!= (-> self next-state name) 'target-wheel)
@@ -2989,7 +2920,6 @@
(set! (-> self control unknown-dword30) (-> *display* base-frame-counter))
)
(target-exit)
(none)
)
:code (behavior ()
(let ((gp-0 0))
@@ -3076,7 +3006,6 @@
)
)
(go target-duck-stance)
(none)
)
:post target-post
)
@@ -3085,7 +3014,6 @@
:event target-standard-event-handler
:enter (behavior ((arg0 float) (arg1 float))
(set! (-> self control unknown-surface00) *wheel-flip-mods*)
(none)
)
:exit target-exit
:trans (behavior ()
@@ -3107,7 +3035,6 @@
)
(go target-attack-air #f)
)
(none)
)
:code (behavior ((arg0 float) (arg1 float))
(ja-channel-push! 1 (seconds 0.04))
@@ -3208,7 +3135,6 @@
(go target-hit-ground #f)
(go target-stance)
)
(none)
)
:post target-post
)
+48 -130
View File
@@ -12,14 +12,14 @@
;; DECOMP BEGINS
(defstate target-load-wait (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('loading)
(set! (-> self state-time) (-> *display* base-frame-counter))
#f
)
(else
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
)
)
@@ -57,19 +57,18 @@
)
)
(go target-stance)
(none)
)
:post target-no-stick-post
)
(defstate target-stance-ambient (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('movie)
(go target-stance)
)
(else
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
)
)
@@ -101,7 +100,6 @@
)
)
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:exit (behavior ()
(let ((a0-0 (-> self control unknown-spoolanim00)))
@@ -113,7 +111,6 @@
)
((-> target-stance exit))
(target-exit)
(none)
)
:trans (behavior ()
(spool-push *art-control* (-> self control unknown-spoolanim00 name) 0 self (the-as float -99.0))
@@ -122,7 +119,6 @@
)
(go target-stance)
)
(none)
)
:code (behavior ()
(while (let ((v1-13 (file-status *art-control* (-> self control unknown-spoolanim00 name) 0)))
@@ -141,7 +137,6 @@
)
(set! (-> self control unknown-uint20) (the-as uint #f))
(go target-stance)
(none)
)
:post target-post
)
@@ -277,8 +272,8 @@
)
(defstate hud-waiting (first-person-hud)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('go-away)
(go hud-going-out)
)
@@ -286,7 +281,6 @@
)
:enter (behavior ()
(disable-hud (the-as int (-> *hud-parts* power)))
(none)
)
:code (behavior ()
(loop
@@ -300,7 +294,6 @@
(go hud-coming-in)
(suspend)
)
(none)
)
)
@@ -314,11 +307,9 @@
)
(suspend)
)
(none)
)
:post (behavior ()
(dumb-15 self)
(none)
)
)
@@ -335,7 +326,6 @@
)
(suspend)
)
(none)
)
)
@@ -348,11 +338,9 @@
)
(suspend)
)
(none)
)
:post (behavior ()
(dumb-15 self)
(none)
)
)
@@ -445,27 +433,26 @@
(set! (-> self state) v1-8)
)
((the-as (function none :behavior target) (-> target-stance code)))
(none)
)
:post target-post
)
(defstate target-look-around (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(cond
((and (= event-type 'query) (= (-> event param 0) 'mode))
((and (= message 'query) (= (-> block param 0) 'mode))
(-> self state name)
)
((let ((v1-4 event-type))
((let ((v1-4 message))
(= v1-4 'end-mode)
)
(go target-stance-look-around)
)
((-> self control unknown-symbol30)
(target-dangerous-event-handler proc arg1 event-type event)
(target-dangerous-event-handler proc argc message block)
)
(else
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
)
)
@@ -484,7 +471,6 @@
(set! (-> self fp-hud)
(ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800)))
)
(none)
)
:exit (behavior ()
(let ((a0-1 (handle->process (-> self fp-hud))))
@@ -500,7 +486,6 @@
(send-event *camera* 'clear-entity)
(camera-change-to (the-as string 'base) 60 #f)
)
(none)
)
:trans (behavior ()
(local-vars (sv-48 vector))
@@ -585,7 +570,6 @@
)
(set! (-> self cam-user-mode) 'normal)
)
(none)
)
)
:code (behavior ()
@@ -605,24 +589,23 @@
)
(suspend)
)
(none)
)
:post target-no-move-post
)
(defstate target-billy-game (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(cond
((and (= event-type 'query) (= (-> event param 0) 'mode))
((and (= message 'query) (= (-> block param 0) 'mode))
(-> self state name)
)
((let ((v1-4 event-type))
((let ((v1-4 message))
(= v1-4 'end-mode)
)
(go target-stance)
)
(else
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
)
)
@@ -642,7 +625,6 @@
(set! (-> self fp-hud)
(ppointer->handle (process-spawn first-person-hud :to *dproc* :stack (&+ *fp-hud-stack* #x3800)))
)
(none)
)
:exit (behavior ()
(let ((a0-1 (handle->process (-> self fp-hud))))
@@ -656,7 +638,6 @@
(camera-change-to (the-as string 'base) 0 #f)
)
(target-exit)
(none)
)
:trans (behavior ()
(local-vars (sv-48 vector))
@@ -730,51 +711,49 @@
)
(set! (-> self control unknown-dword82) (-> *display* base-frame-counter))
)
(none)
)
)
:code (behavior ()
(ja-channel-set! 0)
(set! (-> self control transv quad) (the-as uint128 0))
(anim-loop)
(none)
)
:post target-no-move-post
)
(defstate target-grab (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(cond
((and (= event-type 'query) (= (-> event param 0) 'mode))
((and (= message 'query) (= (-> block param 0) 'mode))
(-> self state name)
)
(else
(case event-type
(case message
(('end-mode)
(go target-stance)
)
(('play-anim)
(let ((v0-0 (the-as object (-> event param 0))))
(let ((v0-0 (the-as object (-> block param 0))))
(set! (-> self control unknown-uint20) (the-as uint v0-0))
v0-0
)
)
(('clone-anim)
(go target-clone-anim (process->handle (the-as process (-> event param 0))))
(go target-clone-anim (process->handle (the-as process (-> block param 0))))
)
(('change-mode)
(case (-> event param 0)
(case (-> block param 0)
(('final-door)
(go
target-final-door
(the-as basic (process->handle (the-as process (-> event param 1))))
(process->handle (the-as process (-> event param 2)))
(the-as basic (process->handle (the-as process (-> block param 1))))
(process->handle (the-as process (-> block param 2)))
)
)
)
)
(else
(target-generic-event-handler proc arg1 event-type event)
(target-generic-event-handler proc argc message block)
)
)
)
@@ -785,12 +764,10 @@
(set! (-> self neck flex-blend) 0.0)
(logior! (-> self state-flags) (state-flags invulnerable grabbed))
(set! (-> self control unknown-uint20) (the-as uint 'stance))
(none)
)
:exit (behavior ()
(logclear! (-> self state-flags) (state-flags invulnerable))
(target-exit)
(none)
)
:code (behavior ()
(set-forward-vel (the-as float 0.0))
@@ -900,22 +877,20 @@
)
(label cfg-94)
)
(none)
)
:post (behavior ()
(if (logtest? (-> self control status) (cshape-moving-flags onsurf))
(set! (-> self control transv quad) (the-as uint128 0))
)
(target-no-stick-post)
(none)
)
)
(defstate target-pole-cycle (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(if (and (= event-type 'query) (= (-> event param 0) 'mode))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(if (and (= message 'query) (= (-> block param 0) 'mode))
(-> self state name)
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
)
:enter (behavior ((arg0 handle))
@@ -928,13 +903,11 @@
(set! (-> self control transv quad) (the-as uint128 0))
(send-event *camera* 'ease-in)
(set! (-> self control unknown-int21) (the-as int #f))
(none)
)
:exit (behavior ()
(target-collide-set! 'normal (the-as float 0.0))
(logclear! (-> self control root-prim prim-core action) (collide-action swingpole-active))
(set! (-> self control unknown-handle10) (the-as handle #f))
(none)
)
:trans (behavior ()
(when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0)
@@ -980,7 +953,6 @@
)
)
)
(none)
)
:code (behavior ((arg0 handle))
(target-compute-pole)
@@ -1025,7 +997,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post target-no-move-post
)
@@ -1044,7 +1015,6 @@
)
(set-forward-vel arg2)
(go target-pole-flip-up-jump (the-as float arg0) (the-as float arg1))
(none)
)
:post target-no-move-post
)
@@ -1056,7 +1026,6 @@
:trans (behavior ()
((-> target-jump-forward trans))
(vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100))
(none)
)
:code (behavior ((arg0 float) (arg1 float))
(sound-play "jump")
@@ -1078,7 +1047,6 @@
(suspend)
(ja :group! eichar-jump-loop-ja :num! (loop!))
)
(none)
)
:post target-post
)
@@ -1097,7 +1065,6 @@
)
(set-forward-vel arg2)
(go target-pole-flip-forward-jump arg0 arg1)
(none)
)
:post target-no-move-post
)
@@ -1107,13 +1074,11 @@
:enter (behavior ((arg0 float) (arg1 float))
((-> target-jump enter) arg0 arg1 (the-as surface #f))
(set! (-> self control unknown-surface00) *forward-pole-jump-mods*)
(none)
)
:exit target-exit
:trans (behavior ()
((-> target-jump-forward trans))
(vector-flatten! (-> self control transv) (-> self control transv) (-> self control unknown-vector100))
(none)
)
:code (behavior ((arg0 float) (arg1 float))
(sound-play "jump")
@@ -1122,19 +1087,18 @@
(ja :num! (seek!))
)
((the-as (function none :behavior target) (-> target-pole-flip-up-jump code)))
(none)
)
:post target-post
)
(defstate target-edge-grab (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('end-mode)
(go target-falling 'target-edge-grab)
)
(else
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
)
)
@@ -1146,14 +1110,12 @@
(set! (-> self control unknown-vector102 quad) (-> self control transv quad))
(set! (-> self control transv quad) (the-as uint128 0))
(send-event *camera* 'ease-in)
(none)
)
:exit (behavior ()
(when (logtest? (-> self control root-prim prim-core action) (collide-action edgegrab-cam))
(logclear! (-> self control root-prim prim-core action) (collide-action edgegrab-active edgegrab-cam))
(send-event *camera* 'damp-up)
)
(none)
)
:trans (behavior ()
(when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.2))
@@ -1193,7 +1155,6 @@
)
)
)
(none)
)
:code (behavior ()
(target-compute-edge)
@@ -1241,19 +1202,18 @@
(ja :num! (seek!))
)
)
(none)
)
:post target-no-move-post
)
(defstate target-edge-grab-jump (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('end-mode)
(go target-falling 'target-edge-grab)
)
(else
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
)
)
@@ -1281,7 +1241,6 @@
(set-forward-vel (the-as float 16384.0))
(send-event *camera* 'damp-up)
(go target-jump-forward arg0 arg1)
(none)
)
:post target-no-move-post
)
@@ -1317,7 +1276,6 @@
(+! (-> self control transv z) (-> self control rider-last-move z))
)
(go target-falling 'target-edge-grab)
(none)
)
:post target-no-move-post
)
@@ -1352,14 +1310,12 @@
)
)
)
(none)
)
:exit (behavior ()
(set! (-> *run-attack-mods* turnv) 0.0)
(set! (-> *run-attack-mods* turnvv) 0.0)
(set! (-> self control unknown-dword31) (-> *display* base-frame-counter))
(target-exit)
(none)
)
:code (behavior ()
(let ((gp-0 (the-as handle #f)))
@@ -1442,7 +1398,6 @@
(go target-stance)
(go target-falling #f)
)
(none)
)
:post target-post
)
@@ -1491,13 +1446,11 @@
)
)
)
(none)
)
:exit (behavior ()
(rot->dir-targ! (-> self control))
(set! (-> self control unknown-dword31) (-> *display* base-frame-counter))
(target-exit)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.075))
@@ -1559,7 +1512,6 @@
(go target-stance)
(go target-falling #f)
)
(none)
)
:post target-no-stick-post
)
@@ -1569,7 +1521,6 @@
:exit target-exit
:trans (behavior ()
(slide-down-test)
(none)
)
:code (behavior ((arg0 object) (arg1 float))
(set! (-> self neck flex-blend) 0.0)
@@ -1641,7 +1592,6 @@
)
)
(go target-falling 'target-eco-powerup)
(none)
)
:post target-post
)
@@ -1652,7 +1602,6 @@
(set! (-> self state-time) (-> *display* base-frame-counter))
(set! (-> self control unknown-surface00) *wade-mods*)
(set-zero! (-> self water bob))
(none)
)
:exit (behavior ()
(target-state-hook-exit)
@@ -1661,7 +1610,6 @@
(set! (-> v1-1 channel-offset) 0)
)
0
(none)
)
:trans (behavior ()
((-> self state-hook))
@@ -1698,7 +1646,6 @@
(if (can-hands? #t)
(go target-running-attack)
)
(none)
)
:code (-> target-stance code)
:post target-post
@@ -1743,7 +1690,6 @@
(if (can-hands? #t)
(go target-running-attack)
)
(none)
)
:code (behavior ()
(let ((gp-0 105)
@@ -1917,7 +1863,6 @@
(suspend)
)
)
(none)
)
:post target-post
)
@@ -1962,7 +1907,6 @@
(set! (-> self state-time) (-> *display* base-frame-counter))
(set! (-> self control unknown-surface00) *swim-mods*)
(logior! (-> self water flags) (water-flags wt04))
(none)
)
:exit (behavior ()
(target-state-hook-exit)
@@ -1977,7 +1921,6 @@
(quaternion-identity! (-> self control unknown-quaternion01))
(set! (-> self control unknown-float00) 0.0)
)
(none)
)
:trans (behavior ()
((-> self state-hook))
@@ -2029,7 +1972,6 @@
(go target-swim-walk)
)
(target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0))
(none)
)
:code (behavior ()
(let ((v1-2 (ja-group)))
@@ -2080,7 +2022,6 @@
)
)
)
(none)
)
:post target-swim-post
)
@@ -2091,7 +2032,6 @@
((-> target-swim-stance enter))
(die-on-next-update! (-> self water bob))
(set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter)))
(none)
)
:exit (-> target-swim-stance exit)
:trans (behavior ()
@@ -2145,7 +2085,6 @@
)
)
(target-swim-tilt (the-as float 0.0) (the-as float 2.0) (the-as float 0.0) (the-as float 1.0))
(none)
)
:code (behavior ()
(let ((v1-2 (ja-group)))
@@ -2185,16 +2124,15 @@
(ja :num! (seek!))
)
)
(none)
)
:post target-swim-post
)
(defstate target-swim-down (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack 'attack-invinc)
(let ((v1-2 (the-as attack-info (-> event param 1))))
(let ((v1-2 (the-as attack-info (-> block param 1))))
(when (or (not (logtest? (-> v1-2 mask) (attack-mask mode))) (= (-> v1-2 mode) 'generic) (= (-> v1-2 mode) 'drown))
(set! (-> v1-2 mode) 'damage)
(if (and (= (-> self game mode) 'play) (>= 1.0 (-> self fact-info-target health)))
@@ -2206,7 +2144,7 @@
)
)
)
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -2219,7 +2157,6 @@
(if (= (-> self next-state name) 'target-swim-down)
(set! (-> self control unknown-float130) 0.0)
)
(none)
)
:exit (behavior ()
(set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max))
@@ -2234,7 +2171,6 @@
(quaternion-identity! (-> self control unknown-quaternion01))
(set! (-> self control unknown-float00) 0.0)
)
(none)
)
:trans (behavior ()
(if (>= (- (-> *display* base-frame-counter) (-> self water swim-time)) (seconds 0.5))
@@ -2254,7 +2190,6 @@
)
)
)
(none)
)
:code (behavior ()
(let ((gp-0 60)
@@ -2354,7 +2289,6 @@
)
)
)
(none)
)
:post target-swim-post
)
@@ -2381,7 +2315,6 @@
(send-event self 'attack #f (static-attack-info ((mode 'drown-death))))
)
((-> target-swim-down trans))
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.1))
@@ -2454,7 +2387,6 @@
(start-bobbing! (-> self water) (the-as float -4096.0) 600 1500)
(set! (-> self water bob start-time) (+ (-> *display* base-frame-counter) (seconds -0.05)))
(go target-swim-stance)
(none)
)
:post target-swim-post
)
@@ -2474,7 +2406,6 @@
)
)
((-> target-jump trans))
(none)
)
:code (-> target-jump code)
:post target-post
@@ -2488,7 +2419,6 @@
(die-on-next-update! (-> self water bob))
(set! (-> self water align-offset) 0.0)
(logior! (-> self water flags) (water-flags wt16))
(none)
)
:code (behavior ((arg0 float) (arg1 float))
(die-on-next-update! (-> self water bob))
@@ -2523,7 +2453,6 @@
)
(go target-swim-jump-jump (+ f30-0 arg0) (+ f30-0 arg1) (the-as surface #f))
)
(none)
)
:post target-swim-post
)
@@ -2535,7 +2464,6 @@
(set! (-> self control unknown-dword33) 0)
(set-forward-vel (the-as float 0.0))
(set! (-> self control unknown-surface00) *walk-mods*)
(none)
)
:code (behavior ((arg0 float))
(when (!= arg0 0.0)
@@ -2577,16 +2505,15 @@
(go target-stance)
)
)
(none)
)
:post target-no-stick-post
)
(defstate target-launch (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(if (and (= event-type 'query) (= (-> event param 0) 'mode))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(if (and (= message 'query) (= (-> block param 0) 'mode))
'target-launch
(target-standard-event-handler proc arg1 event-type event)
(target-standard-event-handler proc argc message block)
)
)
:code (behavior ((arg0 float) (arg1 symbol) (arg2 vector) (arg3 int))
@@ -2673,14 +2600,13 @@
;; PAL patch (sound plays elsewhere)
;(sound-play "launch-fire")
(go target-high-jump arg0 arg0 'launch)
(none)
)
:post target-no-stick-post
)
(defstate target-periscope (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('change-mode)
#f
)
@@ -2691,7 +2617,7 @@
)
)
(else
(target-generic-event-handler proc arg1 event-type event)
(target-generic-event-handler proc argc message block)
)
)
)
@@ -2700,7 +2626,6 @@
(set! (-> self cam-user-mode) 'normal)
;; og:preserve-this PAL patch here
(logclear! (-> self state-flags) (state-flags invulnerable grabbed))
(none)
)
:code (behavior ((arg0 handle))
(set! (-> self neck flex-blend) 0.0)
@@ -2733,7 +2658,6 @@
(ja :num! (seek! 0.0 2.0))
)
(go target-stance)
(none)
)
:post target-no-stick-post
)
@@ -2751,12 +2675,10 @@
)
(logior! (-> self state-flags) (state-flags grabbed))
(set! (-> self neck flex-blend) 0.0)
(none)
)
:exit (behavior ()
(send-event (handle->process (-> self control unknown-handle10)) 'end-mode)
(target-exit)
(none)
)
:code (behavior ((arg0 string) (arg1 handle))
(let ((gp-0 (the-as art-joint-anim (lookup-art (-> self draw art-group) arg0 art-joint-anim))))
@@ -2772,17 +2694,16 @@
)
)
(go target-stance)
(none)
)
:post target-no-stick-post
)
(defstate target-clone-anim (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(if (and (= event-type 'trans) (= (-> event param 0) 'restore))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(if (and (= message 'trans) (= (-> block param 0) 'restore))
(set! (-> self control unknown-uint20) (the-as uint #f))
)
((-> target-grab event) proc arg1 event-type event)
((-> target-grab event) proc argc message block)
)
:enter (behavior ((arg0 handle))
(set! (-> self control unknown-handle10) arg0)
@@ -2793,7 +2714,6 @@
(vector-reset! (-> self control transv))
(set! (-> self neck flex-blend) 0.0)
(send-event (ppointer->process (-> self sidekick)) 'shadow #t)
(none)
)
:exit (behavior ()
(send-event (ppointer->process (-> self sidekick)) 'matrix 'normal)
@@ -2838,12 +2758,10 @@
(ja-channel-set! 0)
(ja-post)
(target-exit)
(none)
)
:code (behavior ((arg0 handle))
(clone-anim arg0 (the-as int (-> self draw origin-joint-index)) #t "")
(go target-stance)
(none)
)
:post target-no-ja-move-post
)
+4 -19
View File
@@ -220,9 +220,9 @@
)
(defstate hud-hidden (hud)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-0 object))
(case arg2
(case message
(('show)
(if (and (not *progress-process*) (!= (-> self last-hide-time) (-> *display* base-frame-counter)))
(go hud-arriving)
@@ -273,32 +273,28 @@
(kill-and-free-particles (-> self particles gp-1 part))
(set! (-> self particles gp-1 part matrix) -1)
)
(none)
)
:exit (behavior ()
(set! (-> self y-offset) (-> self next-y-offset))
(none)
)
:code (behavior ()
(logior! (-> self mask) (process-mask sleep-code))
(loop
(suspend)
)
(none)
)
:post (behavior ()
(if (-> self deactivate-when-hidden)
(deactivate self)
)
(hud-update self)
(none)
)
)
(defstate hud-arriving (hud)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-3 object))
(case arg2
(case message
(('hide-quick)
(set! (-> self last-hide-time) (-> *display* base-frame-counter))
(set! (-> self force-on-screen) #f)
@@ -351,7 +347,6 @@
(set! (-> self particles gp-1 part matrix) (sprite-allocate-user-hvdf))
)
)
(none)
)
:code (behavior ()
(loop
@@ -373,13 +368,11 @@
)
(suspend)
)
(none)
)
:post (behavior ()
(hud-update self)
(draw-particles self)
(draw-hud self)
(none)
)
)
@@ -402,7 +395,6 @@
(go hud-hidden)
)
(go hud-leaving 5)
(none)
)
:post (-> hud-arriving post)
)
@@ -429,7 +421,6 @@
)
(suspend)
)
(none)
)
:post (-> hud-arriving post)
)
@@ -472,7 +463,6 @@
(fuel-cell-animate)
)
)
(none)
)
:code (behavior ((arg0 handle))
(let ((s5-0 (new 'stack-no-clear 'vector)))
@@ -521,11 +511,6 @@
)
)
)
(none)
)
:post ja-post
)
+94 -105
View File
@@ -874,8 +874,8 @@
)
(defstate progress-waiting (progress)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('go-away)
(go progress-gone)
)
@@ -895,7 +895,6 @@
)
(suspend)
)
(none)
)
)
@@ -906,7 +905,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
(none)
)
)
@@ -1716,99 +1714,98 @@
)
(defstate progress-normal (progress)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-0 object))
(the-as object (case event-type
(('go-away)
(go progress-going-out)
)
(('notify)
(cond
((= (-> event param 0) 'done)
(case (-> self display-state)
(((progress-screen memcard-saving))
(cond
((= (-> self display-state-stack 0) (progress-screen title))
(let ((gp-1 (-> *setting-control* default auto-save)))
(sound-volume-off)
(set! (-> *game-info* mode) 'play)
(cond
;; Start a new game differently if speedrunning mode is active
((= (-> *pc-settings* speedrunner-mode?) #t)
(speedrun-start-full-game-run))
;; start the game normally
(else
(initialize! *game-info* 'game (the-as game-save #f) "intro-start")
(set! (-> *setting-control* default auto-save) gp-1)))
)
(the-as object (set-master-mode 'game))
)
(else
(set! v0-0 -1)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
)
)
(((progress-screen memcard-formatting))
(set! (-> self force-transition) #t)
(set! v0-0 15)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(((progress-screen memcard-creating))
(cond
((= (-> self display-state-stack 0) (progress-screen title))
(set! v0-0 18)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
)
(else
(set! v0-0 17)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
)
)
v0-0
)
)
)
((= (-> event param 0) 'error)
(format #t "ERROR NOTIFY: ~S ~D~%" (enum->string mc-status-code (-> event param 1)) (-> self display-state))
(case (-> event param 1)
((14)
(set! v0-0 7)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(else
(case (-> self display-state)
(((progress-screen memcard-formatting))
(set! v0-0 24)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(((progress-screen memcard-creating))
(set! v0-0 25)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(((progress-screen memcard-saving))
(set! v0-0 21)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(((progress-screen memcard-loading))
(set! v0-0 20)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
)
)
)
)
)
)
)
(case message
(('go-away)
(go progress-going-out)
)
(('notify)
(cond
((= (-> block param 0) 'done)
(case (-> self display-state)
(((progress-screen memcard-saving))
(cond
((= (-> self display-state-stack 0) (progress-screen title))
(let ((gp-1 (-> *setting-control* default auto-save)))
(sound-volume-off)
(set! (-> *game-info* mode) 'play)
(cond
;; Start a new game differently if speedrunning mode is active
((= (-> *pc-settings* speedrunner-mode?) #t)
(speedrun-start-full-game-run))
;; start the game normally
(else
(initialize! *game-info* 'game (the-as game-save #f) "intro-start")
(set! (-> *setting-control* default auto-save) gp-1)))
)
(set-master-mode 'game)
)
(else
(set! v0-0 -1)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
)
)
(((progress-screen memcard-formatting))
(set! (-> self force-transition) #t)
(set! v0-0 15)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(((progress-screen memcard-creating))
(cond
((= (-> self display-state-stack 0) (progress-screen title))
(set! v0-0 18)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
)
(else
(set! v0-0 17)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
)
)
v0-0
)
)
)
((= (-> block param 0) 'error)
(format #t "ERROR NOTIFY: ~S ~D~%" (enum->string mc-status-code (-> block param 1)) (-> self display-state))
(case (-> block param 1)
((14)
(set! v0-0 7)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(else
(case (-> self display-state)
(((progress-screen memcard-formatting))
(set! v0-0 24)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(((progress-screen memcard-creating))
(set! v0-0 25)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(((progress-screen memcard-saving))
(set! v0-0 21)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
(((progress-screen memcard-loading))
(set! v0-0 20)
(set! (-> self next-display-state) (the-as progress-screen v0-0))
v0-0
)
)
)
)
)
)
)
)
)
:code (behavior ()
(loop
@@ -1951,7 +1948,6 @@
)
(suspend)
)
(none)
)
:post (behavior ()
(let* ((a1-0 (-> self display-level-index))
@@ -2119,7 +2115,6 @@
)
(adjust-sprites self)
(adjust-icons self)
(none)
)
)
@@ -2133,7 +2128,6 @@
(sound-play "select-menu")
(set-blackout-frames 0)
(set! *pause-lock* #f)
(none)
)
:code (behavior ()
(loop
@@ -2151,7 +2145,6 @@
)
(suspend)
)
(none)
)
:post (-> progress-normal post)
)
@@ -2167,7 +2160,6 @@
(set! (-> self transition-speed) 30.0)
)
)
(none)
)
:code (behavior ()
(loop
@@ -2185,14 +2177,13 @@
)
(suspend)
)
(none)
)
:post (-> progress-normal post)
)
(defstate progress-debug (progress)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('go-away)
(go progress-going-out)
)
@@ -2244,7 +2235,6 @@
(load-game-text-info (-> *text-group-names* (-> self current-debug-group)) '*common-text* *common-text-heap*)
(suspend)
)
(none)
)
:post (behavior ()
(let* ((s5-0 (-> *display* frames (-> *display* on-screen) frame global-buf))
@@ -2393,6 +2383,5 @@
(draw-debug-text-box gp-4)
(print-game-text (-> *common-text* data (-> self current-debug-string) text) gp-4 #f 128 22)
)
(none)
)
)
+5 -5
View File
@@ -396,10 +396,10 @@
;; A protect frame is a frame which has a cleanup function called on exit.
(deftype protect-frame (stack-frame)
((exit (function none) :offset-assert 12)) ;; function to call to clean up
((exit (function object) :offset-assert 12)) ;; function to call to clean up
(:methods
(new (symbol type (function none)) protect-frame)
(new (symbol type (function object)) protect-frame)
)
:size-assert 16
:method-count-assert 9
@@ -495,16 +495,16 @@
;; so if you abort out of a process, it cleans up the state too.
(deftype state (protect-frame)
((code function :offset-assert 16)
(trans (function none) :offset-assert 20)
(trans (function object) :offset-assert 20)
(post function :offset-assert 24)
(enter function :offset-assert 28)
(event (function process int symbol event-message-block object) :offset-assert 32)
)
(:methods
(new (symbol type symbol function
(function none)
(function object)
function
(function none)
(function object)
(function process int symbol event-message-block object)) _type_ 0)
)
:method-count-assert 9
+17 -1
View File
@@ -550,6 +550,22 @@
)
)
(defmacro abandon-thread ()
;; abandon this one too.
;; NOTE - this is different from GOAL.
;; GOAL installs this as the return address for this function and returns normally.
;; but we don't because I don't have an easy way to find where to stick this.
;; I can't see how this makes a difference, as all non-main threads seem
;; temporary, but if this turns out to be false, we will need to change this.
`(rlet ((temp)
(off :reg r15 :type uint :reset-here #t))
(.mov temp return-from-thread) ;; could probably just call this...
(.add temp off)
(.push temp)
(.ret)
)
)
(defun reset-and-call ((obj thread) (func function))
"Make the given thread the top thread, reset the stack, and call the function.
Sets up a return trampoline so when the function returns it will return to the
@@ -2034,7 +2050,7 @@
(break)
)
(defmethod new protect-frame ((allocation symbol) (type-to-make type) (func (function none)))
(defmethod new protect-frame ((allocation symbol) (type-to-make type) (func (function object)))
(let ((obj (the protect-frame (&+ allocation *gtype-basic-offset*))))
(set! (-> obj type) type-to-make)
(set! (-> obj name) 'protect-frame)
+2 -2
View File
@@ -262,9 +262,9 @@ It type checks the arguments for the entry function.
(type-to-make type)
(name symbol)
(code function)
(trans (function none))
(trans (function object))
(enter function)
(exit (function none))
(exit (function object))
(event (function process int symbol event-message-block object)))
"Allocate a new state. It seems like this isn't really used much and most states are
statically allocated and as a result don't have the constructor called."
+35 -60
View File
@@ -9,7 +9,6 @@
;; DECOMP BEGINS
(defskelgroup *beachcam-sg* beachcam beachcam-lod0-jg beachcam-anim-ja
((beachcam-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 60)
@@ -38,7 +37,6 @@
(defstate windmill-one-idle (windmill-one)
:exit (behavior ()
(sound-stop (-> self sound-id))
(none)
)
:trans (behavior ()
(rider-trans)
@@ -47,7 +45,6 @@
(sound-play "gears-rumble" :id (-> self sound-id) :position (the-as symbol t2-0))
)
)
(none)
)
:code (behavior ()
(loop
@@ -57,7 +54,6 @@
(ja :num! (seek! max 0.5))
)
)
(none)
)
:post (the-as (function none :behavior windmill-one) rider-post)
)
@@ -207,19 +203,19 @@
)
(defstate grottopole-idle (grottopole)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (= (-> proc type) target)
(case event-type
(case message
(('attack)
(let ((v1-2 (-> event param 2)))
(let ((v1-2 (-> block param 2)))
(when (!= v1-2 (-> self incomming-attack-id))
(set! (-> self incomming-attack-id) v1-2)
(case (-> event param 1)
(case (-> block param 1)
(('uppercut)
(when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root-override trans y)))
(< (-> self position) (-> self max-position))
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(the-as collide-shape-moving (-> self root-override))
(the-as uint 2)
)
@@ -234,7 +230,7 @@
(when (and (< (+ -40960.0 (-> self root-override trans y)) (-> *target* control trans y))
(> (-> self position) 0)
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(the-as collide-shape-moving (-> self root-override))
(the-as uint 1)
)
@@ -260,7 +256,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
)
@@ -311,7 +306,6 @@
)
(move-grottopole self 1.0)
(go grottopole-idle)
(none)
)
:post (the-as (function none :behavior grottopole) transform-post)
)
@@ -325,7 +319,6 @@
)
(move-grottopole self -1.0)
(go grottopole-idle)
(none)
)
:post (the-as (function none :behavior grottopole) transform-post)
)
@@ -533,8 +526,8 @@
)
(defstate ecoventrock-idle (ecoventrock)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(sound-play "cannon-shot")
(increment-success-for-hint (text-id sidekick-hint-ecorocks))
@@ -548,7 +541,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
)
@@ -559,7 +551,6 @@
)
:enter (behavior ((arg0 symbol))
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:code (behavior ((arg0 symbol))
(local-vars (sv-128 symbol))
@@ -664,7 +655,6 @@
)
(process-entity-status! self (entity-perm-status dead) #t)
(deactivate self)
(none)
)
)
@@ -719,7 +709,6 @@
(defstate flying-rock-rolling (flying-rock)
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:code (behavior ()
(let ((gp-0 #f)
@@ -793,14 +782,12 @@
(suspend)
)
(go flying-rock-idle)
(none)
)
:post (behavior ()
(if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 3))
(go flying-rock-idle)
)
(ja-post)
(none)
)
)
@@ -815,7 +802,6 @@
(suspend)
)
(deactivate self)
(none)
)
:post (the-as (function none :behavior flying-rock) ja-post)
)
@@ -895,7 +881,6 @@
(pusher-post)
(suspend)
)
(none)
)
)
@@ -903,7 +888,7 @@
(let ((v1-0 arg2))
(quaternion-axis-angle! (the-as quaternion (&-> arg0 link)) 0.0 0.0 1.0 (-> v1-0 angle))
)
(the-as object 0)
0
)
(defmethod init-from-entity! bladeassm ((obj bladeassm) (arg0 entity-actor))
@@ -1018,12 +1003,12 @@
)
(defstate flutflutegg-idle (flutflutegg)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(when (and (= event-type 'attack)
(or (= (-> event param 1) 'punch) (= (-> event param 1) 'spin) (= (-> event param 1) 'spin-air))
(!= (-> self incomming-attack-id) (-> event param 2))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (and (= message 'attack)
(or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air))
(!= (-> self incomming-attack-id) (-> block param 2))
)
(set! (-> self incomming-attack-id) (-> event param 2))
(set! (-> self incomming-attack-id) (-> block param 2))
(flutflutegg-hit-sounds)
(let ((s5-1
(vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans))
@@ -1099,42 +1084,37 @@
)
)
)
(none)
)
:code (behavior ()
(ja-post)
(loop
(suspend)
)
(none)
)
)
(defstate flutflutegg-physics (flutflutegg)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as
object
(when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5))
(= event-type 'attack)
(or (= (-> event param 1) 'punch) (= (-> event param 1) 'spin) (= (-> event param 1) 'spin-air))
(!= (-> self incomming-attack-id) (-> event param 2))
)
(set! (-> self incomming-attack-id) (-> event param 2))
(flutflutegg-hit-sounds)
(let ((s5-1
(vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans))
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.5))
(= message 'attack)
(or (= (-> block param 1) 'punch) (= (-> block param 1) 'spin) (= (-> block param 1) 'spin-air))
(!= (-> self incomming-attack-id) (-> block param 2))
)
(set! (-> self incomming-attack-id) (-> block param 2))
(flutflutegg-hit-sounds)
(let ((s5-1
(vector-! (new-stack-vector0) (-> (the-as process-drawable proc) root trans) (-> self root-override trans))
)
(set! (-> s5-1 y) 0.0)
(vector-normalize! s5-1 1.0)
(let ((f0-2 (vector-dot s5-1 (-> self dir)))
(f1-2 (- (* (-> s5-1 x) (-> self dir z)) (* (-> s5-1 z) (-> self dir x))))
)
(if (< f0-2 -0.7)
(the-as symbol (flutflutegg-method-20 self 24576.0 (* -8192.0 f1-2) (* -8192.0 f0-2)))
(the-as symbol (flutflutegg-method-20 self 0.0 (* -8192.0 f1-2) (* -8192.0 f0-2)))
)
)
(set! (-> s5-1 y) 0.0)
(vector-normalize! s5-1 1.0)
(let ((f0-2 (vector-dot s5-1 (-> self dir)))
(f1-2 (- (* (-> s5-1 x) (-> self dir z)) (* (-> s5-1 z) (-> self dir x))))
)
(if (< f0-2 -0.7)
(flutflutegg-method-20 self 24576.0 (* -8192.0 f1-2) (* -8192.0 f0-2))
(flutflutegg-method-20 self 0.0 (* -8192.0 f1-2) (* -8192.0 f0-2))
)
)
)
)
@@ -1165,7 +1145,6 @@
(go flutflutegg-physics-fall)
)
)
(none)
)
:post (the-as (function none :behavior flutflutegg) ja-post)
)
@@ -1230,7 +1209,6 @@
(sound-play "sack-land" :vol 200)
(go flutflutegg-break #f)
)
(none)
)
:post (the-as (function none :behavior flutflutegg) ja-post)
)
@@ -1285,7 +1263,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
:post (the-as (function none :behavior flutflutegg) ja-post)
)
@@ -1365,8 +1342,8 @@
)
(defstate harvester-idle (harvester)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('update)
(if (and (-> self alt-actor) (logtest? (-> self alt-actor extra perm status) (entity-perm-status complete)))
(go harvester-inflate #f)
@@ -1384,7 +1361,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
)
@@ -1404,7 +1380,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior harvester) ja-post)
)
-1
View File
@@ -100,7 +100,6 @@
)
(suspend)
)
(none)
)
)
+2 -8
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(defskelgroup *lrocklrg-sg* lrocklrg lrocklrg-lod0-jg lrocklrg-idle-ja
((lrocklrg-lod0-mg (meters 999999)))
:bounds (static-spherem 0 0 0 5)
@@ -272,8 +271,8 @@
(defstate idle (beach-rock)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('trigger)
(set! (-> self trigger) #t)
(go-virtual falling)
@@ -293,7 +292,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
)
@@ -305,7 +303,6 @@
(spool-push *art-control* "lrocklrg-falling" 0 self -1.0)
(suspend)
)
(none)
)
)
@@ -340,7 +337,6 @@
)
(set! (-> self prev-frame) f30-0)
)
(none)
)
:code (behavior ()
(local-vars (v1-3 symbol) (v1-49 symbol))
@@ -397,7 +393,6 @@
)
(set! (-> self draw bounds w) 20480.0)
(go-virtual fallen)
(none)
)
:post (the-as (function none :behavior beach-rock) transform-post)
)
@@ -423,7 +418,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
(none)
)
:post (the-as (function none :behavior beach-rock) ja-post)
)
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype bird-lady-beach (process-taskable)
((flutflut handle :offset-assert 384)
(egg handle :offset-assert 392)
@@ -42,7 +41,6 @@
(go-virtual hidden)
)
((-> (method-of-type process-taskable idle) enter))
(none)
)
)
+3 -19
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(defpartgroup group-lurkercrab-slide
:id 159
:bounds (static-bspherem 0 -12 0 14)
@@ -92,10 +91,9 @@
6144.0
16384.0
)
(the-as object (if (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)))
(do-push-aways! (-> obj collide-info))
)
)
(if (not (logtest? (-> obj nav-enemy-flags) (nav-enemy-flags navenmf8)))
(do-push-aways! (-> obj collide-info))
)
)
(defmethod attack-handler lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block))
@@ -202,7 +200,6 @@ nav-enemy-default-event-handler
)
:exit (behavior ()
(set! (-> self draw force-lod) -1)
(none)
)
:code (behavior ()
(set! (-> self target-speed) 0.0)
@@ -232,7 +229,6 @@ nav-enemy-default-event-handler
(ja :num! (seek! (ja-aframe 1.0 0)))
)
)
(none)
)
)
@@ -270,7 +266,6 @@ nav-enemy-default-event-handler
(lurkercrab-invulnerable)
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))
(logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))
(none)
)
:code (behavior ()
(when (ja-group? lurkercrab-idle-ja)
@@ -331,7 +326,6 @@ nav-enemy-default-event-handler
(ja :num! (seek! (ja-aframe 90.0 0)))
)
)
(none)
)
)
@@ -343,7 +337,6 @@ nav-enemy-default-event-handler
)
:code (behavior ()
(go-virtual nav-enemy-chase)
(none)
)
)
@@ -356,7 +349,6 @@ nav-enemy-default-event-handler
:exit (behavior ()
(lurkercrab-invulnerable)
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags navenmf6))
(none)
)
:trans (behavior ()
(if (logtest? (-> *target* state-flags)
@@ -367,7 +359,6 @@ nav-enemy-default-event-handler
(if (< (ja-aframe-num 0) 2.0)
((-> (method-of-type nav-enemy nav-enemy-chase) trans))
)
(none)
)
:code (behavior ()
(logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-rotate))
@@ -418,7 +409,6 @@ nav-enemy-default-event-handler
(ja :num! (seek!))
)
)
(none)
)
)
@@ -430,7 +420,6 @@ nav-enemy-default-event-handler
)
:code (behavior ()
(go-virtual nav-enemy-patrol)
(none)
)
)
@@ -442,7 +431,6 @@ nav-enemy-default-event-handler
)
:code (behavior ()
(go-virtual nav-enemy-patrol)
(none)
)
)
@@ -461,7 +449,6 @@ nav-enemy-default-event-handler
(suspend)
)
(go-virtual nav-enemy-patrol)
(none)
)
)
@@ -472,7 +459,6 @@ nav-enemy-default-event-handler
)
:exit (behavior ()
(set! (-> self orient) #t)
(none)
)
:code (behavior ()
(set! (-> self momentum-speed) 57344.0)
@@ -494,7 +480,6 @@ nav-enemy-default-event-handler
)
)
(go-virtual nav-enemy-chase)
(none)
)
:post (behavior ()
(let ((a0-0 (-> self part))
@@ -503,7 +488,6 @@ nav-enemy-default-event-handler
(spawn a0-0 (the-as vector a1-0))
)
(nav-enemy-travel-post)
(none)
)
)
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype lurkerpuppy (nav-enemy)
()
:heap-base #x120
@@ -41,7 +40,6 @@ nav-enemy-default-event-handler
(ja :num! (seek!))
)
(go-virtual nav-enemy-chase)
(none)
)
)
@@ -80,7 +78,6 @@ nav-enemy-default-event-handler
)
)
)
(none)
)
)
@@ -125,7 +122,6 @@ nav-enemy-default-event-handler
)
)
)
(none)
)
)
@@ -158,7 +154,6 @@ nav-enemy-default-event-handler
(ja :num! (seek! max 1.4))
)
(go-virtual nav-enemy-patrol)
(none)
)
)
@@ -171,7 +166,6 @@ nav-enemy-default-event-handler
:code (behavior ()
(sound-play "head-butt")
(go-virtual nav-enemy-victory)
(none)
)
)
@@ -183,7 +177,6 @@ nav-enemy-default-event-handler
)
:exit (behavior ()
(logior! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))
(none)
)
:code (behavior ()
(logclear! (-> self nav-enemy-flags) (nav-enemy-flags enable-travel))
@@ -202,7 +195,6 @@ nav-enemy-default-event-handler
)
)
(go-virtual nav-enemy-chase)
(none)
)
:post (the-as (function none :behavior lurkerpuppy) nav-enemy-face-player-post)
)
-13
View File
@@ -288,7 +288,6 @@ lurkerworm-default-post-behavior
:enter (behavior ()
(ja-channel-set! 0)
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:code (behavior ()
(loop
@@ -300,7 +299,6 @@ lurkerworm-default-post-behavior
)
(suspend)
)
(none)
)
:post lurkerworm-default-post-behavior
)
@@ -310,7 +308,6 @@ lurkerworm-default-post-behavior
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(sound-play "worm-rise1")
(none)
)
:code (behavior ()
(set! (-> self part local-clock) 0)
@@ -325,7 +322,6 @@ lurkerworm-default-post-behavior
)
(suspend)
)
(none)
)
:post lurkerworm-default-post-behavior
)
@@ -334,7 +330,6 @@ lurkerworm-default-post-behavior
:event lurkerworm-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:code (behavior ()
(ja-channel-set! 1)
@@ -347,7 +342,6 @@ lurkerworm-default-post-behavior
)
(set! (-> self strike-count) 3)
(go lurkerworm-rest)
(none)
)
:post lurkerworm-default-post-behavior
)
@@ -357,11 +351,9 @@ lurkerworm-default-post-behavior
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(set! (-> self vulnerable) #t)
(none)
)
:exit (behavior ()
(set! (-> self vulnerable) #f)
(none)
)
:code (behavior ()
(let* ((f30-0 10.0)
@@ -411,7 +403,6 @@ lurkerworm-default-post-behavior
(go lurkerworm-sink)
)
)
(none)
)
:post lurkerworm-default-post-behavior
)
@@ -431,7 +422,6 @@ lurkerworm-default-post-behavior
(ja-no-eval :num! (seek!))
(ja-channel-push! 1 (seconds 0.135))
(go lurkerworm-rest)
(none)
)
:post lurkerworm-default-post-behavior
)
@@ -440,7 +430,6 @@ lurkerworm-default-post-behavior
:event lurkerworm-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:code (behavior ()
(ja-no-eval :group! lurkerworm-sink-ja :num! (seek!) :frame-num 0.0)
@@ -451,7 +440,6 @@ lurkerworm-default-post-behavior
(ja :num! (seek!))
)
(go lurkerworm-idle)
(none)
)
:post lurkerworm-default-post-behavior
)
@@ -474,7 +462,6 @@ lurkerworm-default-post-behavior
(ja :num! (seek!))
)
(cleanup-for-death self)
(none)
)
:post lurkerworm-default-post-behavior
)
-3
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype mayor (process-taskable)
()
:heap-base #x110
@@ -704,7 +703,6 @@
(go-virtual hidden)
)
((-> (method-of-type process-taskable idle) trans))
(none)
)
:post (behavior ()
(let ((t9-0 (-> (method-of-type process-taskable idle) post)))
@@ -713,7 +711,6 @@
)
)
(do-push-aways! (-> self root-override))
(none)
)
)
+81 -119
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype pelican-bank (basic)
((circle-speed meters :offset-assert 4)
(dive-time seconds :offset-assert 8)
@@ -181,26 +180,23 @@
)
(defstate pelican-circle (pelican)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as
object
(case event-type
(('dive)
(let ((v0-0 (the-as structure #t)))
(set! (-> self state-object) (the-as symbol v0-0))
v0-0
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('dive)
(let ((v0-0 (the-as structure #t)))
(set! (-> self state-object) (the-as symbol v0-0))
v0-0
)
(('fuel-cell)
(handle->process (-> self fuel-cell))
)
(('fuel-cell)
(handle->process (-> self fuel-cell))
)
(('position)
(set! (-> self path-pos) (the-as float (-> block param 0)))
(let ((a1-3 (path-control-method-12 (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos))))
(set-heading-vec! (-> self root-override) a1-3)
)
(('position)
(set! (-> self path-pos) (the-as float (-> event param 0)))
(let ((a1-3 (path-control-method-12 (-> self path) (new 'stack-no-clear 'vector) (-> self path-pos))))
(set-heading-vec! (-> self root-override) a1-3)
)
)
)
)
)
)
:enter (behavior ()
@@ -233,7 +229,6 @@
(/ (* (-> *PELICAN-bank* circle-speed) (-> self path-max)) (path-distance (-> self path)))
)
(set-roll-to-grav-2! (-> self root-override) -2730.6667)
(none)
)
:trans (behavior ()
(pelican-path-update 728177.75 30 1.0 (/ (-> self path-max) (path-distance (-> self path))) #f)
@@ -302,7 +297,6 @@
)
(go pelican-dive (-> self path-dive0) (-> self path-to-nest0) (-> *PELICAN-bank* to-nest0-time))
)
(none)
)
:code (behavior ()
(suspend)
@@ -311,22 +305,20 @@
(the-as (function pelican int) (lambda () (rand-vu-int-range 2 4)))
(the-as (function pelican int) (lambda () (rand-vu-int-range 3 5)))
)
(none)
)
:post pelican-post
)
(defstate pelican-dive (pelican)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('got-cell?)
(-> self state-object)
)
(('fuel-cell)
(handle->process (-> self fuel-cell))
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('got-cell?)
(-> self state-object)
)
(('fuel-cell)
(handle->process (-> self fuel-cell))
)
)
)
:enter (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame))
(init! (-> self query) (the-as string #f) 40 150 25 #t (the-as string #f))
@@ -354,11 +346,9 @@
)
(set! (-> self draw force-lod) 0)
0
(none)
)
:exit (behavior ()
(set! (-> self draw force-lod) -1)
(none)
)
:trans (behavior ()
(if (not (handle->process (-> self fuel-cell)))
@@ -369,7 +359,6 @@
(if (= (-> self path-pos) (-> self path-max))
(go pelican-to-nest (-> self path-cache) (the-as int (-> self time-cache)))
)
(none)
)
:code (behavior ((arg0 path-control) (arg1 curve-control) (arg2 time-frame))
(ja-channel-push! 1 (seconds 0.2))
@@ -396,7 +385,6 @@
(ja :num! (seek!))
)
(anim-loop)
(none)
)
:post pelican-post
)
@@ -407,7 +395,6 @@
(set! (-> self path-pos) 0.0)
(set! (-> self path-max) (the float (+ (-> self path curve num-cverts) -1)))
(set! (-> self path-speed) (/ (* 300.0 (-> self path-max)) (the float arg1)))
(none)
)
:trans (behavior ()
(pelican-path-update 546133.3 30 0.0 0.0 #f)
@@ -415,7 +402,6 @@
(if (= (-> self path-pos) (-> self path-max))
(go pelican-wait-at-nest #f)
)
(none)
)
:code (behavior ((arg0 path-control) (arg1 int))
(pelican-fly
@@ -426,60 +412,55 @@
)
)
)
(none)
)
:post pelican-post
)
(defstate pelican-wait-at-nest (pelican)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as
object
(case event-type
(('attack)
(case (-> event param 1)
(('explode)
(let ((a0-2 (handle->process (-> self fuel-cell))))
(if a0-2
(send-event a0-2 'trans (-> self root-override trans))
)
)
(go pelican-explode #f)
#f
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(case (-> block param 1)
(('explode)
(let ((a0-2 (handle->process (-> self fuel-cell))))
(if a0-2
(send-event a0-2 'trans (-> self root-override trans))
)
)
(else
(let* ((gp-0 proc)
(v1-13 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable))
gp-0
)
)
(f30-0 8192.0)
(gp-1 (-> self root-override))
(s4-0 (-> (the-as process-drawable v1-13) root trans))
)
(if (< f30-0
(fabs
(deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-0 (-> gp-1 trans))))
)
(go pelican-explode #f)
#f
)
(else
(let* ((gp-0 proc)
(v1-13 (if (and (nonzero? gp-0) (type-type? (-> gp-0 type) process-drawable))
gp-0
)
)
(f30-0 8192.0)
(gp-1 (-> self root-override))
(s4-0 (-> (the-as process-drawable v1-13) root trans))
)
(if (< f30-0
(fabs
(deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-0 (-> gp-1 trans))))
)
(go pelican-spit)
)
)
)
(go pelican-spit)
)
)
)
)
(('touch)
(the-as object (send-shove-back
(-> self root-override)
proc
(the-as touching-shapes-entry (-> event param 0))
0.7
6144.0
16384.0
)
)
)
(('touch)
(send-shove-back
(-> self root-override)
proc
(the-as touching-shapes-entry (-> block param 0))
0.7
6144.0
16384.0
)
)
)
)
)
:enter (behavior ((arg0 symbol))
@@ -512,13 +493,11 @@
(if (nonzero? (-> self neck))
(set-mode! (-> self neck) (joint-mod-handler-mode look-at))
)
(none)
)
:exit (behavior ()
(if (nonzero? (-> self neck))
(set-mode! (-> self neck) (joint-mod-handler-mode flex-blend))
)
(none)
)
:trans (behavior ()
(let ((a1-0 (-> self state-vector))
@@ -531,7 +510,6 @@
(do-push-aways! (-> self root-override))
(seek-toward-heading-vec! (-> self root-override) (-> self path-vector) 131072.0 (seconds 1))
(spool-push *art-control* "pelican-spit-ext" 0 self -99.0)
(none)
)
:code (behavior ((arg0 symbol))
(cond
@@ -571,7 +549,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (behavior ()
(when *target*
@@ -583,7 +560,6 @@
)
)
(pelican-post)
(none)
)
)
@@ -675,50 +651,43 @@
(send-event gp-3 'trans s5-3)
)
(send-event gp-3 'draw #t)
(send-event
gp-3
'event-hook
(lambda :behavior pelican
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (when (or (= arg2 'touch) (= arg2 'attack))
(let ((v1-7 (birth-pickup-at-point
(-> self root-override trans)
(pickup-type fuel-cell)
(the float (-> self entity extra perm task))
#f
*entity-pool*
(the-as fact-info #f)
(send-event gp-3 'event-hook (lambda :behavior pelican
((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(when (or (= arg2 'touch) (= arg2 'attack))
(let ((v1-7 (birth-pickup-at-point
(-> self root-override trans)
(pickup-type fuel-cell)
(the float (-> self entity extra perm task))
#f
*entity-pool*
(the-as fact-info #f)
)
)
)
(when v1-7
(set! (-> (the-as collectable (-> v1-7 0)) collect-timeout) 0)
0
)
)
(deactivate self)
)
)
(when v1-7
(set! (-> (the-as collectable (-> v1-7 0)) collect-timeout) 0)
0
)
)
(deactivate self)
)
)
)
)
)
)
)
(go pelican-from-nest)
(none)
)
:post (behavior ()
(if (not (ja-group? pelican-sleep-ja))
(quaternion-identity! (-> self root-override quat))
)
(pelican-post)
(none)
)
)
(defstate pelican-from-nest (pelican)
:enter (behavior ()
(set! (-> self path-pos) 1.5)
(none)
)
:trans (behavior ()
(pelican-path-update 131072.0 150 0.0 0.0 #f)
@@ -726,14 +695,12 @@
(if (= (-> self path-pos) (-> self path-max))
(go pelican-dive (-> self path-dive1) (-> self path-to-nest1) (-> *PELICAN-bank* to-nest1-time))
)
(none)
)
:code (behavior ()
(pelican-fly
(the-as (function pelican int) (lambda () (rand-vu-int-range 2 4)))
(the-as (function pelican int) zero-func)
)
(none)
)
:post pelican-post
)
@@ -756,7 +723,6 @@
(eval-path-curve-div! (-> self path) gp-1 0.0 'interp)
(set! (-> self state-float 1) (* 0.0073242188 (vector-vector-distance (-> self root-override trans) gp-1)))
)
(none)
)
:trans (behavior ()
(pelican-path-update 546133.3 30 0.0 0.0 #f)
@@ -775,7 +741,6 @@
(-> self state-float 0)
)
)
(none)
)
:code (behavior ((arg0 path-control) (arg1 time-frame))
(pelican-fly
@@ -786,7 +751,6 @@
)
)
)
(none)
)
:post pelican-post
)
@@ -794,7 +758,6 @@
(defstate pelican-wait-at-end (pelican)
:code (behavior ((arg0 symbol))
(cleanup-for-death self)
(none)
)
)
@@ -845,7 +808,6 @@
(clear-collide-with-as (-> self root-override))
(ja-channel-set! 0)
(anim-loop)
(none)
)
:post (the-as (function none :behavior pelican) ja-post)
)
-3
View File
@@ -8,7 +8,6 @@
;; DECOMP BEGINS
(deftype sculptor (process-taskable)
((muse handle :offset-assert 384)
)
@@ -90,7 +89,6 @@
:virtual #t
:enter (behavior ()
(muse-to-idle (the-as muse self))
(none)
)
)
@@ -342,7 +340,6 @@
)
)
)
(none)
)
)
-13
View File
@@ -12,7 +12,6 @@
;; DECOMP BEGINS
(defpartgroup group-seagull-takeoff
:id 160
:bounds (static-bspherem 0 -12 0 14)
@@ -345,7 +344,6 @@
(the float (sar (shl (the int (+ f30-0 (* f28-0 (+ f26-0 (rand-float-gen))))) 48) 48))
)
)
(none)
)
:trans (behavior ()
(when (nonzero? (-> self scared))
@@ -369,7 +367,6 @@
)
)
)
(none)
)
:code (behavior ()
(+! (-> self root-override trans y) 20480.0)
@@ -452,7 +449,6 @@
)
)
)
(none)
)
:post seagull-post
)
@@ -568,7 +564,6 @@
(-> self part)
(-> self root-override root-prim prim-core)
)
(none)
)
:code (behavior ()
(set! (-> self part-time) (-> *display* base-frame-counter))
@@ -611,7 +606,6 @@
(ja-no-eval :num! (seek!))
(ja-channel-push! 1 (seconds 0.067))
(go seagull-flying)
(none)
)
:post seagull-post
)
@@ -622,7 +616,6 @@
(-> self part)
(-> self root-override root-prim prim-core)
)
(none)
)
:code (behavior ()
(set! (-> self max-tilt) 1820.4445)
@@ -803,7 +796,6 @@
)
)
)
(none)
)
:post seagull-post
)
@@ -814,7 +806,6 @@
(-> self part)
(-> self root-override root-prim prim-core)
)
(none)
)
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -964,7 +955,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post seagull-post
)
@@ -1117,7 +1107,6 @@
0
)
(go seagull-idle)
(none)
)
:post seagull-post
)
@@ -1303,7 +1292,6 @@
)
)
(process-entity-status! self (entity-perm-status dead) #t)
(none)
)
)
@@ -1318,7 +1306,6 @@
)
(suspend)
)
(none)
)
)
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype assistant-lavatube-end (process-taskable)
()
:heap-base #x110
@@ -79,7 +78,6 @@
(not (closed? (-> self tasks) (game-task village4-button) (task-status need-reward-speech)))
)
)
(none)
)
)
@@ -92,7 +90,6 @@
(send-event self 'play-anim)
)
)
(none)
)
:code (behavior ()
(loop
@@ -106,7 +103,6 @@
(ja :num! (seek!))
)
)
(none)
)
)
+20 -44
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype citb-arm-section (process-drawable)
((sync sync-info :inline :offset-assert 176)
(cull-dir-local vector :inline :offset-assert 192)
@@ -94,7 +93,6 @@
(suspend)
)
)
(none)
)
:post (the-as (function none :behavior citb-arm-section) ja-post)
)
@@ -153,7 +151,6 @@
(restore-collide-with-as (-> self root-override))
)
(rider-post)
(none)
)
)
@@ -353,14 +350,13 @@
(defstate citb-disc-idle (citb-disc)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('touch)
(send-event proc 'no-look-around (seconds 0.25))
#f
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touch)
(send-event proc 'no-look-around (seconds 0.25))
#f
)
)
)
:trans (the-as (function none :behavior citb-disc) rider-trans)
:code (behavior ()
@@ -375,7 +371,6 @@
)
(suspend)
)
(none)
)
:post (the-as (function none :behavior citb-disc) rider-post)
)
@@ -630,7 +625,6 @@
)
)
(send-event (ppointer->process (-> self launcher)) 'trans (-> self basetrans))
(none)
)
)
@@ -724,12 +718,12 @@
(defstate citb-robotboss-idle (citb-robotboss)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (sv-96 int) (sv-112 int))
(the-as
object
symbol
(cond
((= event-type 'shield-off)
((= message 'shield-off)
(stop! (-> self sound))
(if (-> self shield-on)
(sound-play "robotcage-off")
@@ -737,17 +731,17 @@
(set! (-> self shield-on) #f)
#f
)
((= event-type 'shield-on)
((= message 'shield-on)
(let ((v0-3 #t))
(set! (-> self shield-on) v0-3)
v0-3
)
)
((= event-type 'die)
((= message 'die)
(cleanup-for-death self)
(the-as symbol (deactivate self))
)
((or (= event-type 'touch) (= event-type 'attack))
((or (= message 'touch) (= message 'attack))
(let ((s4-0 sound-play-by-name)
(s3-0 (make-u128 #x7061 (the-as uint #x7a2d646c65696873)))
(s2-0 (new-sound-id))
@@ -763,7 +757,7 @@
(the-as symbol (send-event
proc
'shove
(-> event param 0)
(-> block param 0)
(static-attack-info ((shove-up (meters 2)) (shove-back (meters 3))))
)
)
@@ -828,7 +822,6 @@
)
(suspend)
)
(none)
)
:post (the-as (function none :behavior citb-robotboss) ja-post)
)
@@ -837,7 +830,6 @@
:code (behavior ()
(cleanup-for-death self)
(deactivate self)
(none)
)
)
@@ -907,8 +899,8 @@
)
(defstate citb-coil-idle (citb-coil)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('trigger)
(go citb-coil-break)
)
@@ -922,12 +914,10 @@
(ja :num! (seek!))
)
)
(none)
)
:post (behavior ()
(spawn (-> self part) (-> self root trans))
(ja-post)
(none)
)
)
@@ -941,7 +931,6 @@
(ja :num! (seek!))
)
(go citb-coil-broken)
(none)
)
:post (the-as (function none :behavior citb-coil) ja-post)
)
@@ -957,7 +946,6 @@
(spawn (-> self part-off) (-> self root trans))
(suspend)
)
(none)
)
:post (the-as (function none :behavior citb-coil) ja-post)
)
@@ -1020,7 +1008,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior citb-hose) ja-post)
)
@@ -1035,7 +1022,6 @@
(ja :num! (seek!))
)
(go citb-hose-idle)
(none)
)
:post (the-as (function none :behavior citb-hose) ja-post)
)
@@ -1051,7 +1037,6 @@
(ja :num! (seek!))
)
(anim-loop)
(none)
)
:post (the-as (function none :behavior citb-hose) ja-post)
)
@@ -1214,8 +1199,8 @@
)
(defstate citb-generator-idle (citb-generator)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(if (-> self mushroom)
(increment-success-for-hint (text-id citadel-generator))
@@ -1230,7 +1215,6 @@
)
:exit (behavior ()
(stop! (-> self sound))
(none)
)
:code (behavior ()
(lods-assign! (-> self draw) (-> self normal-look))
@@ -1258,7 +1242,6 @@
)
(suspend)
)
(none)
)
:post (the-as (function none :behavior citb-generator) ja-post)
)
@@ -1314,7 +1297,6 @@
; (set-continue! *game-info* "citadel-elevator")
; )
(go citb-generator-broken)
(none)
)
:post (the-as (function none :behavior citb-generator) ja-post)
)
@@ -1338,12 +1320,10 @@
)
)
(anim-loop)
(none)
)
:post (behavior ()
(spawn (-> self part-broken) (-> self root-override trans))
(ja-post)
(none)
)
)
@@ -1445,8 +1425,8 @@
(defstate citadelcam-idle (citadelcam)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('trigger)
(when (and (task-complete? *game-info* (game-task citadel-sage-blue))
(task-complete? *game-info* (game-task citadel-sage-red))
@@ -1461,7 +1441,6 @@
:code (behavior ()
(logior! (-> self mask) (process-mask actor-pause))
(anim-loop)
(none)
)
)
@@ -1510,7 +1489,6 @@
)
(level-hint-spawn (text-id citadel-plat) "sksp0387" (the-as entity #f) *entity-pool* (game-task none))
(go citadelcam-idle)
(none)
)
)
@@ -1556,7 +1534,6 @@
)
)
(go-virtual battlecontroller-active)
(none)
)
)
@@ -1569,7 +1546,6 @@
((the-as (function none :behavior battlecontroller) t9-2))
)
)
(none)
)
)
+36 -45
View File
@@ -83,34 +83,33 @@
)
(defstate citb-sagecage-idle (citb-sagecage)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(local-vars (v0-3 basic))
(the-as object (case event-type
(('disable-bars)
(stop! (-> self sound))
(sound-play "sagecage-off")
(set! (-> self bars-on) #f)
(the-as basic (citb-sagecage-update-collision))
)
(('enable-bars)
(set! (-> self bars-on) #t)
(the-as basic (citb-sagecage-update-collision))
)
(('start-cloning)
(set! v0-3 #t)
(set! (-> self cloning) (the-as symbol v0-3))
v0-3
)
(('stop-cloning)
(set! (-> self cloning) #f)
(let ((v1-7 (-> self skel root-channel 0)))
(set! v0-3 (-> self draw art-group data 3))
(set! (-> v1-7 frame-group) (the-as art-joint-anim v0-3))
)
v0-3
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(local-vars (v0-3 object))
(case message
(('disable-bars)
(stop! (-> self sound))
(sound-play "sagecage-off")
(set! (-> self bars-on) #f)
(citb-sagecage-update-collision)
)
(('enable-bars)
(set! (-> self bars-on) #t)
(citb-sagecage-update-collision)
)
(('start-cloning)
(set! v0-3 #t)
(set! (-> self cloning) (the-as symbol v0-3))
v0-3
)
(('stop-cloning)
(set! (-> self cloning) #f)
(let ((v1-7 (-> self skel root-channel 0)))
(set! v0-3 (-> self draw art-group data 3))
(set! (-> v1-7 frame-group) (the-as art-joint-anim v0-3))
)
v0-3
)
)
)
:trans (the-as (function none :behavior citb-sagecage) rider-trans)
:code (behavior ()
@@ -137,7 +136,6 @@
)
(suspend)
)
(none)
)
:post (behavior ()
(rider-post)
@@ -145,7 +143,6 @@
(update! (-> self sound))
(citb-sagecage-draw-bars)
)
(none)
)
)
@@ -368,7 +365,6 @@
(send-event (handle->process (-> self cage)) 'disable-bars)
(send-event (handle->process (-> self cage)) 'stop-cloning)
((-> (method-of-type process-taskable hidden) enter))
(none)
)
)
@@ -395,13 +391,13 @@
(defstate play-anim (citb-sage)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('disable-bars)
(send-event (handle->process (-> self cage)) 'disable-bars)
)
(else
((-> (method-of-type process-taskable play-anim) event) proc arg1 event-type event)
((-> (method-of-type process-taskable play-anim) event) proc argc message block)
)
)
)
@@ -409,13 +405,13 @@
(defstate idle (citb-sage)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('open)
(send-event (handle->process (-> self cage)) 'disable-bars)
)
(else
((-> (method-of-type process-taskable idle) event) proc arg1 event-type event)
((-> (method-of-type process-taskable idle) event) proc argc message block)
)
)
)
@@ -431,14 +427,12 @@
)
)
((-> (method-of-type process-taskable idle) trans))
(none)
)
:post (behavior ()
((the-as (function none :behavior citb-sage) (-> (method-of-type process-taskable idle) post)))
(if (-> self beam-on)
(citb-sage-draw-beam)
)
(none)
)
)
@@ -989,8 +983,8 @@
(defstate play-anim (green-sagecage)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('spawn-robot)
(let ((gp-0 (entity-by-name "robotboss-3")))
(format 0 "robotboss ent ~A~%" gp-0)
@@ -1011,7 +1005,7 @@
)
)
(else
((-> (method-of-type citb-sage play-anim) event) proc arg1 event-type event)
((-> (method-of-type citb-sage play-anim) event) proc argc message block)
)
)
)
@@ -1074,7 +1068,6 @@
)
(set! (-> self draw bounds w) 10240.0)
((-> (method-of-type process-taskable play-anim) exit))
(none)
)
:trans (behavior ()
(case (-> self which-movie)
@@ -1103,7 +1096,6 @@
)
)
((-> (method-of-type process-taskable play-anim) trans))
(none)
)
)
@@ -1125,7 +1117,6 @@
)
)
((-> (method-of-type citb-sage idle) trans))
(none)
)
)
+20 -31
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(defskelgroup *citb-drop-plat-sg* citb-drop-plat citb-drop-plat-lod0-jg citb-drop-plat-idle-ja
((citb-drop-plat-lod0-mg (meters 20)) (citb-drop-plat-lod1-mg (meters 999999)))
:bounds (static-spherem 0 0 0 3)
@@ -62,8 +61,8 @@
(defstate drop-plat-idle (drop-plat)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('drop)
(logclear! (-> self mask) (process-mask actor-pause))
(go drop-plat-drop)
@@ -86,7 +85,6 @@
)
(suspend)
)
(none)
)
:post (the-as (function none :behavior drop-plat) ja-post)
)
@@ -107,8 +105,8 @@
)
(defstate drop-plat-spawn (drop-plat)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('drop)
(go drop-plat-die)
)
@@ -132,13 +130,12 @@
)
(suspend)
)
(none)
)
)
(defstate drop-plat-rise (drop-plat)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('drop)
(go drop-plat-drop)
)
@@ -177,7 +174,6 @@
(suspend)
)
)
(none)
)
:post (behavior ()
(let ((gp-0 (new 'stack-no-clear 'quaternion)))
@@ -186,7 +182,6 @@
)
(drop-plat-set-fade)
(transform-post)
(none)
)
)
@@ -219,7 +214,6 @@
(+! (-> self spin-angle) (* (-> self spin-speed) (-> *display* seconds-per-frame)))
(suspend)
)
(none)
)
:post (behavior ()
(let ((gp-0 (new 'stack-no-clear 'quaternion)))
@@ -228,14 +222,12 @@
)
(drop-plat-set-fade)
(transform-post)
(none)
)
)
(defstate drop-plat-die (drop-plat)
:code (behavior ()
(cleanup-for-death self)
(none)
)
)
@@ -458,8 +450,8 @@
)
(defstate citb-drop-plat-idle (citb-drop-plat)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('trigger)
(go citb-drop-plat-active)
)
@@ -470,24 +462,22 @@
(loop
(suspend)
)
(none)
)
)
(defstate citb-drop-plat-active (citb-drop-plat)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('player-stepped)
(when (>= (- (-> *display* base-frame-counter) (-> self drop-time)) (seconds 0.2))
(set! (-> self drop-time) (-> *display* base-frame-counter))
(the-as object (citb-drop-plat-drop-children (the-as int (-> event param 0))))
)
)
(('trigger)
(go citb-drop-plat-idle)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('player-stepped)
(when (>= (- (-> *display* base-frame-counter) (-> self drop-time)) (seconds 0.2))
(set! (-> self drop-time) (-> *display* base-frame-counter))
(citb-drop-plat-drop-children (the-as int (-> block param 0)))
)
)
(('trigger)
(go citb-drop-plat-idle)
)
)
)
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -503,7 +493,6 @@
)
(suspend)
)
(none)
)
)
+15 -40
View File
@@ -60,7 +60,6 @@
)
(go-virtual citb-base-plat-active)
)
(none)
)
:code (the-as (function none :behavior citb-base-plat) anim-loop)
:post (the-as (function none :behavior citb-base-plat) ja-post)
@@ -76,7 +75,6 @@
(go-virtual citb-base-plat-idle)
)
(rider-trans)
(none)
)
:code (the-as (function none :behavior citb-base-plat) anim-loop)
:post (the-as (function none :behavior citb-base-plat) rider-post)
@@ -201,7 +199,6 @@
(sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans)))
)
(plat-trans)
(none)
)
)
@@ -275,17 +272,16 @@
(defstate citb-base-plat-idle (citb-stair-plat)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('trigger)
(logclear! (-> self mask) (process-mask actor-pause))
(let ((v0-0 #t))
(set! (-> self rise) v0-0)
v0-0
)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('trigger)
(logclear! (-> self mask) (process-mask actor-pause))
(let ((v0-0 #t))
(set! (-> self rise) v0-0)
v0-0
)
)
)
)
:trans (the-as (function none :behavior citb-stair-plat) #f)
:code (behavior ()
@@ -317,7 +313,6 @@
(transform-post)
(suspend)
)
(none)
)
:post (the-as (function none :behavior citb-stair-plat) #f)
)
@@ -331,7 +326,6 @@
(update-transforms! (-> self root-override))
(logior! (-> self mask) (process-mask actor-pause))
(anim-loop)
(none)
)
:post (the-as (function none :behavior citb-stair-plat) ja-post)
)
@@ -460,11 +454,9 @@
(go-virtual rigid-body-platform-float)
)
)
(none)
)
:code (behavior ()
(anim-loop)
(none)
)
:post (the-as (function none :behavior citb-chain-plat) ja-post)
)
@@ -477,11 +469,9 @@
)
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:exit (behavior ()
(stop! (-> self sound))
(none)
)
:trans (behavior ()
(cond
@@ -509,11 +499,9 @@
)
)
)
(none)
)
:code (behavior ()
(anim-loop)
(none)
)
:post (the-as (function none :behavior citb-chain-plat) rigid-body-platform-post)
)
@@ -546,7 +534,6 @@
)
(suspend)
(go-virtual rigid-body-platform-idle)
(none)
)
:post (the-as (function none :behavior citb-chain-plat) rider-post)
)
@@ -636,7 +623,6 @@
(go-virtual citb-base-plat-idle)
)
)
(none)
)
)
@@ -698,7 +684,6 @@
(* 65536.0 (get-current-phase (-> self sync)))
)
(rider-post)
(none)
)
)
@@ -761,7 +746,6 @@
(sound-play "eco-plat-hover" :id (-> self sound-id) :position (the-as symbol (-> self root-override trans)))
)
(plat-trans)
(none)
)
)
@@ -833,13 +817,11 @@
)
(go citb-firehose-active)
)
(none)
)
:code (behavior ()
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior citb-firehose) ja-post)
)
@@ -860,13 +842,11 @@
(go citb-firehose-blast)
)
)
(none)
)
:code (behavior ()
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior citb-firehose) ja-post)
)
@@ -885,13 +865,13 @@
)
(defstate citb-firehose-blast (citb-firehose)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touch)
(send-event
proc
'attack
(-> event param 0)
(-> block param 0)
(static-attack-info ((mode 'damage) (shove-back (meters 6)) (shove-up (meters 3))))
)
)
@@ -923,7 +903,6 @@
(ja :num! (seek!))
)
(go citb-firehose-active)
(none)
)
:post (the-as (function none :behavior citb-firehose) transform-post)
)
@@ -994,8 +973,8 @@
(defstate citb-exit-plat-idle (citb-exit-plat)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('trigger)
(let ((v1-3 (-> self entity extra perm)))
(logior! (-> v1-3 status) (entity-perm-status user-set-from-cstage))
@@ -1011,7 +990,6 @@
(loop
(suspend)
)
(none)
)
)
@@ -1031,7 +1009,6 @@
)
(suspend)
)
(none)
)
:post (the-as (function none :behavior citb-exit-plat) rider-post)
)
@@ -1068,7 +1045,6 @@
)
(citb-exit-plat-move-player gp-0)
)
(none)
)
:post (the-as (function none :behavior citb-exit-plat) transform-post)
)
@@ -1085,7 +1061,6 @@
)
(citb-exit-plat-move-player gp-0)
)
(none)
)
:post (the-as (function none :behavior citb-exit-plat) transform-post)
)
@@ -132,7 +132,7 @@ battlecontroller-default-event-handler
)
)
)
(the-as object 0)
0
)
(defbehavior battlecontroller-camera-off battlecontroller ()
@@ -384,7 +384,6 @@ battlecontroller-default-event-handler
:event battlecontroller-default-event-handler
:trans (behavior ()
0
(none)
)
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -409,7 +408,6 @@ battlecontroller-default-event-handler
)
(suspend)
)
(none)
)
:post (the-as (function none :behavior battlecontroller) #f)
)
@@ -419,15 +417,12 @@ battlecontroller-default-event-handler
:event battlecontroller-default-event-handler
:enter (behavior ()
(process-entity-status! self (entity-perm-status bit-3) #t)
(none)
)
:exit (behavior ()
(process-entity-status! self (entity-perm-status bit-3) #f)
(none)
)
:code (behavior ()
(go-virtual battlecontroller-active)
(none)
)
)
@@ -450,7 +445,6 @@ battlecontroller-default-event-handler
)
(battlecontroller-disable-ocean)
(battlecontroller-update-spawners)
(none)
)
:code (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -482,7 +476,6 @@ battlecontroller-default-event-handler
)
(suspend)
)
(none)
)
:post (the-as (function none :behavior battlecontroller) #f)
)
@@ -585,7 +578,6 @@ battlecontroller-default-event-handler
(suspend)
)
(process-entity-status! self (entity-perm-status dead) #t)
(none)
)
:post (the-as (function none :behavior battlecontroller) #f)
)
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype blocking-plane (process-drawable)
()
:heap-base #x40
@@ -32,7 +31,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
)
@@ -8,7 +8,6 @@
;; DECOMP BEGINS
(deftype launcherdoor (process-drawable)
((root-override collide-shape :offset 112)
(notify-player-passed-thru? symbol :offset-assert 176)
@@ -95,7 +94,6 @@
)
)
)
(none)
)
:post (the-as (function none :behavior launcherdoor) ja-post)
)
@@ -131,7 +129,6 @@
(ja :num! (seek! max (-> self open-speed)))
(suspend)
)
(none)
)
:post (the-as (function none :behavior launcherdoor) ja-post)
)
@@ -209,7 +206,3 @@
)
(none)
)
+20 -40
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype cavecrystal (process-drawable)
((root-override collide-shape :offset 112)
(is-master? symbol :offset-assert 176)
@@ -92,8 +91,8 @@
)
(defstate cavecrystal-idle (cavecrystal)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(go cavecrystal-active)
)
@@ -101,57 +100,46 @@
)
:trans (behavior ()
(if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))))
(level-hint-spawn
(text-id darkcave-light-hint)
"sksp0333"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(level-hint-spawn (text-id darkcave-light-hint) "sksp0333" (the-as entity #f) *entity-pool* (game-task none))
)
(update-connected-crystals! self)
(none)
)
:code (behavior ()
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
0
(none)
)
)
(defstate cavecrystal-active (cavecrystal)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('attack)
(let ((v1-1 (-> event param 2)))
(cond
((!= v1-1 (-> self player-attack-id))
(set! (-> self player-attack-id) v1-1)
(set! (-> self activated-time) (-> *display* game-frame-counter))
#t
)
(else
#f
)
)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(let ((v1-1 (-> block param 2)))
(cond
((!= v1-1 (-> self player-attack-id))
(set! (-> self player-attack-id) v1-1)
(set! (-> self activated-time) (-> *display* game-frame-counter))
#t
)
(else
#f
)
)
)
)
)
)
:enter (behavior ()
(logclear! (-> self mask) (process-mask actor-pause))
(set! (-> self activated-time) (-> *display* game-frame-counter))
(set! (-> self prev-compute-glow-time) (-> *display* game-frame-counter))
(none)
)
:exit (behavior ()
(stop! (-> self sound))
(if (not (-> self is-master?))
(logior! (-> self mask) (process-mask actor-pause))
)
(none)
)
:trans (behavior ()
(let ((f30-0 (compute-glow self)))
@@ -179,24 +167,16 @@
(cavecrystal-light-control-method-9 *cavecrystal-light-control* (-> self crystal-id) (-> self glow-u) self)
(update-connected-crystals! self)
(when (>= 0.0 f30-0)
(level-hint-spawn
(text-id darkcave-light-end)
"sksp0332"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(level-hint-spawn (text-id darkcave-light-end) "sksp0332" (the-as entity #f) *entity-pool* (game-task none))
(go cavecrystal-idle)
)
)
(update! (-> self sound))
(none)
)
:code (behavior ()
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
0
(none)
)
)
-5
View File
@@ -334,11 +334,6 @@
(loop
(suspend)
)
(none)
)
:post target-no-move-post
)
@@ -106,13 +106,11 @@
(set! (-> *setting-control* current bg-a) 1.0)
(set! (-> *setting-control* default bg-a) 0.0)
(add-setting! 'common-page 'set 0.0 (ash 1 (+ arg0 1)))
(none)
)
:trans (behavior ()
(hide-hud-quick)
(spawn (-> self part 0) *zero-vector*)
0
(none)
)
:code (behavior ((arg0 int) (arg1 time-frame) (arg2 symbol))
(local-vars (v1-6 symbol))
@@ -134,7 +132,6 @@
(remove-setting! 'common-page)
(suspend)
0
(none)
)
)
+21 -32
View File
@@ -9,7 +9,6 @@
;; DECOMP BEGINS
(deftype fin-door (process-hidden)
()
:method-count-assert 15
@@ -49,8 +48,8 @@
(defstate idle (final-door)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('open)
(go-virtual open #f)
)
@@ -61,30 +60,28 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
(none)
)
)
(defstate open (final-door)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('brightness)
(let ((f0-0 (the-as float (-> event param 0)))
(f1-0 (the-as float (-> event param 1)))
)
(set-vector! (-> self draw color-mult) f0-0 f0-0 f0-0 f0-0)
(let ((v0-0 (-> self draw color-emissive)))
(set! (-> v0-0 x) f1-0)
(set! (-> v0-0 y) f1-0)
(set! (-> v0-0 z) f1-0)
(set! (-> v0-0 w) f1-0)
v0-0
)
)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('brightness)
(let ((f0-0 (the-as float (-> block param 0)))
(f1-0 (the-as float (-> block param 1)))
)
(set-vector! (-> self draw color-mult) f0-0 f0-0 f0-0 f0-0)
(let ((v0-0 (-> self draw color-emissive)))
(set! (-> v0-0 x) f1-0)
(set! (-> v0-0 y) f1-0)
(set! (-> v0-0 z) f1-0)
(set! (-> v0-0 w) f1-0)
v0-0
)
)
)
)
)
:code (behavior ((arg0 symbol))
(case (-> self type)
@@ -109,7 +106,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
(none)
)
)
@@ -181,7 +177,6 @@
)
(suspend)
)
(none)
)
)
@@ -251,7 +246,6 @@
:to *entity-pool*
)
(go-virtual idle)
(none)
)
)
@@ -266,7 +260,6 @@
(transform-post)
(suspend)
)
(none)
)
)
@@ -302,26 +295,23 @@
)
(defstate target-final-door (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
((-> target-grab event) proc arg1 event-type event)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
((-> target-grab event) proc argc message block)
)
:enter (behavior ((arg0 basic) (arg1 handle))
(send-event *camera* 'change-to-entity-by-name "camera-403")
(set! (-> self control unknown-surface00) *empty-mods*)
(logior! (-> self state-flags) (state-flags invulnerable grabbed))
(set-setting! 'allow-progress #f 0.0 0)
(none)
)
:exit (behavior ()
(send-event *camera* 'change-state *camera-base-mode* (seconds 0.2))
(logclear! (-> self state-flags) (state-flags invulnerable grabbed))
(target-exit)
(remove-setting! 'allow-progress)
(none)
)
:trans (behavior ()
(set-letterbox-frames (seconds 0.017))
(none)
)
:code (behavior ((arg0 basic) (arg1 handle))
(local-vars (sv-144 process) (sv-160 vector) (sv-176 process) (sv-192 vector))
@@ -409,7 +399,6 @@
)
)
(go target-stance)
(none)
)
:post target-no-stick-post
)
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype green-eco-lurker (nav-enemy)
((played-sound? symbol :offset-assert 400)
(sound-delay int32 :offset-assert 404)
@@ -388,11 +387,9 @@
(defstate green-eco-lurker-tune-spheres (green-eco-lurker)
:trans (behavior ()
0
(none)
)
:code (behavior ()
0
(none)
)
:post (the-as (function none :behavior green-eco-lurker) transform-post)
)
@@ -401,25 +398,21 @@
:enter (behavior ()
(logior! (-> self draw status) (draw-status hidden))
(clear-collide-with-as (-> self collide-info))
(none)
)
:exit (behavior ()
(logclear! (-> self draw status) (draw-status hidden))
(restore-collide-with-as (-> self collide-info))
(none)
)
:trans (behavior ()
(if (nav-enemy-method-52 self (-> self appear-dest))
(go green-eco-lurker-appear)
)
(none)
)
:code (behavior ()
(loop
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
(none)
)
)
@@ -489,7 +482,6 @@
(vector-normalize! gp-1 1.0)
(forward-up->quaternion (-> self collide-info quat) gp-1 *up-vector*)
)
(none)
)
:trans (behavior ()
(let ((f30-0 (fmin (the float (- (-> *display* base-frame-counter) (-> self state-time))) (-> self traj time))))
@@ -508,7 +500,6 @@
)
(nav-enemy-method-53 self)
0
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
@@ -533,7 +524,6 @@
(logior! (-> self mask) (process-mask sleep-code))
(suspend)
)
(none)
)
:post (the-as (function none :behavior green-eco-lurker) transform-post)
)
@@ -568,7 +558,6 @@
)
(logior! (-> self nav-enemy-flags) (nav-enemy-flags navenmf1))
(go-virtual nav-enemy-chase)
(none)
)
:post (the-as (function none :behavior green-eco-lurker) transform-post)
)
@@ -582,7 +571,6 @@
((the-as (function none) t9-1))
)
)
(none)
)
)
@@ -615,7 +603,6 @@
(ja :num! (loop! f30-0))
)
)
(none)
)
)
@@ -634,7 +621,6 @@
(ja :num! (seek! (ja-aframe 32.0 0) 0.5))
)
(go-virtual nav-enemy-chase)
(none)
)
)
@@ -664,7 +650,6 @@
(t9-7)
)
)
(none)
)
)
@@ -774,8 +759,8 @@
)
(defstate spawn-minions (green-eco-lurker-gen)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('blob-died)
(set! (-> self num-alive) (max 0 (+ (-> self num-alive) -1)))
(send-event (ppointer->process (-> self parent)) 'blob-died)
@@ -813,7 +798,6 @@
)
(suspend)
0
(none)
)
)
+4 -21
View File
@@ -186,8 +186,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0)
(launch-particles (-> *part-id-table* 2904) gp-0 :rate 1.0)
(launch-particles (-> *part-id-table* 2905) gp-0 :rate 1.0)
(launch-particles (-> *part-id-table* 2904) gp-0)
(launch-particles (-> *part-id-table* 2905) gp-0)
)
)
(none)
@@ -305,8 +305,8 @@
(let ((gp-0 (new 'stack-no-clear 'vector)))
(sp-kill-particle arg0 arg1)
(set-vector! gp-0 (-> arg2 x) (-> arg2 y) (-> arg2 z) 1.0)
(launch-particles (-> *part-id-table* 2910) gp-0 :rate 1.0)
(launch-particles (-> *part-id-table* 2911) gp-0 :rate 1.0)
(launch-particles (-> *part-id-table* 2910) gp-0)
(launch-particles (-> *part-id-table* 2911) gp-0)
)
)
(none)
@@ -382,7 +382,6 @@
:event light-eco-child-default-event-handler
:enter (behavior ()
(set! (-> self falling-start-time) (-> *display* base-frame-counter))
(none)
)
:trans (behavior ()
(let ((f30-0
@@ -395,14 +394,12 @@
)
)
(common-trans self)
(none)
)
:code (behavior ()
(loop
(suspend)
(ja :num! (loop!))
)
(none)
)
:post (the-as (function none :behavior light-eco-child) transform-post)
)
@@ -411,7 +408,6 @@
:event light-eco-child-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans (behavior ()
(let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (-> *display* seconds-per-frame)))))
@@ -444,14 +440,12 @@
)
)
(common-trans self)
(none)
)
:code (behavior ()
(loop
(suspend)
(ja :num! (loop!))
)
(none)
)
:post (the-as (function none :behavior light-eco-child) transform-post)
)
@@ -460,21 +454,18 @@
:event light-eco-child-default-event-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:trans (behavior ()
(if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 4))
(go light-eco-child-die)
)
(common-trans self)
(none)
)
:code (behavior ()
(loop
(suspend)
(ja :num! (loop!))
)
(none)
)
:post (the-as (function none :behavior light-eco-child) transform-post)
)
@@ -488,7 +479,6 @@
(until (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 0.1))
(suspend)
)
(none)
)
)
@@ -496,7 +486,6 @@
:code (behavior ()
(suspend)
0
(none)
)
)
@@ -649,7 +638,6 @@
:trans (behavior ()
(common-trans self)
(spawn (-> self part2) (-> self root trans))
(none)
)
:code (behavior ()
(while (!= (-> self root scale x) 12.0)
@@ -660,7 +648,6 @@
(ja :num! (loop!))
)
(go light-eco-mother-active)
(none)
)
:post (the-as (function none :behavior light-eco-mother) ja-post)
)
@@ -671,14 +658,12 @@
(common-trans self)
(spawn (-> self part) (-> self root trans))
0
(none)
)
:code (behavior ()
(loop
(suspend)
(ja :num! (loop!))
)
(none)
)
:post (the-as (function none :behavior light-eco-mother) ja-post)
)
@@ -687,7 +672,6 @@
:event light-eco-mother-default-event-handler
:trans (behavior ()
(common-trans self)
(none)
)
:code (behavior ()
(while (!= (-> self root scale x) 0.0)
@@ -701,7 +685,6 @@
(until (not (-> self child))
(suspend)
)
(none)
)
:post (the-as (function none :behavior light-eco-mother) ja-post)
)
@@ -11,7 +11,6 @@
;; DECOMP BEGINS
(defskelgroup *med-res-snow1-sg* medres-snowback 0 2
((1 (meters 999999)))
:bounds (static-spherem -360 100 100 380)
@@ -19,11 +18,11 @@
)
(defstate cam-robotboss (camera-slave)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('set-pivot)
(let ((v0-0 (the-as object (-> self pivot-pt))))
(set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> event param 0)) quad))
(set! (-> (the-as vector v0-0) quad) (-> (the-as vector (-> block param 0)) quad))
v0-0
)
)
@@ -31,7 +30,7 @@
#f
)
(else
(cam-standard-event-handler proc arg1 event-type event)
(cam-standard-event-handler proc argc message block)
)
)
)
@@ -47,14 +46,12 @@
(set! (-> self blend-to-type) (the-as uint 2))
)
)
(none)
)
:trans (behavior ()
(when (not (logtest? (-> *camera* master-options) 2))
(set! *camera-base-mode* cam-string)
(cam-slave-go cam-free-floating)
)
(none)
)
:code (behavior ()
(loop
@@ -85,7 +82,6 @@
)
(suspend)
)
(none)
)
)
@@ -157,61 +153,56 @@
)
;; ERROR: Failed load: (set! a0-3 (l.wu (+ gp-1 -4))) at op 13
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 28]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 79]
(defbehavior ecoclaw-handler ecoclaw ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as
object
(case arg2
(('open)
(let ((gp-1 (-> arg3 param 0)))
(set! (-> self particles 0 kind)
(the-as basic (if (and (nonzero? gp-1) (type-type? (rtype-of gp-1) sparticle-launch-group))
gp-1
)
)
)
)
(set! (-> self particles 0 trans quad) (-> self root trans quad))
(set! (-> self particles 0 trans y) (+ 12288.0 (-> self particles 0 trans y)))
)
(('beam-on)
(let ((s5-0 (-> arg3 param 0)))
(set! (-> self particles 1 kind)
(the-as basic (if (and (nonzero? s5-0) (type-type? (rtype-of s5-0) sparticle-launch-group))
s5-0
)
)
)
)
(set! (-> self particles 1 trans quad) (-> self root trans quad))
(+! (-> self particles 1 trans y) 24576.0)
(let ((s5-1 (-> arg3 param 1)))
(set! (-> self particles 2 kind)
(the-as basic (if (and (nonzero? s5-1) (type-type? (rtype-of s5-1) sparticle-launch-group))
s5-1
)
)
)
)
(set! (-> self particles 2 trans quad) (-> (the-as vector (-> arg3 param 2)) quad))
(set! (-> self particles 2 trans y) (+ 81920.0 (-> self particles 2 trans y)))
)
(('beam-off)
(set! (-> self particles 1 kind) #f)
(set! (-> self particles 2 kind) #f)
(let ((a0-10 (handle->process (-> self particles 1 tracker))))
(if a0-10
(deactivate a0-10)
(case arg2
(('open)
(let ((gp-1 (-> arg3 param 0)))
(set! (-> self particles 0 kind)
(the-as basic (if (and (nonzero? gp-1) (type-type? (rtype-of gp-1) sparticle-launch-group))
gp-1
)
)
)
)
(let ((a0-14 (handle->process (-> self particles 2 tracker))))
(if a0-14
(deactivate a0-14)
)
)
)
)
(set! (-> self particles 0 trans quad) (-> self root trans quad))
(set! (-> self particles 0 trans y) (+ 12288.0 (-> self particles 0 trans y)))
)
(('beam-on)
(let ((s5-0 (-> arg3 param 0)))
(set! (-> self particles 1 kind)
(the-as basic (if (and (nonzero? s5-0) (type-type? (rtype-of s5-0) sparticle-launch-group))
s5-0
)
)
)
)
(set! (-> self particles 1 trans quad) (-> self root trans quad))
(+! (-> self particles 1 trans y) 24576.0)
(let ((s5-1 (-> arg3 param 1)))
(set! (-> self particles 2 kind)
(the-as basic (if (and (nonzero? s5-1) (type-type? (rtype-of s5-1) sparticle-launch-group))
s5-1
)
)
)
)
(set! (-> self particles 2 trans quad) (-> (the-as vector (-> arg3 param 2)) quad))
(set! (-> self particles 2 trans y) (+ 81920.0 (-> self particles 2 trans y)))
)
(('beam-off)
(set! (-> self particles 1 kind) #f)
(set! (-> self particles 2 kind) #f)
(let ((a0-10 (handle->process (-> self particles 1 tracker))))
(if a0-10
(deactivate a0-10)
)
)
(let ((a0-14 (handle->process (-> self particles 2 tracker))))
(if a0-14
(deactivate a0-14)
)
)
)
)
)
@@ -245,7 +236,6 @@
)
)
)
(none)
)
:code (behavior ()
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
@@ -256,7 +246,6 @@
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior ecoclaw) ja-post)
)
@@ -270,7 +259,6 @@
)
(suspend)
)
(none)
)
:post (the-as (function none :behavior ecoclaw) ja-post)
)
@@ -309,10 +297,10 @@
(defstate idle (silodoor)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('open)
(set! (-> self part-opened) (the-as float (-> event param 0)))
(set! (-> self part-opened) (the-as float (-> block param 0)))
)
(('hide)
(go-virtual hidden)
@@ -337,14 +325,12 @@
)
(suspend)
)
(none)
)
:post (behavior ()
(if (and (< (vector-vector-xz-distance (target-pos 0) (-> self root trans)) 57344.0) (not (ja-min? 0)))
(rider-post)
(transform-post)
)
(none)
)
)
@@ -363,7 +349,6 @@
(ja :num-func num-func-identity :frame-num 0.0)
(set! (-> self part-opened) 0.0)
(go-virtual idle)
(none)
)
)
@@ -504,7 +489,6 @@
)
)
((-> (method-of-type process-taskable play-anim) exit))
(none)
)
)
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype torus (structure)
((origin vector :inline :offset-assert 0)
(axis vector :inline :offset-assert 16)
@@ -207,14 +206,12 @@
:trans (behavior ()
(arcing-shot-setup (camera-pos) (-> self entity extra trans) 40960.0)
(arcing-shot-draw)
(none)
)
:code (behavior ()
(loop
(format *stdcon* "debug trajectory~%")
(suspend)
)
(none)
)
)
@@ -284,7 +281,6 @@
)
)
(deactivate self)
(none)
)
:post (the-as (function none :behavior darkecobomb) ja-post)
)
@@ -309,11 +305,9 @@
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
(set! (-> self next-tick) 0.9)
(none)
)
:exit (behavior ()
(stop! (-> self sound))
(none)
)
:trans (behavior ()
(darkecobomb-explode-if-player-high-enough)
@@ -354,7 +348,6 @@
(spawn (-> self part) gp-2)
)
)
(none)
)
:code (behavior ()
(sound-play "bomb-open")
@@ -371,7 +364,6 @@
(ja :num! (seek! max (-> self anim-speed)))
)
)
(none)
)
:post (the-as (function none :behavior darkecobomb) transform-post)
)
@@ -381,14 +373,12 @@
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
0
(none)
)
:trans (behavior ()
(darkecobomb-explode-if-player-high-enough)
(if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (seconds 0.5))
(go darkecobomb-countdown)
)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -403,7 +393,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior darkecobomb) transform-post)
)
@@ -411,7 +400,6 @@
(defstate darkecobomb-idle (darkecobomb)
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
(none)
)
:trans (behavior ()
(arcing-shot-calculate
@@ -421,7 +409,6 @@
(if (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self flight-time))
(go darkecobomb-land)
)
(none)
)
:code (behavior ()
(ja-no-eval :group! (-> self draw art-group data 3) :num! (seek!) :frame-num 0.0)
@@ -436,7 +423,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior darkecobomb) transform-post)
)
@@ -494,7 +480,6 @@
(defstate greenshot-idle (greenshot)
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
(none)
)
:trans (behavior ()
(arcing-shot-calculate
@@ -505,7 +490,6 @@
(deactivate self)
)
(spawn (-> self part) (-> self root-override trans))
(none)
)
:code (behavior ()
(loop
@@ -515,7 +499,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior greenshot) transform-post)
)
@@ -645,7 +628,6 @@
)
)
)
(none)
)
:trans (behavior ()
(set! (-> self ring radius-primary)
@@ -677,14 +659,12 @@
(send-event (ppointer->process (-> self parent)) 'missed-jak)
(deactivate self)
)
(none)
)
:code (behavior ()
(loop
(ja :num-func num-func-identity :frame-num (* 0.000016276043 (-> self ring radius-primary)))
(suspend)
)
(none)
)
:post (the-as (function none :behavior redshot) transform-post)
)
@@ -701,7 +681,6 @@
:event redshot-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
(none)
)
:trans (behavior ()
(redshot-trans (- (-> self stall-time) (- (-> *display* game-frame-counter) (-> self state-time))))
@@ -709,13 +688,11 @@
(go redshot-explode)
)
(spawn (-> self shot-particle) (-> self root-override trans))
(none)
)
:code (behavior ()
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior redshot) transform-post)
)
@@ -724,7 +701,6 @@
:event redshot-handler
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
(none)
)
:trans (behavior ()
(redshot-trans (seconds 5))
@@ -736,13 +712,11 @@
(go redshot-wait)
)
(spawn (-> self shot-particle) (-> self root-override trans))
(none)
)
:code (behavior ()
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior redshot) transform-post)
)
@@ -799,11 +773,11 @@
(defstate yellowshot-idle (yellowshot)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touch 'attack)
(when (= (-> proc type) target)
(send-event *target* 'attack (-> event param 0) (static-attack-info ((mode 'generic))))
(send-event *target* 'attack (-> block param 0) (static-attack-info ((mode 'generic))))
(send-event (ppointer->process (-> self parent)) 'hit-jak)
)
)
@@ -811,7 +785,6 @@
)
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
(none)
)
:trans (behavior ()
(arcing-shot-calculate
@@ -823,13 +796,11 @@
(send-event (ppointer->process (-> self parent)) 'missed-jak)
(deactivate self)
)
(none)
)
:code (behavior ()
(loop
(suspend)
)
(none)
)
:post (the-as (function none :behavior yellowshot) transform-post)
)
+62 -126
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(defmethod ease-loc-t robotboss ((obj robotboss))
(parameter-ease-sin-clamp (-> obj loc-t))
)
@@ -388,75 +387,70 @@
)
(defbehavior robotboss-handler robotboss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (case arg2
(('flash)
(set! (-> self palette-val) (* 0.0078125 (the-as float (-> arg3 param 0))))
)
(('attack)
(when (>= arg1 2)
(case (-> arg3 param 1)
(('eco-yellow)
(let ((a0-5 (-> arg3 param 0)))
(when (and a0-5 ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry a0-5)
(-> self root-override)
(the-as uint (-> self vulnerable))
)
)
(when (> (-> self hits-to-go) 0)
(set! (-> self took-hit) #t)
(let ((v0-0 (the-as number (+ (-> self hits-to-go) -1))))
(set! (-> self hits-to-go) (the-as int v0-0))
v0-0
)
)
(case arg2
(('flash)
(set! (-> self palette-val) (* 0.0078125 (the-as float (-> arg3 param 0))))
)
(('attack)
(when (>= arg1 2)
(case (-> arg3 param 1)
(('eco-yellow)
(let ((a0-5 (-> arg3 param 0)))
(when (and a0-5 ((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry a0-5)
(-> self root-override)
(the-as uint (-> self vulnerable))
)
)
)
)
)
)
)
)
(when (> (-> self hits-to-go) 0)
(set! (-> self took-hit) #t)
(let ((v0-0 (the-as number (+ (-> self hits-to-go) -1))))
(set! (-> self hits-to-go) (the-as int v0-0))
v0-0
)
)
)
)
)
)
)
)
)
)
(defstate robotboss-yellow-dark-bomb-wait (robotboss)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(let ((v1-0 event-type))
(the-as object (cond
((= v1-0 'white-eco-picked-up)
(close-specific-task! (game-task finalboss-movies) (task-status unknown))
(entity-birth-no-kill (-> self alts 5))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 0)
(set! (-> a1-2 message) 'play-anim)
(let ((t9-2 send-event-function)
(v1-2 (-> self alts 5))
)
(t9-2
(if v1-2
(-> v1-2 extra process)
)
a1-2
)
)
)
(cleanup-for-death self)
(the-as object (deactivate self))
)
(else
(robotboss-bomb-handler proc arg1 event-type event)
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('white-eco-picked-up)
(close-specific-task! (game-task finalboss-movies) (task-status unknown))
(entity-birth-no-kill (-> self alts 5))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) self)
(set! (-> a1-2 num-params) 0)
(set! (-> a1-2 message) 'play-anim)
(let ((t9-2 send-event-function)
(v1-2 (-> self alts 5))
)
(t9-2
(if v1-2
(-> v1-2 extra process)
)
a1-2
)
)
)
(cleanup-for-death self)
(deactivate self)
)
(else
(robotboss-bomb-handler proc argc message block)
)
)
)
:enter (behavior ()
(set! (-> self state-time) (-> *display* game-frame-counter))
(set! (-> self children-spawned) 0)
0
(none)
)
:exit (behavior ()
(set! (-> self des-cam-entity) #f)
@@ -521,13 +515,11 @@
)
)
(send-event (handle->process (-> self white-eco)) 'beam-off)
(none)
)
:trans (behavior ()
(robotboss-always-trans (the-as (state robotboss) #f))
(spool-push *art-control* "green-sagecage-outro-beat-boss-a" 0 self (the-as float -1.0))
(robotboss-position)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -589,7 +581,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -619,7 +610,6 @@
)
(set-blackout-frames 0)
(go robotboss-yellow-dark-bomb-wait)
(none)
)
)
@@ -629,11 +619,9 @@
(set! (-> self children-spawned) 0)
(set! (-> self state-time) (-> *display* base-frame-counter))
(ja-post)
(none)
)
:exit (behavior ()
(logclear! (-> self draw status) (draw-status hidden))
(none)
)
:trans (behavior ()
(spool-push *art-control* "green-sagecage-daxter-sacrifice" 0 self (the-as float -1.0))
@@ -647,7 +635,6 @@
(set! (-> self white-eco) (ppointer->handle (process-spawn light-eco-mother (-> self entity) gp-0 :to self)))
)
)
(none)
)
:code (behavior ()
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
@@ -810,7 +797,6 @@
(go robotboss-yellow-dark-bomb-wait)
)
)
(none)
)
)
@@ -823,7 +809,6 @@
(set! (-> self loc-t-duration) (seconds 4))
(set! (-> self desired-pool-y) -16384.0)
(play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f))
(none)
)
:trans (behavior ()
(robotboss-always-trans (the-as (state robotboss) #f))
@@ -832,7 +817,6 @@
(go robotboss-white-eco-movie)
)
(robotboss-position)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
@@ -853,7 +837,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -900,8 +883,8 @@
)
(defstate robotboss-yellow-wait (robotboss)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('hit-jak)
(let ((f0-2 (rand-float-gen)))
(cond
@@ -929,7 +912,7 @@
)
)
(else
(robotboss-handler proc arg1 event-type event)
(robotboss-handler proc argc message block)
)
)
)
@@ -939,7 +922,6 @@
(set! (-> self till-next-shot) 300)
(set! (-> self use-interesting) #t)
(set! (-> self keep-charging) #f)
(none)
)
:exit (behavior ()
(let ((a0-1 (handle->process (-> self shot-attractor))))
@@ -993,7 +975,6 @@
(robotboss-yellow-eco-off)
(robotboss-cut-cam-exit)
(stop! (-> self looping-sound 3))
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-yellow-dark-bomb)
@@ -1050,7 +1031,6 @@
(spawn (-> self particle 6) gp-2)
)
)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -1159,7 +1139,6 @@
(go robotboss-yellow-dark-bomb)
)
)
(none)
)
:post (behavior ()
(when *target*
@@ -1168,7 +1147,6 @@
)
)
(transform-post)
(none)
)
)
@@ -1181,7 +1159,6 @@
(set! (-> self loc-t-start) (-> *display* game-frame-counter))
(set! (-> self loc-t-duration) (seconds 3))
(set! (-> self desired-pool-y) -18432.0)
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-yellow-wait)
@@ -1189,7 +1166,6 @@
(go robotboss-yellow-wait)
)
(robotboss-position)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -1223,7 +1199,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -1233,13 +1208,11 @@
:enter (behavior ()
(set! (-> self children-spawned) 0)
(logior! (-> self alts 11 extra perm status) (entity-perm-status bit-3))
(none)
)
:exit (behavior ()
(set! (-> self ignore-camera) #f)
(set! (-> self des-cam-entity) #f)
(logclear! (-> self alts 11 extra perm status) (entity-perm-status bit-3))
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-yellow)
@@ -1249,7 +1222,6 @@
(go robotboss-yellow)
)
(robotboss-position)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -1279,7 +1251,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -1292,7 +1263,6 @@
(set! (-> self loc-t-start) (-> *display* game-frame-counter))
(set! (-> self loc-t-duration) (seconds 3))
(set! (-> self desired-pool-y) -20480.0)
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-red-dark-bomb-wait)
@@ -1300,7 +1270,6 @@
(if (>= (-> self loc-t) 1.0)
(go robotboss-red-dark-bomb-wait)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
@@ -1321,7 +1290,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -1475,8 +1443,8 @@
)
(defstate robotboss-red-wait (robotboss)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('hit-jak)
(let ((f0-2 (rand-float-gen)))
(cond
@@ -1504,7 +1472,7 @@
)
)
(else
(robotboss-handler proc arg1 event-type event)
(robotboss-handler proc argc message block)
)
)
)
@@ -1515,7 +1483,6 @@
(set! (-> self state-time) (-> *display* game-frame-counter))
(set! (-> self till-next-shot) 0)
0
(none)
)
:exit (behavior ()
(let ((a0-1 (handle->process (-> self shot-attractor))))
@@ -1579,7 +1546,6 @@
)
)
)
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-red-dark-bomb)
@@ -1639,7 +1605,6 @@
)
)
(robotboss-position)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -1745,7 +1710,6 @@
(go robotboss-red-dark-bomb)
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -1760,7 +1724,6 @@
(set! (-> self loc-t-duration) (seconds 3))
(set! (-> self desired-pool-y) -22528.0)
(set-setting! 'sound-flava #f 40.0 (music-flava finalboss-end))
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-red-wait)
@@ -1768,7 +1731,6 @@
(go robotboss-red-wait)
)
(robotboss-position)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -1794,7 +1756,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -1804,12 +1765,10 @@
:enter (behavior ()
(set! (-> self children-spawned) 0)
0
(none)
)
:exit (behavior ()
(set! (-> self ignore-camera) #f)
(set! (-> self des-cam-entity) #f)
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-red)
@@ -1819,7 +1778,6 @@
(go robotboss-red)
)
(robotboss-position)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -1850,7 +1808,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -1864,7 +1821,6 @@
(set! (-> self loc-t-duration) (seconds 3))
(set! (-> self desired-pool-y) -24576.0)
(play-ambient (-> self ambient) "MAI-AM01" #t (the-as vector #f))
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-green-dark-bomb-wait)
@@ -1872,7 +1828,6 @@
(if (>= (-> self loc-t) 1.0)
(go robotboss-green-dark-bomb-wait)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
@@ -1893,7 +1848,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -1927,8 +1881,8 @@
)
(defstate robotboss-green-wait (robotboss)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('trigger)
(ja-channel-push! 1 (seconds 0.2))
(ja :group! robotboss-green-roar-ja)
@@ -1986,7 +1940,7 @@
)
)
(else
(robotboss-handler proc arg1 event-type event)
(robotboss-handler proc argc message block)
)
)
)
@@ -1995,7 +1949,6 @@
(set! (-> self children-spawned) 0)
(robotboss-setup-for-hits 2 5)
(set! (-> self des-cam-entity) "camera-385")
(none)
)
:exit (behavior ()
(let ((a0-1 (handle->process (-> self shot-attractor))))
@@ -2058,7 +2011,6 @@
)
)
)
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-green-dark-bomb)
@@ -2128,7 +2080,6 @@
)
)
(robotboss-position)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -2152,7 +2103,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -2168,7 +2118,6 @@
(set! (-> self desired-pool-y) -26624.0)
(play-ambient (-> self ambient) "GOL-AM01" #t (the-as vector #f))
(set-setting! 'sound-flava #f 40.0 (music-flava finalboss-middle))
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-green-wait)
@@ -2176,7 +2125,6 @@
(go robotboss-green-wait)
)
(robotboss-position)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -2202,7 +2150,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -2212,12 +2159,10 @@
:enter (behavior ()
(set! (-> self children-spawned) 0)
0
(none)
)
:exit (behavior ()
(set! (-> self ignore-camera) #f)
(set! (-> self des-cam-entity) #f)
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-green)
@@ -2227,7 +2172,6 @@
(go robotboss-green)
)
(robotboss-position)
(none)
)
:code (behavior ()
(ja-no-eval :num! (seek!))
@@ -2266,7 +2210,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -2279,7 +2222,6 @@
(set! (-> self loc-t-start) (-> *display* game-frame-counter))
(set! (-> self loc-t-duration) (seconds 3))
(set! (-> self desired-pool-y) -28672.0)
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-blue-dark-bomb-wait)
@@ -2287,7 +2229,6 @@
(if (>= (-> self loc-t) 1.0)
(go robotboss-blue-dark-bomb-wait)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.2))
@@ -2308,7 +2249,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -2509,7 +2449,6 @@
(process-entity-status! self (entity-perm-status bit-3) #t)
(set! (-> self use-interesting) #t)
(robotboss-yellow-eco-on)
(none)
)
:exit (behavior ()
(let ((a0-1 (handle->process (-> self shot-attractor))))
@@ -2566,7 +2505,6 @@
)
(robotboss-set-dda)
(robotboss-cut-cam-exit)
(none)
)
:trans (behavior ()
(robotboss-always-trans robotboss-blue-dark-bomb)
@@ -2645,7 +2583,6 @@
)
(robotboss-position)
(robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int robotboss-blue-roar-ja))
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.4))
@@ -2691,7 +2628,6 @@
(go robotboss-blue-dark-bomb)
)
)
(none)
)
:post (the-as (function none :behavior robotboss) transform-post)
)
@@ -6,7 +6,6 @@
;; dgos: FIN
;; DECOMP BEGINS
(defskelgroup *robotboss-cinematic-sg* robotboss-cinematic robotboss-cinematic-lod0-jg robotboss-cinematic-idle-ja
((robotboss-cinematic-lod0-mg (meters 999999)))
:bounds (static-spherem 0 -10 0 2000)
@@ -67,11 +66,11 @@
(defstate plat-path-active (plat-eco-finalboss)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('target)
(process-entity-status! self (entity-perm-status complete) #t)
(set! (-> self force-dest) (the-as float (-> event param 0)))
(set! (-> self force-dest) (the-as float (-> block param 0)))
)
(('ridden 'edge-grabbed)
(if (>= (- (-> *display* base-frame-counter) (-> self touch-time)) (seconds 2))
@@ -93,7 +92,7 @@
#f
)
(else
(plat-event proc arg1 event-type event)
(plat-event proc argc message block)
)
)
)
@@ -110,7 +109,6 @@
)
)
)
(none)
)
:trans (behavior ()
(let ((s5-0 (eval-path-curve! (-> self path) (new 'stack-no-clear 'vector) 0.0 'interp))
@@ -149,7 +147,6 @@
(process-entity-status! self (entity-perm-status complete) #t)
(set! (-> self force-dest) 0.0)
)
(none)
)
)
@@ -561,8 +558,8 @@
(defstate play-anim (sage-finalboss)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('fade)
(set! (-> self credit-fade) 1.0)
)
@@ -571,12 +568,12 @@
)
(('activate-particle)
(let ((v0-0 (the-as object #t)))
(set! (-> self particle (-> event param 0) active) (the-as symbol v0-0))
(set! (-> self particle (-> block param 0) active) (the-as symbol v0-0))
v0-0
)
)
(('deactivate-particle)
(set! (-> self particle (-> event param 0) active) #f)
(set! (-> self particle (-> block param 0) active) #f)
#f
)
)
@@ -584,7 +581,6 @@
:enter (behavior ()
(set! (-> self credit-fade) 0.0)
((-> (method-of-type process-taskable play-anim) enter))
(none)
)
:exit (behavior ()
(when (= (current-status (-> self tasks)) (task-status invalid))
@@ -695,7 +691,6 @@
(set! (-> self particle v1-84 active) #f)
)
((-> (method-of-type process-taskable play-anim) exit))
(none)
)
:trans (behavior ()
(local-vars (f28-0 float))
@@ -866,7 +861,6 @@
)
)
((-> (method-of-type process-taskable play-anim) trans))
(none)
)
)
@@ -876,7 +870,6 @@
(set-blackout-frames 0)
(initialize! *game-info* 'game (the-as game-save #f) "title-start")
)
(none)
)
:code (behavior ()
(local-vars (s5-0 symbol))
@@ -936,7 +929,6 @@
)
)
(go-virtual hidden)
(none)
)
)
@@ -981,12 +973,10 @@
(sage-finalboss-extra-enter)
((-> (method-of-type process-taskable hidden) enter))
(remove-setting! 'allow-progress)
(none)
)
:trans (behavior ()
(sage-finalboss-extra-trans)
((-> (method-of-type process-taskable hidden) trans))
(none)
)
)
@@ -995,12 +985,10 @@
:enter (behavior ()
(sage-finalboss-extra-enter)
((-> (method-of-type process-taskable idle) enter))
(none)
)
:trans (behavior ()
(sage-finalboss-extra-trans)
((-> (method-of-type process-taskable idle) trans))
(none)
)
)
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype assistant-firecanyon (process-taskable)
()
:heap-base #x110
@@ -122,7 +121,6 @@
(game-task none)
)
)
(none)
)
)
@@ -247,7 +245,6 @@
)
)
)
(none)
)
)
@@ -8,7 +8,6 @@
;; DECOMP BEGINS
(deftype balloon (process-drawable)
((root-override collide-shape :offset 112)
)
@@ -110,15 +109,14 @@
(suspend)
(cleanup-for-death self)
(deactivate self)
(none)
)
)
(defstate balloon-idle (balloon)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack)
(send-event arg0 'heat -10.0)
(send-event proc 'heat -10.0)
(go balloon-popping)
)
)
@@ -132,7 +130,6 @@
(ja :num! (seek!))
)
)
(none)
)
:post (the-as (function none :behavior balloon) ja-post)
)
@@ -180,12 +177,11 @@
)
(defstate spike-up (spike)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (if (= v1-0 'go-spike-up)
#t
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('go-spike-up)
#t
)
)
)
:trans (behavior ()
@@ -214,7 +210,6 @@
)
)
)
(none)
)
:code (behavior ()
(ja-no-eval :group! (ja-group) :num! (seek!) :frame-num 0.0)
@@ -226,18 +221,16 @@
(loop
(suspend)
)
(none)
)
)
(defstate spike-down (spike)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as object (when (= v1-0 'go-spike-up)
(go spike-up)
#t
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('go-spike-up)
(go spike-up)
#t
)
)
)
:trans (behavior ()
@@ -266,14 +259,12 @@
)
)
)
(none)
)
:code (behavior ()
(transform-post)
(loop
(suspend)
)
(none)
)
)
@@ -299,14 +290,12 @@
)
)
)
(none)
)
:code (behavior ()
(transform-post)
(loop
(suspend)
)
(none)
)
)
@@ -597,16 +586,15 @@
(suspend)
(cleanup-for-death self)
(deactivate self)
(none)
)
)
(defstate idle (crate-darkeco-cluster)
:virtual #t
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('attack 'touch)
(send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((mode 'darkeco))))
(send-event proc 'attack (-> block param 0) (static-attack-info ((mode 'darkeco))))
(go-virtual die)
)
)
@@ -616,7 +604,6 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
0
(none)
)
)
+24 -51
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(if (not (nmember "flutp" *kernel-packages*))
(set! *kernel-packages* (cons "flutp" *kernel-packages*))
)
@@ -73,33 +72,27 @@
(defstate wait-for-start (flutflut)
:virtual #t
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(let ((v1-0 arg2))
(the-as
object
(cond
((= v1-0 'trans)
(vector+! (the-as vector (-> arg3 param 0)) (-> self root-override trans) (-> self extra-trans))
)
((= v1-0 'notify)
(let ((v0-1 (the-as structure #t)))
(set! (-> self auto-get-off) (the-as symbol v0-1))
v0-1
)
)
((or (= v1-0 'touch) (= v1-0 'attack))
(set! (-> self touch-time) (-> *display* base-frame-counter))
#f
)
)
)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('trans)
(vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans))
)
(('notify)
(let ((v0-1 (the-as structure #t)))
(set! (-> self auto-get-off) (the-as symbol v0-1))
v0-1
)
)
(('touch 'attack)
(set! (-> self touch-time) (-> *display* base-frame-counter))
#f
)
)
)
:exit (behavior ()
(set! (-> self root-override root-prim prim-core action) (collide-action))
(set! (-> self root-override root-prim prim-core offense) (collide-offense no-offense))
0
(none)
)
:code (behavior ()
(loop
@@ -169,7 +162,6 @@
(go-virtual wait-for-return)
(go-virtual idle)
)
(none)
)
)
@@ -179,7 +171,6 @@
:enter (behavior ()
(blocking-plane-destroy)
(blocking-plane-spawn (the-as curve-control (-> self path-target)))
(none)
)
:exit (-> (method-of-type flutflut wait-for-start) exit)
:code (behavior ()
@@ -193,13 +184,7 @@
)
(when (logtest? (-> self draw status) (draw-status was-drawn))
(if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))))
(level-hint-spawn
(text-id swamp-flutflut-hint)
"sksp0160"
(the-as entity #f)
*entity-pool*
(game-task none)
)
(level-hint-spawn (text-id swamp-flutflut-hint) "sksp0160" (the-as entity #f) *entity-pool* (game-task none))
)
)
(when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))))
@@ -233,15 +218,14 @@
(suspend)
(ja :num! (loop!))
)
(none)
)
:post (the-as (function none :behavior flutflut) ja-post)
)
(defstate pickup (flutflut)
:virtual #t
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('draw)
(ja-channel-set! 1)
(ja :group! (-> self draw art-group data 3))
@@ -250,7 +234,7 @@
(transform-post)
)
(('trans)
(vector+! (the-as vector (-> arg3 param 0)) (-> self root-override trans) (-> self extra-trans))
(vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans))
)
(('touch 'attack)
#f
@@ -259,7 +243,6 @@
)
:enter (behavior ((arg0 (state flutflut)))
((-> arg0 enter))
(none)
)
:code (behavior ((arg0 (state flutflut)))
(ja-channel-set! 0)
@@ -284,27 +267,22 @@
)
)
(go arg0)
(none)
)
)
(defstate wait-for-return (flutflut)
:virtual #t
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(if (and (or (= arg2 'touch) (= arg2 'attack)) (send-event *target* 'end-mode))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(if (and (or (= message 'touch) (= message 'attack)) (send-event *target* 'end-mode))
(go-virtual pickup (method-of-object self idle))
)
(the-as
object
(if (= arg2 'trans)
(vector+! (the-as vector (-> arg3 param 0)) (-> self root-override trans) (-> self extra-trans))
)
)
(if (= message 'trans)
(vector+! (the-as vector (-> block param 0)) (-> self root-override trans) (-> self extra-trans))
)
)
:enter (behavior ()
(blocking-plane-destroy)
(blocking-plane-spawn (the-as curve-control (-> self path-flut)))
(none)
)
:code (behavior ()
(ja-channel-set! 0)
@@ -316,7 +294,6 @@
(flutflut-effect)
(suspend)
)
(none)
)
)
@@ -378,7 +355,3 @@
(go (method-of-object obj wait-for-start))
(none)
)
+29 -81
View File
@@ -421,7 +421,6 @@
(remove-setting! 'sound-flava)
(target-exit)
)
(none)
)
:code (behavior ((arg0 handle))
(target-exit)
@@ -500,7 +499,6 @@
)
(remove-exit)
(go target-flut-get-on arg0)
(none)
)
:post target-post
)
@@ -509,7 +507,6 @@
:event target-flut-standard-event-handler
:enter (behavior ()
(set! (-> self control unknown-surface00) *flut-walk-mods*)
(none)
)
:exit (-> target-flut-start exit)
:trans (behavior ()
@@ -546,7 +543,6 @@
)
(go target-flut-falling #f)
)
(none)
)
:code (behavior ()
(let ((gp-0 22))
@@ -587,7 +583,6 @@
(suspend)
(ja :num! (loop!))
)
(none)
)
:post target-flut-post
)
@@ -599,13 +594,11 @@
(set! (-> self control unknown-surface00) *flut-walk-mods*)
(set! (-> self control unknown-uint20) (the-as uint (-> self control unknown-surface00 turnv)))
(set! (-> self control unknown-int21) (the-as int (-> self control unknown-surface00 target-speed)))
(none)
)
:exit (behavior ()
(set! (-> self control unknown-surface00 turnv) (the-as float (-> self control unknown-uint20)))
(set! (-> self control unknown-surface00 target-speed) (the-as float (-> self control unknown-uint30)))
((-> target-flut-start exit))
(none)
)
:trans (behavior ()
(if (not (move-legs?))
@@ -663,7 +656,6 @@
)
)
)
(none)
)
:code (behavior ()
(let ((f28-0 0.0)
@@ -747,16 +739,15 @@
)
)
)
(none)
)
:post target-flut-post
)
(defstate target-flut-jump (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(when (and (= event-type 'touched)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(when (and (= message 'touched)
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(-> self control)
(the-as uint 6)
)
@@ -767,22 +758,22 @@
)
)
)
(send-event proc 'bonk (-> event param 0) (-> self control ground-impact-vel))
(send-event proc 'bonk (-> block param 0) (-> self control ground-impact-vel))
(when (target-send-attack
proc
(the-as uint 'flut-bonk)
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(-> self control unknown-dword50)
(-> self control unknown-dword51)
)
)
)
(case event-type
(case message
(('jump)
(go target-flut-jump (the-as float (-> event param 0)) (the-as float (-> event param 0)))
(go target-flut-jump (the-as float (-> block param 0)) (the-as float (-> block param 0)))
)
(else
(target-flut-standard-event-handler proc arg1 event-type event)
(target-flut-standard-event-handler proc argc message block)
)
)
)
@@ -798,12 +789,10 @@
(set! (-> self control unknown-float122)
(fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01)))))
)
(none)
)
:exit (behavior ()
(target-exit)
((-> target-flut-start exit))
(none)
)
:trans (behavior ()
(set! (-> self control unknown-float123)
@@ -855,7 +844,6 @@
(fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01)))))
(-> *display* seconds-per-frame)
)
(none)
)
:code (behavior ((arg0 float) (arg1 float))
(ja-channel-push! 2 (seconds 0.12))
@@ -910,7 +898,6 @@
:frame-interp (-> self control unknown-float122)
)
)
(none)
)
:post target-flut-post
)
@@ -924,14 +911,12 @@
(set! (-> self control dynam gravity-length) 245760.0)
(logclear! (-> self control status) (cshape-moving-flags onsurf onground tsurf))
(set! (-> self control unknown-surface00) *flut-double-jump-mods*)
(none)
)
:exit (behavior ()
(set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max))
(set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length))
(target-exit)
((-> target-flut-start exit))
(none)
)
:trans (behavior ()
(if (logtest? (-> self control status) (cshape-moving-flags onsurf))
@@ -966,7 +951,6 @@
(fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01)))))
(-> *display* seconds-per-frame)
)
(none)
)
:code (behavior ((arg0 float) (arg1 float))
(ja-channel-push! 1 (seconds 0.05))
@@ -1029,7 +1013,6 @@
(ja :num! (loop! max))
(ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122))
)
(none)
)
:post target-flut-post
)
@@ -1044,7 +1027,6 @@
(set! (-> self control unknown-dword31) 0)
(set! (-> self control unknown-dword33) 0)
(set! (-> self control unknown-surface00) *flut-walk-mods*)
(none)
)
:exit (-> target-flut-start exit)
:trans (behavior ()
@@ -1078,14 +1060,12 @@
)
(go target-flut-falling #f)
)
(none)
)
:code (behavior ()
(let ((t9-0 target-flut-hit-ground-anim))
(t9-0)
)
(go target-flut-stance)
(none)
)
:post target-flut-post
)
@@ -1095,7 +1075,6 @@
:enter (behavior ((arg0 symbol))
(set! (-> self control unknown-surface00) *flut-jump-mods*)
(set! (-> self state-time) (-> *display* base-frame-counter))
(none)
)
:exit (-> target-flut-start exit)
:trans (behavior ()
@@ -1118,7 +1097,6 @@
(fmax 0.0 (fmin 1.0 (* 0.000048828126 (+ -10240.0 (-> self control unknown-float01)))))
(-> *display* seconds-per-frame)
)
(none)
)
:code (behavior ((arg0 symbol))
(cond
@@ -1142,25 +1120,24 @@
(ja :num! (loop! max))
(ja :chan 1 :num! (chan 0) :frame-interp (-> self control unknown-float122))
)
(none)
)
:post target-flut-post
)
(defstate target-flut-running-attack (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touched)
(cond
(((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(-> self control)
(the-as uint 224)
)
(let ((gp-1 (target-send-attack
proc
(the-as uint (-> self control unknown-symbol30))
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(-> self control unknown-dword50)
(-> self control unknown-dword51)
)
@@ -1200,12 +1177,12 @@
)
)
(else
(target-flut-dangerous-event-handler proc arg1 event-type event)
(target-flut-dangerous-event-handler proc argc message block)
)
)
)
(else
(target-flut-dangerous-event-handler proc arg1 event-type event)
(target-flut-dangerous-event-handler proc argc message block)
)
)
)
@@ -1246,7 +1223,6 @@
)
(set! (-> self control unknown-dword82) (-> *display* base-frame-counter))
)
(none)
)
:exit (behavior ()
(set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max))
@@ -1255,7 +1231,6 @@
(set! (-> *run-attack-mods* turnvv) 0.0)
(set! (-> self control unknown-dword31) (-> *display* base-frame-counter))
(target-exit)
(none)
)
:trans (behavior ()
(when (!= (-> self state-time) (-> *display* base-frame-counter))
@@ -1306,7 +1281,6 @@
)
)
)
(none)
)
:code (behavior ()
(ja-channel-push! 1 (seconds 0.02))
@@ -1410,16 +1384,15 @@
)
)
(go target-flut-stance)
(none)
)
:post target-flut-post
)
(defstate target-flut-air-attack (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(if (and (= event-type 'touched)
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(if (and (= message 'touched)
((method-of-type touching-shapes-entry prims-touching?)
(the-as touching-shapes-entry (-> event param 0))
(the-as touching-shapes-entry (-> block param 0))
(-> self control)
(the-as uint 6)
)
@@ -1430,14 +1403,14 @@
)
)
)
(send-event proc 'bonk (-> event param 0) (-> self control ground-impact-vel))
(send-event proc 'bonk (-> block param 0) (-> self control ground-impact-vel))
)
(case event-type
(case message
(('jump)
(go target-flut-jump (the-as float (-> event param 0)) (the-as float (-> event param 0)))
(go target-flut-jump (the-as float (-> block param 0)) (the-as float (-> block param 0)))
)
(else
(target-flut-dangerous-event-handler proc arg1 event-type event)
(target-flut-dangerous-event-handler proc argc message block)
)
)
)
@@ -1464,14 +1437,12 @@
)
)
)
(none)
)
:exit (behavior ()
(target-danger-set! 'harmless #f)
(set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max))
(set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length))
(set! (-> self control dynam gravity quad) (-> self control unknown-dynamics00 gravity quad))
(none)
)
:trans (behavior ()
(let ((s5-0 (new-stack-vector0)))
@@ -1510,7 +1481,6 @@
(logior! (-> self control status) (cshape-moving-flags onsurf))
(go target-flut-hit-ground)
)
(none)
)
:code (behavior ((arg0 float))
(sound-play "flut-hit" :pitch -0.5)
@@ -1551,7 +1521,6 @@
(loop
(suspend)
)
(none)
)
:post target-flut-post
)
@@ -1580,7 +1549,6 @@
)
)
)
(none)
)
:exit (-> target-flut-air-attack exit)
:trans (-> target-flut-hit-ground trans)
@@ -1608,7 +1576,6 @@
(ja :num! (seek!))
)
(go target-flut-stance)
(none)
)
:post target-flut-post
)
@@ -1621,7 +1588,6 @@
)
(target-exit)
((-> target-flut-start exit))
(none)
)
:trans (behavior ()
(when (= *cheat-mode* 'debug)
@@ -1630,7 +1596,6 @@
(go target-flut-stance)
)
)
(none)
)
:code (behavior ((arg0 symbol) (arg1 attack-info))
(set! (-> self state-time) (-> *display* base-frame-counter))
@@ -1765,7 +1730,6 @@
)
)
(go target-flut-hit-ground)
(none)
)
:post target-flut-post
)
@@ -1777,7 +1741,6 @@
(target-exit)
(remove-setting! 'process-mask)
(apply-settings *setting-control*)
(none)
)
:trans (-> target-hit trans)
:code (behavior ((arg0 symbol))
@@ -1872,7 +1835,6 @@
(set! v1-104 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (seconds 1)) (not (movie?))))
)
(go target-flut-stance)
(none)
)
:post target-no-stick-post
)
@@ -1934,7 +1896,6 @@
(quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00))
(rot->dir-targ! (-> self control))
(go target-flut-stance)
(none)
)
:post (behavior ()
(let ((gp-0 (new 'stack-no-clear 'vector))
@@ -1963,7 +1924,6 @@
)
)
(target-no-move-post)
(none)
)
)
@@ -1980,12 +1940,10 @@
)
)
(go target-flut-get-off-jump arg0)
(none)
)
:post (behavior ()
(target-no-stick-post)
(target-flut-post-post)
(none)
)
)
@@ -2045,7 +2003,6 @@
(send-event *camera* 'ease-in)
(ja-channel-set! 0)
(go target-flut-get-off-hit-ground #f)
(none)
)
:post (behavior ()
(let ((gp-0 (new 'stack-no-clear 'vector))
@@ -2080,7 +2037,6 @@
(quaternion-copy! (the-as quaternion (-> self flut flut-quat)) (-> self control quat))
(set! (-> self flut flut-scale quad) (-> self control scale quad))
(target-no-move-post)
(none)
)
)
@@ -2090,7 +2046,6 @@
:trans (behavior ()
(logior! (-> self control status) (cshape-moving-flags onsurf onground tsurf))
((-> target-hit-ground trans))
(none)
)
:code (behavior ((arg0 symbol))
(ja-channel-set! 1)
@@ -2103,27 +2058,26 @@
(ja :num! (seek!))
)
(go target-stance)
(none)
)
:post target-post
)
(defstate target-flut-grab (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(cond
((and (= event-type 'query) (= (-> event param 0) 'mode))
((and (= message 'query) (= (-> block param 0) 'mode))
(-> self state name)
)
(else
(case event-type
(case message
(('end-mode)
(go target-flut-stance)
)
(('clone-anim)
(go target-flut-clone-anim (process->handle (the-as process (-> event param 0))))
(go target-flut-clone-anim (process->handle (the-as process (-> block param 0))))
)
(else
(target-generic-event-handler proc arg1 event-type event)
(target-generic-event-handler proc argc message block)
)
)
)
@@ -2133,45 +2087,39 @@
(set! (-> self control unknown-surface00) *grab-mods*)
(set! (-> self neck flex-blend) 0.0)
(logior! (-> self state-flags) (state-flags invulnerable grabbed))
(none)
)
:exit (behavior ()
(logclear! (-> self state-flags) (state-flags invulnerable grabbed))
(target-exit)
((-> target-flut-start exit))
(none)
)
:code (-> target-flut-stance code)
:post (behavior ()
(target-no-stick-post)
(target-flut-post-post)
(none)
)
)
(defstate target-flut-clone-anim (target)
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(if (and (= event-type 'trans) (= (-> event param 0) 'restore))
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(if (and (= message 'trans) (= (-> block param 0) 'restore))
(set! (-> self control unknown-uint20) (the-as uint #f))
)
((-> target-flut-grab event) proc arg1 event-type event)
((-> target-flut-grab event) proc argc message block)
)
:enter (-> target-clone-anim enter)
:exit (behavior ()
(send-event (ppointer->process (-> self sidekick)) 'matrix #f)
((-> target-clone-anim exit))
((-> target-flut-start exit))
(none)
)
:code (behavior ((arg0 handle))
(send-event (ppointer->process (-> self sidekick)) 'matrix 'play-anim)
(clone-anim arg0 33 #t "")
(go target-flut-stance)
(none)
)
:post (behavior ()
(target-no-ja-move-post)
(target-flut-post-post)
(none)
)
)
-4
View File
@@ -7,7 +7,6 @@
;; DECOMP BEGINS
(deftype evilbro (process-taskable)
((evilsis entity-actor :offset-assert 380)
)
@@ -46,7 +45,6 @@
:exit (behavior ()
(send-event (-> self evilsis extra process) 'end-mode)
((-> (method-of-type process-taskable play-anim) exit))
(none)
)
)
@@ -90,7 +88,6 @@
)
)
)
(none)
)
)
@@ -138,7 +135,6 @@
:trans (behavior ()
(set! (-> self will-talk) #f)
((-> (method-of-type process-taskable idle) trans))
(none)
)
)
+7 -15
View File
@@ -9,7 +9,6 @@
;; DECOMP BEGINS
(deftype springbox (process-drawable)
((spring-height meters :offset-assert 176)
(smush float :offset-assert 180)
@@ -34,10 +33,10 @@
)
(defstate bouncer-wait (springbox)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('bonk)
(when (send-event arg0 'jump (-> self spring-height) (-> self spring-height) #f)
(when (send-event proc 'jump (-> self spring-height) (-> self spring-height) #f)
(sound-play "trampoline")
(go bouncer-fire)
)
@@ -48,7 +47,7 @@
)
)
(('attack)
(when (and (= (-> arg3 param 1) 'flop) (send-event arg0 'jump (-> self spring-height) (-> self spring-height) #f))
(when (and (= (-> block param 1) 'flop) (send-event proc 'jump (-> self spring-height) (-> self spring-height) #f))
(go bouncer-fire)
#f
)
@@ -62,19 +61,18 @@
(logior! (-> self mask) (process-mask sleep))
(suspend)
)
(none)
)
)
(defstate bouncer-smush (springbox)
:event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(case arg2
:event (behavior ((proc process) (argc int) (message symbol) (block event-message-block))
(case message
(('touch)
(set! (-> self state-time) (-> *display* base-frame-counter))
#f
)
(else
((-> bouncer-wait event) arg0 arg1 arg2 arg3)
((-> bouncer-wait event) proc argc message block)
)
)
)
@@ -101,7 +99,6 @@
(go bouncer-wait)
)
)
(none)
)
:post (the-as (function none :behavior springbox) transform-post)
)
@@ -115,7 +112,6 @@
(ja :num! (seek!))
)
(go bouncer-wait)
(none)
)
:post (the-as (function none :behavior springbox) transform-post)
)
@@ -147,7 +143,3 @@
(go bouncer-wait)
(none)
)
+25 -32
View File
@@ -125,36 +125,33 @@
)
)
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 50]
;; WARN: rewrite_to_get_var got a none typed variable. Is there unreachable code? [OP: 52]
(defbehavior darkvine-event-handler darkvine ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(the-as object (case arg2
(('touch)
(do-push-aways! (-> self root-override))
(when (-> self dangerous)
(if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info))
(set-collide-offense (-> self root-override) 2 (collide-offense no-offense))
)
)
)
(('attack)
(let ((v1-10 (-> arg3 param 2)))
(cond
((!= v1-10 (-> self player-attack-id))
(set! (-> self player-attack-id) (the-as int v1-10))
(when (-> self vulnerable)
(do-push-aways! (-> self root-override))
(go darkvine-retreat)
)
)
(else
'push
)
)
)
)
)
(case arg2
(('touch)
(do-push-aways! (-> self root-override))
(when (-> self dangerous)
(if (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info))
(set-collide-offense (-> self root-override) 2 (collide-offense no-offense))
)
)
)
(('attack)
(let ((v1-10 (-> arg3 param 2)))
(cond
((!= v1-10 (-> self player-attack-id))
(set! (-> self player-attack-id) (the-as int v1-10))
(when (-> self vulnerable)
(do-push-aways! (-> self root-override))
(go darkvine-retreat)
)
)
(else
'push
)
)
)
)
)
)
(defstate darkvine-idle (darkvine)
@@ -182,7 +179,6 @@
)
)
)
(none)
)
:post (behavior ()
(when (and (-> self hit-player)
@@ -200,7 +196,6 @@
self
)
)
(none)
)
)
@@ -249,7 +244,6 @@
(ja :num! (seek!))
)
(go darkvine-idle)
(none)
)
:post (-> darkvine-idle post)
)
@@ -268,7 +262,6 @@
)
(logior! (-> self mask) (process-mask sleep))
(anim-loop)
(none)
)
:post (-> darkvine-idle post)
)

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