docs: add support for :override-doc in method declarations as well as documenting state handlers (#2139)

Adding support for better child-type method docstrings. This is a
problem unique to methods.

Usually, a child-type will have the same signature and a common name
will apply, but the implementation is different. This means, you
probably want a different docstring to describe what is happening.

Currently this is possible to do via `:replace`. The problem with
replace is two fold:
- a replaced method ends up in the generated `deftype`...because you
usually change the signature!
- we don't put docstrings in the `deftype` in normal GOAL, this is just
something we do for the `all-types` file (they go in the `defmethod`
instead)
- more importantly, this means anytime you now want to change the
parent's name/args/return type -- you have to apply that change
everywhere.

So this is a better design you can now just declare the method like so:
```clj
(:override-doc "my new docstring" <method_id>)
```

And internally a pseudo-replaced method will be added, but it will
inherit everything from the parent (except the docstring of course)

Unrelated - I also made all the keyword args for declaring methods not
depend on ordering

This also adds support for documenting virtual and non-virtual state
handlers. For example:

```clj
  (:states
    (part-tester-idle (:event "test") symbol))
```

or

```clj
(idle () _type_ :state (:event "test") 20)
```

I will probably add the ability to give some sort of over-view docstring
at a later date.

Co-authored-by: water <awaterford111445@gmail.com>
This commit is contained in:
Tyler Wilding 2023-01-21 20:45:45 -05:00 committed by GitHub
parent e5d6ac1c41
commit abf61a94fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
65 changed files with 793 additions and 472 deletions

View file

@ -65,10 +65,7 @@
"--iso_data_path",
"${workspaceRoot}/iso_data/jak2",
"--game",
"jak2",
"--pretty-print",
"--num_threads",
"32"
"jak2"
]
},
{
@ -96,7 +93,11 @@
"--game",
"jak2",
"--file",
<<<<<<< HEAD
"path-h"
=======
"nav-enemy"
>>>>>>> e5d6ac1c4122115c179fe620c8c8d6c04ed217fe
]
},
{

View file

@ -37,7 +37,8 @@ std::string reg_kind_to_string(RegClass kind) {
bool MethodInfo::operator==(const MethodInfo& other) const {
return id == other.id && name == other.name && type == other.type &&
defined_in_type == other.defined_in_type && other.no_virtual == no_virtual &&
other.overrides_method_type_of_parent == overrides_method_type_of_parent;
other.overrides_parent == overrides_parent &&
only_overrides_docstring == other.only_overrides_docstring;
}
std::string MethodInfo::diff(const MethodInfo& other) const {
@ -62,10 +63,16 @@ std::string MethodInfo::diff(const MethodInfo& other) const {
result += fmt::format("no_virtual: {} vs. {}\n", no_virtual, other.no_virtual);
}
if (overrides_method_type_of_parent != other.overrides_method_type_of_parent) {
result += fmt::format("overrides_method_type_of_parent: {} vs. {}\n",
overrides_method_type_of_parent, other.overrides_method_type_of_parent);
if (overrides_parent != other.overrides_parent) {
result +=
fmt::format("overrides_parent: {} vs. {}\n", overrides_parent, other.overrides_parent);
}
if (only_overrides_docstring != other.only_overrides_docstring) {
result += fmt::format("only_overrides_docstring: {} vs. {}\n", only_overrides_docstring,
other.only_overrides_docstring);
}
return result;
}
@ -220,8 +227,36 @@ std::string Type::get_parent() const {
* to check if two types are really identical.
*/
bool Type::common_type_info_equal(const Type& other) const {
// Check if methods only differ because of documentation overrides
bool methods_the_same = true;
for (const auto& method : m_methods) {
if (method.only_overrides_docstring) {
// skip these methods, as we _expect_ to not find them in one or the other!
// this is a all-types vs normal code wrinkle
continue;
}
// For each method, find it's matching id, it should only be allowed to be different
// if its just the docstring
bool found_method = false;
for (const auto& _method : other.m_methods) {
if (method.id == _method.id) {
if (method == _method) {
found_method = true;
break;
} else {
methods_the_same = false;
break;
}
}
}
if (!methods_the_same || !found_method) {
methods_the_same = false;
break;
}
}
// clang-format off
return m_methods == other.m_methods &&
return methods_the_same &&
m_states == other.m_states &&
m_new_method_info == other.m_new_method_info &&
m_new_method_info_defined == other.m_new_method_info_defined &&
@ -347,7 +382,7 @@ bool Type::get_my_method(int id, MethodInfo* out) const {
*/
bool Type::get_my_last_method(MethodInfo* out) const {
for (auto it = m_methods.rbegin(); it != m_methods.rend(); it++) {
if (!it->overrides_method_type_of_parent) {
if (!it->overrides_parent && !it->only_overrides_docstring) {
*out = *it;
return true;
}
@ -367,12 +402,27 @@ bool Type::get_my_new_method(MethodInfo* out) const {
return false;
}
/*!
* Get the number of legitimate methods / overridden methods. Ignore that which are inherited just
* for documentation overrides
*/
int Type::get_num_methods() const {
int num = 0;
for (auto it = m_methods.rbegin(); it != m_methods.rend(); it++) {
if (it->only_overrides_docstring) {
continue;
}
num++;
}
return num;
}
/*!
* Add a method defined specifically for this type.
*/
const MethodInfo& Type::add_method(const MethodInfo& info) {
for (auto it = m_methods.rbegin(); it != m_methods.rend(); it++) {
if (!it->overrides_method_type_of_parent) {
if (!it->overrides_parent && !it->only_overrides_docstring) {
ASSERT(it->id + 1 == info.id);
break;
}

View file

@ -29,7 +29,8 @@ struct MethodInfo {
TypeSpec type;
std::string defined_in_type;
bool no_virtual = false;
bool overrides_method_type_of_parent = false;
bool overrides_parent = false;
bool only_overrides_docstring = false;
std::optional<std::string> docstring;
bool operator==(const MethodInfo& other) const;
@ -88,6 +89,7 @@ class Type {
bool get_my_method(int id, MethodInfo* out) const;
bool get_my_last_method(MethodInfo* out) const;
bool get_my_new_method(MethodInfo* out) const;
int get_num_methods() const;
const MethodInfo& add_method(const MethodInfo& info);
const MethodInfo& add_new_method(const MethodInfo& info);
std::string print_method_info() const;
@ -115,6 +117,10 @@ class Type {
bool gen_inspect() const { return m_generate_inspect; }
DefinitionMetadata m_metadata;
std::unordered_map<std::string, std::unordered_map<std::string, DefinitionMetadata>>
m_virtual_state_definition_meta = {};
std::unordered_map<std::string, std::unordered_map<std::string, DefinitionMetadata>>
m_state_definition_meta = {};
protected:
Type(std::string parent, std::string name, bool is_boxed, int heap_base);

View file

@ -514,6 +514,21 @@ int TypeSystem::get_load_size_allow_partial_def(const TypeSpec& ts) const {
return partial_def->get_load_size();
}
MethodInfo TypeSystem::override_method(Type* type,
const std::string& type_name,
const int method_id,
const std::optional<std::string>& docstring) {
// Lookup the method from the parent type
MethodInfo existing_info;
bool exists = try_lookup_method(type->get_parent(), method_id, &existing_info);
if (!exists) {
throw_typesystem_error("Trying to use override a method that has no parent declaration");
}
// use the existing ID.
return type->add_method({existing_info.id, existing_info.name, existing_info.type,
type->get_name(), existing_info.no_virtual, false, true, docstring});
}
MethodInfo TypeSystem::declare_method(const std::string& type_name,
const std::string& method_name,
const std::optional<std::string>& docstring,
@ -564,7 +579,7 @@ MethodInfo TypeSystem::declare_method(Type* type,
// use the existing ID.
return type->add_method(
{existing_info.id, method_name, ts, type->get_name(), no_virtual, true, docstring});
{existing_info.id, method_name, ts, type->get_name(), no_virtual, true, false, docstring});
} else {
if (got_existing) {
// make sure we aren't changing anything.
@ -595,7 +610,7 @@ MethodInfo TypeSystem::declare_method(Type* type,
} else {
// add a new method!
return type->add_method({get_next_method_id(type), method_name, ts, type->get_name(),
no_virtual, false, docstring});
no_virtual, false, false, docstring});
}
}
}
@ -664,7 +679,7 @@ MethodInfo TypeSystem::add_new_method(Type* type,
return existing;
} else {
return type->add_new_method({0, "new", ts, type->get_name(), false, false, docstring});
return type->add_new_method({0, "new", ts, type->get_name(), false, false, false, docstring});
}
}
@ -1876,6 +1891,8 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const {
}
std::string methods_string;
// New Method
auto new_info = type->get_new_method_defined_for_type();
if (new_info) {
methods_string.append("(new (");
@ -1896,7 +1913,13 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const {
methods_string.append("0)\n ");
}
// Rest of methods
for (auto& info : type->get_methods_defined_for_type()) {
// check if we only override the docstring
if (info.only_overrides_docstring) {
continue;
}
methods_string.append(fmt::format("({} (", info.name));
for (size_t i = 0; i < info.type.arg_count() - 1; i++) {
methods_string.append(info.type.get_arg(i).print());
@ -1911,7 +1934,7 @@ std::string TypeSystem::generate_deftype_footer(const Type* type) const {
methods_string.append(":no-virtual ");
}
if (info.overrides_method_type_of_parent) {
if (info.overrides_parent) {
methods_string.append(":replace ");
}

View file

@ -160,6 +160,10 @@ class TypeSystem {
int get_load_size_allow_partial_def(const TypeSpec& ts) const;
MethodInfo override_method(Type* type,
const std::string& type_name,
const int method_id,
const std::optional<std::string>& docstring);
MethodInfo declare_method(const std::string& type_name,
const std::string& method_name,
const std::optional<std::string>& docstring,

View file

@ -6,8 +6,11 @@
#include "deftype.h"
#include <unordered_map>
#include "common/goos/ParseHelpers.h"
#include "common/log/log.h"
#include "common/type_system/state.h"
#include "common/util/string_util.h"
#include "third-party/fmt/core.h"
@ -197,48 +200,148 @@ void add_bitfield(BitFieldType* bitfield_type, TypeSystem* ts, const goos::Objec
skip_in_decomp);
}
void declare_method(Type* type, TypeSystem* type_system, const goos::Object& def) {
struct StructureDefResult {
TypeFlags flags;
bool generate_runtime_type = true;
bool pack_me = false;
bool allow_misaligned = false;
bool final = false;
bool always_stack_singleton = false;
std::unordered_map<std::string, std::unordered_map<std::string, DefinitionMetadata>>
virtual_state_definitions;
std::unordered_map<std::string, std::unordered_map<std::string, DefinitionMetadata>>
state_definitions;
void append_virtual_state_def(const std::string& state_name,
const StateHandler handler,
DefinitionMetadata data) {
if (virtual_state_definitions.count(state_name) == 0) {
virtual_state_definitions[state_name] = std::unordered_map<std::string, DefinitionMetadata>();
}
virtual_state_definitions[state_name][handler_kind_to_name(handler)] = data;
}
void append_state_def(const std::string& state_name,
const StateHandler handler,
DefinitionMetadata data) {
if (state_definitions.count(state_name) == 0) {
state_definitions[state_name] = std::unordered_map<std::string, DefinitionMetadata>();
}
state_definitions[state_name][handler_kind_to_name(handler)] = data;
}
};
void declare_method(Type* type,
TypeSystem* type_system,
const goos::Object& def,
StructureDefResult& struct_def) {
for_each_in_list(def, [&](const goos::Object& _obj) {
auto obj = &_obj;
// (name args return-type [:no-virtual] [:replace] [:state] [id])
auto method_name = symbol_string(car(obj));
obj = cdr(obj);
// check for docstring
// (name args return-type [:no-virtual] [:replace] [:state] [:behavior] [id])
// or alternatively
// (:override-doc "new-docstring" [id])
// - this effectively does a :replace without having to re-define the name and signature and
// keep that in-sync
std::string method_name;
TypeSpec function_typespec("function");
std::optional<std::string> docstring;
if (obj->is_pair() && car(obj).is_string()) {
docstring = str_util::trim_newline_indents(car(obj).as_string()->data);
obj = cdr(obj);
}
auto& args = car(obj);
obj = cdr(obj);
auto& return_type = car(obj);
obj = cdr(obj);
goos::Object args;
goos::Object return_type;
bool no_virtual = false;
bool replace_method = false;
TypeSpec function_typespec("function");
bool overriding_doc = false;
if (!obj->is_empty_list() && car(obj).is_symbol(":no-virtual")) {
if (!obj->is_empty_list() && car(obj).is_symbol(":override-doc")) {
obj = cdr(obj);
no_virtual = true;
if (car(obj).is_string()) {
docstring = str_util::trim_newline_indents(car(obj).as_string()->data);
overriding_doc = true;
obj = cdr(obj);
} else {
throw std::runtime_error("Specified :override-doc with no docstring!");
}
}
if (!obj->is_empty_list() && car(obj).is_symbol(":replace")) {
obj = cdr(obj);
replace_method = true;
}
if (!obj->is_empty_list() && car(obj).is_symbol(":state")) {
obj = cdr(obj);
function_typespec = TypeSpec("state");
}
if (!obj->is_empty_list() && car(obj).is_symbol(":behavior")) {
obj = cdr(obj);
function_typespec.add_new_tag("behavior", symbol_string(obj->as_pair()->car));
if (!overriding_doc) {
// name
method_name = symbol_string(car(obj));
obj = cdr(obj);
// docstring
if (obj->is_pair() && car(obj).is_string()) {
docstring = str_util::trim_newline_indents(car(obj).as_string()->data);
obj = cdr(obj);
}
// args
args = car(obj);
obj = cdr(obj);
// return type
return_type = car(obj);
obj = cdr(obj);
// Iterate through the remainder of the form's supported keywords
// this int is assumed to be the id, and always at the end!
//
// Doing it like this makes the ordering not critical
while (!obj->is_empty_list() && car(obj).is_symbol()) {
const auto& keyword = car(obj).as_symbol()->name;
if (keyword == ":no-virtual") {
no_virtual = true;
} else if (keyword == ":replace") {
replace_method = true;
} else if (keyword == ":state") {
auto behavior_tag = function_typespec.try_get_tag("behavior");
function_typespec = TypeSpec("state");
if (behavior_tag) {
function_typespec.add_new_tag("behavior", behavior_tag.value());
}
// parse state docstrings if available
if (car(cdr(obj)).is_list()) {
obj = cdr(obj);
auto docstring_list = &car(obj);
auto elem = docstring_list;
while (!elem->is_empty_list() && car(elem).is_symbol()) {
const auto& handler = car(elem).as_symbol()->name;
const auto handler_kind = handler_keyword_to_kind(handler);
// Get the docstring
elem = cdr(elem);
if (!car(elem).is_string()) {
throw std::runtime_error("Missing a docstring for a state handler!");
}
DefinitionMetadata def_meta;
// TODO - definition location info
def_meta.docstring = car(elem).as_string()->data;
struct_def.append_virtual_state_def(method_name, handler_kind, def_meta);
elem = cdr(elem);
}
}
} else if (keyword == ":behavior") {
obj = cdr(obj);
if (!car(obj).is_symbol()) {
lg::print(
":behavior tag used without providing the process type name in a method "
"declaration. {}::{}\n",
type->get_name(), method_name.c_str());
throw std::runtime_error("Bad usage of :behavior in a method declaration");
}
function_typespec.add_new_tag("behavior", symbol_string(obj->as_pair()->car));
}
obj = cdr(obj);
}
// fill in args now that we've finalized the function spec
for_each_in_list(args, [&](const goos::Object& o) {
function_typespec.add_arg(parse_typespec(type_system, o));
});
function_typespec.add_arg(parse_typespec(type_system, return_type));
}
// determine the method id, it should be the last in the list
int id = -1;
if (!obj->is_empty_list() && car(obj).is_int()) {
auto& id_obj = car(obj);
@ -247,16 +350,17 @@ void declare_method(Type* type, TypeSystem* type_system, const goos::Object& def
}
if (!obj->is_empty_list()) {
throw std::runtime_error("too many things in method def: " + def.print());
throw std::runtime_error("found symbols after the `id` in a method defintion: " +
def.print());
}
for_each_in_list(args, [&](const goos::Object& o) {
function_typespec.add_arg(parse_typespec(type_system, o));
});
function_typespec.add_arg(parse_typespec(type_system, return_type));
auto info = type_system->declare_method(type, method_name, docstring, no_virtual,
function_typespec, replace_method, id);
MethodInfo info;
if (overriding_doc) {
info = type_system->override_method(type, method_name, id, docstring);
} else {
info = type_system->declare_method(type, method_name, docstring, no_virtual,
function_typespec, replace_method, id);
}
// check the method assert
if (id != -1) {
@ -270,12 +374,38 @@ void declare_method(Type* type, TypeSystem* type_system, const goos::Object& def
});
}
void declare_state(Type* type, TypeSystem* type_system, const goos::Object& def) {
void declare_state(Type* type,
TypeSystem* type_system,
const goos::Object& def,
StructureDefResult& struct_def) {
for_each_in_list(def, [&](const goos::Object& _obj) {
auto obj = &_obj;
if (obj->is_list()) {
// (name ,@args)
// (name [(:event "docstring"...)] ,@args)
auto state_name = symbol_string(car(obj));
if (!cdr(obj)->is_empty_list() && car(cdr(obj)).is_list()) {
obj = cdr(obj);
auto docstring_list = &car(obj);
auto elem = docstring_list;
while (!elem->is_empty_list() && car(elem).is_symbol()) {
const auto& handler = car(elem).as_symbol()->name;
const auto handler_kind = handler_keyword_to_kind(handler);
// Get the docstring
elem = cdr(elem);
if (!car(elem).is_string()) {
throw std::runtime_error("Missing a docstring for a state handler!");
}
DefinitionMetadata def_meta;
// TODO - definition location info
def_meta.docstring = car(elem).as_string()->data;
struct_def.append_state_def(state_name, handler_kind, def_meta);
elem = cdr(elem);
}
}
auto args = cdr(obj);
TypeSpec state_typespec("state");
@ -298,15 +428,6 @@ void declare_state(Type* type, TypeSystem* type_system, const goos::Object& def)
});
}
struct StructureDefResult {
TypeFlags flags;
bool generate_runtime_type = true;
bool pack_me = false;
bool allow_misaligned = false;
bool final = false;
bool always_stack_singleton = false;
};
StructureDefResult parse_structure_def(
StructureType* type,
TypeSystem* ts,
@ -335,9 +456,9 @@ StructureDefResult parse_structure_def(
auto list_name = symbol_string(first);
if (list_name == ":methods") {
declare_method(type, ts, *opt_list);
declare_method(type, ts, *opt_list, result);
} else if (list_name == ":states") {
declare_state(type, ts, *opt_list);
declare_state(type, ts, *opt_list, result);
} else {
throw std::runtime_error("Invalid option list in field specification: " +
car(rest).print());
@ -461,7 +582,8 @@ BitFieldTypeDefResult parse_bitfield_type_def(BitFieldType* type,
opt_list = cdr(opt_list);
if (symbol_string(first) == ":methods") {
declare_method(type, ts, *opt_list);
auto dummy = StructureDefResult();
declare_method(type, ts, *opt_list, dummy);
} else {
throw std::runtime_error("Invalid option list in field specification: " +
car(rest).print());
@ -604,6 +726,7 @@ DeftypeResult parse_deftype(const goos::Object& deftype,
auto parent_type_name = deftype_parent_list(parent_list_obj);
auto parent_type = ts->make_typespec(parent_type_name);
DeftypeResult result;
std::optional<StructureDefResult> structure_result;
if (is_type("basic", parent_type, ts)) {
auto new_type = std::make_unique<BasicType>(parent_type_name, name, false, 0);
@ -621,6 +744,7 @@ DeftypeResult parse_deftype(const goos::Object& deftype,
parse_structure_def(new_type.get(), ts, field_list_obj, options_obj, constants_to_use);
result.flags = sr.flags;
result.create_runtime_type = sr.generate_runtime_type;
structure_result = sr;
if (sr.pack_me) {
new_type->set_pack(true);
}
@ -650,6 +774,7 @@ DeftypeResult parse_deftype(const goos::Object& deftype,
parse_structure_def(new_type.get(), ts, field_list_obj, options_obj, constants_to_use);
result.flags = sr.flags;
result.create_runtime_type = sr.generate_runtime_type;
structure_result = sr;
if (sr.pack_me) {
new_type->set_pack(true);
}
@ -686,5 +811,11 @@ DeftypeResult parse_deftype(const goos::Object& deftype,
result.type = ts->make_typespec(name);
result.type_info = ts->lookup_type(result.type);
if (structure_result) {
result.type_info->m_state_definition_meta = structure_result->state_definitions;
result.type_info->m_virtual_state_definition_meta = structure_result->virtual_state_definitions;
}
return result;
}

View file

@ -18,6 +18,11 @@ TypeSpec state_to_go_function(const TypeSpec& state_type, const TypeSpec& return
return result;
}
StateHandler handler_keyword_to_kind(std::string keyword) {
// Remove the first character (should be a :)
return handler_name_to_kind(keyword.erase(0, 1));
}
StateHandler handler_name_to_kind(const std::string& name) {
if (name == "enter") {
return StateHandler::ENTER;

View file

@ -13,6 +13,7 @@ enum class StateHandler { ENTER, EXIT, CODE, TRANS, POST, EVENT };
class TypeSystem;
TypeSpec state_to_go_function(const TypeSpec& state_type, const TypeSpec& return_type);
StateHandler handler_keyword_to_kind(std::string keyword);
StateHandler handler_name_to_kind(const std::string& name);
std::string handler_kind_to_name(StateHandler kind);
TypeSpec get_state_handler_type(const std::string& handler_name, const TypeSpec& state_type);

View file

@ -83,8 +83,34 @@ goos::Object final_output_lambda(const Function& func) {
}
}
goos::Object final_output_defstate_anonymous_behavior(const Function& func) {
goos::Object final_output_defstate_anonymous_behavior(const Function& func,
const DecompilerTypeSystem& dts) {
std::vector<goos::Object> inline_body;
// docstring if available - lookup the appropriate info
const auto& type_name = func.guessed_name.type_name;
const auto& state_name = func.guessed_name.state_name;
const auto& handler_kind = func.guessed_name.handler_kind;
const auto handler_name = handler_kind_to_name(handler_kind);
if (func.guessed_name.kind == FunctionName::FunctionKind::V_STATE) {
if (dts.virtual_state_metadata.count(type_name) != 0 &&
dts.virtual_state_metadata.at(type_name).count(state_name) != 0 &&
dts.virtual_state_metadata.at(type_name).at(state_name).count(handler_name) != 0) {
inline_body.insert(inline_body.begin(),
pretty_print::new_string(dts.virtual_state_metadata.at(type_name)
.at(state_name)
.at(handler_name)
.docstring.value()));
}
} else if (func.guessed_name.kind == FunctionName::FunctionKind::NV_STATE) {
if (dts.state_metadata.count(state_name) != 0 &&
dts.state_metadata.at(state_name).count(handler_name) != 0) {
inline_body.insert(inline_body.begin(),
pretty_print::new_string(
dts.state_metadata.at(state_name).at(handler_name).docstring.value()));
}
}
func.ir2.top_form->inline_forms(inline_body, func.ir2.env);
auto var_dec = func.ir2.env.local_var_type_list(func.ir2.top_form, func.type.arg_count() - 1);

View file

@ -19,5 +19,6 @@ std::string write_from_top_level(const Function& top_level,
goos::Object get_arg_list_for_function(const Function& func, const Env& env);
goos::Object final_output_lambda(const Function& function);
goos::Object final_output_defstate_anonymous_behavior(const Function& func);
goos::Object final_output_defstate_anonymous_behavior(const Function& func,
const DecompilerTypeSystem& dts);
} // namespace decompiler

View file

@ -20,10 +20,11 @@ bool kind_for_lambda(FunctionName::FunctionKind k) {
bool try_convert_lambda(const Function& parent_function,
FormPool& pool,
Form* f,
bool defstate_behavior) {
bool defstate_behavior,
const DecompilerTypeSystem& dts) {
auto atom = form_as_atom(f);
if (atom && atom->is_static_addr()) {
auto lab = parent_function.ir2.env.file->labels.at(atom->label());
auto& lab = parent_function.ir2.env.file->labels.at(atom->label());
auto& env = parent_function.ir2.env;
const auto& info = parent_function.ir2.env.file->label_db->lookup(lab.name);
@ -43,7 +44,7 @@ bool try_convert_lambda(const Function& parent_function,
}
goos::Object result;
if (defstate_behavior) {
result = final_output_defstate_anonymous_behavior(*other_func);
result = final_output_defstate_anonymous_behavior(*other_func, dts);
} else {
result = final_output_lambda(*other_func);
}
@ -57,10 +58,11 @@ bool try_convert_lambda(const Function& parent_function,
}
} // namespace
// TODO - important entry point!
int insert_static_refs(Form* top_level_form,
FormPool& pool,
const Function& function,
const DecompilerTypeSystem&) {
const DecompilerTypeSystem& dts) {
int replaced = 0;
// first, look for defstates and lambdas to behaviors.
@ -69,7 +71,7 @@ int insert_static_refs(Form* top_level_form,
if (as_defstate) {
for (auto& e : as_defstate->entries()) {
if (e.is_behavior) {
if (try_convert_lambda(function, pool, e.val, true)) {
if (try_convert_lambda(function, pool, e.val, true, dts)) {
replaced++;
}
}
@ -79,7 +81,7 @@ int insert_static_refs(Form* top_level_form,
// next, all the rest.
top_level_form->apply_form([&](Form* f) {
if (try_convert_lambda(function, pool, f, false)) {
if (try_convert_lambda(function, pool, f, false, dts)) {
replaced++;
}
});

View file

@ -668,7 +668,6 @@
(define-extern run-function-in-process (function process function object object object object object object object))
(define-extern set-to-run-bootstrap (function none))
(define-extern set-to-run (function cpu-thread function object object object object object object pointer))
(define-extern dead-state (state process))
(define-extern entity-deactivate-handler (function process entity-actor none))
(define-extern *listener-process* process)
(define-extern *null-process* process)
@ -11038,6 +11037,8 @@
:method-count-assert 14
:size-assert #xd0
:flag-assert #xe005000d0
(:states
time-of-day-tick)
)
(deftype time-of-day-palette (basic)
@ -15028,6 +15029,9 @@
(relocate-nav (_type_ int) none 18)
(evaluate-joint-control (_type_) none 19)
)
(:states
(process-drawable-art-error string)
process-drawable-idle)
)
(deftype process-drawable-reserved (process-drawable)
@ -16775,6 +16779,8 @@
:method-count-assert 14
:size-assert #xd8
:flag-assert #xe006000d8
(:states
othercam-running)
)
(deftype explosion (process-drawable)
@ -18078,8 +18084,7 @@
(impact () _type_ :state 22)
(moving () _type_ :state 23)
(draw-laser-sight
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
(_type_) none 24)
(spawn-impact-particles
"Spawns associated particles with the projectile if applicable"
@ -18094,8 +18099,7 @@
"Init the [[projectile]]'s [[collide-shape]]"
(_type_) none 30)
(init-proj-settings!
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(_type_) none 31)
(go-moving! (_type_) none 32)
(go-sitting! (_type_) none 33)
@ -18118,8 +18122,7 @@
"TODO - queries the collision cache, return true/false"
(_type_) symbol 38)
(play-impact-sound!
"Plays impact sound
:virtual"
"Plays impact sound"
(_type_) sound-id :behavior projectile 39)
)
)
@ -18259,20 +18262,150 @@
(init-target (_type_ continue-point symbol) none :behavior target 28)
)
(:states
(target-attack-air symbol)
(target-attack-uppercut float float)
(target-attack-uppercut-jump float float)
target-attack
target-board-duck-stance
(target-board-clone-anim handle)
target-board-falling
(target-board-flip float float symbol)
(target-board-get-off object symbol) ;; unused arg0
target-board-get-on
(target-board-grab symbol)
(target-board-grenade handle)
target-board-halfpipe
(target-board-hit vector attack-info)
target-board-hit-ground
(target-board-hold float float symbol)
(target-board-jump meters meters symbol)
target-board-jump-kick
(target-board-pegasus handle)
(target-board-ride-edge symbol object object float)
target-board-stance
(target-board-start object)
(target-board-trickx float float symbol)
(target-board-turn-to vector time-frame)
(target-board-wall-kick vector float)
target-carry-drop
target-carry-stance
target-carry-walk
target-carry-falling
(target-carry-hit-ground symbol)
(target-carry-jump float float)
target-carry-pickup
target-carry-stance
target-carry-throw
(target-warp-out vector vector target) ;; (define-extern target-warp-out state) ;; (state vector vector target)
(target-warp-in vector vector target) ;; (define-extern target-warp-in state) ;; (state vector vector target)
target-indax-start
(target-racing-start handle)
target-carry-walk
(target-clone-anim handle)
(target-continue continue-point)
target-darkjak-bomb0
(target-darkjak-bomb1 float float)
target-darkjak-get-off
(target-darkjak-get-on int)
target-darkjak-giant
target-darkjak-running-attack
(target-death symbol)
(target-demo symbol)
(target-double-jump float float)
(target-duck-high-jump float float symbol)
(target-duck-high-jump-jump float float symbol)
(target-duck-stance symbol)
(target-duck-walk symbol)
target-edge-grab
(target-edge-grab-jump float float)
target-edge-grab-off
(target-falling symbol)
target-float
(target-flop float float float)
(target-flop-hit-ground symbol)
(target-flut-start handle)
target-gun-stance
target-gun-walk
(target-grab symbol)
target-hide
(target-high-jump float float object)
(target-hit symbol attack-info)
(target-hit-ground symbol)
(target-hit-ground-hard float)
target-ice-stance ;; called in (trans target-stance), but not defined
target-ice-walk ;; called in (trans target-walk), but not defined
target-indax-attack
(target-indax-attack-air symbol)
(target-indax-death symbol)
(target-indax-double-jump float float)
(target-indax-falling symbol)
(target-indax-hit symbol attack-info)
(target-indax-hit-ground symbol)
(target-indax-jump float float surface)
target-indax-running-attack
target-indax-stance
target-indax-start
target-indax-trip
target-indax-walk
(target-jump float float surface)
(target-jump-forward float float)
(target-launch float symbol vector int)
target-load-wait
target-look-around
target-mech-carry-drag
target-mech-carry-drop
target-mech-carry-falling
(target-mech-carry-hit-ground symbol)
(target-mech-carry-jump float float)
target-mech-carry-pickup
target-mech-carry-stance
target-mech-carry-throw
target-mech-carry-walk
(target-mech-clone-anim handle)
(target-mech-death symbol)
(target-mech-falling symbol)
target-mech-get-off
(target-mech-get-on handle)
target-mech-grab
(target-mech-hit symbol attack-info)
(target-mech-hit-ground symbol)
(target-mech-jump float float surface)
target-mech-punch
target-mech-stance
(target-mech-start handle)
target-mech-walk
target-pilot-edge-grab
(target-pilot-start handle)
(target-play-anim string handle)
(target-pole-cycle handle)
(target-pole-flip-forward float float float)
(target-pole-flip-forward-jump float float)
(target-pole-flip-up object object float)
(target-pole-flip-up-jump float float)
(target-racing-start handle)
target-roll
(target-roll-flip float float)
target-running-attack
target-slide-down
target-slide-down-to-ground
target-stance
target-stance-ambient
target-stance-look-around
target-startup
target-swim-down
(target-swim-jump float float)
(target-swim-jump-jump float float surface)
target-swim-stance
target-swim-up
target-swim-walk
(target-title symbol)
target-tube
(target-tube-death symbol)
(target-tube-hit symbol attack-info)
(target-tube-jump float float)
(target-tube-start handle)
target-turn-around
(target-turret-get-on handle)
target-wade-stance
target-wade-walk
target-walk
(target-warp-in vector vector target) ;; (define-extern target-warp-in state) ;; (state vector vector target)
(target-warp-out vector vector target) ;; (define-extern target-warp-out state) ;; (state vector vector target)
target-yellow-jump-blast ;; called in (code target-flop), but not defined, causes crash on PCSX2
)
)
@ -20848,6 +20981,8 @@
:method-count-assert 14
:size-assert #x22c
:flag-assert #xe01b0022c
(:states
cam-combiner-active)
)
;; +++camera-h:camera-blend-to-type
@ -20939,7 +21074,9 @@
cam-robotboss ;; TODO - state docstrings "A holdout from jak 1?"
cam-point-watch
cam-free-floating
cam-remote))
cam-remote
cam-launcher-longfall
cam-launcher-shortfall))
(deftype camera-master (process)
((master-options cam-master-options-u32 :offset-assert 128)
@ -20990,6 +21127,8 @@
(camera-master-method-15 (_type_ vector) vector 15)
(camera-master-method-16 (_type_ symbol) int 16)
)
(:states
cam-master-active)
)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -21164,6 +21303,11 @@
(update-value-callback (_type_ int int) none 25) ;; (get-icon-scale-x (_type_) float 25)
(alloc-string-if-needed (_type_ int) none 26) ;; (get-icon-scale-y (_type_) float 26)
)
(:states
hud-arriving
hud-hidden
hud-in
(hud-leaving float))
)
(deftype hud-money (hud)
@ -22394,14 +22538,12 @@
:flag-assert #x1b00000024
(:methods
(new (symbol type process symbol float) _type_ 0)
;; TODO - child docstrings
;; 10
;; 12 - "Calls [[path-control::26]] with the `idx` at a given percent along the path @see [[path-control::26]]"
;; 26
;; 15
;; 16
;; 13 - different, just calls [[curve-evaluate!]]
;; 18 - "Returns total path length of the [[curve]], will lazily calculate and set the [[curve]]'s `length` via [[curve::4]]"
(:override-doc "Calls [[path-control::26]] with the `idx` at a given percent along the path @see [[path-control::26]]" 12)
(:override-doc "@see [[curve-control::12]]" 13)
(:override-doc
"Will lazily calculate and set the [[curve]]'s `length`
@returns total path length of the [[curve]]
@see [[curve-length]]" 18)
)
)
@ -22753,8 +22895,7 @@
;; Failed to read fields.
(:methods
(debug-draw (_type_) none 9)
(nav-state-method-10
"Virtual/Stub" (_type_) none 10)
(nav-state-method-10 (_type_) none 10)
(plan-over-pat1-polys-using-route (_type_ nav-gap-info) symbol 11)
(get-velocity (_type_ vector) vector 12)
(get-travel (_type_ vector) vector 13)
@ -22802,7 +22943,7 @@
(reset! (_type_ nav-control) none 47)
(nav-state-method-48 () none 48)
(navigate-using-best-dir-use-existing-avoid-spheres (_type_ nav-avoid-spheres-params) none 49)
(nav-state-method-50 "Virtual/Stub" (_type_) none 50)
(nav-state-method-50 (_type_) none 50)
(navigate-using-route-portals (_type_) none 51)
(navigate-using-best-dir-recompute-avoid-spheres-1 (_type_) none 52)
(navigate-within-poly (_type_) none 53)
@ -26392,7 +26533,6 @@
(define-extern time-of-day-effect (function none))
(define-extern time-of-day-update (function none :behavior time-of-day-proc))
(define-extern update-counters (function float :behavior time-of-day-proc))
(define-extern time-of-day-tick (state time-of-day-proc))
(define-extern init-time-of-day (function object :behavior time-of-day-proc)) ;;
(define-extern start-time-of-day (function (pointer process)))
(define-extern time-of-day-setup (function symbol symbol))
@ -27172,7 +27312,6 @@
(define-extern master-choose-entity (function cam-setting-data symbol :behavior camera-master))
(define-extern cam-master-set-entity (function cam-setting-data none))
(define-extern cam-master-activate-slave (function symbol none))
(define-extern cam-master-active (state camera-master))
(define-extern cam-master-init (function none :behavior camera-master))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -27331,7 +27470,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern cam-helper-temp (function (pointer camera-slave) (pointer camera-slave) float matrix :behavior camera-combiner))
(define-extern cam-combiner-active (state camera-combiner))
(define-extern cam-combiner-init (function none :behavior camera-combiner))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -27638,7 +27776,6 @@
(define-extern cam-layout-do-action (function clm-item-action symbol :behavior cam-layout)) ;;
(define-extern cam-layout-function-call (function symbol string int basic symbol :behavior cam-layout)) ;;
(define-extern cam-layout-do-menu (function clm symbol :behavior cam-layout)) ;;
(define-extern cam-layout-active (state cam-layout)) ;;
(define-extern cam-layout-init (function object :behavior cam-layout)) ;;
(define-extern cam-layout-stop (function symbol))
(define-extern cam-layout-start (function symbol))
@ -27781,8 +27918,6 @@
(define-extern draw-joint-axes (function process-drawable none))
(define-extern draw-root (function process-drawable none))
;; (define-extern empty-state state) ;; (state process)
(define-extern process-drawable-art-error (state string process-drawable))
(define-extern process-drawable-idle (state process-drawable))
(define-extern skeleton-group->draw-control (function process-drawable skeleton-group (pointer cspace-array) draw-control))
(define-extern ja-done? (function int symbol :behavior process-drawable))
(define-extern ja-min? (function int symbol :behavior process-drawable)) ;;
@ -27975,9 +28110,7 @@
(define-extern ja-anim-done? (function process symbol)) ;;
(define-extern camera-pov-from (function pair uint process))
(define-extern cam-launcher-joystick (function vector :behavior camera-slave))
(define-extern cam-launcher-shortfall (state camera-slave))
(define-extern cam-launcher-long-joystick(function vector :behavior camera-slave))
(define-extern cam-launcher-longfall (state camera-slave))
(define-extern launcher-init-by-other (function vector float int float none :behavior launcher))
(define-extern touch-tracker-init (function vector float time-frame none :behavior touch-tracker))
(define-extern explosion-init-by-other (function explosion-init-params object :behavior explosion))
@ -28998,90 +29131,35 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern target-falling-trans (function symbol time-frame none :behavior target))
(define-extern target-startup (state target))
(define-extern target-stance (state target))
(define-extern target-walk (state target))
(define-extern target-ice-walk (state target)) ;; called in (trans target-walk), but not defined
(define-extern target-ice-stance (state target)) ;; called in (trans target-stance), but not defined
(define-extern target-turn-around (state target))
(define-extern target-slide-down (state target))
(define-extern *slide-down-mods* surface)
(define-extern *slide-jump-mods* surface)
(define-extern target-slide-down-to-ground (state target))
(define-extern init-var-jump (function float float symbol symbol vector float vector :behavior target))
(define-extern mod-var-jump (function symbol symbol symbol vector vector :behavior target))
(define-extern *duck-mods* surface)
(define-extern target-duck-stance (state symbol target))
(define-extern target-duck-walk (state symbol target))
(define-extern target-jump-top-anim (function none :behavior target))
(define-extern target-jump (state float float surface target))
(define-extern target-jump-forward (state float float target))
(define-extern target-double-jump (state float float target))
(define-extern target-high-jump (state float float object target))
(define-extern target-duck-high-jump (state float float symbol target))
(define-extern target-duck-high-jump-jump (state float float symbol target))
(define-extern target-falling (state symbol target))
(define-extern target-hit-ground (state symbol target))
(define-extern *attack-mods* surface)
(define-extern *attack-end-mods* surface)
(define-extern target-attack (state target))
(define-extern *run-attack-mods* surface)
(define-extern target-running-attack (state target))
(define-extern *jump-attack-mods* surface)
(define-extern target-attack-air (state symbol target))
(define-extern *uppercut-mods* surface)
(define-extern *uppercut-jump-mods* surface)
(define-extern target-attack-uppercut (state float float target))
(define-extern target-attack-uppercut-jump (state float float target))
(define-extern target-flop (state float float float target))
(define-extern target-flop-hit-ground (state symbol target))
(define-extern target-roll (state target))
(define-extern target-roll-flip (state float float target))
(define-extern target-land-effect (function none :behavior target)) ;; called in (code target-roll-flip), but not actually defined anywhere?
(define-extern target-yellow-jump-blast (state target)) ;; called in (code target-flop), but not defined, causes crash on PCSX2
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; target2 ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern *trip-mods* surface)
(define-extern target-load-wait (state target))
(define-extern target-stance-ambient (state target))
(define-extern target-stance-look-around (state target))
(define-extern *look-around-mods* surface)
(define-extern target-look-around (state target))
(define-extern target-grab (state symbol target))
(define-extern target-pole-cycle (state handle target))
(define-extern target-pole-flip-up (state object object float target))
(define-extern target-pole-flip-up-jump (state float float target))
(define-extern target-pole-flip-forward (state float float float target))
(define-extern target-pole-flip-forward-jump (state float float target))
(define-extern target-edge-grab (state target))
(define-extern target-edge-grab-jump (state float float target))
(define-extern target-edge-grab-off (state target))
(define-extern *hit-ground-hard-mods* surface)
(define-extern target-hit-ground-hard (state float target))
(define-extern *hide-mods* surface)
(define-extern target-hide (state target))
(define-extern target-launch (state float symbol vector int target))
(define-extern target-play-anim (state string handle target))
(define-extern target-clone-anim (state handle target))
(define-extern *float-mods* surface)
(define-extern target-float (state target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; target-swim ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern target-wade-stance (state target))
(define-extern target-wade-walk (state target))
(define-extern target-swim-tilt (function float float float float float :behavior target))
(define-extern target-swim-stance (state target))
(define-extern target-swim-walk (state target))
(define-extern target-swim-down (state target))
(define-extern target-swim-up (state target))
(define-extern target-swim-jump-jump (state float float surface target))
(define-extern target-swim-jump (state float float target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; target-carry ;;
@ -29091,7 +29169,6 @@
(define-extern *carry-jump-mods* surface)
(define-extern target-carry-update (function none :behavior target))
(define-extern target-carry-post (function none :behavior target))
(define-extern target-carry-pickup (state target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; target-darkjak ;;
@ -29102,14 +29179,8 @@
(define-extern *darkjak-trans-mods* surface)
(define-extern target-darkjak-end-mode (function none :behavior target))
(define-extern target-darkjak-process (function none :behavior target)) ;; only arg6 used
(define-extern target-darkjak-get-on (state int target))
(define-extern target-darkjak-get-off (state target))
(define-extern target-darkjak-running-attack (state target))
(define-extern target-darkjak-bomb-collide (function float float none :behavior target))
(define-extern target-darkjak-bomb0 (state target))
(define-extern target-bomb1-fire-shot (function (pointer handle) int int int none :behavior target))
(define-extern target-darkjak-bomb1 (state float float target))
(define-extern target-darkjak-giant (state target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; target-death ;;
@ -29126,7 +29197,6 @@
(define-extern *auto-continue* symbol) ;;
(define-extern next-continue (function continue-point continue-point))
(define-extern target-continue (state continue-point target))
(define-extern *smack-mods* surface)
(define-extern *smack-up-mods* surface)
(define-extern velocity-set-to-target! (function vector float attack-info vector :behavior target)) ;;
@ -29135,7 +29205,6 @@
(define-extern target-hit-orient (function attack-info vector symbol :behavior target))
(define-extern target-hit-setup-anim (function attack-info none :behavior target)) ;;
(define-extern target-hit-move (function attack-info symbol (function none :behavior target) float none :behavior target))
(define-extern target-hit (state symbol attack-info target))
(define-extern *death-spool-array* (array spool-anim)) ;;
(define-extern death-movie-remap (function int int int)) ;;
(define-extern *kill-nearby-enemies-info* kill-nearby-enemies-info)
@ -29144,7 +29213,6 @@
(define-extern target-death-anim (function spool-anim none :behavior target)) ;;
(define-extern target-death-main (function symbol none :behavior target))
(define-extern target-death-reset (function symbol symbol none :behavior target))
(define-extern target-death (state symbol target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; target-gun ;;
@ -29352,8 +29420,6 @@
;; gun-states ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern target-gun-stance (state target))
(define-extern target-gun-walk (state target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; board-util ;;
@ -29422,27 +29488,6 @@
(define-extern target-board-ground-check (function none :behavior target))
(define-extern target-board-halfpipe-check (function collide-action :behavior target))
(define-extern target-board-jump-trans (function none :behavior target))
(define-extern target-board-start (state object target))
(define-extern target-board-stance (state target))
(define-extern target-board-duck-stance (state target))
(define-extern target-board-jump (state meters meters symbol target))
(define-extern target-board-halfpipe (state target))
(define-extern target-board-falling (state target))
(define-extern target-board-jump-kick (state target))
(define-extern target-board-wall-kick (state vector float target))
(define-extern target-board-flip (state float float symbol target))
(define-extern target-board-hold (state float float symbol target))
(define-extern target-board-trickx (state float float symbol target))
(define-extern target-board-hit-ground (state target))
(define-extern target-board-turn-to (state vector time-frame target))
(define-extern target-board-ride-edge (state symbol object object float target))
(define-extern target-board-grenade (state handle target))
(define-extern target-board-get-on (state target))
(define-extern target-board-pegasus (state handle target))
(define-extern target-board-get-off (state object symbol target)) ;; unused arg0
(define-extern target-board-grab (state symbol target))
(define-extern target-board-clone-anim (state handle target))
(define-extern target-board-hit (state vector attack-info target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; mech-h ;;
@ -30413,7 +30458,6 @@
(define-extern pov-camera-play-and-reposition (function art-joint-anim vector float none :behavior pov-camera))
(define-extern pov-camera-init-by-other (function vector skeleton-group string pov-camera-flag process-drawable pair none :behavior pov-camera)) ;;
(define-extern othercam-calc (function float float)) ;;
(define-extern othercam-running (state othercam))
(define-extern othercam-init-by-other (function pov-camera int symbol symbol none :behavior othercam)) ;; (function process-taskable symbol symbol symbol none :behavior othercam)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -30514,10 +30558,6 @@
(define-extern *hud-sprite-work* hud-sprite-work)
(define-extern hud-create-icon (function hud int int (pointer manipy)))
(define-extern hud-hidden (state hud)) ;; (state hud)
(define-extern hud-arriving (state hud)) ;;
(define-extern hud-in (state hud)) ;; (state hud)
(define-extern hud-leaving (state float hud)) ;; (state int hud)
(define-extern hud-init-by-other (function object :behavior hud))
(define-extern hide-hud (function symbol none))
(define-extern enable-hud (function none))
@ -31197,13 +31237,12 @@
:method-count-assert 20
:size-assert #xcc
:flag-assert #x14005000cc
(:methods
)
(:states
viewer-process)
)
(define-extern *viewer* viewer)
(define-extern *viewer-sg* skeleton-group) ;; skeleton-group
(define-extern viewer-process (state viewer)) ;;
(define-extern viewer-string string) ;;
(define-extern viewer-ja-name string) ;; string
(define-extern viewer-geo-name string) ;; string
@ -31225,11 +31264,11 @@
:heap-base 16
:size-assert #x8c
:flag-assert #xe0010008c
;; Failed to read fields.
(:states
part-tester-idle)
)
(define-extern *part-tester-name* string)
(define-extern part-tester-idle (state part-tester))
(define-extern part-tester-init-by-other (function vector none :behavior process-drawable))
(define-extern *debug-part-dead-pool* dead-pool)
(define-extern start-part (function none))
@ -34083,10 +34122,11 @@
(adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list 28) ;; (TODO-RENAME-28 (_type_ joint-exploder-list) none 28)
(adjust-bbox-for-limits (_type_ joint-exploder-list) none 29)
)
(:states
joint-exploder-shatter)
)
(define-extern joint-exploder-joint-callback (function draw-control cspace-array joint-control none))
(define-extern joint-exploder-shatter (state joint-exploder))
(define-extern joint-exploder-init-by-other (function skeleton-group int joint-exploder-tuning joint-exploder-static-params none :behavior joint-exploder))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -34761,7 +34801,7 @@
(get-params
"@returns [[*default-elec-gate-params*]] by default"
(_type_) elec-gate-params 23)
(elec-gate-method-24 "virtual" (_type_) none 24)
(elec-gate-method-24 (_type_) none 24)
(set-palette!
"Sets the [[elec-gate]]'s `palette-id` appropriately"
(_type_) none 25)
@ -37140,12 +37180,7 @@
(define-extern tube-sounds (function sound-id :behavior target))
(define-extern tube-thrust (function float float none :behavior target))
(define-extern target-tube-post (function none :behavior target))
(define-extern target-tube-start (state handle target))
(define-extern target-tube-turn-anim (function none :behavior target))
(define-extern target-tube (state target))
(define-extern target-tube-jump (state float float target))
(define-extern target-tube-hit (state symbol attack-info target))
(define-extern target-tube-death (state symbol target))
(define-extern distance-from-tangent (function path-control float vector vector vector vector float))
(define-extern find-target-point (function vector float :behavior slide-control))
@ -37328,7 +37363,6 @@
;; (define-extern target-turret-post function)
;; (define-extern target-turret-stance state)
;; (define-extern *turret-get-on-mods* object)
(define-extern target-turret-get-on (state handle target))
;; (define-extern target-turret-get-off state)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -38801,9 +38835,9 @@
:size-assert #x30
:flag-assert #xc00000030
(:methods
(reset-task! "Virtual" (_type_) none 9)
(ai-task-method-10 "Virtual" (_type_ bot) none 10)
(ai-task-method-11 "Virtual" (_type_ bot) none 11)
(reset-task! (_type_) none 9)
(ai-task-method-10 (_type_ bot) none 10)
(ai-task-method-11 (_type_ bot) none 11)
)
)
@ -43407,7 +43441,6 @@
;; (define-extern demo-wait-for-press function)
;; (define-extern demo-menu function)
;; (define-extern demo-control-init function)
(define-extern target-demo (state symbol target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; credits ;;
@ -43992,19 +44025,7 @@
(define-extern target-indax-exit (function none :behavior target))
(define-extern target-indax-real-post (function none :behavior target))
(define-extern target-indax-post (function none :behavior target))
(define-extern target-indax-stance (state target))
(define-extern target-indax-walk (state target))
(define-extern target-indax-falling (state symbol target))
(define-extern target-indax-jump (state float float surface target))
(define-extern target-indax-double-jump (state float float target))
(define-extern target-indax-hit-ground (state symbol target))
(define-extern target-indax-trip (state target))
(define-extern target-indax-attack (state target))
(define-extern target-indax-attack-air (state symbol target))
(define-extern target-indax-running-attack (state target))
(define-extern target-indax-hit-setup-anim (function attack-info none :behavior target))
(define-extern target-indax-hit (state symbol attack-info target))
(define-extern target-indax-death (state symbol target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; tomb-boulder ;;
@ -44592,7 +44613,6 @@
(define-extern title-fade-out (function float none))
(define-extern title-progress (function symbol none))
(define-extern title-control-init (function none :behavior title-control))
(define-extern target-title (state symbol target))
(define-extern *title-control* (pointer title-control))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
@ -44678,31 +44698,9 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern *mech-exploder-params* joint-exploder-static-params)
(define-extern target-mech-start (state handle target))
(define-extern target-mech-stance (state target))
(define-extern target-mech-walk (state target))
(define-extern target-mech-punch-pick (function symbol int :behavior target))
(define-extern target-mech-punch (state target))
(define-extern target-mech-falling (state symbol target))
(define-extern target-mech-jump (state float float surface target))
(define-extern target-mech-hit-ground (state symbol target))
(define-extern target-mech-hit (state symbol attack-info target))
(define-extern target-mech-death (state symbol target))
(define-extern target-mech-carry-update (function none :behavior target))
(define-extern target-mech-carry-post (function none :behavior target))
(define-extern target-mech-carry-pickup (state target))
(define-extern target-mech-carry-drop (state target))
(define-extern target-mech-carry-stance (state target))
(define-extern target-mech-carry-walk (state target))
(define-extern target-mech-carry-drag (state target))
(define-extern target-mech-carry-falling (state target))
(define-extern target-mech-carry-hit-ground (state symbol target))
(define-extern target-mech-carry-jump (state float float target))
(define-extern target-mech-carry-throw (state target))
(define-extern target-mech-get-on (state handle target))
(define-extern target-mech-get-off (state target))
(define-extern target-mech-grab (state target))
(define-extern target-mech-clone-anim (state handle target))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; grunt-mech ;;
@ -51872,7 +51870,6 @@
;; pilot-states ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-extern target-pilot-start (state handle target))
;; (define-extern target-pilot-bike-anim-loop function)
;; (define-extern target-pilot-car-anim-loop function)
;; (define-extern target-daxter-pilot-car-anim-loop function)
@ -51886,7 +51883,6 @@
;; (define-extern target-pilot-get-off state)
;; (define-extern target-pilot-grab state)
;; (define-extern target-pilot-clone-anim state)
(define-extern target-pilot-edge-grab (state target))
;; (define-extern target-pilot-hit state)
;; (define-extern target-pilot-death state)

View file

@ -81,6 +81,12 @@ void DecompilerTypeSystem::parse_type_defs(const std::vector<std::string>& file_
// TODO - get definition info for the state definitions specifically
add_symbol(state.first, state.second, dtr.type_info->m_metadata);
}
// add state documentation to the DTS
virtual_state_metadata.emplace(dtr.type.base_type(),
dtr.type_info->m_virtual_state_definition_meta);
for (const auto& [state_name, meta] : dtr.type_info->m_state_definition_meta) {
state_metadata.emplace(state_name, meta);
}
} else if (car(o).as_symbol()->name == "declare-type") {
auto* rest = &cdr(o);
auto type_name = car(*rest);

View file

@ -17,9 +17,20 @@ class DecompilerTypeSystem {
std::unordered_map<std::string, TypeSpec> symbol_types;
std::unordered_set<std::string> symbols;
std::unordered_map<std::string, DefinitionMetadata> symbol_metadata_map;
std::vector<std::string> symbol_add_order;
// TODO - these are needed to propagate the info from the `Type` to the final result
// as only the `TypeSpec` is available at that point
std::unordered_map<std::string, DefinitionMetadata> symbol_metadata_map;
// {type_name : {method_name : {handler : doc}}}
std::unordered_map<
std::string,
std::unordered_map<std::string, std::unordered_map<std::string, DefinitionMetadata>>>
virtual_state_metadata;
// {state_name : {handler : doc}}
std::unordered_map<std::string, std::unordered_map<std::string, DefinitionMetadata>>
state_metadata;
std::unordered_map<std::string, u64> type_flags;
std::unordered_map<std::string, std::string> type_parents;
std::unordered_map<std::string, int> bad_format_strings;

View file

@ -256,8 +256,7 @@
(defmethod draw-laser-sight ashelin-shot ((obj ashelin-shot))
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
(draw-beam (-> *part-id-table* 675) (-> obj tail-pos) (-> obj starting-dir) #f #t)
0
(none)
@ -507,8 +506,7 @@
)
(defmethod init-proj-settings! ashelin-shot ((obj ashelin-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj tail-pos quad) (-> obj root-override trans quad))
(set! (-> obj attack-mode) 'eco-yellow)
(set! (-> obj max-speed) 307200.0)

View file

@ -125,6 +125,9 @@
(adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list 28)
(adjust-bbox-for-limits (_type_ joint-exploder-list) none 29)
)
(:states
joint-exploder-shatter
)
)

View file

@ -316,6 +316,9 @@
:method-count-assert 14
:size-assert #x22c
:flag-assert #xe01b0022c
(:states
cam-combiner-active
)
)
@ -389,6 +392,8 @@
cam-fixed
cam-fixed-read-entity
cam-free-floating
cam-launcher-longfall
cam-launcher-shortfall
cam-lookat
cam-point-watch
cam-pov
@ -456,4 +461,7 @@
(camera-master-method-15 (_type_ vector) vector 15)
(camera-master-method-16 (_type_ symbol) int 16)
)
(:states
cam-master-active
)
)

View file

@ -23,30 +23,33 @@
;; DECOMP BEGINS
(deftype manipy (process-drawable)
((root-override collide-shape :offset 128 :score 1)
(new-trans-hook (function none) :offset-assert 200)
(cur-trans-hook (function none) :offset-assert 204)
(cur-event-hook (function none) :offset-assert 208)
(new-joint-anim art-joint-anim :offset-assert 212)
(new-joint-anim-blend uint64 :offset-assert 216)
(anim-mode symbol :offset-assert 224)
(cur-grab-handle handle :offset-assert 232)
(cur-target-handle handle :offset-assert 240)
(old-grab-pos vector :inline :offset-assert 256)
(joint joint-mod 4 :offset-assert 272)
(new-post-hook (function none) :offset-assert 288)
(cur-post-hook (function none) :offset-assert 292)
(clone-copy-trans symbol :offset-assert 296)
(shadow-backup basic :offset-assert 300)
(draw? symbol :offset-assert 304)
(userdata uint64 :offset-assert 312)
(prefix basic :offset-assert 320)
(shadow-volume-joint int32 :offset-assert 324)
(speed float :offset-assert 328)
(user-uint64 uint64 4 :offset-assert 336)
(options manipy-options :offset-assert 368)
((root-override collide-shape :offset 128)
(new-trans-hook (function none) :offset-assert 200)
(cur-trans-hook (function none) :offset-assert 204)
(cur-event-hook (function none) :offset-assert 208)
(new-joint-anim art-joint-anim :offset-assert 212)
(new-joint-anim-blend uint64 :offset-assert 216)
(anim-mode symbol :offset-assert 224)
(cur-grab-handle handle :offset-assert 232)
(cur-target-handle handle :offset-assert 240)
(old-grab-pos vector :inline :offset-assert 256)
(joint joint-mod 4 :offset-assert 272)
(new-post-hook (function none) :offset-assert 288)
(cur-post-hook (function none) :offset-assert 292)
(clone-copy-trans symbol :offset-assert 296)
(shadow-backup basic :offset-assert 300)
(draw? symbol :offset-assert 304)
(userdata uint64 :offset-assert 312)
(prefix basic :offset-assert 320)
(shadow-volume-joint int32 :offset-assert 324)
(speed float :offset-assert 328)
(user-uint64 uint64 4 :offset-assert 336)
(options manipy-options :offset-assert 368)
)
:flag-assert #x1501000174
:heap-base #x100
:method-count-assert 21
:size-assert #x174
:flag-assert #x1501000174
(:methods
(idle () _type_ :state 20)
)
@ -209,6 +212,9 @@
:method-count-assert 14
:size-assert #xd8
:flag-assert #xe006000d8
(:states
othercam-running
)
)

View file

@ -5,12 +5,13 @@
;; name in dgo: part-tester
;; dgos: ENGINE, GAME
(define-extern *part-tester* (pointer process))
;; DECOMP BEGINS
;; this file is debug only
(declare-file (debug))
(when *debug-segment*
;; failed to figure out what this is:
(defpartgroup group-part-tester
:id 127
:flags (unk-4 unk-6)
@ -19,7 +20,6 @@
:parts ((sp-item 209))
)
;; definition of type part-tester
(deftype part-tester (process)
((root trsqv :offset-assert 128)
(part sparticle-launch-control :offset-assert 132)
@ -29,29 +29,14 @@
:method-count-assert 14
:size-assert #x8c
:flag-assert #xe0010008c
)
(define-extern *part-tester* (pointer process))
;; definition for method 3 of type part-tester
(defmethod inspect part-tester ((obj part-tester))
(when (not obj)
(set! obj obj)
(goto cfg-4)
(:states
part-tester-idle
)
(let ((t9-0 (method-of-type process inspect)))
(t9-0 obj)
)
(format #t "~2Troot: ~A~%" (-> obj root))
(format #t "~2Tpart: ~A~%" (-> obj part))
(format #t "~2Told-group: ~A~%" (-> obj old-group))
(label cfg-4)
obj
)
;; definition for symbol *part-tester-name*, type string
(define *part-tester-name* (the-as string #f))
;; definition for method 10 of type part-tester
(defmethod deactivate part-tester ((obj part-tester))
(if (nonzero? (-> obj part))
(kill-and-free-particles (-> obj part))
@ -60,7 +45,6 @@
(none)
)
;; failed to figure out what this is:
(defstate part-tester-idle (part-tester)
:code (behavior ()
(until #f
@ -112,8 +96,6 @@
)
)
;; definition for function part-tester-init-by-other
;; INFO: Used lq/sq
;; WARN: Return type mismatch object vs none.
(defbehavior part-tester-init-by-other process-drawable ((arg0 vector))
(set! (-> self root) (new 'process 'trsqv))
@ -123,10 +105,8 @@
(none)
)
;; definition (perm) for symbol *debug-part-dead-pool*, type dead-pool
(define-perm *debug-part-dead-pool* dead-pool (new 'debug 'dead-pool 1 #x10000 "*debug-part-dead-pool*"))
;; definition for function start-part
;; WARN: Return type mismatch (pointer process) vs none.
(defun start-part ()
(kill-by-type part-tester *active-pool*)
@ -142,6 +122,3 @@
)
)

View file

@ -23,6 +23,9 @@
:method-count-assert 20
:size-assert #xcc
:flag-assert #x14005000cc
(:states
viewer-process
)
)

View file

@ -118,6 +118,10 @@
(relocate-nav (_type_ int) none 18)
(evaluate-joint-control (_type_) none 19)
)
(:states
(process-drawable-art-error string)
process-drawable-idle
)
)

View file

@ -82,6 +82,9 @@
:method-count-assert 14
:size-assert #xd0
:flag-assert #xe005000d0
(:states
time-of-day-tick
)
)
@ -143,9 +146,3 @@
(define *time-of-day-context* (new 'static 'time-of-day-context))
0

View file

@ -257,19 +257,150 @@
(init-target (_type_ continue-point symbol) none :behavior target 28)
)
(:states
target-attack
(target-attack-air symbol)
(target-attack-uppercut float float)
(target-attack-uppercut-jump float float)
(target-board-clone-anim handle)
target-board-duck-stance
target-board-falling
(target-board-flip float float symbol)
(target-board-get-off object symbol)
target-board-get-on
(target-board-grab symbol)
(target-board-grenade handle)
target-board-halfpipe
(target-board-hit vector attack-info)
target-board-hit-ground
(target-board-hold float float symbol)
(target-board-jump meters meters symbol)
target-board-jump-kick
(target-board-pegasus handle)
(target-board-ride-edge symbol object object float)
target-board-stance
(target-board-start object)
(target-board-trickx float float symbol)
(target-board-turn-to vector time-frame)
(target-board-wall-kick vector float)
target-carry-drop
target-carry-falling
(target-carry-hit-ground symbol)
(target-carry-jump float float)
target-carry-pickup
target-carry-stance
target-carry-throw
target-carry-walk
(target-clone-anim handle)
(target-continue continue-point)
target-darkjak-bomb0
(target-darkjak-bomb1 float float)
target-darkjak-get-off
(target-darkjak-get-on int)
target-darkjak-giant
target-darkjak-running-attack
(target-death symbol)
(target-demo symbol)
(target-double-jump float float)
(target-duck-high-jump float float symbol)
(target-duck-high-jump-jump float float symbol)
(target-duck-stance symbol)
(target-duck-walk symbol)
target-edge-grab
(target-edge-grab-jump float float)
target-edge-grab-off
(target-falling symbol)
target-float
(target-flop float float float)
(target-flop-hit-ground symbol)
(target-flut-start handle)
(target-grab symbol)
target-gun-stance
target-gun-walk
target-hide
(target-high-jump float float object)
(target-hit symbol attack-info)
(target-hit-ground symbol)
(target-hit-ground-hard float)
target-ice-stance
target-ice-walk
target-indax-attack
(target-indax-attack-air symbol)
(target-indax-death symbol)
(target-indax-double-jump float float)
(target-indax-falling symbol)
(target-indax-hit symbol attack-info)
(target-indax-hit-ground symbol)
(target-indax-jump float float surface)
target-indax-running-attack
target-indax-stance
target-indax-start
target-indax-trip
target-indax-walk
(target-jump float float surface)
(target-jump-forward float float)
(target-launch float symbol vector int)
target-load-wait
target-look-around
target-mech-carry-drag
target-mech-carry-drop
target-mech-carry-falling
(target-mech-carry-hit-ground symbol)
(target-mech-carry-jump float float)
target-mech-carry-pickup
target-mech-carry-stance
target-mech-carry-throw
target-mech-carry-walk
(target-mech-clone-anim handle)
(target-mech-death symbol)
(target-mech-falling symbol)
target-mech-get-off
(target-mech-get-on handle)
target-mech-grab
(target-mech-hit symbol attack-info)
(target-mech-hit-ground symbol)
(target-mech-jump float float surface)
target-mech-punch
target-mech-stance
(target-mech-start handle)
target-mech-walk
target-pilot-edge-grab
(target-pilot-start handle)
(target-play-anim string handle)
(target-pole-cycle handle)
(target-pole-flip-forward float float float)
(target-pole-flip-forward-jump float float)
(target-pole-flip-up object object float)
(target-pole-flip-up-jump float float)
(target-racing-start handle)
target-roll
(target-roll-flip float float)
target-running-attack
target-slide-down
target-slide-down-to-ground
target-stance
target-stance-ambient
target-stance-look-around
target-startup
target-swim-down
(target-swim-jump float float)
(target-swim-jump-jump float float surface)
target-swim-stance
target-swim-up
target-swim-walk
(target-title symbol)
target-tube
(target-tube-death symbol)
(target-tube-hit symbol attack-info)
(target-tube-jump float float)
(target-tube-start handle)
target-turn-around
(target-turret-get-on handle)
target-wade-stance
target-wade-walk
target-walk
(target-warp-in vector vector target)
(target-warp-out vector vector target)
target-yellow-jump-blast
)
)

View file

@ -137,6 +137,12 @@
(update-value-callback (_type_ int int) none 25)
(alloc-string-if-needed (_type_ int) none 26)
)
(:states
hud-arriving
hud-hidden
hud-in
(hud-leaving float)
)
)

View file

@ -379,8 +379,7 @@
)
(defmethod init-proj-settings! juicer-shot ((obj juicer-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(logior! (-> obj options) (projectile-options proj-options-8000))
(set! (-> obj attack-mode) 'eco-yellow)
(set! (-> obj move) juicer-proj-move)

View file

@ -8,7 +8,6 @@
;; DECOMP BEGINS
(defmethod reset-task! kidt-wait-spot ((obj kidt-wait-spot))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
@ -18,7 +17,6 @@
;; WARN: Return type mismatch symbol vs none.
(defmethod ai-task-method-11 kidt-wait-spot ((obj kidt-wait-spot) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(when (>= s4-0 0)
(let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0))))

View file

@ -8,7 +8,6 @@
;; DECOMP BEGINS
(defmethod reset-task! kort-wait-spot ((obj kort-wait-spot))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
@ -18,7 +17,6 @@
;; WARN: Return type mismatch symbol vs none.
(defmethod ai-task-method-11 kort-wait-spot ((obj kort-wait-spot) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(when (>= s4-0 0)
(let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0))))

View file

@ -32,8 +32,7 @@
)
(defmethod init-proj-settings! spyder-shot ((obj spyder-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
((the-as (function projectile none) (find-parent-method spyder-shot 31)) obj)
(set! (-> obj max-speed) 307200.0)
(set! (-> obj timeout) (seconds 0.267))

View file

@ -8,7 +8,6 @@
;; DECOMP BEGINS
(defmethod reset-task! halt-wait-spot ((obj halt-wait-spot))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) 0)
(set! (-> obj num-spots) (the-as uint 1))
@ -17,7 +16,6 @@
;; WARN: Return type mismatch symbol vs none.
(defmethod ai-task-method-11 halt-wait-spot ((obj halt-wait-spot) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(if (logtest? *display-bot-marks* (bot-marks-controls bmc16))
(bot-debug-draw-spot-sphere

View file

@ -281,8 +281,7 @@
;; definition for method 24 of type ashelin-shot
;; WARN: Return type mismatch int vs none.
(defmethod draw-laser-sight ashelin-shot ((obj ashelin-shot))
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
(draw-beam (-> *part-id-table* 675) (-> obj tail-pos) (-> obj starting-dir) #f #t)
0
(none)
@ -547,8 +546,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! ashelin-shot ((obj ashelin-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj tail-pos quad) (-> obj root-override trans quad))
(set! (-> obj attack-mode) 'eco-yellow)
(set! (-> obj max-speed) 307200.0)
@ -556,7 +554,3 @@
(set! (-> obj timeout) (seconds 1.335))
(none)
)

View file

@ -281,8 +281,7 @@
;; definition for method 24 of type sig-shot
;; WARN: Return type mismatch int vs none.
(defmethod draw-laser-sight sig-shot ((obj sig-shot))
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
(draw-beam (-> *part-id-table* 655) (-> obj tail-pos) (-> obj starting-dir) #f #t)
0
(none)
@ -546,8 +545,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! sig-shot ((obj sig-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj tail-pos quad) (-> obj root-override trans quad))
(set! (-> obj attack-mode) 'eco-yellow)
(set! (-> obj max-speed) 307200.0)

View file

@ -4,7 +4,6 @@
;; definition for method 9 of type sigt-wait-spot
;; WARN: Return type mismatch int vs none.
(defmethod reset-task! sigt-wait-spot ((obj sigt-wait-spot))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
@ -14,7 +13,6 @@
;; definition for method 11 of type sigt-wait-spot
(defmethod ai-task-method-11 sigt-wait-spot ((obj sigt-wait-spot) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(when (>= s4-0 0)
(let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0))))
@ -63,7 +61,6 @@
;; definition for method 11 of type sigt-fight-focus
(defmethod ai-task-method-11 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot))
"Virtual"
(let ((a1-1 (handle->process (-> arg0 focus handle))))
(if (and a1-1
(attacked-by-player? arg0 (the-as process-focusable a1-1))
@ -79,14 +76,12 @@
;; definition for method 10 of type sigt-fight-focus
;; WARN: Return type mismatch bot-flags vs none.
(defmethod ai-task-method-10 sigt-fight-focus ((obj sigt-fight-focus) (arg0 bot))
"Virtual"
(logclear! (-> arg0 bot-flags) (bot-flags bf00))
(none)
)
;; definition for method 11 of type sigt-repair-gun
(defmethod ai-task-method-11 sigt-repair-gun ((obj sigt-repair-gun) (arg0 bot))
"Virtual"
(cond
((not (logtest? (bot-flags bf19) (-> arg0 bot-flags)))
(ai-task-control-method-14 (-> arg0 ai-ctrl) obj arg0)
@ -219,7 +214,6 @@
;; definition for method 9 of type sigt-choose-piston
;; WARN: Return type mismatch int vs none.
(defmethod reset-task! sigt-choose-piston ((obj sigt-choose-piston))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
@ -229,7 +223,6 @@
;; definition for method 11 of type sigt-choose-piston
(defmethod ai-task-method-11 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(cond
((< s4-0 0)
@ -264,7 +257,6 @@
;; definition for method 10 of type sigt-choose-piston
(defmethod ai-task-method-10 sigt-choose-piston ((obj sigt-choose-piston) (arg0 bot))
"Virtual"
(clear-poi-and-focus! arg0)
(none)
)
@ -315,7 +307,6 @@
;; definition for method 9 of type sigt-riding-piston
;; WARN: Return type mismatch int vs none.
(defmethod reset-task! sigt-riding-piston ((obj sigt-riding-piston))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
@ -326,7 +317,6 @@
;; definition for method 11 of type sigt-riding-piston
;; WARN: Return type mismatch symbol vs none.
(defmethod ai-task-method-11 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(when (or (< s4-0 0) (player-blocking-spot? arg0 (-> arg0 course spots (-> obj spot-indexes s4-0))))
(set! s4-0 (choose-spot arg0 (the-as int (-> obj num-spots)) (the-as (pointer uint) (-> obj spot-indexes))))
@ -353,7 +343,6 @@
;; definition for method 10 of type sigt-riding-piston
(defmethod ai-task-method-10 sigt-riding-piston ((obj sigt-riding-piston) (arg0 bot))
"Virtual"
(clear-poi-and-focus! arg0)
(none)
)
@ -361,7 +350,6 @@
;; definition for method 9 of type sigt-charge-plasma
;; WARN: Return type mismatch int vs none.
(defmethod reset-task! sigt-charge-plasma ((obj sigt-charge-plasma))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
@ -371,7 +359,6 @@
;; definition for method 11 of type sigt-charge-plasma
(defmethod ai-task-method-11 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(when (>= s4-0 0)
(let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0))))
@ -446,14 +433,9 @@
;; definition for method 10 of type sigt-charge-plasma
;; WARN: Return type mismatch int vs none.
(defmethod ai-task-method-10 sigt-charge-plasma ((obj sigt-charge-plasma) (arg0 bot))
"Virtual"
(clear-poi-and-focus! arg0)
(set! (-> arg0 stack 920) (logand -2 (-> arg0 stack 920)))
(set! (-> arg0 focus-mode) 0)
0
(none)
)

View file

@ -222,6 +222,9 @@
(adjust-bbox-for-limits-along-axis (_type_ joint-exploder-list int) joint-exploder-list 28)
(adjust-bbox-for-limits (_type_ joint-exploder-list) none 29)
)
(:states
joint-exploder-shatter
)
)
;; definition for method 3 of type joint-exploder

View file

@ -397,6 +397,9 @@
:method-count-assert 14
:size-assert #x22c
:flag-assert #xe01b0022c
(:states
cam-combiner-active
)
)
;; definition for method 3 of type camera-combiner
@ -496,6 +499,8 @@
cam-fixed
cam-fixed-read-entity
cam-free-floating
cam-launcher-longfall
cam-launcher-shortfall
cam-lookat
cam-point-watch
cam-pov
@ -631,6 +636,9 @@
(camera-master-method-15 (_type_ vector) vector 15)
(camera-master-method-16 (_type_ symbol) int 16)
)
(:states
cam-master-active
)
)
;; definition for method 3 of type camera-master

View file

@ -359,6 +359,9 @@
:method-count-assert 14
:size-assert #xd8
:flag-assert #xe006000d8
(:states
othercam-running
)
)
;; definition for method 3 of type othercam

View file

@ -17,8 +17,7 @@
;; definition for method 39 of type projectile
;; WARN: Return type mismatch int vs sound-id.
(defmethod play-impact-sound! projectile ((obj projectile))
"Plays impact sound
:virtual"
"Plays impact sound"
(the-as sound-id 0)
)
@ -122,8 +121,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p
;; definition for method 24 of type projectile
;; WARN: Return type mismatch int vs none.
(defmethod draw-laser-sight projectile ((obj projectile))
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
0
(none)
)
@ -427,8 +425,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p
;; definition for method 31 of type projectile
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! projectile ((obj projectile))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
0
(none)
)
@ -664,8 +661,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p
;; definition for method 39 of type projectile-bounce
(defmethod play-impact-sound! projectile-bounce ((obj projectile-bounce))
"Plays impact sound
:virtual"
"Plays impact sound"
(let* ((a2-0 (-> obj root-override))
(v1-0 (-> a2-0 status))
)
@ -721,8 +717,7 @@ If we've met or exceeded the projectiles maximum allowed hits, switch to the [[p
;; definition for method 31 of type projectile-bounce
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! projectile-bounce ((obj projectile-bounce))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj max-speed) 450560.0)
(set! (-> obj timeout) (seconds 1.6))
(set! (-> obj update-velocity) projectile-bounce-update-velocity)

View file

@ -23,6 +23,9 @@
:method-count-assert 14
:size-assert #x8c
:flag-assert #xe0010008c
(:states
part-tester-idle
)
)
;; definition for method 3 of type part-tester

View file

@ -16,6 +16,9 @@
:method-count-assert 20
:size-assert #xcc
:flag-assert #x14005000cc
(:states
viewer-process
)
)
;; definition for method 3 of type viewer

View file

@ -33,6 +33,10 @@
(relocate-nav (_type_ int) none 18)
(evaluate-joint-control (_type_) none 19)
)
(:states
(process-drawable-art-error string)
process-drawable-idle
)
)
;; definition for method 3 of type process-drawable

View file

@ -72,7 +72,9 @@
;; definition for method 18 of type curve-control
(defmethod total-distance curve-control ((obj curve-control))
"Calcuate the total path length by summing the distance between each adjacent [[curve]] vertex"
"Will lazily calculate and set the [[curve]]'s `length`
@returns total path length of the [[curve]]
@see [[curve-length]]"
(let ((f0-0 (-> obj curve length)))
(when (= f0-0 0.0)
(set! f0-0 (curve-length (-> obj curve)))
@ -325,8 +327,7 @@ using the fractional component of `idx` as the interpolant, return this result
;; definition for method 12 of type curve-control
(defmethod displacement-between-two-points-copy! curve-control ((obj curve-control) (ret vector) (percent float) (mag float))
"Calls [[path-control::26]] with the provided args
@see [[path-control::26]]"
"Calls [[path-control::26]] with the `idx` at a given percent along the path @see [[path-control::26]]"
(displacement-between-two-points! obj ret (/ percent (the float (+ (-> obj curve num-cverts) -1))) mag)
)
@ -354,11 +355,7 @@ using the fractional component of `idx` as the interpolant, return this result
;; definition for method 13 of type curve-control
(defmethod displacement-between-two-points-normalized! curve-control ((obj curve-control) (ret vector) (idx float))
"Calls [[path-control::26], with the provided `idx`
@param! ret The [[vector]] the result is stored within
@param idx The vertex index
@returns The resulting displacement vector, normalized
@see [[path-control::26]]"
"@see [[curve-control::12]]"
(displacement-between-points-at-percent-normalized!
obj
ret

View file

@ -77,6 +77,9 @@
:method-count-assert 14
:size-assert #xd0
:flag-assert #xe005000d0
(:states
time-of-day-tick
)
)
;; definition for method 3 of type time-of-day-proc

View file

@ -2249,7 +2249,6 @@ Note that this doesn't actually return the nav-control, but instead adds this pr
;; definition for method 10 of type nav-state
;; WARN: Return type mismatch int vs none.
(defmethod nav-state-method-10 nav-state ((obj nav-state))
"Virtual/Stub"
0
(none)
)
@ -2522,7 +2521,6 @@ Note that this doesn't actually return the nav-control, but instead adds this pr
;; definition for method 50 of type nav-state
;; WARN: Return type mismatch int vs none.
(defmethod nav-state-method-50 nav-state ((obj nav-state))
"Virtual/Stub"
0
(none)
)

View file

@ -66,8 +66,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-laser-sight gun-blue-shot ((obj gun-blue-shot))
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
(let* ((s5-0 (ppointer->process (-> obj parent)))
(s4-0 (-> *part-id-table* 196))
(s3-0 (get-field-spec-by-id s4-0 (sp-field-id spt-omega)))
@ -343,8 +342,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! gun-blue-shot ((obj gun-blue-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(with-pp
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1))
(set! (-> obj init-pos quad) (-> obj root-override trans quad))

View file

@ -166,8 +166,7 @@
;; definition for method 31 of type gun-dark-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! gun-dark-shot ((obj gun-dark-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj attack-mode) 'eco-dark)
(vector-normalize! (-> obj root-override transv) (+ 225280.0 (* 225280.0 (-> obj charge-level))))
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 72) obj))

View file

@ -26,8 +26,7 @@
;; definition for method 31 of type gun-eject
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! gun-eject ((obj gun-eject))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-gun" (the-as (pointer uint32) #f)))
@ -73,8 +72,7 @@
;; definition for method 31 of type gun-mag-yellow
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! gun-mag-yellow ((obj gun-mag-yellow))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-yellow" (the-as (pointer uint32) #f)))
@ -114,8 +112,7 @@
;; definition for method 31 of type gun-mag-red
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! gun-mag-red ((obj gun-mag-red))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-red" (the-as (pointer uint32) #f)))
@ -155,8 +152,7 @@
;; definition for method 31 of type gun-mag-blue
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! gun-mag-blue ((obj gun-mag-blue))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-blue" (the-as (pointer uint32) #f)))
@ -196,8 +192,7 @@
;; definition for method 31 of type gun-mag-dark
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! gun-mag-dark ((obj gun-mag-dark))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(initialize-skeleton
obj
(the-as skeleton-group (art-group-get-by-name *level* "skel-ammo-dark" (the-as (pointer uint32) #f)))

View file

@ -80,8 +80,7 @@
;; definition for method 24 of type gun-yellow-shot
;; WARN: Return type mismatch int vs none.
(defmethod draw-laser-sight gun-yellow-shot ((obj gun-yellow-shot))
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
(draw-beam (-> *part-id-table* 227) (-> obj tail-pos) (-> obj starting-dir) #f #t)
0
(none)
@ -409,8 +408,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! gun-yellow-shot ((obj gun-yellow-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj hit-actor?) #f)
(set! (-> obj tail-pos quad) (-> obj root-override trans quad))
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1))

View file

@ -416,8 +416,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch projectile-options vs none.
(defmethod init-proj-settings! turret-shot ((obj turret-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj tail-pos quad) (-> obj root-override trans quad))
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 204 (seconds 0.1))
(set! (-> obj attack-mode) 'turret)

View file

@ -190,6 +190,12 @@
(update-value-callback (_type_ int int) none 25)
(alloc-string-if-needed (_type_ int) none 26)
)
(:states
hud-arriving
hud-hidden
hud-in
(hud-leaving float)
)
)
;; definition for method 3 of type hud

View file

@ -411,8 +411,7 @@
;; definition for method 31 of type juicer-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! juicer-shot ((obj juicer-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(logior! (-> obj options) (projectile-options proj-options-8000))
(set! (-> obj attack-mode) 'eco-yellow)
(set! (-> obj move) juicer-proj-move)

View file

@ -4,7 +4,6 @@
;; definition for method 9 of type kidt-wait-spot
;; WARN: Return type mismatch int vs none.
(defmethod reset-task! kidt-wait-spot ((obj kidt-wait-spot))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
@ -15,7 +14,6 @@
;; definition for method 11 of type kidt-wait-spot
;; WARN: Return type mismatch symbol vs none.
(defmethod ai-task-method-11 kidt-wait-spot ((obj kidt-wait-spot) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(when (>= s4-0 0)
(let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0))))
@ -45,7 +43,3 @@
((-> obj check-done) obj (the-as kid arg0))
(none)
)

View file

@ -4,7 +4,6 @@
;; definition for method 9 of type kort-wait-spot
;; WARN: Return type mismatch int vs none.
(defmethod reset-task! kort-wait-spot ((obj kort-wait-spot))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) -1)
(set! (-> obj num-spots) (the-as uint 0))
@ -15,7 +14,6 @@
;; definition for method 11 of type kort-wait-spot
;; WARN: Return type mismatch symbol vs none.
(defmethod ai-task-method-11 kort-wait-spot ((obj kort-wait-spot) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(when (>= s4-0 0)
(let ((s3-0 (-> arg0 course spots (-> obj spot-indexes s4-0))))
@ -45,7 +43,3 @@
((-> obj check-done) obj (the-as kor arg0))
(none)
)

View file

@ -105,7 +105,6 @@
;; definition for method 11 of type ai-task
;; WARN: Return type mismatch int vs none.
(defmethod ai-task-method-11 ai-task ((obj ai-task) (arg0 bot))
"Virtual"
0
(none)
)
@ -113,7 +112,6 @@
;; definition for method 10 of type ai-task
;; WARN: Return type mismatch int vs none.
(defmethod ai-task-method-10 ai-task ((obj ai-task) (arg0 bot))
"Virtual"
0
(none)
)
@ -121,7 +119,6 @@
;; definition for method 9 of type ai-task
;; WARN: Return type mismatch int vs none.
(defmethod reset-task! ai-task ((obj ai-task))
"Virtual"
0
(none)
)
@ -317,7 +314,3 @@
)
(none)
)

View file

@ -870,7 +870,6 @@
;; definition for method 24 of type elec-gate
;; WARN: Return type mismatch int vs none.
(defmethod elec-gate-method-24 elec-gate ((obj elec-gate))
"virtual"
0
(none)
)

View file

@ -197,8 +197,7 @@
;; definition for method 31 of type centurion-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! centurion-shot ((obj centurion-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
((the-as (function projectile none) (find-parent-method centurion-shot 31)) obj)
(set! (-> obj max-speed) 327680.0)
(set! (-> obj timeout) (seconds 1.25))

View file

@ -43,8 +43,7 @@
;; definition for method 31 of type spyder-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! spyder-shot ((obj spyder-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
((the-as (function projectile none) (find-parent-method spyder-shot 31)) obj)
(set! (-> obj max-speed) 307200.0)
(set! (-> obj timeout) (seconds 0.267))

View file

@ -363,8 +363,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-laser-sight guard-shot ((obj guard-shot))
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
(draw-beam (-> *part-id-table* 610) (-> obj tail-pos) (-> obj starting-dir) #f #t)
(let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0))
(v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3))
@ -703,8 +702,7 @@
;; definition for method 31 of type guard-shot
;; INFO: Used lq/sq
(defmethod init-proj-settings! guard-shot ((obj guard-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj hit-actor?) #f)
(set! (-> obj tail-pos quad) (-> obj root-override trans quad))
(set! (-> obj attack-mode) 'guard-shot)
@ -805,8 +803,7 @@
;; definition for method 31 of type vehicle-grenade
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! vehicle-grenade ((obj vehicle-grenade))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj attack-mode) 'eco-dark)
(initialize-skeleton
obj
@ -845,8 +842,7 @@
;; definition for method 39 of type vehicle-grenade
(defmethod play-impact-sound! vehicle-grenade ((obj vehicle-grenade))
"Plays impact sound
:virtual"
"Plays impact sound"
(let* ((a2-0 (-> obj root-override))
(v1-0 (-> a2-0 status))
)
@ -1120,8 +1116,7 @@
;; definition for method 31 of type guard-lazer-shot
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! guard-lazer-shot ((obj guard-lazer-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj attack-mode) 'shock)
(set! (-> obj max-speed) 131072.0)
(set! (-> obj timeout) (seconds 0.125))

View file

@ -348,8 +348,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-laser-sight metalhead-shot ((obj metalhead-shot))
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
(draw-beam (-> *part-id-table* 624) (-> obj tail-pos) (-> obj starting-dir) #f #t)
(let* ((a0-3 (vector-normalize-copy! (new 'stack-no-clear 'vector) (-> obj starting-dir) 2048.0))
(v1-2 (vector+! (new 'stack-no-clear 'vector) (-> obj tail-pos) a0-3))
@ -601,8 +600,7 @@
;; definition for method 31 of type metalhead-shot
;; INFO: Used lq/sq
(defmethod init-proj-settings! metalhead-shot ((obj metalhead-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj tail-pos quad) (-> obj root-override trans quad))
(set! (-> obj attack-mode) 'metalhead-shot)
(set! (-> obj max-speed) 532480.0)
@ -994,8 +992,7 @@
;; definition for method 31 of type metalhead-grenade-shot
;; WARN: Return type mismatch sound-id vs none.
(defmethod init-proj-settings! metalhead-grenade-shot ((obj metalhead-grenade-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj attack-mode) 'eco-yellow)
(set! (-> obj blast-radius) 4096.0)
(set! (-> obj max-speed) 135168.0)

View file

@ -577,8 +577,7 @@ This commonly includes things such as:
;; INFO: Used lq/sq
;; WARN: Return type mismatch time-frame vs sound-id.
(defmethod play-impact-sound! dig-spikey-sphere ((obj dig-spikey-sphere))
"Plays impact sound
:virtual"
"Plays impact sound"
(let* ((a0-1 (-> obj root-override))
(s5-0 (-> a0-1 status))
)
@ -677,8 +676,7 @@ This commonly includes things such as:
;; definition for method 31 of type dig-spikey-sphere
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! dig-spikey-sphere ((obj dig-spikey-sphere))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(with-pp
(set! (-> obj attack-mode) 'eco-dark)
(initialize-skeleton

View file

@ -206,8 +206,7 @@
;; definition for method 31 of type predator-shot
;; INFO: Used lq/sq
(defmethod init-proj-settings! predator-shot ((obj predator-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj tail-pos quad) (-> obj root-override trans quad))
(set! (-> obj attack-mode) 'predator-shot)
(set! (-> obj max-speed) 532480.0)

View file

@ -1525,13 +1525,8 @@
;; definition for method 24 of type fort-elec-gate
;; WARN: Return type mismatch int vs none.
(defmethod elec-gate-method-24 fort-elec-gate ((obj fort-elec-gate))
"virtual"
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 551) obj))
(set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 552) obj))
0
(none)
)

View file

@ -790,8 +790,7 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod init-proj-settings! fort-robotank-shot ((obj fort-robotank-shot))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(set! (-> obj tail-pos quad) (-> obj root-override trans quad))
(set! (-> obj attack-mode) 'fort-robotank-shot)
(set! (-> obj max-speed) 819200.0)

View file

@ -1560,13 +1560,8 @@
;; definition for method 24 of type fort-elec-gate
;; WARN: Return type mismatch int vs none.
(defmethod elec-gate-method-24 fort-elec-gate ((obj fort-elec-gate))
"virtual"
(set! (-> obj part) (create-launch-control (-> *part-group-id-table* 653) obj))
(set! (-> obj part-off) (create-launch-control (-> *part-group-id-table* 654) obj))
0
(none)
)

View file

@ -1289,8 +1289,7 @@ This commonly includes things such as:
;; INFO: Used lq/sq
;; WARN: Return type mismatch int vs none.
(defmethod draw-laser-sight grenade ((obj grenade))
"TODO - confirm If applicable, draw the laser sight particles
:virtual"
"TODO - confirm If applicable, draw the laser sight particles"
(let ((gp-0 (get-process *default-dead-pool* part-tracker #x4000)))
(when gp-0
(let ((t9-1 (method-of-type part-tracker activate)))
@ -1573,8 +1572,7 @@ This commonly includes things such as:
;; definition for method 31 of type grenade
(defmethod init-proj-settings! grenade ((obj grenade))
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc
:virtual"
"Init relevant settings for the [[projectile]] such as gravity, speed, timeout, etc"
(with-pp
(initialize-skeleton
obj

View file

@ -4,7 +4,6 @@
;; definition for method 9 of type halt-wait-spot
;; WARN: Return type mismatch int vs none.
(defmethod reset-task! halt-wait-spot ((obj halt-wait-spot))
"Virtual"
(set! (-> obj check-done) #f)
(set! (-> obj which-spot) 0)
(set! (-> obj num-spots) (the-as uint 1))
@ -15,7 +14,6 @@
;; INFO: Used lq/sq
;; WARN: Return type mismatch symbol vs none.
(defmethod ai-task-method-11 halt-wait-spot ((obj halt-wait-spot) (arg0 bot))
"Virtual"
(let ((s4-0 (-> obj which-spot)))
(if (logtest? *display-bot-marks* (bot-marks-controls bmc16))
(bot-debug-draw-spot-sphere
@ -35,7 +33,3 @@
((-> obj check-done) obj (the-as hal arg0))
(none)
)

View file

@ -766,7 +766,7 @@ TEST_F(WithGameTests, StaticLambda) {
{"Add: 30 sub: -10\n0\n"});
}
TEST_F(WithGameTests, StaticLambdaArrayDraft) {
TEST_F(WithGameTests, StaticLambdaArray) {
shared_compiler->runner.run_static_test(testCategory, "test-static-array-of-lambdas.gc",
{"2\n1\n0\n"});
}