[decompiler] decomp jak2 static-attack-info (#2992)

Fixes #2993
This commit is contained in:
ManDude
2023-09-15 19:32:57 +01:00
committed by GitHub
parent a03413d4ca
commit 87be9ebd14
208 changed files with 4472 additions and 6706 deletions
+10
View File
@@ -123,6 +123,16 @@ std::string Env::get_variable_name(const RegisterAccess& access) const {
return get_variable_and_cast(access).name;
}
std::string Env::get_variable_name_name_only(const RegisterAccess& access) const {
if (access.reg().get_kind() == Reg::FPR || access.reg().get_kind() == Reg::GPR) {
auto& var_info = m_var_names.lookup(access.reg(), access.idx(), access.mode());
return var_info.name();
} else {
return std::string(access.reg().to_charp());
}
}
VariableWithCast Env::get_variable_and_cast(const RegisterAccess& access) const {
if (access.reg().get_kind() == Reg::FPR || access.reg().get_kind() == Reg::GPR) {
auto& var_info = m_var_names.lookup(access.reg(), access.idx(), access.mode());
+1
View File
@@ -82,6 +82,7 @@ class Env {
goos::Object get_variable_name_with_cast(Register reg, int atomic_idx, AccessMode mode) const;
goos::Object get_variable_name_with_cast(const RegisterAccess& access) const;
std::string get_variable_name(const RegisterAccess& access) const;
std::string get_variable_name_name_only(const RegisterAccess& access) const;
VariableWithCast get_variable_and_cast(const RegisterAccess& access) const;
std::optional<TypeSpec> get_user_cast_for_access(const RegisterAccess& access) const;
TypeSpec get_variable_type(const RegisterAccess& access, bool using_user_var_types) const;
+135 -28
View File
@@ -8,6 +8,20 @@ Matcher Matcher::any_reg(int match_id) {
return m;
}
Matcher Matcher::same_var(int match_id) {
Matcher m;
m.m_kind = Kind::SAME_VAR;
m.m_reg_out_id = match_id;
return m;
}
Matcher Matcher::var_name(const std::string& name) {
Matcher m;
m.m_kind = Kind::VAR_NAME;
m.m_str = name;
return m;
}
Matcher Matcher::any_label(int match_id) {
Matcher m;
m.m_kind = Kind::ANY_LABEL;
@@ -214,7 +228,18 @@ Matcher Matcher::begin(const std::vector<Matcher>& elts) {
return m;
}
bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
Matcher Matcher::let(bool is_star,
const std::vector<LetEntryMatcher>& entries,
const std::vector<Matcher>& elts) {
Matcher m;
m.m_kind = Kind::LET;
m.m_let_is_star = is_star;
m.m_entry_matchers = entries;
m.m_sub_matchers = elts;
return m;
}
bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out, const Env* const env) const {
switch (m_kind) {
case Kind::ANY:
if (m_form_match != -1) {
@@ -222,6 +247,8 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
}
return true;
case Kind::ANY_REG:
case Kind::VAR_NAME:
case Kind::SAME_VAR:
case Kind::REG: {
bool got = false;
RegisterAccess result;
@@ -246,9 +273,17 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
if (got) {
if (m_kind == Kind::REG) {
return result.reg() == *m_reg;
} else if (m_kind == Kind::VAR_NAME) {
return env && env->get_variable_name_name_only(result) == m_str;
} else if (m_reg_out_id != -1) {
maps_out->regs.resize(std::max(size_t(m_reg_out_id + 1), maps_out->regs.size()));
maps_out->regs.at(m_reg_out_id) = result;
if (m_kind == Kind::SAME_VAR && maps_out->regs.size() > m_reg_out_id &&
maps_out->regs.at(m_reg_out_id)) {
return env && env->get_variable_name_name_only(result) ==
env->get_variable_name_name_only(*maps_out->regs.at(m_reg_out_id));
} else {
maps_out->regs.resize(std::max(size_t(m_reg_out_id + 1), maps_out->regs.size()));
maps_out->regs.at(m_reg_out_id) = result;
}
}
return true;
} else {
@@ -291,7 +326,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
case Kind::GENERIC_OP_WITH_REST: {
auto as_generic = dynamic_cast<GenericElement*>(input->try_as_single_active_element());
if (as_generic) {
if (!m_gen_op_matcher->do_match(as_generic->op(), maps_out)) {
if (!m_gen_op_matcher->do_match(as_generic->op(), maps_out, env)) {
return false;
}
@@ -302,7 +337,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
}
for (size_t i = 0; i < m_sub_matchers.size(); i++) {
if (!m_sub_matchers.at(i).do_match(as_generic->elts().at(i), maps_out)) {
if (!m_sub_matchers.at(i).do_match(as_generic->elts().at(i), maps_out, env)) {
return false;
}
}
@@ -313,7 +348,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
case Kind::OR: {
for (auto& matcher : m_sub_matchers) {
if (matcher.do_match(input, maps_out)) {
if (matcher.do_match(input, maps_out, env)) {
return true;
}
}
@@ -344,7 +379,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
auto as_cast = dynamic_cast<CastElement*>(input->try_as_single_active_element());
if (as_cast) {
if (as_cast->type().print() == m_str) {
return m_sub_matchers.at(0).do_match(as_cast->source(), maps_out);
return m_sub_matchers.at(0).do_match(as_cast->source(), maps_out, env);
}
}
return false;
@@ -354,7 +389,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
auto as_cast = dynamic_cast<CastElement*>(input->try_as_single_active_element());
if (as_cast) {
maps_out->strings[m_string_out_id] = as_cast->type().print();
return m_sub_matchers.at(0).do_match(as_cast->source(), maps_out);
return m_sub_matchers.at(0).do_match(as_cast->source(), maps_out, env);
}
return false;
} break;
@@ -512,7 +547,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
if (as_deref->is_addr_of() != m_deref_is_addr_of) {
return false;
}
if (!m_sub_matchers.at(0).do_match(as_deref->base(), maps_out)) {
if (!m_sub_matchers.at(0).do_match(as_deref->base(), maps_out, env)) {
return false;
}
if (as_deref->tokens().size() != m_token_matchers.size()) {
@@ -533,11 +568,11 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
if (!as_set) {
return false;
}
if (!m_sub_matchers.at(0).do_match(as_set->dst(), maps_out)) {
if (!m_sub_matchers.at(0).do_match(as_set->dst(), maps_out, env)) {
return false;
}
if (!m_sub_matchers.at(1).do_match(as_set->src(), maps_out)) {
if (!m_sub_matchers.at(1).do_match(as_set->src(), maps_out, env)) {
return false;
} else {
return true;
@@ -554,15 +589,15 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
return false;
}
if (!m_sub_matchers.at(0).do_match(as_cond->entries.front().condition, maps_out)) {
if (!m_sub_matchers.at(0).do_match(as_cond->entries.front().condition, maps_out, env)) {
return false;
}
if (!m_sub_matchers.at(1).do_match(as_cond->entries.front().body, maps_out)) {
if (!m_sub_matchers.at(1).do_match(as_cond->entries.front().body, maps_out, env)) {
return false;
}
if (!m_sub_matchers.at(2).do_match(as_cond->else_ir, maps_out)) {
if (!m_sub_matchers.at(2).do_match(as_cond->else_ir, maps_out, env)) {
return false;
}
return true;
@@ -578,11 +613,11 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
return false;
}
if (!m_sub_matchers.at(0).do_match(as_cond->entries.front().condition, maps_out)) {
if (!m_sub_matchers.at(0).do_match(as_cond->entries.front().condition, maps_out, env)) {
return false;
}
if (!m_sub_matchers.at(1).do_match(as_cond->entries.front().body, maps_out)) {
if (!m_sub_matchers.at(1).do_match(as_cond->entries.front().body, maps_out, env)) {
return false;
}
@@ -599,7 +634,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
}
for (size_t i = 0; i < m_sub_matchers.size(); i++) {
if (!m_sub_matchers.at(i).do_match(as_sc->entries.at(i).condition, maps_out)) {
if (!m_sub_matchers.at(i).do_match(as_sc->entries.at(i).condition, maps_out, env)) {
return false;
}
}
@@ -613,11 +648,11 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
return false;
}
if (!m_sub_matchers.at(0).do_match(as_while->condition, maps_out)) {
if (!m_sub_matchers.at(0).do_match(as_while->condition, maps_out, env)) {
return false;
}
if (!m_sub_matchers.at(1).do_match(as_while->body, maps_out)) {
if (!m_sub_matchers.at(1).do_match(as_while->body, maps_out, env)) {
return false;
}
return true;
@@ -631,7 +666,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
for (int i = 0; i < input->size(); i++) {
Form fake;
fake.elts().push_back(input->elts().at(i));
if (!m_sub_matchers.at(i).do_match(&fake, maps_out)) {
if (!m_sub_matchers.at(i).do_match(&fake, maps_out, env)) {
return false;
}
}
@@ -644,7 +679,7 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
return false;
}
if (!m_sub_matchers.at(0).do_match(as_set->src(), maps_out)) {
if (!m_sub_matchers.at(0).do_match(as_set->src(), maps_out, env)) {
return false;
}
@@ -655,6 +690,34 @@ bool Matcher::do_match(Form* input, MatchResult::Maps* maps_out) const {
return true;
}
case Kind::LET: {
auto as_let = dynamic_cast<LetElement*>(input->try_as_single_active_element());
if (as_let) {
// fail if we have wrong number of entries/body elts or recursive marker
if ((m_entry_matchers.size() != as_let->entries().size()) ||
(m_sub_matchers.size() != as_let->body()->size()) ||
(as_let->is_star() != m_let_is_star)) {
return false;
}
// match entries first
for (size_t i = 0; i < m_entry_matchers.size(); ++i) {
if (!m_entry_matchers.at(i).do_match(as_let->entries().at(i), maps_out, env)) {
return false;
}
}
// now match body
for (int i = 0; i < m_sub_matchers.size(); ++i) {
Form fake;
fake.elts().push_back(as_let->body()->elts().at(i));
if (!m_sub_matchers.at(i).do_match(&fake, maps_out, env)) {
return false;
}
}
return true;
}
return false;
}
default:
ASSERT(false);
return false;
@@ -666,17 +729,17 @@ Matcher Matcher::any_reg_cast_to_int_or_uint(int match_id) {
{any_reg(match_id), cast("uint", any_reg(match_id)), cast("int", any_reg(match_id))});
}
MatchResult match(const Matcher& spec, Form* input) {
MatchResult match(const Matcher& spec, Form* input, const Env* const env) {
MatchResult result;
result.matched = spec.do_match(input, &result.maps);
result.matched = spec.do_match(input, &result.maps, env);
return result;
}
MatchResult match(const Matcher& spec, FormElement* input) {
MatchResult match(const Matcher& spec, FormElement* input, const Env* const env) {
Form hack;
hack.elts().push_back(input);
MatchResult result;
result.matched = spec.do_match(&hack, &result.maps);
result.matched = spec.do_match(&hack, &result.maps, env);
return result;
}
@@ -790,7 +853,9 @@ GenericOpMatcher GenericOpMatcher::or_match(const std::vector<GenericOpMatcher>&
return m;
}
bool GenericOpMatcher::do_match(GenericOperator& input, MatchResult::Maps* maps_out) const {
bool GenericOpMatcher::do_match(GenericOperator& input,
MatchResult::Maps* maps_out,
const Env* const env) const {
switch (m_kind) {
case Kind::FIXED:
if (input.kind() == GenericOperator::Kind::FIXED_OPERATOR) {
@@ -799,7 +864,7 @@ bool GenericOpMatcher::do_match(GenericOperator& input, MatchResult::Maps* maps_
return false;
case Kind::FUNC:
if (input.kind() == GenericOperator::Kind::FUNCTION_EXPR) {
return m_func_matcher.do_match(input.func(), maps_out);
return m_func_matcher.do_match(input.func(), maps_out, env);
}
return false;
case Kind::CONDITION:
@@ -809,7 +874,7 @@ bool GenericOpMatcher::do_match(GenericOperator& input, MatchResult::Maps* maps_
return false;
case Kind::OR:
for (auto& m : m_sub_matchers) {
if (m.do_match(input, maps_out)) {
if (m.do_match(input, maps_out, env)) {
return true;
}
}
@@ -820,4 +885,46 @@ bool GenericOpMatcher::do_match(GenericOperator& input, MatchResult::Maps* maps_
}
}
LetEntryMatcher LetEntryMatcher::name(std::optional<Matcher> src, const std::string& name) {
LetEntryMatcher result;
result.m_kind = Kind::NAME;
result.m_reg_name = name;
result.m_src_matcher = src;
return result;
}
LetEntryMatcher LetEntryMatcher::any(std::optional<Matcher> src, int match_id) {
LetEntryMatcher result;
result.m_kind = Kind::ANY;
result.m_reg_out_id = match_id;
result.m_src_matcher = src;
return result;
}
bool LetEntryMatcher::do_match(const LetElement::Entry& input,
MatchResult::Maps* maps_out,
const Env* const env) const {
switch (m_kind) {
case Kind::ANY:
case Kind::NAME:
if (m_reg_out_id != -1) {
if (m_kind == Kind::NAME && maps_out->regs.size() > m_reg_out_id &&
maps_out->regs.at(m_reg_out_id)) {
return env && env->get_variable_name_name_only(input.dest) ==
env->get_variable_name_name_only(*maps_out->regs.at(m_reg_out_id));
} else {
maps_out->regs.resize(std::max(size_t(m_reg_out_id + 1), maps_out->regs.size()));
maps_out->regs.at(m_reg_out_id) = input.dest;
}
}
if (m_src_matcher) {
return m_src_matcher->do_match(input.src, maps_out, env);
}
return true;
default:
ASSERT(false);
return false;
}
}
} // namespace decompiler
+42 -9
View File
@@ -5,11 +5,13 @@
*/
#pragma once
#include "Env.h"
#include "Form.h"
namespace decompiler {
class DerefTokenMatcher;
class GenericOpMatcher;
class LetEntryMatcher;
struct MatchResult {
bool matched = false;
@@ -33,6 +35,8 @@ struct MatchResult {
class Matcher {
public:
static Matcher any_reg(int match_id = -1);
static Matcher same_var(int match_id);
static Matcher var_name(const std::string& name);
static Matcher any_label(int match_id = -1);
static Matcher reg(Register reg);
static inline Matcher s6() { return Matcher::reg(Register(Reg::GPR, Reg::S6)); }
@@ -69,6 +73,9 @@ class Matcher {
static Matcher constant_token(const std::string& name);
static Matcher or_expression(const std::vector<Matcher>& elts);
static Matcher begin(const std::vector<Matcher>& elts);
static Matcher let(bool is_star,
const std::vector<LetEntryMatcher>& entries,
const std::vector<Matcher>& elts);
enum class Kind {
ANY_REG, // matching any register
@@ -97,30 +104,38 @@ class Matcher {
BEGIN,
REG, // a specific register. like s6.
QUOTED_SYMBOL,
SAME_VAR,
LET,
VAR_NAME,
INVALID
};
bool do_match(Form* input, MatchResult::Maps* maps_out) const;
bool do_match(Form* input, MatchResult::Maps* maps_out, const Env* const env) const;
private:
std::vector<Matcher> m_sub_matchers;
std::vector<DerefTokenMatcher> m_token_matchers;
std::vector<LetEntryMatcher> m_entry_matchers;
std::shared_ptr<GenericOpMatcher> m_gen_op_matcher;
bool m_deref_is_addr_of = false;
bool m_let_is_star = false;
Kind m_kind = Kind::INVALID;
int m_reg_out_id = -1;
int m_string_out_id = -1;
int m_form_match = -1;
int m_label_out_id = -1;
int m_int_out_id = -1;
union {
int m_out_id = -1;
int m_reg_out_id;
int m_string_out_id;
int m_form_match;
int m_label_out_id;
int m_int_out_id;
};
std::optional<int> m_int_match;
std::optional<float> m_float_match;
std::optional<Register> m_reg;
std::string m_str;
};
MatchResult match(const Matcher& spec, Form* input);
MatchResult match(const Matcher& spec, FormElement* input);
MatchResult match(const Matcher& spec, Form* input, const Env* const env = nullptr);
MatchResult match(const Matcher& spec, FormElement* input, const Env* const env = nullptr);
class DerefTokenMatcher {
public:
@@ -159,7 +174,7 @@ class GenericOpMatcher {
enum class Kind { FIXED, FUNC, CONDITION, OR, INVALID };
bool do_match(GenericOperator& input, MatchResult::Maps* maps_out) const;
bool do_match(GenericOperator& input, MatchResult::Maps* maps_out, const Env* const env) const;
private:
Kind m_kind = Kind::INVALID;
@@ -169,4 +184,22 @@ class GenericOpMatcher {
Matcher m_func_matcher;
};
class LetEntryMatcher {
public:
static LetEntryMatcher name(std::optional<Matcher> src_matcher, const std::string& name);
static LetEntryMatcher any(std::optional<Matcher> src_matcher, int match_id = -1);
enum class Kind { ANY, NAME, INVALID };
bool do_match(const LetElement::Entry& input,
MatchResult::Maps* maps_out,
const Env* const env) const;
private:
Kind m_kind = Kind::INVALID;
int m_reg_out_id = -1;
std::optional<Matcher> m_src_matcher;
std::string m_reg_name;
};
} // namespace decompiler
+147 -82
View File
@@ -316,7 +316,6 @@ FormElement* rewrite_as_send_event(LetElement* in,
// (let ((block-var (new 'stack-no-clear 'event-message-block))
auto block_var = in->entries().at(0).dest;
const auto& block_var_reg = block_var.reg();
auto block_var_name = env.get_variable_name(block_var);
auto block_src = in->entries().at(0).src->try_as_element<StackStructureDefElement>();
if (!block_src) {
return nullptr;
@@ -1148,13 +1147,13 @@ FormElement* rewrite_as_case_with_else(LetElement* in, const Env& env, FormPool&
return pool.alloc_element<CaseElement>(in->entries().at(0).src, entries, cond->else_ir);
}
bool var_name_equal(const Env& env, const std::string& a, std::optional<RegisterAccess> b) {
bool var_equal(const Env& env, const RegisterAccess& a, std::optional<RegisterAccess> b) {
ASSERT(b);
return env.get_variable_name(*b) == a;
return env.get_variable_name_name_only(*b) == env.get_variable_name_name_only(a);
}
Form* match_ja_set(const Env& env,
const std::string& ch_var_name,
const RegisterAccess& ch_var,
const std::string& field_name,
int arr_idx,
Form* in,
@@ -1179,9 +1178,9 @@ Form* match_ja_set(const Env& env,
return nullptr;
}
if (!var_name_equal(env, ch_var_name, mr.maps.regs.at(0))) {
lg::error("[{}] JA MACRO ERROR channel var not {} in set {} {}", env.func->name(), ch_var_name,
field_name, arr_idx);
if (!var_equal(env, ch_var, mr.maps.regs.at(0))) {
lg::error("[{}] JA MACRO ERROR channel var not {} in set {} {}", env.func->name(),
env.get_variable_name(ch_var), field_name, arr_idx);
*bad = true;
return nullptr;
}
@@ -1226,8 +1225,7 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
// look for setting a var to (-> self skel root-channel ,channel).
// yes, channel is actually not always just 0!
auto ra = in->entries().at(0).dest;
auto var = env.get_variable_name(ra);
auto chan = in->entries().at(0).dest;
auto mr_chan = match(
Matcher::deref(Matcher::s6(), false,
{DerefTokenMatcher::string("skel"), DerefTokenMatcher::string("root-channel"),
@@ -1242,13 +1240,13 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
// there is just a LOT to match. and then to write!
bool bad = false;
int idx = 0;
auto set_fi = match_ja_set(env, var, "frame-interp", -1, in->body(), &idx, &bad);
auto set_dist = match_ja_set(env, var, "dist", -1, in->body(), &idx, &bad);
auto set_fg = match_ja_set(env, var, "frame-group", -1, in->body(), &idx, &bad);
auto set_p0 = match_ja_set(env, var, "param", 0, in->body(), &idx, &bad);
auto set_p1 = match_ja_set(env, var, "param", 1, in->body(), &idx, &bad);
auto set_nf = match_ja_set(env, var, "num-func", -1, in->body(), &idx, &bad);
auto set_fn = match_ja_set(env, var, "frame-num", -1, in->body(), &idx, &bad);
auto set_fi = match_ja_set(env, chan, "frame-interp", -1, in->body(), &idx, &bad);
auto set_dist = match_ja_set(env, chan, "dist", -1, in->body(), &idx, &bad);
auto set_fg = match_ja_set(env, chan, "frame-group", -1, in->body(), &idx, &bad);
auto set_p0 = match_ja_set(env, chan, "param", 0, in->body(), &idx, &bad);
auto set_p1 = match_ja_set(env, chan, "param", 1, in->body(), &idx, &bad);
auto set_nf = match_ja_set(env, chan, "num-func", -1, in->body(), &idx, &bad);
auto set_fn = match_ja_set(env, chan, "frame-num", -1, in->body(), &idx, &bad);
// lastly, match the function call.
enum { NO_FUNC, EVAL, NO_EVAL } func_status = NO_FUNC;
@@ -1261,7 +1259,7 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
in->body()->at(idx));
if (mr_func.matched) {
// NOTE : it's actually fine for there to be no func. we just forgo setting the num! param.
if (!var_name_equal(env, var, mr_func.maps.regs.at(0))) {
if (!var_equal(env, chan, mr_func.maps.regs.at(0))) {
return nullptr;
}
@@ -1293,7 +1291,7 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
}
// PSYCHE! there may actually be a second frame-num set. for some reason. sigh...
auto set_fn2 = match_ja_set(env, var, "frame-num", -1, in->body(), &idx, &bad);
auto set_fn2 = match_ja_set(env, chan, "frame-num", -1, in->body(), &idx, &bad);
if (bad) {
// an error occurred
@@ -1378,7 +1376,7 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
auto mr = match(matcher_max_num, set_fn2);
if (mr.matched &&
((form_fg && mr.maps.forms.at(1)->to_form(env) == form_fg->to_form(env)) ||
(!form_fg && var_name_equal(env, var, mr.maps.regs.at(0))))) {
(!form_fg && var_equal(env, chan, mr.maps.regs.at(0))))) {
num_form = pool.form<ConstantTokenElement>("max");
} else {
num_form = pool.form<GenericElement>(
@@ -1398,7 +1396,7 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
auto mr = match(matcher_max_num, set_p0);
if (mr.matched &&
((form_fg && mr.maps.forms.at(1)->to_form(env) == form_fg->to_form(env)) ||
(!form_fg && var_name_equal(env, var, mr.maps.regs.at(0))))) {
(!form_fg && var_equal(env, chan, mr.maps.regs.at(0))))) {
num_form = pool.form<GenericElement>(
GenericOperator::make_function(pool.form<ConstantTokenElement>(prelim_num)),
pool.form<ConstantTokenElement>("max"));
@@ -1432,7 +1430,7 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
// (the float (1- (-> ja-ch frame-group data 0 length)))
auto mr = match(matcher_max_num, set_p0);
if (!mr.matched || (form_fg && mr.maps.forms.at(1)->to_form(env) != form_fg->to_form(env)) ||
(!form_fg && !var_name_equal(env, var, mr.maps.regs.at(0)))) {
(!form_fg && !var_equal(env, chan, mr.maps.regs.at(0)))) {
// did not match default
seek_args.push_back(set_p0);
}
@@ -1466,7 +1464,7 @@ FormElement* rewrite_joint_macro(LetElement* in, const Env& env, FormPool& pool)
if (set_fn) {
auto mr = match(matcher_max_num, set_fn);
if (mr.matched && ((form_fg && mr.maps.forms.at(1)->to_form(env) == form_fg->to_form(env)) ||
(!form_fg && var_name_equal(env, var, mr.maps.regs.at(0))))) {
(!form_fg && var_equal(env, chan, mr.maps.regs.at(0))))) {
set_fn = pool.form<ConstantTokenElement>("max");
}
}
@@ -1510,11 +1508,8 @@ FormElement* rewrite_proc_new(LetElement* in, const Env& env, FormPool& pool) {
return nullptr;
}
auto test = in->to_form(env).print();
// look for setting a var to (get-process *default-dead-pool* logo-slave #x4000)
auto ra = in->entries().at(0).dest;
auto var = env.get_variable_name(ra);
auto mr_get_proc = match(
Matcher::func("get-process", {Matcher::any(0), Matcher::any_symbol(1), Matcher::any(2)}),
in->entries().at(0).src);
@@ -1690,8 +1685,6 @@ FormElement* rewrite_attack_info(LetElement* in, const Env& env, FormPool& pool)
return nullptr;
}
auto test = in->to_form(env).print();
// (let ((block-var (new 'static 'attack-info))
auto block_src = in->entries().at(0).src->try_as_element<DecompiledDataElement>();
if (!block_src) {
@@ -1705,34 +1698,109 @@ FormElement* rewrite_attack_info(LetElement* in, const Env& env, FormPool& pool)
const auto& label = block_src->label();
const auto& words = env.file->words_by_seg.at(label.target_segment);
u32 mask = words.at((label.offset + 64) / 4).data;
// offset of `mask` field in `attack-info`
int mask_field_offset = 64;
if (env.version == GameVersion::Jak2) {
mask_field_offset = 88;
}
u32 mask = words.at((label.offset + mask_field_offset) / 4).data;
u32 mask_implicit = 0;
auto block_var = in->entries().at(0).dest;
const auto& block_var_reg = block_var.reg();
auto block_var_name = env.get_variable_name(block_var);
const static std::map<std::string, std::pair<int, bool>> possible_args = {
{"vector", {1, true}}, {"mode", {5, false}}, {"shove-back", {6, false}},
{"shove-up", {7, false}}, {"control", {10, false}}, {"angle", {11, false}}};
enum AttackInfoFieldKind { DEFAULT, VECTOR, METERS, DEGREES };
const static std::map<std::string, std::pair<int, AttackInfoFieldKind>> possible_args_jak1 = {
{"vector", {1, VECTOR}}, {"mode", {5, DEFAULT}}, {"shove-back", {6, DEFAULT}},
{"shove-up", {7, DEFAULT}}, {"control", {10, DEFAULT}}, {"angle", {11, DEFAULT}},
};
const static std::map<std::string, std::pair<int, AttackInfoFieldKind>> possible_args_jak2 = {
{"vector", {1, VECTOR}},
{"intersection", {2, VECTOR}},
{"attacker", {3, DEFAULT}},
{"invinc-time", {5, DEFAULT}},
{"mode", {6, DEFAULT}},
{"shove-back", {7, DEFAULT}},
{"shove-up", {8, DEFAULT}},
{"speed", {9, DEFAULT}},
{"control", {11, DEFAULT}},
{"angle", {12, DEFAULT}},
{"id", {15, DEFAULT}},
{"count", {16, DEFAULT}},
{"penetrate-using", {17, DEFAULT}},
{"attacker-velocity", {18, VECTOR}},
{"damage", {19, DEFAULT}},
{"shield-damage", {20, DEFAULT}},
{"knock", {21, DEFAULT}},
{"test", {22, DEFAULT}},
};
const auto& possible_args =
env.version == GameVersion::Jak1 ? possible_args_jak1 : possible_args_jak2;
std::vector<std::pair<std::string, Form*>> args_in_info;
for (int i = 0; i < in->body()->size() - 1; ++i) {
auto s_elt = dynamic_cast<SetFormFormElement*>(in->body()->at(i));
// v--v
// (set! (-> v1-2 mode) arg2)
Form* s_src = nullptr; // the source form. we use a separate variable since we might want to
// change this (e.g. into (new-attack-id))
if (!s_elt) {
lg::error("attack info err elt {} not a set!: {}", i, in->body()->at(i)->to_string(env));
return nullptr;
// lg::error("attack info err elt {} not a set!: {}", i, in->body()->at(i)->to_string(env));
// lg::error("checking if (new-attack-id)...");
auto l_elt = dynamic_cast<LetElement*>(in->body()->at(i));
if (l_elt) {
const auto match_let_for_new_attack_id = Matcher::let(
false, {LetEntryMatcher::any(Matcher::symbol("*game-info*"), 0)},
{Matcher::let(
false,
{LetEntryMatcher::any(
Matcher::op_fixed(FixedOperatorKind::ADDITION,
{Matcher::deref(Matcher::same_var(0), false,
{DerefTokenMatcher::string("attack-id")}),
Matcher::integer(1)}),
1)},
{Matcher::set(Matcher::deref(Matcher::same_var(0), false,
{DerefTokenMatcher::string("attack-id")}),
Matcher::same_var(1)),
Matcher::set(Matcher::deref(Matcher::reg(block_var_reg), false,
{DerefTokenMatcher::string("id")}),
Matcher::same_var(1))})});
auto mr_let = match(match_let_for_new_attack_id, l_elt, &env);
if (mr_let.matched) {
s_src = pool.form<GenericElement>(
GenericOperator::make_function(pool.form<ConstantTokenElement>("new-attack-id")));
s_elt = dynamic_cast<SetFormFormElement*>(
dynamic_cast<LetElement*>(l_elt->body()->at(0))->body()->at(1));
}
}
if (!s_src) {
lg::error("attack info err elt {} not a set! or (new-attack-id): {}", i,
in->body()->at(i)->to_string(env));
return nullptr;
}
} else {
s_src = s_elt->src();
}
auto d_elt = s_elt->dst()->try_as_element<DerefElement>();
// (set! (-> v1-2 mode) arg2)
// ^------------^
if (!d_elt) {
lg::error("attack info err elt {} dst not a deref: {}", i, s_elt->dst()->to_string(env));
return nullptr;
}
// (set! (-> v1-2 mode) arg2)
// ^--^ ^--^
if (d_elt->tokens().size() != 1 && d_elt->tokens().size() != 2) {
lg::error("attack info err elt {} invalid token len: {}", i, d_elt->to_string(env));
return nullptr;
}
// (set! (-> v1-2 mode) arg2)
// ^--^
if (d_elt->tokens().at(0).kind() != DerefToken::Kind::FIELD_NAME) {
lg::error("attack info err elt {} invalid token kind: {}", i, d_elt->to_string(env));
return nullptr;
@@ -1740,7 +1808,8 @@ FormElement* rewrite_attack_info(LetElement* in, const Env& env, FormPool& pool)
const auto& field_name = d_elt->tokens().at(0).field_name();
auto arg_it = possible_args.find(field_name);
if (arg_it == possible_args.end()) {
lg::error("attack info unknown field {}", field_name);
lg::error("attack info unknown field `{}`, static-attack-info could not be generated",
field_name);
return nullptr;
}
if (arg_it->second.second &&
@@ -1753,25 +1822,25 @@ FormElement* rewrite_attack_info(LetElement* in, const Env& env, FormPool& pool)
}
if (arg_it->second.second) {
auto d_src = s_elt->src()->try_as_element<DerefElement>();
auto d_src = s_src->try_as_element<DerefElement>();
if (d_src) {
if (d_src->tokens().size() == 1 && d_src->tokens().at(0).is_field_name("quad")) {
args_in_info.push_back({field_name, d_src->base()});
} else {
d_src->tokens().pop_back();
args_in_info.push_back({field_name, s_elt->src()});
args_in_info.push_back({field_name, s_src});
}
}
} else {
if ((field_name == "shove-back" || field_name == "shove-up") &&
s_elt->src()->to_form(env).is_float()) {
s_src->to_form(env).is_float()) {
args_in_info.push_back(
{field_name, pool.form<GenericElement>(GenericOperator::make_function(
pool.form<ConstantTokenElement>("meters")),
pool.form<ConstantTokenElement>(meters_to_string(
s_elt->src()->to_form(env).as_float())))});
s_src->to_form(env).as_float())))});
} else {
args_in_info.push_back({field_name, s_elt->src()});
args_in_info.push_back({field_name, s_src});
}
}
mask_implicit |= 1 << arg_it->second.first;
@@ -2110,16 +2179,15 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
}
// dma buffer part can be anything, really.
auto buf_reg = in->entries().at(0).dest;
auto buf_dst = env.get_variable_name(buf_reg);
auto bucket_dst = env.get_variable_name(in->entries().at(1).dest);
auto buf_dst = in->entries().at(0).dest;
auto bucket_dst = in->entries().at(1).dest;
auto buf_src = in->entries().at(0).src;
// check for (-> buf_dst base) now
auto mr_buf_base = match(dma_buf_base_matcher, in->entries().at(1).src);
if (!mr_buf_base.matched) {
return nullptr;
}
if (!var_name_equal(env, buf_dst, mr_buf_base.maps.regs.at(0))) {
if (!var_equal(env, buf_dst, mr_buf_base.maps.regs.at(0))) {
lg::print("dma buf bad name\n");
return nullptr;
}
@@ -2141,7 +2209,7 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
if (last_part->entries().size() != 1 || last_part->body()->size() != 2) {
return nullptr;
}
auto buf_end_dst = env.get_variable_name(last_part->entries().at(0).dest);
auto buf_end_dst = last_part->entries().at(0).dest;
auto dmatag_let = dynamic_cast<LetElement*>(last_part->body()->at(0));
@@ -2149,7 +2217,7 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
return nullptr;
}
auto dmatag_dst = env.get_variable_name(dmatag_let->entries().at(0).dest);
auto dmatag_dst = dmatag_let->entries().at(0).dest;
auto mr_last_part = match(dma_buf_base_matcher, last_part->entries().at(0).src);
auto mr_dmatag = match(dma_buf_base_matcher, dmatag_let->entries().at(0).src);
@@ -2157,8 +2225,8 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
lg::print("dma buf bad match 2\n");
return nullptr;
}
if (!var_name_equal(env, buf_dst, mr_last_part.maps.regs.at(0)) ||
!var_name_equal(env, buf_dst, mr_dmatag.maps.regs.at(0))) {
if (!var_equal(env, buf_dst, mr_last_part.maps.regs.at(0)) ||
!var_equal(env, buf_dst, mr_dmatag.maps.regs.at(0))) {
lg::print("dma buf bad name 2\n");
return nullptr;
}
@@ -2178,7 +2246,7 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
Matcher::set(Matcher::deref(Matcher::cast("(pointer int64)", Matcher::any_reg(0)), false, {}),
Matcher::integer(0x20000000)),
set_dmatag_hdr);
if (!mr_dmatag_hdr.matched || !var_name_equal(env, dmatag_dst, mr_dmatag_hdr.maps.regs.at(0))) {
if (!mr_dmatag_hdr.matched || !var_equal(env, dmatag_dst, mr_dmatag_hdr.maps.regs.at(0))) {
return nullptr;
}
@@ -2186,7 +2254,7 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
set_dmatag_w1->op()->store_size() != 4 || !set_dmatag_w1->op()->value().is_int(0) ||
set_dmatag_w1->op()->addr().kind() != SimpleExpression::Kind::ADD ||
set_dmatag_w1->op()->addr().args() != 2 || !set_dmatag_w1->op()->addr().get_arg(0).is_var() ||
!var_name_equal(env, dmatag_dst, set_dmatag_w1->op()->addr().get_arg(0).var()) ||
!var_equal(env, dmatag_dst, set_dmatag_w1->op()->addr().get_arg(0).var()) ||
!set_dmatag_w1->op()->addr().get_arg(1).is_int(8)) {
return nullptr;
}
@@ -2194,7 +2262,7 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
set_dmatag_w2->op()->store_size() != 4 || !set_dmatag_w2->op()->value().is_int(0) ||
set_dmatag_w2->op()->addr().kind() != SimpleExpression::Kind::ADD ||
set_dmatag_w2->op()->addr().args() != 2 || !set_dmatag_w2->op()->addr().get_arg(0).is_var() ||
!var_name_equal(env, dmatag_dst, set_dmatag_w2->op()->addr().get_arg(0).var()) ||
!var_equal(env, dmatag_dst, set_dmatag_w2->op()->addr().get_arg(0).var()) ||
!set_dmatag_w2->op()->addr().get_arg(1).is_int(12)) {
return nullptr;
}
@@ -2204,8 +2272,8 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
Matcher::op_fixed(FixedOperatorKind::ADDITION_PTR,
{Matcher::any_reg(0), Matcher::integer(16)})),
set_dmatag_push);
if (!mr_dmatag_push.matched || !var_name_equal(env, dmatag_dst, mr_dmatag_push.maps.regs.at(0)) ||
!var_name_equal(env, buf_dst, mr_dmatag_push.maps.regs.at(1))) {
if (!mr_dmatag_push.matched || !var_equal(env, dmatag_dst, mr_dmatag_push.maps.regs.at(0)) ||
!var_equal(env, buf_dst, mr_dmatag_push.maps.regs.at(1))) {
return nullptr;
}
@@ -2219,8 +2287,8 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
Matcher::cast("(pointer dma-tag)", Matcher::any_reg(3))}),
last_part->body()->at(1));
if (!mr_bucket_add_tag_func.matched ||
!var_name_equal(env, bucket_dst, mr_bucket_add_tag_func.maps.regs.at(2)) ||
!var_name_equal(env, buf_end_dst, mr_bucket_add_tag_func.maps.regs.at(3))) {
!var_equal(env, bucket_dst, mr_bucket_add_tag_func.maps.regs.at(2)) ||
!var_equal(env, buf_end_dst, mr_bucket_add_tag_func.maps.regs.at(3))) {
return nullptr;
}
auto mr_submatch = match(
@@ -2241,7 +2309,7 @@ FormElement* rewrite_with_dma_buf_add_bucket(LetElement* in, const Env& env, For
}
auto elt = pool.alloc_element<WithDmaBufferAddBucketElement>(
buf_reg, buf_src, mr_bucket_add_tag_func.maps.forms.at(1),
buf_dst, buf_src, mr_bucket_add_tag_func.maps.forms.at(1),
pool.alloc_sequence_form(nullptr, body));
elt->parent_form = in->parent_form;
return elt;
@@ -2270,7 +2338,7 @@ FormElement* rewrite_launch_particles(LetElement* in, const Env& env, FormPool&
return nullptr;
}
auto func = in->entries().at(0);
auto& func = in->entries().at(0);
if (func.src->elts().at(0)->to_string(env) != "sp-launch-particles-var") {
return nullptr;
}
@@ -2285,7 +2353,7 @@ FormElement* rewrite_launch_particles(LetElement* in, const Env& env, FormPool&
return nullptr;
}
auto part_system = in->entries().at(1);
auto& part_system = in->entries().at(1);
auto system = part_system.src->at(0)->to_string(env);
if (system != "*sp-particle-system-2d*" && system != "*sp-particle-system-3d*") {
return nullptr;
@@ -2302,7 +2370,7 @@ FormElement* rewrite_launch_particles(LetElement* in, const Env& env, FormPool&
return nullptr;
}
auto launch_matrix = in->entries().at(3);
auto& launch_matrix = in->entries().at(3);
if (launch_matrix.src->at(0)->to_string(env) != "*launch-matrix*") {
return nullptr;
}
@@ -2440,28 +2508,27 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
// (set! (-> v1-0 base) (&+ a0-2 16))
u16 dma_qwc = 0;
bool flusha = false;
auto check_vifcode_set = [&](StoreElement* store, const std::string& varname, int size,
int addr) {
auto check_vifcode_set = [&](StoreElement* store, const RegisterAccess& var, int size, int addr) {
return store->op()->kind() == StoreOp::Kind::INTEGER && store->op()->store_size() == size &&
// store->op()->value().is_int(0) &&
store->op()->addr().kind() == SimpleExpression::Kind::ADD &&
store->op()->addr().args() == 2 && store->op()->addr().get_arg(0).is_var() &&
store->op()->addr().get_arg(1).is_int(addr) &&
var_name_equal(env, varname, store->op()->addr().get_arg(0).var());
var_equal(env, var, store->op()->addr().get_arg(0).var());
};
const auto match_buf_push = [&env](FormElement* elt, const std::string& reg_buf,
const std::string& reg_base, int amt) {
const auto match_buf_push = [&env](FormElement* elt, const RegisterAccess& reg_buf,
const RegisterAccess& reg_base, int amt) {
auto mr = match(Matcher::set(Matcher::deref(Matcher::any_reg(0), false,
{DerefTokenMatcher::string("base")}),
Matcher::op_fixed(FixedOperatorKind::ADDITION_PTR,
{Matcher::any_reg(1), Matcher::integer(amt)})),
elt);
return mr.matched && var_name_equal(env, reg_buf, mr.maps.regs.at(0)) &&
var_name_equal(env, reg_base, mr.maps.regs.at(1));
return mr.matched && var_equal(env, reg_buf, mr.maps.regs.at(0)) &&
var_equal(env, reg_base, mr.maps.regs.at(1));
};
{
auto dmatag_buf = env.get_variable_name(let0->entries().at(0).dest);
auto dmatag_ptr = env.get_variable_name(let0->entries().at(1).dest);
auto dmatag_buf = let0->entries().at(0).dest;
auto dmatag_ptr = let0->entries().at(1).dest;
auto set_dmatag_hdr = dynamic_cast<SetFormFormElement*>(let0->body()->at(0));
auto set_dmatag_vif0 = dynamic_cast<StoreElement*>(let0->body()->at(1));
auto let_dmatag_vif0 = dynamic_cast<LetElement*>(let0->body()->at(1));
@@ -2506,7 +2573,7 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
Matcher::deref(Matcher::cast("(pointer int64)", Matcher::any_reg(0)), false, {}),
Matcher::any_integer(1)),
set_dmatag_hdr);
if (!mr_dmatag_hdr.matched || !var_name_equal(env, dmatag_ptr, mr_dmatag_hdr.maps.regs.at(0))) {
if (!mr_dmatag_hdr.matched || !var_equal(env, dmatag_ptr, mr_dmatag_hdr.maps.regs.at(0))) {
lg::error("rewrite_dma_buffer_add_gs_set: bad dmatag set");
return nullptr;
}
@@ -2553,8 +2620,8 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
// (set! (-> v1-1 base) (&+ a0-4 16))
// )
{
auto giftag_buf = env.get_variable_name(let1->entries().at(0).dest);
auto giftag_ptr = env.get_variable_name(let1->entries().at(1).dest);
auto giftag_buf = let1->entries().at(0).dest;
auto giftag_ptr = let1->entries().at(1).dest;
auto set_giftag_hdr = dynamic_cast<SetFormFormElement*>(let1->body()->at(0));
auto let_giftag_regs = dynamic_cast<LetElement*>(let1->body()->at(1));
auto set_giftag_push = dynamic_cast<SetFormFormElement*>(let1->body()->at(2));
@@ -2576,7 +2643,7 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
set_giftag_hdr);
if (!mr_giftag_hdr.matched || (mr_giftag_hdr.maps.ints.at(1) & 0x0fffffffffffffff) != 0x8001 ||
((mr_giftag_hdr.maps.ints.at(1) >> 60) & 0xf) != dma_qwc - 1 ||
!var_name_equal(env, giftag_ptr, mr_giftag_hdr.maps.regs.at(0))) {
!var_equal(env, giftag_ptr, mr_giftag_hdr.maps.regs.at(0))) {
return nullptr;
}
auto giftag_regs_elt = let_giftag_regs->entries().at(0).src->try_as_element<CastElement>();
@@ -2635,8 +2702,8 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
// (set! (-> v1-2 base) (&+ a0-6 96))
// )
{
auto gsregs_buf = env.get_variable_name(let2->entries().at(0).dest);
auto gsregs_ptr = env.get_variable_name(let2->entries().at(1).dest);
auto gsregs_buf = let2->entries().at(0).dest;
auto gsregs_ptr = let2->entries().at(1).dest;
auto set_gsregs_push =
dynamic_cast<SetFormFormElement*>(let2->body()->at(let2->body()->size() - 1));
// check dma buffer base set
@@ -2646,7 +2713,7 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
return nullptr;
}
bool error = false;
auto get_int_from_form = [&](FormElement* elt, const std::string& ptr_name, int offset) {
auto get_int_from_form = [&](FormElement* elt, const RegisterAccess& ptr_name, int offset) {
auto as_set = dynamic_cast<SetFormFormElement*>(elt);
if (as_set) {
auto mr_set = match(
@@ -2657,7 +2724,7 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
false, {}),
Matcher::any_integer(1)),
as_set);
if (!mr_set.matched || !var_name_equal(env, gsregs_ptr, mr_set.maps.regs.at(0))) {
if (!mr_set.matched || !var_equal(env, gsregs_ptr, mr_set.maps.regs.at(0))) {
error = true;
return (s64)0;
}
@@ -2681,8 +2748,7 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
auto store_in_let = dynamic_cast<StoreElement*>(as_let->body()->at(0));
if (!store_in_let || !check_vifcode_set(store_in_let, ptr_name, 8, offset) ||
!store_in_let->op()->value().is_var() ||
!var_name_equal(env, env.get_variable_name(as_let->entries().at(0).dest),
store_in_let->op()->value().var())) {
!var_equal(env, as_let->entries().at(0).dest, store_in_let->op()->value().var())) {
error = true;
return (s64)0;
}
@@ -2707,7 +2773,7 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
error = true;
return (s64)0;
};
auto get_src_form = [&](FormPool& pool, FormElement* elt, const std::string& ptr_name,
auto get_src_form = [&](FormPool& pool, FormElement* elt, const RegisterAccess& ptr_name,
int offset) -> Form* {
auto as_set = dynamic_cast<SetFormFormElement*>(elt);
if (as_set) {
@@ -2719,7 +2785,7 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
false, {}),
Matcher::any()),
as_set);
if (!mr_set.matched || !var_name_equal(env, gsregs_ptr, mr_set.maps.regs.at(0))) {
if (!mr_set.matched || !var_equal(env, gsregs_ptr, mr_set.maps.regs.at(0))) {
return nullptr;
}
return as_set->src();
@@ -2739,8 +2805,7 @@ FormElement* rewrite_dma_buffer_add_gs_set(const std::vector<LetElement*>& in,
auto store_in_let = dynamic_cast<StoreElement*>(as_let->body()->at(0));
if (!store_in_let || !check_vifcode_set(store_in_let, ptr_name, 8, offset) ||
!store_in_let->op()->value().is_var() ||
!var_name_equal(env, env.get_variable_name(as_let->entries().at(0).dest),
store_in_let->op()->value().var())) {
!var_equal(env, as_let->entries().at(0).dest, store_in_let->op()->value().var())) {
return nullptr;
}
return as_let->entries().at(0).src;
+4 -4
View File
@@ -8084,7 +8084,7 @@
(allow-pause symbol :offset-assert 104)
(ocean-off symbol :offset-assert 108)
(allow-look-around symbol :offset-assert 112)
(unknowng-symbol-00 symbol :offset-assert 116)
(camera-stick-dir symbol :offset-assert 116)
(movie-name symbol :offset 120)
(weather symbol :offset-assert 124)
(mouse symbol :offset-assert 128)
@@ -15675,7 +15675,7 @@
:flag-assert #x900000040
)
(defenum attack-info-mask
(defenum attack-mask
:bitfield #t
:type uint32
(trans 0) ;; 1
@@ -15713,7 +15713,7 @@
(attacker handle :offset-assert 64)
(attack-time time-frame :offset-assert 72)
(invinc-time time-frame :offset-assert 80)
(mask attack-info-mask :offset-assert 88)
(mask attack-mask :offset-assert 88)
(mode symbol :offset-assert 92)
(shove-back meters :offset-assert 96)
(shove-up meters :offset-assert 100)
@@ -17034,7 +17034,7 @@
(:methods
(new (symbol type process-drawable collide-list-enum) _type_ 0)
(find-ground (_type_ collide-query collide-spec float float float) symbol 55)
(react-to-pat! (_type_ pat-surface) int 56)
(react-to-pat! (_type_ pat-surface) cshape-reaction-flags 56)
(integrate-no-collide! (_type_ vector) none 57)
(integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol 58)
(move-above-ground (_type_ vector move-above-ground-params) none 59)
@@ -3892,7 +3892,8 @@
],
"(method 56 collide-shape-moving)": [
[68, "a0", "process-focusable"],
[153, "a0", "process-focusable"]
[153, "a0", "process-focusable"],
[[77, 272], "s5", "cshape-reaction-flags"]
],
"(method 66 collide-shape-moving)": [[[29, 58], "s0", "collide-cache-prim"]],
"(method 36 collide-shape)": [[[1, 40], "v1", "collide-shape-prim"]],
@@ -4498,5 +4498,10 @@
"s3-0": "x-pos"
},
"args": ["y-pos", "height", "alpha"]
},
"(method 56 collide-shape-moving)": {
"vars": {
"s5-0": ["set-flags", "cshape-reaction-flags"]
}
}
}
+14 -21
View File
@@ -362,7 +362,7 @@
;; WARN: Return type mismatch int vs penetrate.
(defun get-penetrate-using-from-attack-event ((arg0 process-drawable) (arg1 event-message-block))
(let ((v1-0 (the-as attack-info (-> arg1 param 1))))
(if (logtest? (attack-info-mask penetrate-using) (-> v1-0 mask))
(if (logtest? (attack-mask penetrate-using) (-> v1-0 mask))
(return (the-as penetrate (-> v1-0 penetrate-using)))
)
)
@@ -626,24 +626,17 @@
(if (and (logtest? (-> *game-info* secrets) (game-secrets hero-mode)) (= v1-1 1))
(set! v1-1 2)
)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (the-as uint arg1))
(let ((a0-10 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id damage knock))))
(set! (-> a0-10 id) arg2)
(set! (-> a0-10 shove-back) (-> obj enemy-info attack-shove-back))
(set! (-> a0-10 shove-up) (-> obj enemy-info attack-shove-up))
(set! (-> a0-10 mode) (-> obj enemy-info attack-mode))
(set! (-> a0-10 damage) (the float v1-1))
(set! (-> a0-10 knock) (the-as uint 8))
(set! (-> a1-2 param 1) (the-as uint a0-10))
)
(when (send-event-function arg0 a1-2)
(enemy-method-105 obj arg0)
#t
)
(when (send-event arg0 'attack arg1 (static-attack-info ((id arg2)
(shove-back (-> obj enemy-info attack-shove-back))
(shove-up (-> obj enemy-info attack-shove-up))
(mode (-> obj enemy-info attack-mode))
(damage (the float v1-1))
(knock (the-as uint 8))
)
)
)
(enemy-method-105 obj arg0)
#t
)
)
)
@@ -730,7 +723,7 @@
(defmethod enemy-method-106 enemy ((obj enemy) (arg0 process) (arg1 object) (arg2 int) (arg3 attack-info))
(set! (-> obj incoming penetrate-using) (the-as uint arg2))
(set! (-> obj incoming attack-id) (-> arg3 id))
(let ((v1-3 (if (logtest? (attack-info-mask knock) (-> arg3 mask))
(let ((v1-3 (if (logtest? (attack-mask knock) (-> arg3 mask))
(-> arg3 knock)
(enemy-method-131 obj arg2)
)
@@ -1997,7 +1990,7 @@ This commonly includes things such as:
(defmethod damage-amount-from-attack enemy ((obj enemy) (arg0 process) (arg1 event-message-block))
"@returns the amount of damage taken from an attack. This can come straight off the [[attack-info]] or via [[penetrate-using->damage]]"
(let ((v1-0 (the-as attack-info (-> arg1 param 1))))
(if (logtest? (attack-info-mask damage) (-> v1-0 mask))
(if (logtest? (attack-mask damage) (-> v1-0 mask))
(the int (-> v1-0 damage))
(penetrate-using->damage (the-as penetrate (-> obj incoming penetrate-using)))
)
+9 -16
View File
@@ -55,23 +55,16 @@
(case event-type
(('touched)
(let ((v1-1 (-> event param 0)))
(when v1-1
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) v1-1)
(let ((v1-2 (new 'static 'attack-info :mask (attack-info-mask mode id attacker-velocity damage knock))))
(set! (-> v1-2 id) (-> self attack-id))
(set! (-> v1-2 mode) 'eco-red)
(set! (-> v1-2 attacker-velocity quad) (-> self root transv quad))
(set! (-> v1-2 damage) 2.0)
(set! (-> v1-2 knock) (the-as uint 2))
(set! (-> a1-2 param 1) (the-as uint v1-2))
)
(send-event-function proc a1-2)
(if v1-1
(send-event proc 'attack v1-1 (static-attack-info ((id (-> self attack-id))
(mode 'eco-red)
(attacker-velocity (-> self root transv))
(damage 2.0)
(knock (the-as uint 2))
)
)
)
)
)
)
)
)
+1 -1
View File
@@ -2492,7 +2492,7 @@
(if (logtest? (cam-slave-options-u32 BLOCK_RIGHT_STICK) (-> self options))
(set! f30-2 0.0)
)
(if (-> *setting-control* user-default unknowng-symbol-00)
(if (-> *setting-control* user-default camera-stick-dir)
(set! f30-2 (- f30-2))
)
(if (-> self have-phony-joystick)
@@ -517,7 +517,7 @@
(:methods
(new (symbol type process-drawable collide-list-enum) _type_ 0)
(find-ground (_type_ collide-query collide-spec float float float) symbol 55)
(react-to-pat! (_type_ pat-surface) int 56)
(react-to-pat! (_type_ pat-surface) cshape-reaction-flags 56)
(integrate-no-collide! (_type_ vector) none 57)
(integrate-for-enemy-no-mtg (_type_ vector overlaps-others-params) symbol 58)
(move-above-ground (_type_ vector move-above-ground-params) none 59)
+194 -280
View File
@@ -748,239 +748,172 @@ it returns a triangle and normal direction to push in.
(defun target-attack-up ((arg0 target) (arg1 symbol) (arg2 symbol))
"Send events to target in response to hitting a surface that launches you up."
(with-pp
;; first, just send an event to test and see if we should even respond
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) (process->ppointer pp))
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) arg1)
(set! (-> a1-1 param 0) (the-as uint #f))
(let ((v1-2 (new 'static 'attack-info :mask (attack-info-mask mode id test))))
(set! (-> v1-2 id) (the-as uint 2))
(set! (-> v1-2 mode) arg2)
(set! (-> v1-2 test) #t)
(set! (-> a1-1 param 1) (the-as uint v1-2))
)
(when (send-event-function arg0 a1-1)
;; we should respond. now do the more complicated ground point finding.
(let ((s3-0 (find-ground-point (-> arg0 control) (new 'stack-no-clear 'vector) 8192.0 40960.0)))
(set! s3-0 (cond
(s3-0
(empty)
s3-0
)
(else
(-> arg0 control last-trans-on-ground)
)
)
)
(let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> arg0 control trans)))
(f0-0 8192.0)
(f1-0 40960.0)
(v1-8 s2-1)
(f30-0 (fmax f0-0 (fmin f1-0 (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))))))
)
(cond
((< (fabs (vector-dot
(-> arg0 control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) s3-0 (-> arg0 control trans))
)
)
40960.0
)
(vector-xz-normalize! s2-1 f30-0)
(let ((s1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> s1-0 from) (process->ppointer pp))
(set! (-> s1-0 num-params) 2)
(set! (-> s1-0 message) arg1)
(set! (-> s1-0 param 0) (the-as uint #f))
(let ((s4-1 (new 'static 'attack-info :mask (attack-info-mask vector mode shove-up angle id))))
(set! (-> s4-1 id) (the-as uint 2))
(set! (-> s4-1 mode) arg2)
(set! (-> s4-1 vector quad) (-> s2-1 quad))
(set! (-> s4-1 shove-up)
(+ (lerp-scale 4096.0 16384.0 f30-0 4096.0 40960.0) (fmax 0.0 (- (-> s3-0 y) (-> arg0 control trans y))))
)
(set! (-> s4-1 angle) 'up)
(set! (-> s1-0 param 1) (the-as uint s4-1))
;; first, just send an event to test and see if we should even respond
(when (send-event arg0 arg1 #f (static-attack-info ((id (the-as uint 2)) (mode arg2) (test #t))))
(let ((s3-0 (find-ground-point (-> arg0 control) (new 'stack-no-clear 'vector) 8192.0 40960.0)))
(set! s3-0 (cond
(s3-0
(empty)
s3-0
)
(else
(-> arg0 control last-trans-on-ground)
)
)
(send-event-function arg0 s1-0)
)
)
(else
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-7 from) (process->ppointer pp))
(set! (-> a1-7 num-params) 2)
(set! (-> a1-7 message) arg1)
(set! (-> a1-7 param 0) (the-as uint #f))
(let ((v1-24 (new 'static 'attack-info :mask (attack-info-mask vector mode shove-up control angle id))))
(set! (-> v1-24 id) (the-as uint 2))
(set! (-> v1-24 mode) arg2)
(set! (-> v1-24 vector quad) (-> (new 'static 'vector :y 40960.0 :w 1.0) quad))
(set! (-> v1-24 shove-up) 40960.0)
(set! (-> v1-24 angle) 'up)
(set! (-> v1-24 control) 1.0)
(set! (-> a1-7 param 1) (the-as uint v1-24))
)
(send-event-function arg0 a1-7)
)
(let* ((s2-1 (vector-! (new 'stack-no-clear 'vector) s3-0 (-> arg0 control trans)))
(f0-0 8192.0)
(f1-0 40960.0)
(v1-8 s2-1)
(f30-0 (fmax f0-0 (fmin f1-0 (sqrtf (+ (* (-> v1-8 x) (-> v1-8 x)) (* (-> v1-8 z) (-> v1-8 z)))))))
)
(cond
((< (fabs
(vector-dot
(-> arg0 control dynam gravity-normal)
(vector-! (new 'stack-no-clear 'vector) s3-0 (-> arg0 control trans))
)
)
40960.0
)
(vector-xz-normalize! s2-1 f30-0)
(send-event
arg0
arg1
#f
(static-attack-info
((id (the-as uint 2))
(mode arg2)
(vector s2-1)
(shove-up
(+ (lerp-scale 4096.0 16384.0 f30-0 4096.0 40960.0) (fmax 0.0 (- (-> s3-0 y) (-> arg0 control trans y))))
)
(angle 'up)
)
)
)
)
(else
(send-event arg0 arg1 #f (static-attack-info ((id (the-as uint 2))
(mode arg2)
(vector (new 'static 'vector :y 40960.0 :w 1.0))
(shove-up (meters 10))
(angle 'up)
(control 1.0)
)
)
)
)
)
)
)
(none)
)
(none)
)
(defmethod react-to-pat! collide-shape-moving ((obj collide-shape-moving) (arg0 pat-surface))
"React to colliding with the given 'pat'."
(with-pp
(let ((s5-0 0))
(set! (-> obj cur-pat) arg0)
(set! (-> obj poly-pat) arg0)
;; update the surface based on the material.
(case (-> arg0 material)
(((pat-material ice))
(set! (-> obj surf) *ice-surface*)
(let ((set-flags (cshape-reaction-flags)))
(set! (-> obj cur-pat) arg0)
(set! (-> obj poly-pat) arg0)
;; update the surface based on materials.
(case (-> arg0 material)
(((pat-material ice))
(set! (-> obj surf) *ice-surface*)
)
(((pat-material gravel))
(set! (-> obj surf) *gravel-surface*)
)
(((pat-material quicksand))
(set! (-> obj surf) *quicksand-surface*)
)
(((pat-material tube))
(set! (-> obj surf) *no-walk-surface*)
)
(else
(set! (-> obj surf) *standard-ground-surface*)
)
)
;; respond to events.
(when (nonzero? (-> arg0 event))
(case (-> arg0 event)
(((pat-event slide))
(set! (-> obj surf) *gravel-surface*)
(send-event (-> obj process) 'slide)
)
(((pat-material gravel))
(((pat-event slippery))
(set! (-> obj surf) *gravel-surface*)
)
(((pat-material quicksand))
(set! (-> obj surf) *quicksand-surface*)
(((pat-event rail))
(let* ((s4-0 (-> obj process))
(a0-14 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(if (and a0-14 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-14) focus-status))))
(set! (-> obj surf) *rail-surface*)
)
)
)
(((pat-material tube))
(set! (-> obj surf) *no-walk-surface*)
(((pat-event deadly))
(set! set-flags (logior set-flags (cshape-reaction-flags csrf14)))
(send-event
(-> obj process)
'attack
#f
(static-attack-info ((id (the-as uint 2)) (mode 'deadly) (shove-up (meters 3))))
)
)
(((pat-event burn))
(set! set-flags (logior set-flags (cshape-reaction-flags csrf14)))
(send-event
(-> obj process)
'attack
#f
(static-attack-info ((id (the-as uint 2)) (mode 'burn) (shove-up (meters 3))))
)
)
(((pat-event deadlup))
(set! set-flags (logior set-flags (cshape-reaction-flags csrf14)))
(target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'deadlyup)
)
(((pat-event shockup))
(set! set-flags (logior set-flags (cshape-reaction-flags csrf14)))
(target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'shockup)
)
(((pat-event burnup))
(when (not (focus-test? (the-as process-focusable (-> obj process)) pilot))
(set! set-flags (logior set-flags (cshape-reaction-flags csrf14)))
(target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup)
)
)
(((pat-event melt))
(set! set-flags (logior set-flags (cshape-reaction-flags csrf14)))
(send-event (-> obj process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'melt))))
)
(((pat-event endlessfall))
(set! set-flags (logior set-flags (cshape-reaction-flags csrf14)))
(send-event
(-> obj process)
'attack-invinc
#f
(static-attack-info ((id (the-as uint 2)) (mode 'endlessfall)))
)
)
(((pat-event shock))
(set! set-flags (logior set-flags (cshape-reaction-flags csrf14)))
(send-event (-> obj process) 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'shock))))
)
(((pat-event lip))
(send-event (-> obj process) 'lip 'lip)
)
(((pat-event lipramp))
(send-event (-> obj process) 'lip 'lipramp)
)
(else
(set! (-> obj surf) *standard-ground-surface*)
)
)
;; respond to events.
(when (nonzero? (-> arg0 event))
(case (-> arg0 event)
(((pat-event slide))
(set! (-> obj surf) *gravel-surface*)
(send-event (-> obj process) 'slide)
)
(((pat-event slippery))
(set! (-> obj surf) *gravel-surface*)
)
(((pat-event rail))
(let* ((s4-0 (-> obj process))
(a0-14 (if (type? s4-0 process-focusable)
s4-0
)
)
)
(if (and a0-14 (not (logtest? (focus-status rail) (-> (the-as process-focusable a0-14) focus-status))))
(set! (-> obj surf) *rail-surface*)
)
)
)
(((pat-event deadly))
(set! s5-0 (logior s5-0 #x4000))
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) (process->ppointer pp))
(set! (-> a1-4 num-params) 2)
(set! (-> a1-4 message) 'attack)
(set! (-> a1-4 param 0) (the-as uint #f))
(let ((v1-24 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id))))
(set! (-> v1-24 id) (the-as uint 2))
(set! (-> v1-24 mode) 'deadly)
(set! (-> v1-24 shove-up) 12288.0)
(set! (-> a1-4 param 1) (the-as uint v1-24))
)
(send-event-function (-> obj process) a1-4)
)
)
(((pat-event burn))
(set! s5-0 (logior s5-0 #x4000))
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) (process->ppointer pp))
(set! (-> a1-5 num-params) 2)
(set! (-> a1-5 message) 'attack)
(set! (-> a1-5 param 0) (the-as uint #f))
(let ((v1-29 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id))))
(set! (-> v1-29 id) (the-as uint 2))
(set! (-> v1-29 mode) 'burn)
(set! (-> v1-29 shove-up) 12288.0)
(set! (-> a1-5 param 1) (the-as uint v1-29))
)
(send-event-function (-> obj process) a1-5)
)
)
(((pat-event deadlup))
(set! s5-0 (logior s5-0 #x4000))
(target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'deadlyup)
)
(((pat-event shockup))
(set! s5-0 (logior s5-0 #x4000))
(target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'shockup)
)
(((pat-event burnup))
(when (not (focus-test? (the-as process-focusable (-> obj process)) pilot))
(set! s5-0 (logior s5-0 #x4000))
(target-attack-up (the-as target (-> obj process)) 'attack-or-shove 'burnup)
)
)
(((pat-event melt))
(set! s5-0 (logior s5-0 #x4000))
(let ((a1-9 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-9 from) (process->ppointer pp))
(set! (-> a1-9 num-params) 2)
(set! (-> a1-9 message) 'attack-invinc)
(set! (-> a1-9 param 0) (the-as uint #f))
(let ((v1-40 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-40 id) (the-as uint 2))
(set! (-> v1-40 mode) 'melt)
(set! (-> a1-9 param 1) (the-as uint v1-40))
)
(send-event-function (-> obj process) a1-9)
)
)
(((pat-event endlessfall))
(set! s5-0 (logior s5-0 #x4000))
(let ((a1-10 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-10 from) (process->ppointer pp))
(set! (-> a1-10 num-params) 2)
(set! (-> a1-10 message) 'attack-invinc)
(set! (-> a1-10 param 0) (the-as uint #f))
(let ((v1-45 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-45 id) (the-as uint 2))
(set! (-> v1-45 mode) 'endlessfall)
(set! (-> a1-10 param 1) (the-as uint v1-45))
)
(send-event-function (-> obj process) a1-10)
)
)
(((pat-event shock))
(set! s5-0 (logior s5-0 #x4000))
(let ((a1-11 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-11 from) (process->ppointer pp))
(set! (-> a1-11 num-params) 2)
(set! (-> a1-11 message) 'attack-invinc)
(set! (-> a1-11 param 0) (the-as uint #f))
(let ((v1-50 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-50 id) (the-as uint 2))
(set! (-> v1-50 mode) 'shock)
(set! (-> a1-11 param 1) (the-as uint v1-50))
)
(send-event-function (-> obj process) a1-11)
)
)
(((pat-event lip))
(send-event (-> obj process) 'lip 'lip)
)
(((pat-event lipramp))
(send-event (-> obj process) 'lip 'lipramp)
)
)
)
s5-0
)
set-flags
)
)
@@ -3133,82 +3066,63 @@ it returns a triangle and normal direction to push in.
(defmethod send-shoves collide-shape ((obj collide-shape) (arg0 process) (arg1 touching-shapes-entry) (arg2 float) (arg3 float) (arg4 float))
(local-vars (sv-144 process) (sv-160 collide-shape-prim) (sv-176 vector))
(with-pp
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(when arg1
(let ((s0-0 (-> arg1 head)))
(set! sv-144 arg0)
(let ((gp-0 (if (type? sv-144 process-focusable)
sv-144
)
)
)
(when (and s0-0 gp-0)
(while s0-0
(set! sv-160 (get-touched-prim s0-0 obj arg1))
(get-touched-prim s0-0 (-> (the-as process-focusable gp-0) root) arg1)
(when (logtest? (-> sv-160 prim-core action) (collide-action no-standon))
(let ((v1-12 (get-middle-of-bsphere-overlap s0-0 (new 'stack-no-clear 'vector))))
(set! sv-176 (new 'stack-no-clear 'vector))
(let ((a0-7 (-> sv-160 prim-core)))
(.lvf vf4 (&-> v1-12 quad))
(.lvf vf5 (&-> a0-7 world-sphere quad))
)
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(when arg1
(let ((s0-0 (-> arg1 head)))
(set! sv-144 arg0)
(let ((gp-0 (if (type? sv-144 process-focusable)
sv-144
)
)
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-176 quad) vf6)
(vector-normalize! sv-176 1.0)
(when (and (< arg2 (-> sv-176 y)) (and (not (focus-test? (the-as process-focusable gp-0) dead hit board mech))
(< (-> (the-as process-focusable gp-0) root transv y) 4.096)
)
)
(let ((s2-1 (new 'stack-no-clear 'vector)))
(set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root transv quad))
(let* ((v1-26 (-> (the-as process-focusable gp-0) root transv))
(f30-0 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))))
)
(if (= f30-0 0.0)
(set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat)) quad))
)
(vector-xz-normalize! s2-1 (fmax f30-0 arg4))
)
(set! (-> s2-1 y) arg3)
(let ((a1-8 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-8 from) (process->ppointer pp))
(set! (-> a1-8 num-params) 2)
(set! (-> a1-8 message) 'shove)
(set! (-> a1-8 param 0) (the-as uint arg1))
(let ((v1-34 (new 'static 'attack-info :mask (attack-info-mask vector angle id))))
(let* ((a0-13 *game-info*)
(a2-4 (+ (-> a0-13 attack-id) 1))
)
(set! (-> a0-13 attack-id) a2-4)
(set! (-> v1-34 id) a2-4)
)
(set! (-> v1-34 vector quad) (-> s2-1 quad))
(set! (-> v1-34 angle) 'jump)
(set! (-> a1-8 param 1) (the-as uint v1-34))
)
(send-event-function gp-0 a1-8)
)
)
(return #t)
)
(when (and s0-0 gp-0)
(while s0-0
(set! sv-160 (get-touched-prim s0-0 obj arg1))
(get-touched-prim s0-0 (-> (the-as process-focusable gp-0) root) arg1)
(when (logtest? (-> sv-160 prim-core action) (collide-action no-standon))
(let ((v1-12 (get-middle-of-bsphere-overlap s0-0 (new 'stack-no-clear 'vector))))
(set! sv-176 (new 'stack-no-clear 'vector))
(let ((a0-7 (-> sv-160 prim-core)))
(.lvf vf4 (&-> v1-12 quad))
(.lvf vf5 (&-> a0-7 world-sphere quad))
)
)
(set! s0-0 (-> s0-0 next))
(.mov.vf vf6 vf0 :mask #b1000)
(.sub.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> sv-176 quad) vf6)
(vector-normalize! sv-176 1.0)
(when (and (< arg2 (-> sv-176 y)) (and (not (focus-test? (the-as process-focusable gp-0) dead hit board mech))
(< (-> (the-as process-focusable gp-0) root transv y) 4.096)
)
)
(let ((s2-1 (new 'stack-no-clear 'vector)))
(set! (-> s2-1 quad) (-> (the-as process-focusable gp-0) root transv quad))
(let* ((v1-26 (-> (the-as process-focusable gp-0) root transv))
(f30-0 (sqrtf (+ (* (-> v1-26 x) (-> v1-26 x)) (* (-> v1-26 z) (-> v1-26 z)))))
)
(if (= f30-0 0.0)
(set! (-> s2-1 quad) (-> (vector-z-quaternion! s2-1 (-> (the-as process-focusable gp-0) root quat)) quad))
)
(vector-xz-normalize! s2-1 (fmax f30-0 arg4))
)
(set! (-> s2-1 y) arg3)
(send-event gp-0 'shove arg1 (static-attack-info ((id (new-attack-id)) (vector s2-1) (angle 'jump))))
)
(return #t)
)
)
(set! s0-0 (-> s0-0 next))
)
)
)
)
#f
)
#f
)
)
+3 -51
View File
@@ -519,23 +519,7 @@
)
)
(('darkeco)
(let ((a1-36 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-36 from) (process->ppointer self))
(set! (-> a1-36 num-params) 2)
(set! (-> a1-36 message) 'attack)
(set! (-> a1-36 param 0) (-> arg3 param 0))
(let ((v1-83 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-67 *game-info*)
(a2-11 (+ (-> a0-67 attack-id) 1))
)
(set! (-> a0-67 attack-id) a2-11)
(set! (-> v1-83 id) a2-11)
)
(set! (-> v1-83 mode) 'darkeco)
(set! (-> a1-36 param 1) (the-as uint v1-83))
)
(send-event-function arg0 a1-36)
)
(send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((id (new-attack-id)) (mode 'darkeco))))
(when (= (-> arg0 type) target)
(talker-spawn-func (-> *talker-speech* 319) *entity-pool* (target-pos 0) (the-as region #f))
(talker-spawn-func (-> *talker-speech* 314) *entity-pool* (target-pos 0) (the-as region #f))
@@ -557,23 +541,7 @@
(('touch)
(case (-> self defense)
(('darkeco)
(let ((a1-42 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-42 from) (process->ppointer self))
(set! (-> a1-42 num-params) 2)
(set! (-> a1-42 message) 'attack)
(set! (-> a1-42 param 0) (-> arg3 param 0))
(let ((v1-111 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-93 *game-info*)
(a2-15 (+ (-> a0-93 attack-id) 1))
)
(set! (-> a0-93 attack-id) a2-15)
(set! (-> v1-111 id) a2-15)
)
(set! (-> v1-111 mode) 'darkeco)
(set! (-> a1-42 param 1) (the-as uint v1-111))
)
(send-event-function arg0 a1-42)
)
(send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((id (new-attack-id)) (mode 'darkeco))))
(process-contact-action arg0)
(set! (-> self target) (process->handle arg0))
(go-virtual die #f 0)
@@ -864,23 +832,7 @@
(('touched)
(case (-> self defense)
(('darkeco)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'attack)
(set! (-> a1-3 param 0) (-> event param 0))
(let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a2-2 *game-info*)
(a3-2 (+ (-> a2-2 attack-id) 1))
)
(set! (-> a2-2 attack-id) a3-2)
(set! (-> v1-6 id) a3-2)
)
(set! (-> v1-6 mode) 'darkeco)
(set! (-> a1-3 param 1) (the-as uint v1-6))
)
(send-event-function proc a1-3)
)
(send-event proc 'attack (-> event param 0) (static-attack-info ((id (new-attack-id)) (mode 'darkeco))))
)
)
)
@@ -2607,22 +2607,12 @@ This commonly includes things such as:
(when (!= v1-1 proc)
(cond
((= (-> self event) 'attack)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) (process->ppointer v1-1))
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) (-> self event))
(set! (-> a1-1 param 0) (the-as uint #f))
(let ((v1-5 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-5 mode) (the-as symbol (-> self event-mode)))
(let* ((a2-3 *game-info*)
(a3-2 (+ (-> a2-3 attack-id) 1))
)
(set! (-> a2-3 attack-id) a3-2)
(set! (-> v1-5 id) a3-2)
)
(set! (-> a1-1 param 1) (the-as uint v1-5))
)
(send-event-function proc a1-1)
(send-event
proc
(-> self event)
:from v1-1
#f
(static-attack-info ((mode (the-as symbol (-> self event-mode))) (id (new-attack-id))))
)
)
((-> self event)
@@ -2874,20 +2864,9 @@ This commonly includes things such as:
(set! (-> v1-5 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-5 action-mask) (collide-action solid))
)
(when (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'attack)
(set! (-> a1-3 param 0) (-> event param 0))
(let ((v1-12 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-12 id) (-> self attack-id))
(set! (-> v1-12 mode) 'explode)
(set! (-> a1-3 param 1) (the-as uint v1-12))
)
(send-event-function proc a1-3)
(if (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0)
(send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode))))
)
)
)
)
)
@@ -55,23 +55,23 @@
(let ((a0-2 v1-1))
(set! (-> a0-2 mode) (-> obj attack-mode))
(set! (-> a0-2 id) (-> obj attack-id))
(set! (-> a0-2 mask) (attack-info-mask mode id))
(set! (-> a0-2 mask) (attack-mask mode id))
)
(when (!= (-> obj owner-handle) #f)
(set! (-> v1-1 attacker) (-> obj owner-handle))
(logior! (-> v1-1 mask) (attack-info-mask attacker))
(logior! (-> v1-1 mask) (attack-mask attacker))
)
(when (logtest? (-> obj options) (projectile-options account-for-target-velocity))
(set! (-> v1-1 attacker-velocity quad) (-> obj pre-move-transv quad))
(logior! (-> v1-1 mask) (attack-info-mask attacker-velocity))
(logior! (-> v1-1 mask) (attack-mask attacker-velocity))
)
(when (logtest? (-> obj options) (projectile-options deal-damage))
(set! (-> v1-1 damage) (-> obj damage))
(logior! (-> v1-1 mask) (attack-info-mask damage))
(logior! (-> v1-1 mask) (attack-mask damage))
)
(when (logtest? (projectile-options respect-invinc-time) (-> obj options))
(set! (-> v1-1 invinc-time) (-> obj invinc-time))
(logior! (-> v1-1 mask) (attack-info-mask invinc-time))
(logior! (-> v1-1 mask) (attack-mask invinc-time))
)
(the-as symbol (send-event
arg0
+81 -95
View File
@@ -314,109 +314,95 @@
;; WARN: Return type mismatch none vs object.
(defbehavior water-anim-event-handler water-anim ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
(local-vars (v0-1 object))
(the-as
object
(case arg2
(('move-to)
(move-to-point! self (the-as vector (-> arg3 param 0)))
(set! v0-1 (logclear (-> self mask) (process-mask sleep-code)))
(set! (-> self mask) (the-as process-mask v0-1))
v0-1
)
(('move-to-y)
(let ((a1-2 (new 'stack-no-clear 'vector)))
(set! (-> a1-2 quad) (-> self root trans quad))
(set! (-> a1-2 y) (the-as float (-> arg3 param 0)))
(move-to-point! self a1-2)
)
(set! v0-1 (logclear (-> self mask) (process-mask sleep-code)))
(set! (-> self mask) (the-as process-mask v0-1))
v0-1
)
(('water)
(let* ((s5-0 (the-as object (-> arg3 param 0)))
(s4-0 (the-as object (-> arg3 param 1)))
(gp-0 (if (type? (the-as process s4-0) process-focusable)
(the-as uint s4-0)
)
(the-as object (case arg2
(('move-to)
(move-to-point! self (the-as vector (-> arg3 param 0)))
(set! v0-1 (logclear (-> self mask) (process-mask sleep-code)))
(set! (-> self mask) (the-as process-mask v0-1))
v0-1
)
)
(when (and (logtest? (-> self flags) (water-flags deadly))
(logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags))
(the-as uint gp-0)
(('move-to-y)
(let ((a1-2 (new 'stack-no-clear 'vector)))
(set! (-> a1-2 quad) (-> self root trans quad))
(set! (-> a1-2 y) (the-as float (-> arg3 param 0)))
(move-to-point! self a1-2)
)
(set! v0-1 (logclear (-> self mask) (process-mask sleep-code)))
(set! (-> self mask) (the-as process-mask v0-1))
v0-1
)
(let ((v1-15 (-> self attack-event)))
(case v1-15
((#f)
)
(('heat)
(send-event (the-as process-tree gp-0) 'heat (* 10.0 (seconds-per-frame)))
)
(('drown-death 'lava 'dark-eco-pool)
(if (and (not (focus-test? (the-as process-focusable gp-0) board))
(let ((a1-10 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-10 from) (process->ppointer self))
(set! (-> a1-10 num-params) 2)
(set! (-> a1-10 message) 'attack-invinc)
(set! (-> a1-10 param 0) (the-as uint #f))
(let ((a2-4 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> a2-4 id) (-> self attack-id))
(set! (-> a2-4 mode) v1-15)
(set! (-> a1-10 param 1) (the-as uint a2-4))
)
(send-event-function (the-as process-focusable gp-0) a1-10)
(('water)
(let* ((s5-0 (the-as object (-> arg3 param 0)))
(s4-0 (the-as object (-> arg3 param 1)))
(gp-0 (if (type? (the-as process s4-0) process-focusable)
(the-as uint s4-0)
)
)
)
)
(send-event self 'notify 'attack)
)
)
(else
(if (and (not (focus-test? (the-as process-focusable gp-0) board))
(let ((a1-13 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-13 from) (process->ppointer self))
(set! (-> a1-13 num-params) 2)
(set! (-> a1-13 message) 'attack)
(set! (-> a1-13 param 0) (the-as uint #f))
(let ((a2-6 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> a2-6 id) (-> self attack-id))
(set! (-> a2-6 mode) v1-15)
(set! (-> a1-13 param 1) (the-as uint a2-6))
(when (and (logtest? (-> self flags) (water-flags deadly))
(logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags))
(the-as uint gp-0)
)
(let ((v1-15 (-> self attack-event)))
(case v1-15
((#f)
)
(('heat)
(send-event (the-as process-tree gp-0) 'heat (* 10.0 (seconds-per-frame)))
)
(('drown-death 'lava 'dark-eco-pool)
(if (and (not (focus-test? (the-as process-focusable gp-0) board))
(send-event
(the-as process-focusable gp-0)
'attack-invinc
#f
(static-attack-info ((id (-> self attack-id)) (mode v1-15)))
)
)
(send-event self 'notify 'attack)
)
)
(else
(if (and (not (focus-test? (the-as process-focusable gp-0) board))
(send-event
(the-as process-tree gp-0)
'attack
#f
(static-attack-info ((id (-> self attack-id)) (mode v1-15)))
)
)
(send-event self 'notify 'attack)
)
)
(send-event-function (the-as process-tree gp-0) a1-13)
)
)
(send-event self 'notify 'attack)
)
)
)
)
)
(when (and (logtest? (-> self flags) (water-flags flow))
(logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags))
)
(when (and (logtest? (-> self flags) (water-flags flow))
(logtest? (water-flags touch-water) (-> (the-as water-info s5-0) flags))
)
(let ((a0-40 (-> self flow)))
(if (nonzero? a0-40)
(the-as object (push-process a0-40 (the-as process-focusable gp-0)))
)
)
)
)
)
(let ((a0-40 (-> self flow)))
(if (nonzero? a0-40)
(the-as object (push-process a0-40 (the-as process-focusable gp-0)))
)
)
)
)
)
(('visible)
(cond
((-> arg3 param 0)
(set! (-> self visible) #t)
(('visible)
(cond
((-> arg3 param 0)
(set! (-> self visible) #t)
)
(else
(set! (-> self visible) #f)
(logior! (-> self draw status) (draw-control-status no-draw))
)
)
(logclear! (-> self mask) (process-mask sleep-code))
#t
)
)
)
(else
(set! (-> self visible) #f)
(logior! (-> self draw status) (draw-control-status no-draw))
)
)
(logclear! (-> self mask) (process-mask sleep-code))
#t
)
)
)
)
(defstate idle (water-anim)
+14 -29
View File
@@ -1006,22 +1006,14 @@
)
(when (< (-> obj process control trans y) (+ -1228.8 (-> obj base-height)))
(send-event (-> obj process) 'no-look-around (seconds 1.5))
(when (not (logtest? (-> obj process focus-status) (focus-status flut)))
(let ((a1-51 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-51 from) (process->ppointer pp))
(set! (-> a1-51 num-params) 2)
(set! (-> a1-51 message) 'attack)
(set! (-> a1-51 param 0) (the-as uint #f))
(let ((v1-327 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id))))
(set! (-> v1-327 id) (-> obj attack-id))
(set! (-> v1-327 shove-up) 2048.0)
(set! (-> v1-327 shove-back) 0.0)
(set! (-> v1-327 mode) 'tar)
(set! (-> a1-51 param 1) (the-as uint v1-327))
(if (not (logtest? (-> obj process focus-status) (focus-status flut)))
(send-event
(-> obj process)
'attack
#f
(static-attack-info ((id (-> obj attack-id)) (shove-up (meters 0.5)) (shove-back (meters 0)) (mode 'tar)))
)
(send-event-function (-> obj process) a1-51)
)
)
(let ((v1-329 (-> obj process)))
(set! (-> v1-329 control surf) *tar-surface*)
(set! (-> v1-329 control ground-pat)
@@ -1038,21 +1030,14 @@
)
(when (< (-> obj process control trans y) (+ -204.8 (-> obj base-height)))
(send-event (-> obj process) 'no-look-around (seconds 1.5))
(let ((a1-56 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-56 from) (process->ppointer pp))
(set! (-> a1-56 num-params) 2)
(set! (-> a1-56 message) 'attack)
(set! (-> a1-56 param 0) (the-as uint #f))
(let ((v1-350 (new 'static 'attack-info :mask (attack-info-mask intersection mode shove-back shove-up id))))
(set! (-> v1-350 id) (the-as uint 2))
(set! (-> v1-350 shove-up) 2048.0)
(set! (-> v1-350 shove-back) 0.0)
(set! (-> v1-350 mode) 'melt)
(set! (-> v1-350 intersection quad) (-> s5-0 trans quad))
(set! (-> a1-56 param 1) (the-as uint v1-350))
)
(send-event-function (-> obj process) a1-56)
)
(send-event (-> obj process) 'attack #f (static-attack-info ((id (the-as uint 2))
(shove-up (meters 0.5))
(shove-back (meters 0))
(mode 'melt)
(intersection (-> s5-0 trans))
)
)
)
)
(set! (-> obj swim-height) (lerp (-> obj swim-height) 7372.8 0.05))
)
+3 -3
View File
@@ -3392,11 +3392,11 @@
#f
,(lambda ((arg0 object) (arg1 debug-menu-msg))
(if (= arg1 (debug-menu-msg press))
(set! (-> *setting-control* user-default unknowng-symbol-00)
(not (-> *setting-control* user-default unknowng-symbol-00))
(set! (-> *setting-control* user-default camera-stick-dir)
(not (-> *setting-control* user-default camera-stick-dir))
)
)
(the-as uint (-> *setting-control* user-default unknowng-symbol-00))
(the-as uint (-> *setting-control* user-default camera-stick-dir))
)
)
(flag
+49 -25
View File
@@ -57,7 +57,7 @@
(sf31 31)
)
(defenum attack-info-mask
(defenum attack-mask
:bitfield #t
:type uint32
(trans 0) ;; 1
@@ -85,6 +85,30 @@
(test 22) ;; hi 64
)
(defmacro static-attack-info (&key (mask ()) args)
(let ((mask-actual mask))
(dolist (it args)
(when (not (member (caar it) mask-actual))
(cons! mask-actual (caar it))
)
)
`(let ((atk (new 'static 'attack-info :mask (attack-mask ,@mask-actual))))
,@(apply (lambda (x) (if (or (eq? (car x) 'vector)
(eq? (car x) 'intersection)
(eq? (car x) 'attacker-velocity))
`(vector-copy! (-> atk ,(car x)) ,(cadr x))
`(set! (-> atk ,(car x)) ,(cadr x))
)) args)
atk)
)
)
(defmacro new-attack-id ()
"generate a new attack-id"
`(1+! (-> *game-info* attack-id))
)
;; DECOMP BEGINS
(deftype process-drawable (process)
@@ -307,30 +331,30 @@
(deftype attack-info (structure)
((trans vector :inline :offset-assert 0)
(vector vector :inline :offset-assert 16)
(attacker-velocity vector :inline :offset-assert 32)
(intersection vector :inline :offset-assert 48)
(attacker handle :offset-assert 64)
(attack-time time-frame :offset-assert 72)
(invinc-time time-frame :offset-assert 80)
(mask attack-info-mask :offset-assert 88)
(mode symbol :offset-assert 92)
(shove-back meters :offset-assert 96)
(shove-up meters :offset-assert 100)
(speed meters :offset-assert 104)
(dist meters :offset-assert 108)
(control float :offset-assert 112)
(angle symbol :offset-assert 116)
(rotate-to degrees :offset-assert 120)
(prev-state state :offset-assert 124)
(id uint32 :offset-assert 128)
(count uint32 :offset-assert 132)
(penetrate-using penetrate :offset-assert 136)
(damage float :offset-assert 144)
(shield-damage float :offset-assert 148)
(knock uint8 :offset-assert 152)
(test symbol :offset-assert 156)
((trans vector :inline :offset-assert 0)
(vector vector :inline :offset-assert 16)
(attacker-velocity vector :inline :offset-assert 32)
(intersection vector :inline :offset-assert 48)
(attacker handle :offset-assert 64)
(attack-time time-frame :offset-assert 72)
(invinc-time time-frame :offset-assert 80)
(mask attack-mask :offset-assert 88)
(mode symbol :offset-assert 92)
(shove-back meters :offset-assert 96)
(shove-up meters :offset-assert 100)
(speed meters :offset-assert 104)
(dist meters :offset-assert 108)
(control float :offset-assert 112)
(angle symbol :offset-assert 116)
(rotate-to degrees :offset-assert 120)
(prev-state state :offset-assert 124)
(id uint32 :offset-assert 128)
(count uint32 :offset-assert 132)
(penetrate-using penetrate :offset-assert 136)
(damage float :offset-assert 144)
(shield-damage float :offset-assert 148)
(knock uint8 :offset-assert 152)
(test symbol :offset-assert 156)
)
:method-count-assert 12
:size-assert #xa0
+2 -2
View File
@@ -936,7 +936,7 @@
(let ((a0-149 (-> (the-as (inline-array game-save-tag) v1-207) 0)))
(set! (-> a0-149 elt-type) (game-save-elt camera-stick-dir))
(set! (-> a0-149 elt-count) 0)
(set! (-> a0-149 user-uint64) (the-as uint (if (-> *setting-control* user-default unknowng-symbol-00)
(set! (-> a0-149 user-uint64) (the-as uint (if (-> *setting-control* user-default camera-stick-dir)
1
0
)
@@ -1150,7 +1150,7 @@
)
)
(((game-save-elt camera-stick-dir))
(set! (-> *setting-control* user-default unknowng-symbol-00)
(set! (-> *setting-control* user-default camera-stick-dir)
(= (-> (the-as (inline-array game-save-tag) v1-0) 0 user-uint64) 1)
)
)
+1 -1
View File
@@ -147,7 +147,7 @@
(allow-pause symbol :offset-assert 104)
(ocean-off symbol :offset-assert 108)
(allow-look-around symbol :offset-assert 112)
(unknowng-symbol-00 symbol :offset-assert 116)
(camera-stick-dir symbol :offset-assert 116)
(movie-name symbol :offset 120)
(weather symbol :offset-assert 124)
(mouse symbol :offset-assert 128)
+1 -1
View File
@@ -1422,7 +1422,7 @@
#t
)
)
(set! (-> gp-0 unknowng-symbol-00) #f)
(set! (-> gp-0 camera-stick-dir) #f)
(set! (-> gp-0 auto-save) #f)
(set! (-> gp-0 play-hints) #t)
(set! (-> gp-0 sound-bank-load) #t)
+1 -10
View File
@@ -1597,16 +1597,7 @@
(set! (-> a1-0 num-params) 2)
(set! (-> a1-0 message) 'attack-invinc)
(set! (-> a1-0 param 0) (the-as uint #f))
(let ((v1-24 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-10 *game-info*)
(a2-1 (+ (-> a0-10 attack-id) 1))
)
(set! (-> a0-10 attack-id) a2-1)
(set! (-> v1-24 id) a2-1)
)
(set! (-> v1-24 mode) 'bot)
(set! (-> a1-0 param 1) (the-as uint v1-24))
)
(set! (-> a1-0 param 1) (the-as uint (static-attack-info ((id (new-attack-id)) (mode 'bot)))))
(not (or (send-event-function *target* a1-0) (and *target* (focus-test? *target* dead))))
)
)
+1 -1
View File
@@ -1144,7 +1144,7 @@ This commonly includes things such as:
(when arg2
(let ((s5-0 (new 'stack-no-clear 'rigid-body-impact)))
(rigid-body-object-method-49 obj s5-0 arg2)
(if (logtest? (attack-info-mask attacker-velocity) (-> arg1 mask))
(if (logtest? (attack-mask attacker-velocity) (-> arg1 mask))
(set! (-> s5-0 velocity quad) (-> arg1 attacker-velocity quad))
(vector-! (-> s5-0 velocity) (-> s5-0 point) (-> arg0 root trans))
)
@@ -1852,7 +1852,7 @@
;; WARN: Return type mismatch object vs process-focusable.
(defbehavior find-offending-process-focusable process-drawable ((arg0 process-tree) (arg1 attack-info))
(let ((s5-0 (the-as object #f)))
(when (and arg1 (logtest? (-> arg1 mask) (attack-info-mask attacker)))
(when (and arg1 (logtest? (-> arg1 mask) (attack-mask attacker)))
(let ((s4-0 (handle->process (-> arg1 attacker))))
(set! s5-0 (if (type? s4-0 process-focusable)
s4-0
@@ -124,26 +124,14 @@ Seen take in - `true-func` which takes no args TODO - seems fishy
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
(('attack)
(when (-> self bounce-away)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'shove)
(set! (-> a1-3 param 0) (the-as uint #f))
(let ((v1-5 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(let* ((a2-2 *game-info*)
(a3-2 (+ (-> a2-2 attack-id) 1))
)
(set! (-> a2-2 attack-id) a3-2)
(set! (-> v1-5 id) a3-2)
)
(set! (-> v1-5 shove-back) 12288.0)
(set! (-> v1-5 shove-up) 4096.0)
(set! (-> a1-3 param 1) (the-as uint v1-5))
(if (-> self bounce-away)
(send-event
proc
'shove
#f
(static-attack-info ((id (new-attack-id)) (shove-back (meters 3)) (shove-up (meters 1))))
)
(send-event-function proc a1-3)
)
)
)
(('touch)
(send-shoves (-> self root) proc (the-as touching-shapes-entry (-> event param 0)) 0.7 6144.0 16384.0)
@@ -3137,7 +3137,7 @@
)
)
(combine! gp-0 arg1 self)
(when (not (logtest? (-> gp-0 mask) (attack-info-mask vector)))
(when (not (logtest? (-> gp-0 mask) (attack-mask vector)))
(vector-z-quaternion! (-> gp-0 vector) (-> self control quat-for-control))
(vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back))))
(set! (-> gp-0 vector y) (-> gp-0 shove-up))
@@ -734,12 +734,14 @@
(set! (-> a1-15 num-params) 2)
(set! (-> a1-15 message) 'attack)
(set! (-> a1-15 param 0) (-> arg3 param 0))
(let ((v1-61 (new 'static 'attack-info :mask (attack-info-mask mode id penetrate-using))))
(set! (-> v1-61 id) (-> self board attack-id))
(set! (-> v1-61 mode) 'board)
(set! (-> v1-61 penetrate-using) (-> self control penetrate-using))
(set! (-> a1-15 param 1) (the-as uint v1-61))
)
(set! (-> a1-15 param 1)
(the-as
uint
(static-attack-info
((id (-> self board attack-id)) (mode 'board) (penetrate-using (-> self control penetrate-using)))
)
)
)
(set! v0-0 (send-event-function arg0 a1-15))
)
(when v0-0
@@ -766,9 +768,9 @@
((= v1-3 'shove)
(when (not (focus-test? self hit))
(mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160)
(when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker)))
(when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker)))
(set! (-> self attack-info-rec attacker) (process->handle arg0))
(logior! (-> self attack-info-rec mask) (attack-info-mask attacker))
(logior! (-> self attack-info-rec mask) (attack-mask attacker))
)
(go target-board-hit (the-as vector 'shove) (-> self attack-info-rec))
)
@@ -747,24 +747,7 @@
)
)
(when s4-1
(let ((a1-21 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-21 from) (process->ppointer self))
(set! (-> a1-21 num-params) 2)
(set! (-> a1-21 message) 'attack)
(set! (-> a1-21 param 0) (the-as uint #f))
(let ((v1-91 (new 'static 'attack-info :mask (attack-info-mask mode id damage))))
(let* ((a0-49 *game-info*)
(a2-12 (+ (-> a0-49 attack-id) 1))
)
(set! (-> a0-49 attack-id) a2-12)
(set! (-> v1-91 id) a2-12)
)
(set! (-> v1-91 mode) 'explode)
(set! (-> v1-91 damage) 16.0)
(set! (-> a1-21 param 1) (the-as uint v1-91))
)
(send-event-function s4-1 a1-21)
)
(send-event s4-1 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'explode) (damage 16.0))))
(process-spawn-function
process
(lambda :behavior gun-dark-shot
@@ -169,19 +169,11 @@
)
)
)
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-7 from) (process->ppointer self))
(set! (-> a1-7 num-params) 2)
(set! (-> a1-7 message) 'attack)
(set! (-> a1-7 param 0) (the-as uint arg1))
(let ((v1-24 (new 'static 'attack-info :mask (attack-info-mask mode id attacker-velocity damage))))
(set! (-> v1-24 id) (-> obj attack-id))
(set! (-> v1-24 mode) 'eco-red)
(set! (-> v1-24 attacker-velocity quad) (-> s5-2 quad))
(set! (-> v1-24 damage) f30-0)
(set! (-> a1-7 param 1) (the-as uint v1-24))
)
(send-event-function arg0 a1-7)
(send-event
arg0
'attack
arg1
(static-attack-info ((id (-> obj attack-id)) (mode 'eco-red) (attacker-velocity s5-2) (damage f30-0)))
)
)
)
+7 -23
View File
@@ -1754,30 +1754,14 @@
)
)
(let ((v1-229 (-> self current-level)))
(when (and (or (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 2)) (focus-test? self pilot))
(and v1-229
(< (-> self control trans y) (-> v1-229 info buttom-height))
(not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2)))
)
)
(let ((a1-45 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-45 from) (process->ppointer self))
(set! (-> a1-45 num-params) 2)
(set! (-> a1-45 message) 'attack-invinc)
(set! (-> a1-45 param 0) (the-as uint #f))
(let ((v1-240 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-162 *game-info*)
(a2-22 (+ (-> a0-162 attack-id) 1))
)
(set! (-> a0-162 attack-id) a2-22)
(set! (-> v1-240 id) a2-22)
)
(set! (-> v1-240 mode) 'endlessfall)
(set! (-> a1-45 param 1) (the-as uint v1-240))
)
(send-event-function self a1-45)
(if (and (or (>= (- (current-time) (-> self control last-time-on-surface)) (seconds 2)) (focus-test? self pilot))
(and v1-229
(< (-> self control trans y) (-> v1-229 info buttom-height))
(not (and (= *cheat-mode* 'debug) (cpad-hold? (-> self control cpad number) r2)))
)
)
(send-event self 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'endlessfall))))
)
)
)
(set! (-> self control bend-speed) (if (logtest? (-> self control status) (collide-status on-surface))
32.0
+2 -20
View File
@@ -532,26 +532,8 @@
;; WARN: Return type mismatch object vs none.
(defmethod grunt-mech-method-194 grunt-mech ((obj grunt-mech))
(with-pp
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer pp))
(set! (-> a1-0 num-params) 2)
(set! (-> a1-0 message) 'attack)
(set! (-> a1-0 param 0) (the-as uint #f))
(let ((v1-3 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-2 *game-info*)
(a2-1 (+ (-> a0-2 attack-id) 1))
)
(set! (-> a0-2 attack-id) a2-1)
(set! (-> v1-3 id) a2-1)
)
(set! (-> v1-3 mode) 'grunt)
(set! (-> a1-0 param 1) (the-as uint v1-3))
)
(send-event-function *target* a1-0)
)
(none)
)
(send-event *target* 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'grunt))))
(none)
)
;; WARN: Return type mismatch object vs none.
+16 -19
View File
@@ -500,24 +500,21 @@
)
(if (and s4-1
(and (or (and s5-2 (focus-test? (the-as process-focusable s5-2) dead))
(let ((a1-6 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-6 from) (process->ppointer self))
(set! (-> a1-6 num-params) 2)
(set! (-> a1-6 message) 'attack)
(set! (-> a1-6 param 0) (the-as uint #f))
(let ((v1-20 (new 'static 'attack-info :mask (attack-info-mask intersection mode id count penetrate-using))))
(set! (-> v1-20 id) (-> self control target-attack-id))
(set! (-> v1-20 mode) (-> self control danger-mode))
(set! (-> v1-20 count) (-> self control attack-count))
(set! (-> v1-20 penetrate-using) (penetrate touch punch mech mech-punch))
(set! (-> v1-20 intersection quad) (-> (the-as collide-query gp-1) best-other-tri intersect quad))
(set! (-> a1-6 param 1) (the-as uint v1-20))
)
(when (send-event-function (-> s4-1 cshape process) a1-6)
(set! (-> self control send-attack-dest) (process->handle s5-2))
(set! (-> self control send-attack-time) (current-time))
#t
)
(when (send-event
(-> s4-1 cshape process)
'attack
#f
(static-attack-info ((id (-> self control target-attack-id))
(mode (-> self control danger-mode))
(count (-> self control attack-count))
(penetrate-using (penetrate touch punch mech mech-punch))
(intersection (-> (the-as collide-query gp-1) best-other-tri intersect))
)
)
)
(set! (-> self control send-attack-dest) (process->handle s5-2))
(set! (-> self control send-attack-time) (current-time))
#t
)
)
s5-2
@@ -1063,7 +1060,7 @@
)
)
(combine! gp-0 arg1 self)
(when (not (logtest? (-> gp-0 mask) (attack-info-mask vector)))
(when (not (logtest? (-> gp-0 mask) (attack-mask vector)))
(vector-z-quaternion! (-> gp-0 vector) (-> self control quat-for-control))
(vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back))))
(set! (-> gp-0 vector y) (-> gp-0 shove-up))
+5 -17
View File
@@ -55,23 +55,11 @@
(case event-type
(('attack 'bonk)
(send-event proc 'target-mech-get-off (seconds 0.3))
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'shove)
(set! (-> a1-3 param 0) (the-as uint #f))
(let ((v1-9 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(let* ((a0-8 *game-info*)
(a2-2 (+ (-> a0-8 attack-id) 1))
)
(set! (-> a0-8 attack-id) a2-2)
(set! (-> v1-9 id) a2-2)
)
(set! (-> v1-9 shove-back) 12288.0)
(set! (-> v1-9 shove-up) 4096.0)
(set! (-> a1-3 param 1) (the-as uint v1-9))
)
(send-event-function proc a1-3)
(send-event
proc
'shove
#f
(static-attack-info ((id (new-attack-id)) (shove-back (meters 3)) (shove-up (meters 1))))
)
(the-as structure #f)
)
+79 -130
View File
@@ -78,15 +78,11 @@
(case arg3
((1)
(if (= (-> *cpad-list* cpads (-> self control cpad number) stick0-speed) 0.0)
(seek!
(-> self control did-move-to-pole-or-max-jump-height)
0.0
(* 127431.11 (-> self clock seconds-per-frame))
)
(seek! (-> self control did-move-to-pole-or-max-jump-height) 0.0 (* 127431.11 (seconds-per-frame)))
(seek!
(-> self control did-move-to-pole-or-max-jump-height)
(* (-> self control turn-to-magnitude) (-> arg0 turnvv))
(* 127431.11 (-> self clock seconds-per-frame))
(* 127431.11 (seconds-per-frame))
)
)
(set! (-> arg0 turnvv) (-> self control did-move-to-pole-or-max-jump-height))
@@ -140,21 +136,15 @@
(case arg3
((1)
(when (= (-> arg2 name) '*edge-surface*)
(let ((v1-5
(vector-flatten!
(new 'stack-no-clear 'vector)
(vector-negate! (new-stack-vector0) (-> self control dynam gravity-normal))
(-> self control local-normal)
)
)
(let ((v1-5 (vector-flatten!
(new 'stack-no-clear 'vector)
(vector-negate! (new-stack-vector0) (-> self control dynam gravity-normal))
(-> self control local-normal)
)
)
)
(set! (-> arg0 vel-turn) 0.0)
(vector+float*!
(-> self control transv)
(-> self control transv)
v1-5
(* 409600.0 (-> self clock seconds-per-frame))
)
(vector+float*! (-> self control transv) (-> self control transv) v1-5 (* 409600.0 (seconds-per-frame)))
)
)
)
@@ -547,12 +537,14 @@
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'attack)
(set! (-> a1-1 param 0) (-> arg3 param 0))
(let ((v1-25 (new 'static 'attack-info :mask (attack-info-mask mode id penetrate-using))))
(set! (-> v1-25 id) (-> self mech attack-id))
(set! (-> v1-25 mode) 'mech)
(set! (-> v1-25 penetrate-using) (-> self control penetrate-using))
(set! (-> a1-1 param 1) (the-as uint v1-25))
)
(set! (-> a1-1 param 1)
(the-as
uint
(static-attack-info
((id (-> self mech attack-id)) (mode 'mech) (penetrate-using (-> self control penetrate-using)))
)
)
)
(set! v0-0 (send-event-function arg0 a1-1))
)
(when v0-0
@@ -593,107 +585,64 @@
)
)
(let* ((v1-30 (-> s3-0 mode))
(f30-0
(cond
((= v1-30 'tar)
(set! (-> s3-0 id) (the-as uint 2))
(* 100.0 (-> self clock seconds-per-frame))
)
((= v1-30 'melt)
(set! (-> s3-0 id) (the-as uint 2))
(let ((s2-1 (if (logtest? (-> s3-0 mask) (attack-info-mask intersection))
(-> s3-0 intersection)
(-> self control trans)
)
)
(f30-0 (cond
((= v1-30 'tar)
(set! (-> s3-0 id) (the-as uint 2))
(* 100.0 (seconds-per-frame))
)
((= v1-30 'melt)
(set! (-> s3-0 id) (the-as uint 2))
(let ((s2-1 (if (logtest? (-> s3-0 mask) (attack-mask intersection))
(-> s3-0 intersection)
(-> self control trans)
)
)
)
(launch-particles (-> *part-id-table* 955) s2-1)
(launch-particles (-> *part-id-table* 957) s2-1)
)
(* 100.0 (seconds-per-frame))
)
((or (= v1-30 'burn) (= v1-30 'burnup))
(set! (-> s3-0 id) (the-as uint 2))
(if (logtest? (-> s3-0 mask) (attack-mask intersection))
(-> s3-0 intersection)
(-> self control trans)
)
(launch-particles (-> *part-id-table* 955) (-> self control trans))
(launch-particles (-> *part-id-table* 957) (-> self control trans))
(* 20.0 (seconds-per-frame))
)
((= v1-30 'shock)
(let ((s2-2 (if (logtest? (-> s3-0 mask) (attack-mask intersection))
(-> s3-0 intersection)
(-> self control trans)
)
)
)
(launch-particles (-> *part-id-table* 959) s2-2)
(launch-particles (-> *part-id-table* 960) s2-2)
)
(set! (-> s3-0 id) (the-as uint 2))
(* 20.0 (seconds-per-frame))
)
((= v1-30 'explode)
20.0
)
((= v1-30 'grunt)
1.0
)
((= v1-30 'air)
100.0
)
((or (= v1-30 'endlessfall) (= v1-30 'crush) (= v1-30 'instant-death))
100.0
)
(else
3.0
)
(let ((t9-10 sp-launch-particles-var)
(a0-50 *sp-particle-system-2d*)
(a1-5 (-> *part-id-table* 955))
(a2-8 *launch-matrix*)
)
(set! (-> a2-8 trans quad) (-> s2-1 quad))
(t9-10 a0-50 a1-5 a2-8 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-11 sp-launch-particles-var)
(a0-51 *sp-particle-system-2d*)
(a1-6 (-> *part-id-table* 957))
(a2-9 *launch-matrix*)
)
(set! (-> a2-9 trans quad) (-> s2-1 quad))
(t9-11 a0-51 a1-6 a2-9 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
(* 100.0 (-> self clock seconds-per-frame))
)
((or (= v1-30 'burn) (= v1-30 'burnup))
(set! (-> s3-0 id) (the-as uint 2))
(if (logtest? (-> s3-0 mask) (attack-info-mask intersection))
(-> s3-0 intersection)
(-> self control trans)
)
(let ((t9-12 sp-launch-particles-var)
(a0-55 *sp-particle-system-2d*)
(a1-8 (-> *part-id-table* 955))
(a2-10 *launch-matrix*)
)
(set! (-> a2-10 trans quad) (-> self control trans quad))
(t9-12 a0-55 a1-8 a2-10 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-13 sp-launch-particles-var)
(a0-56 *sp-particle-system-2d*)
(a1-9 (-> *part-id-table* 957))
(a2-11 *launch-matrix*)
)
(set! (-> a2-11 trans quad) (-> self control trans quad))
(t9-13 a0-56 a1-9 a2-11 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(* 20.0 (-> self clock seconds-per-frame))
)
((= v1-30 'shock)
(let ((s2-2 (if (logtest? (-> s3-0 mask) (attack-info-mask intersection))
(-> s3-0 intersection)
(-> self control trans)
)
)
)
(let ((t9-14 sp-launch-particles-var)
(a0-58 *sp-particle-system-2d*)
(a1-10 (-> *part-id-table* 959))
(a2-12 *launch-matrix*)
)
(set! (-> a2-12 trans quad) (-> s2-2 quad))
(t9-14 a0-58 a1-10 a2-12 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
(let ((t9-15 sp-launch-particles-var)
(a0-59 *sp-particle-system-2d*)
(a1-11 (-> *part-id-table* 960))
(a2-13 *launch-matrix*)
)
(set! (-> a2-13 trans quad) (-> s2-2 quad))
(t9-15 a0-59 a1-11 a2-13 (the-as sparticle-launch-state #f) (the-as sparticle-launch-control #f) 1.0)
)
)
(set! (-> s3-0 id) (the-as uint 2))
(* 20.0 (-> self clock seconds-per-frame))
)
((= v1-30 'explode)
20.0
)
((= v1-30 'grunt)
1.0
)
((= v1-30 'air)
100.0
)
((or (= v1-30 'endlessfall) (= v1-30 'crush) (= v1-30 'instant-death))
100.0
)
(else
3.0
)
)
)
)
(when (target-log-attack s3-0 'background)
(case arg2
@@ -723,9 +672,9 @@
(('shove)
(when (not (focus-test? self dead hit))
(mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160)
(when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker)))
(when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker)))
(set! (-> self attack-info-rec attacker) (process->handle arg0))
(logior! (-> self attack-info-rec mask) (attack-info-mask attacker))
(logior! (-> self attack-info-rec mask) (attack-mask attacker))
)
(go target-mech-hit 'shove (-> self attack-info-rec))
)
@@ -850,7 +799,7 @@
(+! (-> arg0 user-position y) f0-1)
)
(let ((f0-4 (- (-> arg3 y) (-> arg0 user-position y))))
(seek! (-> arg0 user-float) f0-4 (* 40960.0 (-> self clock seconds-per-frame)))
(seek! (-> arg0 user-float) f0-4 (* 40960.0 (seconds-per-frame)))
)
(let* ((f28-0 (-> arg0 user-float))
(f30-1 (lerp-scale 1.0 0.0 f28-0 0.0 12288.0))
@@ -995,7 +944,7 @@
(lerp-scale 1.0 0.0 (- (-> s0-0 y) (-> (the-as collide-shape-moving s5-0) gspot-pos y)) 2048.0 12288.0)
)
)
(seek! (-> s3-0 user-blend) f0-11 (* 4.0 (-> self clock seconds-per-frame)))
(seek! (-> s3-0 user-blend) f0-11 (* 4.0 (seconds-per-frame)))
)
(let ((a1-9 (-> gp-0 start-pos)))
(let ((v1-18 s0-0))
@@ -1127,7 +1076,7 @@
(set! (-> self control reaction) target-collision-reaction)
(set! (-> self control transv quad) (the-as uint128 0))
(set! (-> self control ctrl-xz-vel) 0.0)
(set! (-> self focus-status) (logior (focus-status mech) (-> self focus-status)))
(logior! (-> self focus-status) (focus-status mech))
(set! (-> self control bend-target) 0.0)
(let ((v1-40 (-> self node-list data)))
(set! (-> v1-40 0 param0) (the-as (function cspace transformq none) cspace<-transformq+world-trans!))
@@ -1407,7 +1356,7 @@
(s4-1 s3-0 (t9-4
(sqrtf (+ (* (-> v1-30 x) (-> v1-30 x)) (* (-> v1-30 z) (-> v1-30 z))))
(sqrtf (+ (* (-> s5-0 x) (-> s5-0 x)) (* (-> s5-0 z) (-> s5-0 z))))
(* f0-11 (-> self clock seconds-per-frame))
(* f0-11 (seconds-per-frame))
)
)
)
@@ -1527,7 +1476,7 @@
)
)
(else
(send-event self 'drop 150)
(send-event self 'drop (seconds 0.5))
)
)
)
+17 -20
View File
@@ -1486,26 +1486,23 @@
3
:to self
)
(let ((a1-6 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-6 from) (process->ppointer self))
(set! (-> a1-6 num-params) 2)
(set! (-> a1-6 message) 'attack)
(set! (-> a1-6 param 0) (the-as uint #f))
(let ((v1-19 (new 'static 'attack-info :mask (attack-info-mask mode id penetrate-using damage))))
(set! (-> v1-19 id) (the-as uint arg3))
(set! (-> v1-19 mode) 'ice)
(set! (-> v1-19 damage) 15.0)
(set! (-> v1-19 penetrate-using) (if (and (focus-test? self dark)
(nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) (darkjak-stage giant))
)
(penetrate touch dark-skin dark-bomb dark-giant)
(penetrate touch dark-skin dark-bomb)
)
)
(set! (-> a1-6 param 1) (the-as uint v1-19))
)
(send-event-function gp-0 a1-6)
(send-event
gp-0
'attack
#f
(static-attack-info ((id (the-as uint arg3))
(mode 'ice)
(damage 15.0)
(penetrate-using (if (and (focus-test? self dark)
(nonzero? (-> self darkjak))
(logtest? (-> self darkjak stage) (darkjak-stage giant))
)
(penetrate touch dark-skin dark-bomb dark-giant)
(penetrate touch dark-skin dark-bomb)
)
)
)
)
)
)
)
+4 -4
View File
@@ -536,7 +536,7 @@
(t2-0 #f)
(t3-0 *launch-matrix*)
)
(set! (-> t3-0 trans quad) (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-info-mask intersection))
(set! (-> t3-0 trans quad) (-> (the-as vector (if (logtest? (-> arg0 mask) (attack-mask intersection))
(-> arg0 intersection)
(the-as vector (-> self control root-prim prim-core))
)
@@ -730,7 +730,7 @@
(let ((s5-0 #f))
(if (and (!= (-> arg0 angle) 'front)
(!= (-> arg0 angle) 'shove)
(logtest? (-> arg0 mask) (attack-info-mask vector))
(logtest? (-> arg0 mask) (attack-mask vector))
(!= (-> arg0 shove-back) 0.0)
)
(forward-up-nopitch->quaternion (-> self control dir-targ) arg1 (-> self control dynam gravity-normal))
@@ -743,7 +743,7 @@
(set! (-> self control mod-surface) *smack-up-mods*)
)
(('front)
(if (and (logtest? (-> arg0 mask) (attack-info-mask vector)) (!= (-> arg0 shove-back) 0.0))
(if (and (logtest? (-> arg0 mask) (attack-mask vector)) (!= (-> arg0 shove-back) 0.0))
(forward-up-nopitch->quaternion
(-> self control dir-targ)
(vector-negate! (new 'stack-no-clear 'vector) arg1)
@@ -989,7 +989,7 @@
)
)
(combine! sv-32 arg1 self)
(when (not (logtest? (-> sv-32 mask) (attack-info-mask vector)))
(when (not (logtest? (-> sv-32 mask) (attack-mask vector)))
(vector-z-quaternion! (-> sv-32 vector) (-> self control quat-for-control))
(vector-xz-normalize! (-> sv-32 vector) (- (fabs (-> sv-32 shove-back))))
(set! (-> sv-32 vector y) (-> sv-32 shove-up))
+21 -24
View File
@@ -22,7 +22,7 @@
'shove
)
)
(set! (-> s5-0 mask) (attack-info-mask attacker shove-back shove-up angle))
(set! (-> s5-0 mask) (attack-mask attacker shove-back shove-up angle))
(cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 (seconds 0.1))
(go arg3 'shove s5-0)
)
@@ -54,7 +54,7 @@
(arg3 touching-shapes-entry)
(arg4 (state symbol attack-info target))
)
(let ((s4-0 (if (logtest? (-> arg1 mask) (attack-info-mask mode))
(let ((s4-0 (if (logtest? (-> arg1 mask) (attack-mask mode))
(-> arg1 mode)
)
)
@@ -105,7 +105,7 @@
(mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer arg1) 160)
(compute-intersect-info (-> self attack-info-rec) arg1 self arg2 arg3)
(when (not (focus-test? self mech))
(if (and (not (target-log-attack (-> self attack-info-rec) (if (logtest? (attack-info-mask test) (-> arg1 mask))
(if (and (not (target-log-attack (-> self attack-info-rec) (if (logtest? (attack-mask test) (-> arg1 mask))
'test
'log
)
@@ -116,12 +116,12 @@
(return #f)
)
)
(if (logtest? (attack-info-mask test) (-> arg1 mask))
(if (logtest? (attack-mask test) (-> arg1 mask))
(return #t)
)
(set! (-> self control attacked-by-id) (the-as int (-> self attack-info-rec id)))
(cond
((and (logtest? (-> self attack-info-rec mask) (attack-info-mask mode))
((and (logtest? (-> self attack-info-rec mask) (attack-mask mode))
(= (-> self attack-info-rec mode) 'damage)
(not (and (= (-> self game mode) 'play)
(>= 0.0 (- (-> (the-as fact-info-target (-> self fact)) health) (-> self attack-info-rec damage)))
@@ -131,7 +131,7 @@
(pickup-collectable!
(-> self fact)
(pickup-type health)
(if (logtest? (attack-info-mask damage) (-> self attack-info-rec mask))
(if (logtest? (attack-mask damage) (-> self attack-info-rec mask))
(- (-> self attack-info-rec damage))
(- (-> *FACT-bank* health-single-inc))
)
@@ -153,7 +153,7 @@
(t3-0 *launch-matrix*)
)
(set! (-> t3-0 trans quad)
(-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-info-mask intersection))
(-> (the-as vector (if (logtest? (-> self attack-info-rec mask) (attack-mask intersection))
(-> self attack-info-rec intersection)
(the-as vector (-> self control root-prim prim-core))
)
@@ -176,7 +176,7 @@
)
)
(target-timed-invulnerable
(the-as time-frame (if (logtest? (-> self attack-info-rec mask) (attack-info-mask invinc-time))
(the-as time-frame (if (logtest? (-> self attack-info-rec mask) (attack-mask invinc-time))
(the-as int (-> self attack-info-rec invinc-time))
(the-as int (-> *TARGET-bank* hit-invulnerable-timeout))
)
@@ -256,20 +256,17 @@
)
(s3-1 (and s4-0 (focus-test? (the-as process-focusable s4-0) dead hit)))
)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (the-as uint arg2))
(let ((v1-5 (new 'static 'attack-info :mask (attack-info-mask mode id count penetrate-using))))
(set! (-> v1-5 id) (the-as uint arg3))
(set! (-> v1-5 mode) arg1)
(set! (-> v1-5 count) (the-as uint arg4))
(set! (-> v1-5 penetrate-using) sv-224)
(set! (-> a1-2 param 1) (the-as uint v1-5))
)
(set! sv-96 (the-as symbol (send-event-function arg0 a1-2)))
)
(set! sv-96
(the-as
symbol
(send-event
arg0
'attack
arg2
(static-attack-info ((id (the-as uint arg3)) (mode arg1) (count (the-as uint arg4)) (penetrate-using sv-224)))
)
)
)
(when sv-96
(set! (-> self control send-attack-dest) (process->handle arg0))
(set! (-> self control send-attack-time) (current-time))
@@ -1086,9 +1083,9 @@
(b! (!= v1-0 'shove) cfg-21 :delay (nop!))
(set! v0-0 (when (not (and (-> self next-state) (= (-> self next-state name) 'target-hit)))
(mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160)
(when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker)))
(when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker)))
(set! (-> self attack-info-rec attacker) (process->handle arg0))
(logior! (-> self attack-info-rec mask) (attack-info-mask attacker))
(logior! (-> self attack-info-rec mask) (attack-mask attacker))
)
(go target-hit 'shove (-> self attack-info-rec))
)
+7 -23
View File
@@ -652,7 +652,7 @@
(case event-type
(('attack 'attack-invinc 'attack-or-shove)
(let ((v1-1 (the-as attack-info (-> event param 1))))
(set! t0-7 (or (not (logtest? (-> v1-1 mask) (attack-info-mask mode)))
(set! t0-7 (or (not (logtest? (-> v1-1 mask) (attack-mask mode)))
(case (-> v1-1 mode)
(('bot 'lava 'melt 'dark-eco-pool)
#f
@@ -669,7 +669,7 @@
)
)
(when t0-7
(if (not (logtest? (attack-info-mask damage) (-> v1-1 mask)))
(if (not (logtest? (attack-mask damage) (-> v1-1 mask)))
(set! (-> v1-1 damage) (-> *FACT-bank* health-single-inc))
)
(if (!= (-> v1-1 mode) 'drown-death)
@@ -680,7 +680,7 @@
)
(set! (-> v1-1 mode) 'drown-death)
)
(logior! (-> v1-1 mask) (attack-info-mask mode))
(logior! (-> v1-1 mask) (attack-mask mode))
(set! (-> self control unknown-word04) (the-as uint #t))
)
)
@@ -891,27 +891,11 @@
(the-as surface #f)
)
)
(when (and (>= (- (current-time) (-> self state-time)) (seconds 10))
(< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance))
)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'attack)
(set! (-> a1-3 param 0) (the-as uint #f))
(let ((v1-27 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-8 *game-info*)
(a2-2 (+ (-> a0-8 attack-id) 1))
)
(set! (-> a0-8 attack-id) a2-2)
(set! (-> v1-27 id) a2-2)
)
(set! (-> v1-27 mode) 'drown-death)
(set! (-> a1-3 param 1) (the-as uint v1-27))
)
(send-event-function self a1-3)
(if (and (>= (- (current-time) (-> self state-time)) (seconds 10))
(< (target-move-dist (-> *TARGET-bank* stuck-time)) (-> *TARGET-bank* stuck-distance))
)
(send-event self 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'drown-death))))
)
)
(if (and (cpad-pressed? (-> self control cpad number) circle square)
(or (< (- (current-time) (-> self control unknown-time-frame27)) (seconds 10))
(logtest? (-> self control status) (collide-status touch-ceiling))
+5 -5
View File
@@ -823,7 +823,7 @@
(set! (-> self state-time) (current-time))
(logior! (-> self focus-status) (focus-status hit))
(set! (-> self game hit-time) (current-time))
(when (not (logtest? (-> arg1 mask) (attack-info-mask vector)))
(when (not (logtest? (-> arg1 mask) (attack-mask vector)))
(vector-!
(-> arg1 vector)
(vector+float*! (new 'stack-no-clear 'vector) (-> self tube foretube) (-> self tube downtube) 20480.0)
@@ -847,14 +847,14 @@
)
)
)
(logior! (-> arg1 mask) (attack-info-mask vector))
(logior! (-> arg1 mask) (attack-mask vector))
)
(when (and (logtest? (-> arg1 mask) (attack-info-mask mode))
(when (and (logtest? (-> arg1 mask) (attack-mask mode))
(= (-> arg1 mode) 'darkeco)
(not (logtest? (-> arg1 mask) (attack-info-mask shove-up)))
(not (logtest? (-> arg1 mask) (attack-mask shove-up)))
)
(set! (-> arg1 shove-up) 12288.0)
(logior! (-> arg1 mask) (attack-info-mask shove-up))
(logior! (-> arg1 mask) (attack-mask shove-up))
)
(let ((v1-23 gp-0))
(set! (-> v1-23 attacker) (the-as handle #f))
@@ -207,18 +207,11 @@
)
(when toucher
(-> toucher root)
(let ((evt (new 'stack-no-clear 'event-message-block)))
(set! (-> evt from) (process->ppointer self))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'attack)
(set! (-> evt param 0) (-> event param 0))
(let ((attack-info (new 'static 'attack-info :mask (attack-info-mask mode id damage))))
(set! (-> attack-info id) (-> self attack-id))
(set! (-> attack-info mode) 'explode)
(set! (-> attack-info damage) (-> self damage))
(set! (-> evt param 1) (the-as uint attack-info))
)
(send-event-function proc evt)
(send-event
proc
'attack
(-> event param 0)
(static-attack-info ((id (-> self attack-id)) (mode 'explode) (damage (-> self damage))))
)
)
)
+15 -50
View File
@@ -890,23 +890,11 @@
(case event-type
(('attack 'bonk)
(send-event proc 'target-turret-get-off 90)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'shove)
(set! (-> a1-2 param 0) (the-as uint #f))
(let ((v1-9 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(let* ((a0-7 *game-info*)
(a2-2 (+ (-> a0-7 attack-id) 1))
)
(set! (-> a0-7 attack-id) a2-2)
(set! (-> v1-9 id) a2-2)
)
(set! (-> v1-9 shove-back) 12288.0)
(set! (-> v1-9 shove-up) 4096.0)
(set! (-> a1-2 param 1) (the-as uint v1-9))
)
(send-event-function proc a1-2)
(send-event
proc
'shove
#f
(static-attack-info ((id (new-attack-id)) (shove-back (meters 3)) (shove-up (meters 1))))
)
#f
)
@@ -1471,23 +1459,11 @@
(case event-type
(('attack 'bonk)
(send-event proc 'target-turret-get-off 90)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'shove)
(set! (-> a1-2 param 0) (the-as uint #f))
(let ((v1-9 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(let* ((a0-7 *game-info*)
(a2-2 (+ (-> a0-7 attack-id) 1))
)
(set! (-> a0-7 attack-id) a2-2)
(set! (-> v1-9 id) a2-2)
)
(set! (-> v1-9 shove-back) 12288.0)
(set! (-> v1-9 shove-up) 4096.0)
(set! (-> a1-2 param 1) (the-as uint v1-9))
)
(send-event-function proc a1-2)
(send-event
proc
'shove
#f
(static-attack-info ((id (new-attack-id)) (shove-back (meters 3)) (shove-up (meters 1))))
)
#f
)
@@ -1526,22 +1502,11 @@
(suspend)
)
)
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) (process->ppointer self))
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'attack)
(set! (-> a1-1 param 0) (the-as uint #f))
(let ((v1-11 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-4 *game-info*)
(a2-2 (+ (-> a0-4 attack-id) 1))
)
(set! (-> a0-4 attack-id) a2-2)
(set! (-> v1-11 id) a2-2)
)
(set! (-> v1-11 mode) 'turret)
(set! (-> a1-1 param 1) (the-as uint v1-11))
)
(send-event-function (handle->process (-> self rider)) a1-1)
(send-event
(handle->process (-> self rider))
'attack
#f
(static-attack-info ((id (new-attack-id)) (mode 'turret)))
)
(let ((v1-17 (-> self root root-prim)))
(set! (-> v1-17 prim-core collide-as) (collide-spec))
+32 -32
View File
@@ -1515,7 +1515,7 @@
)
)
(cond
((logtest? (attack-info-mask attacker-velocity) (-> obj mask))
((logtest? (attack-mask attacker-velocity) (-> obj mask))
(set! (-> arg0 attacker-velocity quad) (-> obj attacker-velocity quad))
(vector-normalize-copy! (-> arg0 trans) (-> arg0 attacker-velocity) 1.0)
)
@@ -1572,23 +1572,23 @@
(let ((a1-2 (prims-touching? arg3 (the-as collide-shape (-> arg1 root)) (the-as uint -1))))
(when a1-2
(get-intersect-point (-> obj intersection) a1-2 (the-as collide-shape (-> arg1 root)) arg3)
(logior! (-> obj mask) (attack-info-mask intersection))
(logior! (-> obj mask) (attack-mask intersection))
)
)
)
(when arg1
(set! (-> obj prev-state) (-> arg1 state))
(logior! (-> obj mask) (attack-info-mask prev-state))
(logior! (-> obj mask) (attack-mask prev-state))
)
(when (not (logtest? (-> obj mask) (attack-info-mask attacker)))
(when (not (logtest? (-> obj mask) (attack-mask attacker)))
(set! (-> obj attacker) (process->handle arg2))
(logior! (-> obj mask) (attack-info-mask attacker))
(logior! (-> obj mask) (attack-mask attacker))
)
(when (not (logtest? (-> obj mask) (attack-info-mask attack-time)))
(when (not (logtest? (-> obj mask) (attack-mask attack-time)))
(set! (-> obj attack-time) (-> *display* base-clock frame-counter))
(logior! (-> obj mask) (attack-info-mask attack-time))
(logior! (-> obj mask) (attack-mask attack-time))
)
(if (not (logtest? (attack-info-mask damage) (-> obj mask)))
(if (not (logtest? (attack-mask damage) (-> obj mask)))
(set! (-> obj damage) (-> *FACT-bank* health-default-inc))
)
obj
@@ -1597,62 +1597,62 @@
(defmethod combine! attack-info ((obj attack-info) (arg0 attack-info) (arg1 process-drawable))
(let ((s4-0 (-> arg0 mask)))
(set! (-> obj mask) (-> arg0 mask))
(if (logtest? s4-0 (attack-info-mask attacker))
(if (logtest? s4-0 (attack-mask attacker))
(set! (-> obj attacker) (-> arg0 attacker))
)
(if (logtest? s4-0 (attack-info-mask mode))
(if (logtest? s4-0 (attack-mask mode))
(set! (-> obj mode) (-> arg0 mode))
)
(if (logtest? s4-0 (attack-info-mask angle))
(if (logtest? s4-0 (attack-mask angle))
(set! (-> obj angle) (-> arg0 angle))
)
(if (logtest? s4-0 (attack-info-mask dist))
(if (logtest? s4-0 (attack-mask dist))
(set! (-> obj dist) (-> arg0 dist))
)
(if (logtest? s4-0 (attack-info-mask control))
(if (logtest? s4-0 (attack-mask control))
(set! (-> obj control) (-> arg0 control))
)
(if (logtest? s4-0 (attack-info-mask speed))
(if (logtest? s4-0 (attack-mask speed))
(set! (-> obj speed) (-> arg0 speed))
)
(if (logtest? (attack-info-mask penetrate-using) s4-0)
(if (logtest? (attack-mask penetrate-using) s4-0)
(set! (-> obj penetrate-using) (-> arg0 penetrate-using))
)
(if (logtest? (attack-info-mask damage) s4-0)
(if (logtest? (attack-mask damage) s4-0)
(set! (-> obj damage) (-> arg0 damage))
)
(if (logtest? (attack-info-mask shield-damage) s4-0)
(if (logtest? (attack-mask shield-damage) s4-0)
(set! (-> obj shield-damage) (-> arg0 shield-damage))
)
(if (logtest? (attack-info-mask knock) s4-0)
(if (logtest? (attack-mask knock) s4-0)
(set! (-> obj knock) (-> arg0 knock))
)
(if (logtest? (attack-info-mask count) s4-0)
(if (logtest? (attack-mask count) s4-0)
(set! (-> obj count) (-> arg0 count))
)
(if (logtest? s4-0 (attack-info-mask id))
(if (logtest? s4-0 (attack-mask id))
(set! (-> obj id) (-> arg0 id))
)
(if (logtest? s4-0 (attack-info-mask shove-back))
(if (logtest? s4-0 (attack-mask shove-back))
(set! (-> obj shove-back) (-> arg0 shove-back))
)
(if (logtest? s4-0 (attack-info-mask shove-up))
(if (logtest? s4-0 (attack-mask shove-up))
(set! (-> obj shove-up) (-> arg0 shove-up))
)
(if (logtest? s4-0 (attack-info-mask invinc-time))
(if (logtest? s4-0 (attack-mask invinc-time))
(set! (-> obj invinc-time) (-> arg0 invinc-time))
)
(if (logtest? s4-0 (attack-info-mask rotate-to))
(if (logtest? s4-0 (attack-mask rotate-to))
(set! (-> obj rotate-to) (-> arg0 rotate-to))
)
(if (logtest? s4-0 (attack-info-mask intersection))
(if (logtest? s4-0 (attack-mask intersection))
(set! (-> obj intersection quad) (-> arg0 intersection quad))
)
(if (logtest? (attack-info-mask attacker-velocity) s4-0)
(if (logtest? (attack-mask attacker-velocity) s4-0)
(set! (-> obj attacker-velocity quad) (-> arg0 attacker-velocity quad))
)
(cond
((not (logtest? s4-0 (attack-info-mask vector)))
((not (logtest? s4-0 (attack-mask vector)))
(let* ((s2-0 (handle->process (-> obj attacker)))
(v1-65 (if (type? s2-0 process-drawable)
s2-0
@@ -1662,7 +1662,7 @@
(when (and v1-65 (nonzero? (-> (the-as process-drawable v1-65) root)))
(set! (-> obj trans quad) (-> (the-as process-drawable v1-65) root trans quad))
(vector-! (-> obj vector) (-> arg1 root trans) (-> (the-as process-drawable v1-65) root trans))
(logior! (-> obj mask) (attack-info-mask vector))
(logior! (-> obj mask) (attack-mask vector))
)
)
)
@@ -1678,20 +1678,20 @@
)
)
(set! (-> obj vector quad) (-> arg0 vector quad))
(when (not (logtest? s4-0 (attack-info-mask shove-back)))
(when (not (logtest? s4-0 (attack-mask shove-back)))
(let ((v1-79 (-> obj vector)))
(set! (-> obj shove-back) (sqrtf (+ (* (-> v1-79 x) (-> v1-79 x)) (* (-> v1-79 z) (-> v1-79 z)))))
)
)
(if (not (logtest? s4-0 (attack-info-mask shove-up)))
(if (not (logtest? s4-0 (attack-mask shove-up)))
(set! (-> obj shove-up) (-> obj vector y))
)
)
)
(if (not (logtest? (-> obj mask) (attack-info-mask dist)))
(if (not (logtest? (-> obj mask) (attack-mask dist)))
(set! (-> obj dist) (fabs (-> obj shove-back)))
)
(if (logtest? s4-0 (attack-info-mask trans))
(if (logtest? s4-0 (attack-mask trans))
(set! (-> obj trans quad) (-> arg0 trans quad))
)
)
+65 -95
View File
@@ -157,13 +157,9 @@
*target*
)
((= arg0 'sidekick)
(when *target*
(let ((v1-11 (-> *target* sidekick)))
(if v1-11
(the-as process (-> v1-11 0 self))
)
(if *target*
(ppointer->process (-> *target* sidekick))
)
)
)
((= arg0 'parent)
(let ((v1-14 (-> pp parent)))
@@ -1330,16 +1326,9 @@
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) (the-as symbol (-> arg0 param 4)))
(set! (-> a1-1 param 0) (the-as uint #f))
(let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-4 *game-info*)
(a2-1 (+ (-> a0-4 attack-id) 1))
)
(set! (-> a0-4 attack-id) a2-1)
(set! (-> v1-6 id) a2-1)
)
(set! (-> v1-6 mode) (the-as symbol (-> arg0 param 3)))
(set! (-> a1-1 param 1) (the-as uint v1-6))
)
(set! (-> a1-1 param 1)
(the-as uint (static-attack-info ((id (new-attack-id)) (mode (the-as symbol (-> arg0 param 3))))))
)
(let ((t9-1 send-event-function)
(v1-10 (the-as object (-> (the-as (pointer uint32) (+ (+ (* s4-0 8) 12) (the-as int s5-0))))))
)
@@ -1360,16 +1349,9 @@
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) (the-as symbol (-> arg0 param 4)))
(set! (-> a1-2 param 0) (the-as uint #f))
(let ((v1-18 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-8 *game-info*)
(a2-3 (+ (-> a0-8 attack-id) 1))
)
(set! (-> a0-8 attack-id) a2-3)
(set! (-> v1-18 id) a2-3)
)
(set! (-> v1-18 mode) (the-as symbol (-> arg0 param 3)))
(set! (-> a1-2 param 1) (the-as uint v1-18))
)
(set! (-> a1-2 param 1)
(the-as uint (static-attack-info ((id (new-attack-id)) (mode (the-as symbol (-> arg0 param 3))))))
)
(set! v0-0 (send-event-function s5-0 a1-2))
)
)
@@ -1411,37 +1393,37 @@
((logtest? (the-as int v1-0) 1)
(cond
((= v1-0 'board)
(if (logtest? (focus-status board) (-> gp-0 focus-status))
(if (focus-test? gp-0 board)
(return #t)
)
)
((= v1-0 'gun)
(if (logtest? (focus-status gun) (-> gp-0 focus-status))
(if (focus-test? gp-0 gun)
(return #t)
)
)
((= v1-0 'mech)
(if (logtest? (focus-status mech) (-> gp-0 focus-status))
(if (focus-test? gp-0 mech)
(return #t)
)
)
((= v1-0 'pilot)
(if (logtest? (focus-status pilot) (-> gp-0 focus-status))
(if (focus-test? gp-0 pilot)
(return #t)
)
)
((= v1-0 'grabbed)
(if (logtest? (-> gp-0 focus-status) (focus-status grabbed))
(if (focus-test? gp-0 grabbed)
(return #t)
)
)
((= v1-0 'indax)
(if (logtest? (focus-status indax) (-> gp-0 focus-status))
(if (focus-test? gp-0 indax)
(return #t)
)
)
((= v1-0 'dark)
(if (logtest? (focus-status dark) (-> gp-0 focus-status))
(if (focus-test? gp-0 dark)
(return #t)
)
)
@@ -1894,11 +1876,11 @@
(let ((v1-1 (command-get-int (-> arg0 param 1) 0)))
(cond
((< v1-1 0)
(send-event (ppointer->process *time-of-day*) 'change 'ratio #x3f800000)
(send-event (ppointer->process *time-of-day*) 'change 'ratio 1.0)
)
(else
(send-event (ppointer->process *time-of-day*) 'change 'hour v1-1)
(send-event (ppointer->process *time-of-day*) 'change 'ratio 0)
(send-event (ppointer->process *time-of-day*) 'change 'ratio 0.0)
)
)
)
@@ -1949,11 +1931,10 @@
(set! (-> v1-109 spec)
'((return macro (drawable-region-prim)) (function macro (symbol)) (id eval (binteger)))
)
(set! (-> v1-109 func)
(lambda ((arg0 script-context))
"lookup a region by number and return the region-prim."
(region-prim-lookup-by-id (command-get-int (-> arg0 param 1) 0) #f 0)
)
(set! (-> v1-109 func) (lambda ((arg0 script-context))
"lookup a region by number and return the region-prim."
(region-prim-lookup-by-id (command-get-int (-> arg0 param 1) 0) #f 0)
)
)
)
@@ -2126,10 +2107,10 @@
(else
(set! a1-14 (ppointer->process (-> *setting-control* user-current movie)))
(cond
(a1-14
(empty)
a1-14
)
((the-as process a1-14)
(empty)
a1-14
)
(else
*entity-pool*
)
@@ -2479,7 +2460,7 @@
(if (and (-> arg0 side-effect?)
*target*
(not *scene-player*)
(zero? (logand (-> *target* focus-status) (focus-status dead)))
(not (logtest? (-> *target* focus-status) (focus-status dead)))
)
(process-spawn scene-player :init scene-player-init (-> arg0 param 1) #t #f)
)
@@ -2972,22 +2953,23 @@
(set! (-> v1-157 name) 'talker-spawn)
(set! (-> v1-157 spec) '((return macro (binteger)) (function macro (symbol)) (message eval (string))))
(set! (-> v1-157 func)
(the-as (function script-context object) (lambda :behavior process
((arg0 script-context))
(if (-> arg0 side-effect?)
(* (talker-spawn-func
(string->talker-speech (the-as string (-> arg0 param 1)))
*entity-pool*
(target-pos 0)
(the-as region (-> arg0 key))
)
8
)
0
)
(none)
)
(the-as
(function script-context object)
(lambda :behavior process
((arg0 script-context))
(if (-> arg0 side-effect?)
(* (talker-spawn-func
(string->talker-speech (the-as string (-> arg0 param 1)))
*entity-pool*
(target-pos 0)
(the-as region (-> arg0 key))
)
8)
0
)
(none)
)
)
)
)
@@ -3065,23 +3047,13 @@
(let ((v1-165 (-> *script-form* 77)))
(set! (-> v1-165 name) 'endlessfall)
(set! (-> v1-165 spec) '((return macro (object)) (function macro (symbol))))
(set! (-> v1-165 func) (lambda :behavior process
((arg0 script-context))
(when (-> arg0 side-effect?)
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer self))
(set! (-> a1-0 num-params) 2)
(set! (-> a1-0 message) 'attack-invinc)
(set! (-> a1-0 param 0) (the-as uint #f))
(let ((v1-4 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-4 id) (the-as uint 2))
(set! (-> v1-4 mode) 'endlessfall)
(set! (-> a1-0 param 1) (the-as uint v1-4))
)
(send-event-function *target* a1-0)
)
)
)
(set! (-> v1-165 func)
(lambda :behavior process
((arg0 script-context))
(if (-> arg0 side-effect?)
(send-event *target* 'attack-invinc #f (static-attack-info ((id (the-as uint 2)) (mode 'endlessfall))))
)
)
)
)
@@ -3158,16 +3130,16 @@
(let ((v1-169 (-> *script-form* 79)))
(set! (-> v1-169 name) 'test-pickup)
(set! (-> v1-169 spec) '((return macro (binteger)) (function macro (symbol)) (pickup macro (symbol))))
(set! (-> v1-169 func)
(lambda ((arg0 script-context)) (case (-> arg0 param 1)
(('gem)
(* (the int (the float (send-event *target* 'test-pickup 21))) 8)
)
(else
0
)
)
)
(set! (-> v1-169 func) (lambda ((arg0 script-context))
(case (-> arg0 param 1)
(('gem)
(* (the int (the float (send-event *target* 'test-pickup (pickup-type gem)))) 8)
)
(else
0
)
)
)
)
)
@@ -3325,10 +3297,10 @@
(else
(set! a1-7 (ppointer->process (-> *setting-control* user-current movie)))
(cond
(a1-7
(empty)
a1-7
)
((the-as process a1-7)
(empty)
a1-7
)
(else
*entity-pool*
)
@@ -3350,13 +3322,11 @@
)
)
(let ((v1-182 (new 'global 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f))))
(let ((v1-182 (new 'global 'script-context (process->ppointer pp) pp (the-as vector #f))))
(set! (-> v1-182 side-effect?) #f)
(set! *syntax-context* v1-182)
)
(define *script-context*
(new 'global 'script-context (the-as basic (process->ppointer pp)) pp (the-as vector #f))
)
(define *script-context* (new 'global 'script-context (process->ppointer pp) pp (the-as vector #f)))
)
+5 -13
View File
@@ -759,19 +759,11 @@ This commonly includes things such as:
)
)
(sound-play "slide-zap")
(let ((a1-8 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-8 from) (process->ppointer self))
(set! (-> a1-8 num-params) 2)
(set! (-> a1-8 message) 'attack-or-shove)
(set! (-> a1-8 param 0) (-> event param 0))
(let ((v1-17 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up id))))
(set! (-> v1-17 id) (-> self attack-id))
(set! (-> v1-17 vector quad) (-> s4-1 quad))
(set! (-> v1-17 shove-back) 32768.0)
(set! (-> v1-17 shove-up) 12288.0)
(set! (-> a1-8 param 1) (the-as uint v1-17))
)
(send-event-function proc a1-8)
(send-event
proc
'attack-or-shove
(-> event param 0)
(static-attack-info ((id (-> self attack-id)) (vector s4-1) (shove-back (meters 8)) (shove-up (meters 3))))
)
)
(let ((v0-0 (current-time)))
@@ -805,25 +805,13 @@ For example for an elevator pre-compute the distance between the first and last
(case arg2
(('touch 'bonk 'attack)
(when (and (-> obj next-state) (= (-> obj next-state name) 'hostile))
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer pp))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'attack)
(set! (-> a1-3 param 0) (the-as uint #f))
(let ((v1-8 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id damage))))
(let* ((a0-7 *game-info*)
(a2-2 (+ (-> a0-7 attack-id) 1))
)
(set! (-> a0-7 attack-id) a2-2)
(set! (-> v1-8 id) a2-2)
)
(set! (-> v1-8 mode) 'shock-green)
(set! (-> v1-8 shove-up) 8192.0)
(set! (-> v1-8 shove-back) 16384.0)
(set! (-> v1-8 damage) 1.0)
(set! (-> a1-3 param 1) (the-as uint v1-8))
(send-event
arg0
'attack
#f
(static-attack-info
((id (new-attack-id)) (mode 'shock-green) (shove-up (meters 2)) (shove-back (meters 4)) (damage 1.0))
)
(send-event-function arg0 a1-3)
)
(cond
((!= arg0 *target*)
+17 -41
View File
@@ -599,31 +599,22 @@ This commonly includes things such as:
(when (and gp-2 (not (logtest? (-> gp-2 focus-status) (focus-status disable dead ignore inactive))))
(let ((s4-3 (get-trans gp-2 0)))
(when (< (vector-vector-distance s4-3 (-> self root trans)) 24576.0)
(let ((s5-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> s5-3 from) (process->ppointer self))
(set! (-> s5-3 num-params) 2)
(set! (-> s5-3 message) 'attack)
(set! (-> s5-3 param 0) (the-as uint #f))
(let ((s3-3 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id))))
(let* ((v1-38 *game-info*)
(a0-29 (+ (-> v1-38 attack-id) 1))
)
(set! (-> v1-38 attack-id) a0-29)
(set! (-> s3-3 id) a0-29)
)
(set! (-> s3-3 vector quad)
(-> (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-3 (-> self root trans)) 1.0) quad)
)
(set! (-> s3-3 shove-back) 24576.0)
(set! (-> s3-3 shove-up) 12288.0)
(set! (-> s3-3 control) (if (focus-test? gp-2 board)
1.0
0.0
)
)
(set! (-> s5-3 param 1) (the-as uint s3-3))
(send-event
gp-2
'attack
#f
(static-attack-info
((id (new-attack-id))
(vector (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-3 (-> self root trans)) 1.0))
(shove-back (meters 6))
(shove-up (meters 3))
(control (if (focus-test? gp-2 board)
1.0
0.0
)
)
)
)
(send-event-function gp-2 s5-3)
)
(let ((s5-4 (new 'stack-no-clear 'vector)))
(set! (-> s5-4 quad) (-> self root trans quad))
@@ -1940,24 +1931,9 @@ This commonly includes things such as:
)
(while s3-0
(let ((a0-3 (get-touched-prim s3-0 (the-as collide-shape (-> self root)) (the-as touching-shapes-entry s4-0))))
(when (= (-> a0-3 prim-id) 1)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (-> event param 0))
(let ((a0-6 (new 'static 'attack-info :mask (attack-info-mask id))))
(let* ((v1-10 *game-info*)
(a2-3 (+ (-> v1-10 attack-id) 1))
)
(set! (-> v1-10 attack-id) a2-3)
(set! (-> a0-6 id) a2-3)
)
(set! (-> a1-2 param 1) (the-as uint a0-6))
)
(send-event-function proc a1-2)
(if (= (-> a0-3 prim-id) 1)
(send-event proc 'attack (-> event param 0) (static-attack-info ((id (new-attack-id)))))
)
)
)
(set! s3-0 (-> s3-0 next))
)
+49 -67
View File
@@ -1274,83 +1274,65 @@
(defmethod general-event-handler bombbot ((obj bombbot) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(with-pp
(case arg2
(('nav-mesh-kill)
(change-to *default-nav-mesh* obj)
#t
)
(('hit-flinch)
(send-event *traffic-manager* 'set-alert-level 1)
(cond
((zero? (-> obj hit-points))
(if (not (and (-> obj next-state) (= (-> obj next-state name) 'die)))
(kill-prefer-falling obj)
)
)
(else
(let ((a1-3 (-> arg3 param 1)))
(when arg0
(let ((v1-14 (find-offending-process-focusable arg0 (the-as attack-info a1-3))))
(when v1-14
(let ((s5-1 (new 'stack-no-clear 'vector)))
(let ((s4-1 (new 'stack-no-clear 'vector)))
(set! (-> s4-1 quad) (-> v1-14 root trans quad))
(let ((s3-1 (matrix->trans (-> obj node-list data 3 bone transform) (new 'stack-no-clear 'vector))))
(+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0)))
(+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0)))
(+! (-> s4-1 z) (* 4096.0 (rand-vu-float-range -20.0 20.0)))
(vector-! s5-1 s3-1 s4-1)
)
)
(vector-normalize! s5-1 4096000.0)
(vector-inv-orient-by-quat! s5-1 s5-1 (-> obj root quat))
(let* ((s4-2 (-> obj rigidbody))
(v1-26 (-> obj rigidbody))
(a1-10 (new 'stack-no-clear 'vector))
(a1-11 (rigid-body-method-23 (-> v1-26 state) a1-10))
)
(rigid-body-method-18 (-> s4-2 state) a1-11 s5-1)
(case arg2
(('nav-mesh-kill)
(change-to *default-nav-mesh* obj)
#t
)
(('hit-flinch)
(send-event *traffic-manager* 'set-alert-level 1)
(cond
((zero? (-> obj hit-points))
(if (not (and (-> obj next-state) (= (-> obj next-state name) 'die)))
(kill-prefer-falling obj)
)
)
(else
(let ((a1-3 (-> arg3 param 1)))
(when arg0
(let ((v1-14 (find-offending-process-focusable arg0 (the-as attack-info a1-3))))
(when v1-14
(let ((s5-1 (new 'stack-no-clear 'vector)))
(let ((s4-1 (new 'stack-no-clear 'vector)))
(set! (-> s4-1 quad) (-> v1-14 root trans quad))
(let ((s3-1 (matrix->trans (-> obj node-list data 3 bone transform) (new 'stack-no-clear 'vector))))
(+! (-> s4-1 x) (* 4096.0 (rand-vu-float-range -20.0 20.0)))
(+! (-> s4-1 y) (* 4096.0 (rand-vu-float-range -20.0 20.0)))
(+! (-> s4-1 z) (* 4096.0 (rand-vu-float-range -20.0 20.0)))
(vector-! s5-1 s3-1 s4-1)
)
)
(vector-normalize! s5-1 4096000.0)
(vector-inv-orient-by-quat! s5-1 s5-1 (-> obj root quat))
(let* ((s4-2 (-> obj rigidbody))
(v1-26 (-> obj rigidbody))
(a1-10 (new 'stack-no-clear 'vector))
(a1-11 (rigid-body-method-23 (-> v1-26 state) a1-10))
)
(rigid-body-method-18 (-> s4-2 state) a1-11 s5-1)
)
)
)
)
)
'back
)
'back
)
)
(('explode)
(if (not (and (-> obj next-state) (= (-> obj next-state name) 'explode)))
(go (method-of-object obj explode))
)
)
(('touched 'touch 'attack)
(when (logtest? (process-mask vehicle) (-> arg0 mask))
(let ((a1-14 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-14 from) (process->ppointer pp))
(set! (-> a1-14 num-params) 2)
(set! (-> a1-14 message) 'attack)
(set! (-> a1-14 param 0) (-> arg3 param 0))
(let ((v1-43 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-27 *game-info*)
(a2-4 (+ (-> a0-27 attack-id) 1))
)
(set! (-> a0-27 attack-id) a2-4)
(set! (-> v1-43 id) a2-4)
)
(set! (-> v1-43 mode) 'mine)
(set! (-> a1-14 param 1) (the-as uint v1-43))
)
(send-event-function arg0 a1-14)
)
)
(('explode)
(if (not (and (-> obj next-state) (= (-> obj next-state name) 'explode)))
(go (method-of-object obj explode))
)
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
(('touched 'touch 'attack)
(if (logtest? (process-mask vehicle) (-> arg0 mask))
(send-event arg0 'attack (-> arg3 param 0) (static-attack-info ((id (new-attack-id)) (mode 'mine))))
)
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
)
+26 -44
View File
@@ -190,58 +190,40 @@
)
(defmethod security-wall-method-24 security-wall ((obj security-wall))
(with-pp
(let ((s4-0 *target*))
(when s4-0
(let* ((f0-0 (vector-vector-distance-squared (-> obj root trans) (-> s4-0 control trans)))
(f30-0 (+ 40960.0 (-> obj root root-prim local-sphere w)))
(f1-1 f30-0)
)
(when (< f0-0 (* f1-1 f1-1))
(let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1)))
(set! (-> s5-0 0 quad) (-> s4-0 control trans quad))
(when (< (vector-vector-distance-squared (-> obj root trans) (-> obj target-pos)) (* f30-0 f30-0))
(let ((f0-3 (vector4-dot (-> obj target-pos) (the-as vector (-> obj plane))))
(f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> obj plane))))
)
(if (and (< (fabs f1-7) 16384.0)
(< (fabs f0-3) 16384.0)
(or (and (< f0-3 0.0) (>= f1-7 0.0)) (and (< f1-7 0.0) (>= f0-3 0.0)))
)
(set! (-> obj breach) #t)
)
)
)
(set! (-> obj target-pos quad) (-> s5-0 0 quad))
)
(when (-> obj breach)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer pp))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack-invinc)
(set! (-> a1-2 param 0) (the-as uint #f))
(let ((v1-32 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-11 *game-info*)
(a2-1 (+ (-> a0-11 attack-id) 1))
(let ((s4-0 *target*))
(when s4-0
(let* ((f0-0 (vector-vector-distance-squared (-> obj root trans) (-> s4-0 control trans)))
(f30-0 (+ 40960.0 (-> obj root root-prim local-sphere w)))
(f1-1 f30-0)
)
(when (< f0-0 (* f1-1 f1-1))
(let ((s5-0 (new 'stack-no-clear 'inline-array 'vector 1)))
(set! (-> s5-0 0 quad) (-> s4-0 control trans quad))
(when (< (vector-vector-distance-squared (-> obj root trans) (-> obj target-pos)) (* f30-0 f30-0))
(let ((f0-3 (vector4-dot (-> obj target-pos) (the-as vector (-> obj plane))))
(f1-7 (vector4-dot (-> s5-0 0) (the-as vector (-> obj plane))))
)
(if (and (< (fabs f1-7) 16384.0)
(< (fabs f0-3) 16384.0)
(or (and (< f0-3 0.0) (>= f1-7 0.0)) (and (< f1-7 0.0) (>= f0-3 0.0)))
)
(set! (-> a0-11 attack-id) a2-1)
(set! (-> v1-32 id) a2-1)
)
(set! (-> v1-32 mode) 'grenade)
(set! (-> a1-2 param 1) (the-as uint v1-32))
)
(if (send-event-function *target* a1-2)
(set! (-> obj breach) #f)
(set! (-> obj breach) #t)
)
)
)
(set! (-> obj target-pos quad) (-> s5-0 0 quad))
)
(when (-> obj breach)
(if (send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'grenade))))
(set! (-> obj breach) #f)
)
)
)
)
)
0
(none)
)
0
(none)
)
(defstate idle-close (security-wall)
@@ -1383,7 +1365,7 @@ This commonly includes things such as:
)
(+! (-> self hit-points) -10)
)
((logtest? (attack-info-mask damage) (-> (the-as attack-info v1-5) mask))
((logtest? (attack-mask damage) (-> (the-as attack-info v1-5) mask))
(set! (-> self hit-points) (- (-> self hit-points) (the int (-> (the-as attack-info v1-5) damage))))
)
(else
@@ -486,60 +486,45 @@ This commonly includes things such as:
(defmethod check-vehicle-exit crocadog-escort ((obj crocadog-escort))
(local-vars (v1-22 enemy-flag))
(with-pp
(when (focus-test? obj pilot)
(let ((v1-4 (handle->process (-> obj vehicle-handle))))
(when (or (not v1-4) (logtest? (-> (the-as vehicle v1-4) flags) (rigid-body-object-flag dead)))
(logior! (-> obj bot-flags) (bot-flags bf17))
(logclear! (-> obj bot-flags) (bot-flags bf15))
(logclear! (-> obj focus-status) (focus-status pilot-riding pilot))
(set! (-> obj vehicle-seat-index) -1)
(set! (-> obj vehicle-handle) (the-as handle #f))
(logior! (-> obj root nav-flags) (nav-flags has-root-sphere))
(let* ((s5-0 (-> obj root quat))
(f30-0 (quaternion-y-angle s5-0))
)
(quaternion-identity! s5-0)
(quaternion-rotate-y! s5-0 s5-0 f30-0)
)
(let ((v1-21 (-> obj enemy-flags)))
(if (logtest? v1-21 (enemy-flag checking-water))
(set! v1-22 (logior v1-21 (enemy-flag enable-on-active)))
(set! v1-22 (logclear v1-21 (enemy-flag enable-on-active)))
)
)
(set! (-> obj enemy-flags) v1-22)
(let ((f30-2 (+ 16384.0 (quaternion-y-angle (-> obj root quat))))
(s5-1 (new 'stack-no-clear 'vector))
)
(set-vector! s5-1 (sin f30-2) 0.0 (cos f30-2) 1.0)
(vector-normalize! s5-1 65536.0)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer pp))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'attack)
(set! (-> a1-3 param 0) (the-as uint #f))
(let ((v1-29 (new 'static 'attack-info :mask (attack-info-mask vector id attacker-velocity knock))))
(let* ((a0-24 *game-info*)
(a2-2 (+ (-> a0-24 attack-id) 1))
)
(set! (-> a0-24 attack-id) a2-2)
(set! (-> v1-29 id) a2-2)
)
(set! (-> v1-29 vector quad) (-> s5-1 quad))
(set! (-> v1-29 attacker-velocity quad) (-> s5-1 quad))
(set! (-> v1-29 knock) (the-as uint 8))
(set! (-> a1-3 param 1) (the-as uint v1-29))
)
(send-event-function obj a1-3)
(when (focus-test? obj pilot)
(let ((v1-4 (handle->process (-> obj vehicle-handle))))
(when (or (not v1-4) (logtest? (-> (the-as vehicle v1-4) flags) (rigid-body-object-flag dead)))
(logior! (-> obj bot-flags) (bot-flags bf17))
(logclear! (-> obj bot-flags) (bot-flags bf15))
(logclear! (-> obj focus-status) (focus-status pilot-riding pilot))
(set! (-> obj vehicle-seat-index) -1)
(set! (-> obj vehicle-handle) (the-as handle #f))
(logior! (-> obj root nav-flags) (nav-flags has-root-sphere))
(let* ((s5-0 (-> obj root quat))
(f30-0 (quaternion-y-angle s5-0))
)
(quaternion-identity! s5-0)
(quaternion-rotate-y! s5-0 s5-0 f30-0)
)
(let ((v1-21 (-> obj enemy-flags)))
(if (logtest? v1-21 (enemy-flag checking-water))
(set! v1-22 (logior v1-21 (enemy-flag enable-on-active)))
(set! v1-22 (logclear v1-21 (enemy-flag enable-on-active)))
)
)
(set! (-> obj enemy-flags) v1-22)
(let ((f30-2 (+ 16384.0 (quaternion-y-angle (-> obj root quat))))
(s5-1 (new 'stack-no-clear 'vector))
)
(set-vector! s5-1 (sin f30-2) 0.0 (cos f30-2) 1.0)
(vector-normalize! s5-1 65536.0)
(send-event
obj
'attack
#f
(static-attack-info ((id (new-attack-id)) (vector s5-1) (attacker-velocity s5-1) (knock (the-as uint 8))))
)
)
)
)
0
(none)
)
0
(none)
)
(defmethod go-hostile crocadog-escort ((obj crocadog-escort))
@@ -693,60 +693,45 @@ This commonly includes things such as:
(defmethod check-vehicle-exit kid-escort ((obj kid-escort))
(local-vars (v1-25 enemy-flag))
(with-pp
(when (focus-test? obj pilot)
(let ((s5-0 (handle->process (-> obj vehicle-handle))))
(when (or (not s5-0) (logtest? (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag dead)))
(logior! (-> obj bot-flags) (bot-flags bf17))
(logclear! (-> obj bot-flags) (bot-flags bf15))
(logclear! (-> obj focus-status) (focus-status pilot-riding pilot))
(if (the-as vehicle s5-0)
(remove-rider (the-as vehicle s5-0) obj)
)
(set! (-> obj vehicle-seat-index) -1)
(set! (-> obj vehicle-handle) (the-as handle #f))
(logior! (-> obj root nav-flags) (nav-flags has-root-sphere))
(let* ((s4-0 (-> obj root quat))
(f30-0 (quaternion-y-angle s4-0))
)
(quaternion-identity! s4-0)
(quaternion-rotate-y! s4-0 s4-0 f30-0)
(when (focus-test? obj pilot)
(let ((s5-0 (handle->process (-> obj vehicle-handle))))
(when (or (not s5-0) (logtest? (-> (the-as vehicle s5-0) flags) (rigid-body-object-flag dead)))
(logior! (-> obj bot-flags) (bot-flags bf17))
(logclear! (-> obj bot-flags) (bot-flags bf15))
(logclear! (-> obj focus-status) (focus-status pilot-riding pilot))
(if (the-as vehicle s5-0)
(remove-rider (the-as vehicle s5-0) obj)
)
(let ((v1-24 (-> obj enemy-flags)))
(if (logtest? v1-24 (enemy-flag checking-water))
(set! v1-25 (logior v1-24 (enemy-flag enable-on-active)))
(set! v1-25 (logclear v1-24 (enemy-flag enable-on-active)))
)
)
(set! (-> obj enemy-flags) v1-25)
(let ((s4-2 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as vehicle s5-0) root trans))))
(vector-normalize! s4-2 57344.0)
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) (process->ppointer pp))
(set! (-> a1-4 num-params) 2)
(set! (-> a1-4 message) 'attack)
(set! (-> a1-4 param 0) (the-as uint #f))
(let ((v1-31 (new 'static 'attack-info :mask (attack-info-mask vector id attacker-velocity knock))))
(let* ((a0-23 *game-info*)
(a2-2 (+ (-> a0-23 attack-id) 1))
)
(set! (-> a0-23 attack-id) a2-2)
(set! (-> v1-31 id) a2-2)
)
(set! (-> v1-31 vector quad) (-> s4-2 quad))
(set! (-> v1-31 attacker-velocity quad) (-> s4-2 quad))
(set! (-> v1-31 knock) (the-as uint 8))
(set! (-> a1-4 param 1) (the-as uint v1-31))
)
(send-event-function obj a1-4)
(set! (-> obj vehicle-seat-index) -1)
(set! (-> obj vehicle-handle) (the-as handle #f))
(logior! (-> obj root nav-flags) (nav-flags has-root-sphere))
(let* ((s4-0 (-> obj root quat))
(f30-0 (quaternion-y-angle s4-0))
)
(quaternion-identity! s4-0)
(quaternion-rotate-y! s4-0 s4-0 f30-0)
)
(let ((v1-24 (-> obj enemy-flags)))
(if (logtest? v1-24 (enemy-flag checking-water))
(set! v1-25 (logior v1-24 (enemy-flag enable-on-active)))
(set! v1-25 (logclear v1-24 (enemy-flag enable-on-active)))
)
)
(set! (-> obj enemy-flags) v1-25)
(let ((s4-2 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as vehicle s5-0) root trans))))
(vector-normalize! s4-2 57344.0)
(send-event
obj
'attack
#f
(static-attack-info ((id (new-attack-id)) (vector s4-2) (attacker-velocity s4-2) (knock (the-as uint 8))))
)
)
)
)
0
(none)
)
0
(none)
)
(defmethod go-hostile kid-escort ((obj kid-escort))
@@ -1470,20 +1470,13 @@ This commonly includes things such as:
(v1-1 (new 'stack-no-clear 'vector))
)
(vector-! v1-1 (-> self root trans) (-> self prev-pos))
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) (process->ppointer self))
(set! (-> a1-4 num-params) 2)
(set! (-> a1-4 message) 'attack)
(set! (-> a1-4 param 0) a2-1)
(let ((a2-2 (new 'static 'attack-info :mask (attack-info-mask mode id attacker-velocity damage knock))))
(set! (-> a2-2 id) (-> self attack-id))
(set! (-> a2-2 mode) 'eco-red)
(set! (-> a2-2 attacker-velocity quad) (-> v1-1 quad))
(set! (-> a2-2 damage) 2.0)
(set! (-> a2-2 knock) (the-as uint 2))
(set! (-> a1-4 param 1) (the-as uint a2-2))
(send-event
proc
'attack
a2-1
(static-attack-info
((id (-> self attack-id)) (mode 'eco-red) (attacker-velocity v1-1) (damage 2.0) (knock (the-as uint 2)))
)
(send-event-function proc a1-4)
)
)
)
@@ -1880,24 +1880,7 @@
(let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))))
(set! (-> gp-0 y) 1.0)
(vector-normalize! gp-0 40960.0)
(let ((a1-6 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-6 from) (process->ppointer self))
(set! (-> a1-6 num-params) 2)
(set! (-> a1-6 message) 'attack)
(set! (-> a1-6 param 0) (the-as uint #f))
(let ((v1-15 (new 'static 'attack-info :mask (attack-info-mask vector id knock))))
(let* ((a0-11 *game-info*)
(a2-1 (+ (-> a0-11 attack-id) 1))
)
(set! (-> a0-11 attack-id) a2-1)
(set! (-> v1-15 id) a2-1)
)
(set! (-> v1-15 vector quad) (-> gp-0 quad))
(set! (-> v1-15 knock) (the-as uint 7))
(set! (-> a1-6 param 1) (the-as uint v1-15))
)
(send-event-function self a1-6)
)
(send-event self 'attack #f (static-attack-info ((id (new-attack-id)) (vector gp-0) (knock (the-as uint 7)))))
)
)
)
@@ -1099,23 +1099,7 @@
(('touched 'touch 'attack)
(cond
((logtest? (process-mask projectile vehicle) (-> proc mask))
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-7 from) (process->ppointer self))
(set! (-> a1-7 num-params) 2)
(set! (-> a1-7 message) 'attack)
(set! (-> a1-7 param 0) (-> event param 0))
(let ((v1-7 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a2-4 *game-info*)
(a3-2 (+ (-> a2-4 attack-id) 1))
)
(set! (-> a2-4 attack-id) a3-2)
(set! (-> v1-7 id) a3-2)
)
(set! (-> v1-7 mode) 'mine)
(set! (-> a1-7 param 1) (the-as uint v1-7))
)
(send-event-function proc a1-7)
)
(send-event proc 'attack (-> event param 0) (static-attack-info ((id (new-attack-id)) (mode 'mine))))
(set! (-> self beep) #f)
)
(else
@@ -1229,49 +1229,30 @@ This commonly includes things such as:
)
(defmethod throw-off-vehicle citizen ((obj citizen))
(with-pp
(let ((s4-0 (handle->process (-> obj vehicle))))
(let ((v1-4 (-> obj root root-prim)))
(set! (-> v1-4 prim-core collide-as) (-> obj root backup-collide-as))
(set! (-> v1-4 prim-core collide-with) (-> obj root backup-collide-with))
)
(when s4-0
(let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as vehicle s4-0) root trans))))
(let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> (the-as vehicle s4-0) root quat)))
(v1-10 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as vehicle s4-0) root quat)))
)
(if (< 0.0 (vector-dot s5-1 s3-0))
(vector+! s5-1 v1-10 s3-0)
(vector-! s5-1 v1-10 s3-0)
)
)
(vector-normalize! s5-1 32768.0)
(set! (-> s5-1 y) 71680.0)
(vector+! s5-1 s5-1 (-> (the-as vehicle s4-0) root transv))
(let ((a1-8 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-8 from) (process->ppointer pp))
(set! (-> a1-8 num-params) 2)
(set! (-> a1-8 message) 'attack)
(set! (-> a1-8 param 0) (the-as uint #f))
(let ((v1-16 (new 'static 'attack-info :mask (attack-info-mask vector id knock))))
(let* ((a0-22 *game-info*)
(a2-1 (+ (-> a0-22 attack-id) 1))
)
(set! (-> a0-22 attack-id) a2-1)
(set! (-> v1-16 id) a2-1)
)
(set! (-> v1-16 vector quad) (-> s5-1 quad))
(set! (-> v1-16 knock) (the-as uint 7))
(set! (-> a1-8 param 1) (the-as uint v1-16))
(let ((s4-0 (handle->process (-> obj vehicle))))
(let ((v1-4 (-> obj root root-prim)))
(set! (-> v1-4 prim-core collide-as) (-> obj root backup-collide-as))
(set! (-> v1-4 prim-core collide-with) (-> obj root backup-collide-with))
)
(when s4-0
(let ((s5-1 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) (-> (the-as vehicle s4-0) root trans))))
(let ((s3-0 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> (the-as vehicle s4-0) root quat)))
(v1-10 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> (the-as vehicle s4-0) root quat)))
)
(if (< 0.0 (vector-dot s5-1 s3-0))
(vector+! s5-1 v1-10 s3-0)
(vector-! s5-1 v1-10 s3-0)
)
(send-event-function obj a1-8)
)
)
(vector-normalize! s5-1 32768.0)
(set! (-> s5-1 y) 71680.0)
(vector+! s5-1 s5-1 (-> (the-as vehicle s4-0) root transv))
(send-event obj 'attack #f (static-attack-info ((id (new-attack-id)) (vector s5-1) (knock (the-as uint 7)))))
)
)
0
(none)
)
0
(none)
)
(defstate in-ditch (citizen)
@@ -392,22 +392,11 @@
)
)
(dotimes (gp-1 (-> self info seat-count))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack-invinc)
(set! (-> a1-2 param 0) (the-as uint #f))
(let ((v1-14 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-4 *game-info*)
(a2-1 (+ (-> a0-4 attack-id) 1))
)
(set! (-> a0-4 attack-id) a2-1)
(set! (-> v1-14 id) a2-1)
)
(set! (-> v1-14 mode) 'big-explosion)
(set! (-> a1-2 param 1) (the-as uint v1-14))
)
(send-event-function (handle->process (-> self rider-array gp-1)) a1-2)
(send-event
(handle->process (-> self rider-array gp-1))
'attack-invinc
#f
(static-attack-info ((id (new-attack-id)) (mode 'big-explosion)))
)
(put-rider-in-seat self gp-1 (the-as process-focusable #f))
)
@@ -897,23 +897,11 @@
((logtest? (do-push-aways s5-0) (collide-spec jak))
(+! (-> obj overlap-player-counter) 1)
(when (< (the-as uint 60) (-> obj overlap-player-counter))
(let ((a1-9 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-9 from) (process->ppointer pp))
(set! (-> a1-9 num-params) 2)
(set! (-> a1-9 message) 'attack-invinc)
(set! (-> a1-9 param 0) (the-as uint #f))
(let ((v1-56 (new 'static 'attack-info :mask (attack-info-mask mode id damage))))
(let* ((a0-29 *game-info*)
(a2-3 (+ (-> a0-29 attack-id) 1))
)
(set! (-> a0-29 attack-id) a2-3)
(set! (-> v1-56 id) a2-3)
)
(set! (-> v1-56 mode) 'smush)
(set! (-> v1-56 damage) 1000.0)
(set! (-> a1-9 param 1) (the-as uint v1-56))
)
(send-event-function *target* a1-9)
(send-event
*target*
'attack-invinc
#f
(static-attack-info ((id (new-attack-id)) (mode 'smush) (damage 1000.0)))
)
(set! (-> obj overlap-player-counter) (the-as uint 0))
0
@@ -1483,7 +1471,7 @@
(let ((s5-0 (new 'stack-no-clear 'matrix)))
(rigid-body-object-method-49 obj (the-as rigid-body-impact s5-0) arg2)
(cond
((logtest? (attack-info-mask attacker-velocity) (-> arg1 mask))
((logtest? (attack-mask attacker-velocity) (-> arg1 mask))
(set! (-> s5-0 vector 2 quad) (-> arg1 attacker-velocity quad))
)
(else
@@ -1518,7 +1506,7 @@
0.2
)
((or (logtest? (penetrate dark-giant) arg3)
(and (logtest? (-> arg1 mask) (attack-info-mask mode)) (= (-> arg1 mode) 'eco-dark))
(and (logtest? (-> arg1 mask) (attack-mask mode)) (= (-> arg1 mode) 'eco-dark))
)
(set! (-> s5-0 vector 2 y) (* 0.1 (-> s5-0 vector 2 y)))
(set! f0-2 (* 409600.0 (-> obj info info mass)))
@@ -1551,11 +1539,11 @@
0.5
)
((or (logtest? (penetrate explode) arg3)
(and (logtest? (-> arg1 mask) (attack-info-mask mode)) (case (-> arg1 mode)
(('explode 'grenade 'melt 'ice)
#t
)
)
(and (logtest? (-> arg1 mask) (attack-mask mode)) (case (-> arg1 mode)
(('explode 'grenade 'melt 'ice)
#t
)
)
)
)
(set! f0-2 122880.0)
@@ -1688,15 +1676,17 @@
(set! (-> s1-0 num-params) 2)
(set! (-> s1-0 message) 'attack)
(set! (-> s1-0 param 0) (the-as uint arg1))
(let ((s0-0 (new 'static 'attack-info :mask (attack-info-mask vector attacker mode id penetrate-using damage))))
(set! (-> s0-0 id) (-> obj outgoing-attack-id))
(set! (-> s0-0 attacker) (process->handle (vehicle-method-70 obj)))
(set! (-> s0-0 mode) 'vehicle)
(set! (-> s0-0 vector quad) (-> s2-0 quad))
(set! (-> s0-0 penetrate-using) (penetrate vehicle))
(set! (-> s0-0 damage) f30-1)
(set! (-> s1-0 param 1) (the-as uint s0-0))
)
(set! (-> s1-0 param 1)
(the-as uint (static-attack-info ((id (-> obj outgoing-attack-id))
(attacker (process->handle (vehicle-method-70 obj)))
(mode 'vehicle)
(vector s2-0)
(penetrate-using (penetrate vehicle))
(damage f30-1)
)
)
)
)
(b! (not (send-event-function arg0 s1-0)) cfg-25 :delay (empty-form))
)
)
+18 -37
View File
@@ -941,46 +941,27 @@
(defmethod enemy-method-104 bot ((obj bot) (arg0 process) (arg1 touching-shapes-entry) (arg2 uint))
(cond
((and (= (-> arg0 type) target) (not (logtest? (-> obj bot-flags) (bot-flags attacked))))
(let ((a1-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-1 from) (process->ppointer self))
(set! (-> a1-1 num-params) 2)
(set! (-> a1-1 message) 'shove)
(set! (-> a1-1 param 0) (the-as uint #f))
(let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(let* ((a0-6 *game-info*)
(a2-2 (+ (-> a0-6 attack-id) 1))
)
(set! (-> a0-6 attack-id) a2-2)
(set! (-> v1-6 id) a2-2)
)
(set! (-> v1-6 shove-back) 8192.0)
(set! (-> v1-6 shove-up) 6144.0)
(set! (-> a1-1 param 1) (the-as uint v1-6))
)
(when (send-event-function arg0 a1-1)
(set! (-> obj root penetrated-by) (the-as penetrate -1))
(enemy-method-49 obj)
#t
)
(when (send-event
arg0
'shove
#f
(static-attack-info ((id (new-attack-id)) (shove-back (meters 2)) (shove-up (meters 1.5))))
)
(set! (-> obj root penetrated-by) (the-as penetrate -1))
(enemy-method-49 obj)
#t
)
)
(else
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (the-as uint arg1))
(let ((v1-14 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id))))
(set! (-> v1-14 id) arg2)
(set! (-> v1-14 shove-back) (-> obj enemy-info attack-shove-back))
(set! (-> v1-14 shove-up) (-> obj enemy-info attack-shove-up))
(set! (-> v1-14 mode) (-> obj enemy-info attack-mode))
(set! (-> a1-2 param 1) (the-as uint v1-14))
)
(when (send-event-function arg0 a1-2)
(enemy-method-105 obj arg0)
#t
)
(when (send-event arg0 'attack arg1 (static-attack-info ((id arg2)
(shove-back (-> obj enemy-info attack-shove-back))
(shove-up (-> obj enemy-info attack-shove-up))
(mode (-> obj enemy-info attack-mode))
)
)
)
(enemy-method-105 obj arg0)
#t
)
)
)
+15 -22
View File
@@ -376,29 +376,22 @@
)
(< (fabs (-> s3-1 y)) (-> self wall-y))
)
(let ((evt (new 'stack-no-clear 'event-message-block)))
(set! (-> evt from) (process->ppointer self))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'attack)
(set! (-> evt param 0) (the-as uint #f))
(let ((attack (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id))))
(let* ((game-info *game-info*)
(attack-id (+ (-> game-info attack-id) 1))
)
(set! (-> game-info attack-id) attack-id)
(set! (-> attack id) attack-id)
)
(set! (-> attack vector quad) (-> s4-0 dir quad))
(set! (-> attack shove-back) 24576.0)
(set! (-> attack shove-up) 12288.0)
(set! (-> attack control) (if (focus-test? proc-focus board)
1.0
0.0
)
)
(set! (-> evt param 1) (the-as uint attack))
(send-event
proc-focus
'attack
#f
(static-attack-info
((id (new-attack-id))
(vector (-> s4-0 dir))
(shove-back (meters 6))
(shove-up (meters 3))
(control (if (focus-test? proc-focus board)
1.0
0.0
)
)
)
)
(send-event-function proc-focus evt)
)
(let* ((s4-1 (-> self l-bolt))
(s3-2 (get-point-at-percent-along-path! (-> self path) (new 'stack-no-clear 'vector) (-> s4-1 0 pos) 'interp))
@@ -761,55 +761,45 @@
)
(defmethod amphibian-method-186 amphibian ((obj amphibian) (arg0 vector) (arg1 vector))
(with-pp
(let ((s4-0 (new 'stack-no-clear 'collide-query))
(s5-0 (new 'stack-no-clear 'vector))
)
(set! (-> s4-0 start-pos quad) (-> arg0 quad))
(vector-! (-> s4-0 move-dist) arg1 arg0)
(set! (-> s5-0 quad) (-> s4-0 move-dist quad))
(let ((v1-4 s4-0))
(set! (-> v1-4 radius) 409.6)
(set! (-> v1-4 collide-with) (collide-spec jak bot enemy obstacle hit-by-others-list player-list pusher))
(set! (-> v1-4 ignore-process0) obj)
(set! (-> v1-4 ignore-process1) #f)
(set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-4 action-mask) (collide-action solid))
(let ((s4-0 (new 'stack-no-clear 'collide-query))
(s5-0 (new 'stack-no-clear 'vector))
)
(when (>= (fill-and-probe-using-line-sphere *collide-cache* s4-0) 0.0)
(let* ((s3-0 (-> s4-0 best-other-tri collide-ptr))
(s4-1 (if (type? s3-0 collide-shape-prim-sphere)
(the-as collide-shape-prim-sphere s3-0)
)
)
)
(when s4-1
(set! (-> s5-0 y) 0.0)
(vector-normalize! s5-0 1.0)
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) (process->ppointer pp))
(set! (-> a1-4 num-params) 2)
(set! (-> a1-4 message) 'attack)
(set! (-> a1-4 param 0) (the-as uint #f))
(let ((v1-11 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up id damage))))
(let* ((a0-14 *game-info*)
(a2-2 (+ (-> a0-14 attack-id) 1))
(set! (-> s4-0 start-pos quad) (-> arg0 quad))
(vector-! (-> s4-0 move-dist) arg1 arg0)
(set! (-> s5-0 quad) (-> s4-0 move-dist quad))
(let ((v1-4 s4-0))
(set! (-> v1-4 radius) 409.6)
(set! (-> v1-4 collide-with) (collide-spec jak bot enemy obstacle hit-by-others-list player-list pusher))
(set! (-> v1-4 ignore-process0) obj)
(set! (-> v1-4 ignore-process1) #f)
(set! (-> v1-4 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-4 action-mask) (collide-action solid))
)
(when (>= (fill-and-probe-using-line-sphere *collide-cache* s4-0) 0.0)
(let* ((s3-0 (-> s4-0 best-other-tri collide-ptr))
(s4-1 (if (type? s3-0 collide-shape-prim-sphere)
(the-as collide-shape-prim-sphere s3-0)
)
(set! (-> a0-14 attack-id) a2-2)
(set! (-> v1-11 id) a2-2)
)
(set! (-> v1-11 vector quad) (-> s5-0 quad))
(set! (-> v1-11 shove-back) 16384.0)
(set! (-> v1-11 shove-up) 12288.0)
(set! (-> v1-11 damage) (the float (-> obj enemy-info attack-damage)))
(set! (-> a1-4 param 1) (the-as uint v1-11))
)
(send-event-function (-> s4-1 cshape process) a1-4)
)
)
)
(when s4-1
(set! (-> s5-0 y) 0.0)
(vector-normalize! s5-0 1.0)
(send-event
(-> s4-1 cshape process)
'attack
#f
(static-attack-info ((id (new-attack-id))
(vector s5-0)
(shove-back (meters 4))
(shove-up (meters 3))
(damage (the float (-> obj enemy-info attack-damage)))
)
)
)
)
#t
)
#t
)
)
)
+88 -98
View File
@@ -420,119 +420,109 @@
(defmethod general-event-handler centurion ((obj centurion) (arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(with-pp
(case arg2
(('jump)
#f
)
(('touch)
(cond
((and (-> obj next-state) (= (-> obj next-state name) 'attack))
(let ((s4-1 (-> arg3 param 0)))
(let ((s3-1 arg0))
(if (type? s3-1 process-focusable)
(empty)
)
)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer pp))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack-or-shove)
(set! (-> a1-2 param 0) s4-1)
(let ((v1-10 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id))))
(let* ((a0-6 *game-info*)
(a2-2 (+ (-> a0-6 attack-id) 1))
)
(set! (-> a0-6 attack-id) a2-2)
(set! (-> v1-10 id) a2-2)
)
(set! (-> v1-10 shove-back) (* 2.0 (-> obj enemy-info attack-shove-back)))
(set! (-> v1-10 shove-up) (* 2.0 (-> obj enemy-info attack-shove-up)))
(set! (-> v1-10 mode) 'deadly)
(set! (-> a1-2 param 1) (the-as uint v1-10))
(case arg2
(('jump)
#f
)
(('touch)
(cond
((and (-> obj next-state) (= (-> obj next-state name) 'attack))
(let ((s4-1 (-> arg3 param 0)))
(let ((s3-1 arg0))
(if (type? s3-1 process-focusable)
(empty)
)
(send-event-function arg0 a1-2)
)
(send-event
arg0
'attack-or-shove
s4-1
(static-attack-info ((id (new-attack-id))
(shove-back (* 2.0 (-> obj enemy-info attack-shove-back)))
(shove-up (* 2.0 (-> obj enemy-info attack-shove-up)))
(mode 'deadly)
)
)
)
)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
)
(('attack)
(let ((v1-12 (the-as object (-> arg3 param 1))))
(cond
((!= (-> (the-as attack-info v1-12) id) (-> obj incoming-attack-id))
(set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-12) id))
(cond
((or (-> obj can-take-damage?)
(logtest? (penetrate dark-skin dark-punch dark-bomb) (-> (the-as attack-info v1-12) penetrate-using))
)
(cond
((and (-> obj next-state) (= (-> obj next-state name) 'fire))
(centurion-method-180 obj)
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
)
(else
(+! (-> obj shield-shot) 1)
(if (= (-> obj shield-shot) 4)
(talker-spawn-func (-> *talker-speech* 58) *entity-pool* (target-pos 0) (the-as region #f))
)
(set! (-> *part-id-table* 2102 init-specs 13 initial-valuef) 255.0)
(set! (-> obj state-time) (current-time))
'back
)
)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
#f
)
)
)
(('attack)
(let ((v1-12 (the-as object (-> arg3 param 1))))
(cond
((!= (-> (the-as attack-info v1-12) id) (-> obj incoming-attack-id))
(set! (-> obj incoming-attack-id) (-> (the-as attack-info v1-12) id))
(cond
((or (-> obj can-take-damage?)
(logtest? (penetrate dark-skin dark-punch dark-bomb) (-> (the-as attack-info v1-12) penetrate-using))
)
(('victory)
(if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'victory)))
(and (> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(not (logtest? (-> obj focus-status) (focus-status grabbed)))
)
(cond
((and (-> obj next-state) (= (-> obj next-state name) 'fire))
(centurion-method-180 obj)
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
)
(else
(+! (-> obj shield-shot) 1)
(if (= (-> obj shield-shot) 4)
(talker-spawn-func (-> *talker-speech* 58) *entity-pool* (target-pos 0) (the-as region #f))
)
(set! (-> *part-id-table* 2102 init-specs 13 initial-valuef) 255.0)
(set! (-> obj state-time) (current-time))
'back
)
)
)
(else
#f
)
)
(go (method-of-object obj victory))
)
)
(('victory)
(if (and (not (and (-> obj next-state) (= (-> obj next-state name) 'victory)))
(and (> (-> obj hit-points) 0)
(zero? (-> obj fated-time))
(not (logtest? (-> obj focus-status) (focus-status grabbed)))
)
)
(go (method-of-object obj victory))
)
)
(('notify)
(let ((v1-47 (handle->process (-> obj focus handle))))
(when (and (= (-> arg3 param 0) 'attack)
(= (-> arg3 param 1) v1-47)
(-> obj next-state)
(let ((v1-52 (-> obj next-state name)))
(or (= v1-52 'hostile) (= v1-52 'fire))
)
)
(('notify)
(let ((v1-47 (handle->process (-> obj focus handle))))
(when (and (= (-> arg3 param 0) 'attack)
(= (-> arg3 param 1) v1-47)
(-> obj next-state)
(let ((v1-52 (-> obj next-state name)))
(or (= v1-52 'hostile) (= v1-52 'fire))
)
(let ((a1-13 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-13 from) (process->ppointer arg0))
(set! (-> a1-13 num-params) arg1)
(set! (-> a1-13 message) 'victory)
(set! (-> a1-13 param 0) (-> arg3 param 0))
(set! (-> a1-13 param 1) (-> arg3 param 1))
(set! (-> a1-13 param 2) (-> arg3 param 2))
(set! (-> a1-13 param 3) (-> arg3 param 3))
(set! (-> a1-13 param 4) (-> arg3 param 4))
(set! (-> a1-13 param 5) (-> arg3 param 5))
(send-event-function obj a1-13)
)
)
(let ((a1-13 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-13 from) (process->ppointer arg0))
(set! (-> a1-13 num-params) arg1)
(set! (-> a1-13 message) 'victory)
(set! (-> a1-13 param 0) (-> arg3 param 0))
(set! (-> a1-13 param 1) (-> arg3 param 1))
(set! (-> a1-13 param 2) (-> arg3 param 2))
(set! (-> a1-13 param 3) (-> arg3 param 3))
(set! (-> a1-13 param 4) (-> arg3 param 4))
(set! (-> a1-13 param 5) (-> arg3 param 5))
(send-event-function obj a1-13)
)
)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
)
@@ -2438,252 +2438,234 @@
;; WARN: Return type mismatch object vs none.
(defmethod crimson-guard-level-method-198 crimson-guard-level ((obj crimson-guard-level))
(local-vars (sv-784 vector))
(with-pp
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
(rlet ((acc :class vf)
(vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
(vf7 :class vf)
)
(init-vf0-vector)
(let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14)))
(v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15)))
(s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0))
(s1-0
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj target-pos-predict-miss) s4-0) 16384.0)
)
(s5-0 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'collide-query))
)
(init-vf0-vector)
(let* ((s4-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 14)))
(v0-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 15)))
(s2-0 (vector-normalize! (vector-! (new 'stack-no-clear 'vector) s4-0 v0-1) 16384.0))
(s1-0
(vector-normalize! (vector-! (new 'stack-no-clear 'vector) (-> obj target-pos-predict-miss) s4-0) 16384.0)
(when (< 1820.4445 (vector-vector-angle-safe s2-0 s1-0))
(let* ((a1-9 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) s2-0 s1-0) 1.0))
(a2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-9 1820.4445))
)
(vector-orient-by-quat! s1-0 s2-0 a2-1)
)
)
(let ((a0-12 s4-0))
(let ((v1-8 s4-0))
(let ((a1-12 0.2))
(.mov vf7 a1-12)
)
(.lvf vf5 (&-> s2-0 quad))
(.lvf vf4 (&-> v1-8 quad))
)
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf5 vf7 :mask #b111)
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
(.svf (&-> a0-12 quad) vf6)
)
(vector+! s5-0 s4-0 s1-0)
(let ((v1-10 s3-0))
(set! (-> v1-10 radius) 409.6)
(set! (-> v1-10 collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list))
(set! (-> v1-10 ignore-process0) #f)
(set! (-> v1-10 ignore-process1) #f)
(set! (-> v1-10 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-10 action-mask) (collide-action solid))
)
(set! (-> s3-0 start-pos quad) (-> s4-0 quad))
(set! (-> s3-0 move-dist quad) (-> s1-0 quad))
(set! (-> s3-0 ignore-process0) #f)
(set! (-> s3-0 ignore-process1) #f)
(set! (-> s3-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(fill-using-line-sphere *collide-cache* s3-0)
(set! (-> obj l-control state points-to-draw) 0)
(let ((f0-3 (probe-using-line-sphere *collide-cache* s3-0))
(s2-1 (new 'stack-no-clear 'vector))
)
(cond
((>= f0-3 0.0)
(vector-float*! s1-0 (-> s3-0 move-dist) f0-3)
(vector+! s5-0 s4-0 s1-0)
(point-in-plane-<-point+normal! s2-1 s5-0 (-> s3-0 best-other-tri normal))
(vector-! s2-1 s2-1 s5-0)
(let ((s1-1 quaternion-vector-angle!)
(s0-0 (new 'stack-no-clear 'quaternion))
)
(set! sv-784 (-> s3-0 best-other-tri normal))
(let* ((a2-3 (rand-vu-float-range 0.0 65536.0))
(a2-4 (s1-1 s0-0 sv-784 a2-3))
)
(vector-orient-by-quat! s2-1 s2-1 a2-4)
)
(s5-0 (new 'stack-no-clear 'vector))
(s3-0 (new 'stack-no-clear 'collide-query))
)
(when (< 1820.4445 (vector-vector-angle-safe s2-0 s1-0))
(let* ((a1-9 (vector-normalize! (vector-cross! (new 'stack-no-clear 'vector) s2-0 s1-0) 1.0))
(a2-1 (quaternion-vector-angle! (new 'stack-no-clear 'quaternion) a1-9 1820.4445))
(let ((s1-2 (get-process *default-dead-pool* part-tracker #x4000)))
(when s1-2
(let ((t9-15 (method-of-type part-tracker activate)))
(t9-15 (the-as part-tracker s1-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000))
)
(vector-orient-by-quat! s1-0 s2-0 a2-1)
)
)
(let ((a0-12 s4-0))
(let ((v1-8 s4-0))
(let ((a1-12 0.2))
(.mov vf7 a1-12)
)
(.lvf vf5 (&-> s2-0 quad))
(.lvf vf4 (&-> v1-8 quad))
)
(.add.x.vf vf6 vf0 vf0 :mask #b1000)
(.mul.x.vf acc vf5 vf7 :mask #b111)
(.add.mul.w.vf vf6 vf4 vf0 acc :mask #b111)
(.svf (&-> a0-12 quad) vf6)
)
(vector+! s5-0 s4-0 s1-0)
(let ((v1-10 s3-0))
(set! (-> v1-10 radius) 409.6)
(set! (-> v1-10 collide-with) (collide-spec backgnd jak bot obstacle hit-by-others-list player-list))
(set! (-> v1-10 ignore-process0) #f)
(set! (-> v1-10 ignore-process1) #f)
(set! (-> v1-10 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-10 action-mask) (collide-action solid))
)
(set! (-> s3-0 start-pos quad) (-> s4-0 quad))
(set! (-> s3-0 move-dist quad) (-> s1-0 quad))
(set! (-> s3-0 ignore-process0) #f)
(set! (-> s3-0 ignore-process1) #f)
(set! (-> s3-0 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(fill-using-line-sphere *collide-cache* s3-0)
(set! (-> obj l-control state points-to-draw) 0)
(let ((f0-3 (probe-using-line-sphere *collide-cache* s3-0))
(s2-1 (new 'stack-no-clear 'vector))
)
(cond
((>= f0-3 0.0)
(vector-float*! s1-0 (-> s3-0 move-dist) f0-3)
(vector+! s5-0 s4-0 s1-0)
(point-in-plane-<-point+normal! s2-1 s5-0 (-> s3-0 best-other-tri normal))
(vector-! s2-1 s2-1 s5-0)
(let ((s1-1 quaternion-vector-angle!)
(s0-0 (new 'stack-no-clear 'quaternion))
)
(set! sv-784 (-> s3-0 best-other-tri normal))
(let* ((a2-3 (rand-vu-float-range 0.0 65536.0))
(a2-4 (s1-1 s0-0 sv-784 a2-3))
)
(vector-orient-by-quat! s2-1 s2-1 a2-4)
(let ((t9-16 run-function-in-process)
(a0-34 s1-2)
(a1-25 part-tracker-init)
(a2-9 (-> *part-group-id-table* 140))
(a3-1 0)
(t0-0 #f)
(t1-0 #f)
(t2-0 #f)
(t3-0 *launch-matrix*)
)
(set! (-> t3-0 trans quad) (-> s4-0 quad))
((the-as (function object object object object object object object object none) t9-16)
a0-34
a1-25
a2-9
a3-1
t0-0
t1-0
t2-0
t3-0
)
)
(-> s1-2 ppointer)
)
(let ((s1-2 (get-process *default-dead-pool* part-tracker #x4000)))
(when s1-2
(let ((t9-15 (method-of-type part-tracker activate)))
(t9-15 (the-as part-tracker s1-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000))
)
(let ((t9-16 run-function-in-process)
(a0-34 s1-2)
(a1-25 part-tracker-init)
(a2-9 (-> *part-group-id-table* 140))
(a3-1 0)
(t0-0 #f)
(t1-0 #f)
(t2-0 #f)
(t3-0 *launch-matrix*)
)
(set! (-> t3-0 trans quad) (-> s4-0 quad))
((the-as (function object object object object object object object object none) t9-16)
a0-34
a1-25
a2-9
a3-1
t0-0
t1-0
t2-0
t3-0
)
)
(-> s1-2 ppointer)
)
(let ((s1-3 (get-process *default-dead-pool* part-tracker #x4000)))
(when s1-3
(let ((t9-18 (method-of-type part-tracker activate)))
(t9-18 (the-as part-tracker s1-3) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000))
)
)
(let ((s1-3 (get-process *default-dead-pool* part-tracker #x4000)))
(when s1-3
(let ((t9-18 (method-of-type part-tracker activate)))
(t9-18 (the-as part-tracker s1-3) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000))
)
(let ((t9-19 run-function-in-process)
(a0-37 s1-3)
(a1-28 part-tracker-init)
(a2-14 (-> *part-group-id-table* 140))
(a3-3 0)
(t0-1 #f)
(t1-1 #f)
(t2-1 #f)
(t3-1 *launch-matrix*)
)
(set! (-> t3-1 trans quad) (-> s5-0 quad))
((the-as (function object object object object object object object object none) t9-19)
a0-37
a1-28
a2-14
a3-3
t0-1
t1-1
t2-1
t3-1
)
)
(-> s1-3 ppointer)
(let ((t9-19 run-function-in-process)
(a0-37 s1-3)
(a1-28 part-tracker-init)
(a2-14 (-> *part-group-id-table* 140))
(a3-3 0)
(t0-1 #f)
(t1-1 #f)
(t2-1 #f)
(t3-1 *launch-matrix*)
)
(set! (-> t3-1 trans quad) (-> s5-0 quad))
((the-as (function object object object object object object object object none) t9-19)
a0-37
a1-28
a2-14
a3-3
t0-1
t1-1
t2-1
t3-1
)
)
(-> s1-3 ppointer)
)
(set-point! (-> obj l-control) 0 s4-0)
(set-point! (-> obj l-control) 1 s5-0)
(set! (-> obj l-control spec) (-> *lightning-spec-id-table* 13))
(+! (-> obj l-control state points-to-draw) 2)
(let* ((s4-1 (-> s3-0 best-other-tri collide-ptr))
(v1-45 (if (type? s4-1 collide-shape-prim)
(the-as collide-shape-prim s4-1)
)
)
(s4-2 #t)
)
(when v1-45
(set! s4-2 #f)
(when (logtest? (-> v1-45 prim-core collide-as) (collide-spec jak bot))
(let ((a1-32 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-32 from) (process->ppointer pp))
(set! (-> a1-32 num-params) 2)
(set! (-> a1-32 message) 'attack)
(set! (-> a1-32 param 0) (the-as uint #f))
(let ((a0-50 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a2-18 *game-info*)
(a3-5 (+ (-> a2-18 attack-id) 1))
)
(set! (-> a2-18 attack-id) a3-5)
(set! (-> a0-50 id) a3-5)
)
(set-point! (-> obj l-control) 0 s4-0)
(set-point! (-> obj l-control) 1 s5-0)
(set! (-> obj l-control spec) (-> *lightning-spec-id-table* 13))
(+! (-> obj l-control state points-to-draw) 2)
(let* ((s4-1 (-> s3-0 best-other-tri collide-ptr))
(v1-45 (if (type? s4-1 collide-shape-prim)
(the-as collide-shape-prim s4-1)
)
)
(set! (-> a0-50 mode) 'shock)
(set! (-> a1-32 param 1) (the-as uint a0-50))
)
(send-event-function (-> v1-45 cshape process) a1-32)
)
(s4-2 #t)
)
(when v1-45
(set! s4-2 #f)
(if (logtest? (-> v1-45 prim-core collide-as) (collide-spec jak bot))
(send-event (-> v1-45 cshape process) 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'shock))))
)
)
(crimson-guard-level-method-199 obj s5-0 s2-1 (-> s3-0 best-other-tri normal) (the-as float s4-2))
)
(crimson-guard-level-method-199 obj s5-0 s2-1 (-> s3-0 best-other-tri normal) (the-as float s4-2))
)
(else
(let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000)))
(when s3-1
(let ((t9-26 (method-of-type part-tracker activate)))
(t9-26 (the-as part-tracker s3-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000))
)
(let ((t9-27 run-function-in-process)
(a0-56 s3-1)
(a1-36 part-tracker-init)
(a2-25 (-> *part-group-id-table* 140))
(a3-8 0)
(t0-3 #f)
(t1-2 #f)
(t2-2 #f)
(t3-2 *launch-matrix*)
)
(set! (-> t3-2 trans quad) (-> s4-0 quad))
((the-as (function object object object object object object object object none) t9-27)
a0-56
a1-36
a2-25
a3-8
t0-3
t1-2
t2-2
t3-2
)
)
(-> s3-1 ppointer)
)
(else
(let ((s3-1 (get-process *default-dead-pool* part-tracker #x4000)))
(when s3-1
(let ((t9-26 (method-of-type part-tracker activate)))
(t9-26 (the-as part-tracker s3-1) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000))
)
)
(let ((s3-2 (get-process *default-dead-pool* part-tracker #x4000)))
(when s3-2
(let ((t9-29 (method-of-type part-tracker activate)))
(t9-29 (the-as part-tracker s3-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000))
)
(let ((t9-30 run-function-in-process)
(a0-59 s3-2)
(a1-39 part-tracker-init)
(a2-30 (-> *part-group-id-table* 140))
(a3-10 0)
(t0-4 #f)
(t1-3 #f)
(t2-3 #f)
(t3-3 *launch-matrix*)
)
(set! (-> t3-3 trans quad) (-> s5-0 quad))
((the-as (function object object object object object object object object none) t9-30)
a0-59
a1-39
a2-30
a3-10
t0-4
t1-3
t2-3
t3-3
)
)
(-> s3-2 ppointer)
(let ((t9-27 run-function-in-process)
(a0-56 s3-1)
(a1-36 part-tracker-init)
(a2-25 (-> *part-group-id-table* 140))
(a3-8 0)
(t0-3 #f)
(t1-2 #f)
(t2-2 #f)
(t3-2 *launch-matrix*)
)
(set! (-> t3-2 trans quad) (-> s4-0 quad))
((the-as (function object object object object object object object object none) t9-27)
a0-56
a1-36
a2-25
a3-8
t0-3
t1-2
t2-2
t3-2
)
)
(-> s3-1 ppointer)
)
(set! (-> obj l-control state points-to-draw) 9)
(set! (-> obj l-control spec) (-> *lightning-spec-id-table* 14))
(let ((v1-67 s4-0))
(set! (-> obj l-control state meet data 0 quad) (-> v1-67 quad))
)
(let ((a0-65 (-> obj l-control))
(v1-69 s5-0)
)
(set! (-> a0-65 state meet data (+ (-> a0-65 state points-to-draw) -1) quad) (-> v1-69 quad))
)
(let ((s3-2 (get-process *default-dead-pool* part-tracker #x4000)))
(when s3-2
(let ((t9-29 (method-of-type part-tracker activate)))
(t9-29 (the-as part-tracker s3-2) obj (symbol->string (-> part-tracker symbol)) (the-as pointer #x70004000))
)
(let ((t9-30 run-function-in-process)
(a0-59 s3-2)
(a1-39 part-tracker-init)
(a2-30 (-> *part-group-id-table* 140))
(a3-10 0)
(t0-4 #f)
(t1-3 #f)
(t2-3 #f)
(t3-3 *launch-matrix*)
)
(set! (-> t3-3 trans quad) (-> s5-0 quad))
((the-as (function object object object object object object object object none) t9-30)
a0-59
a1-39
a2-30
a3-10
t0-4
t1-3
t2-3
t3-3
)
)
(-> s3-2 ppointer)
)
)
(set! (-> obj l-control state points-to-draw) 9)
(set! (-> obj l-control spec) (-> *lightning-spec-id-table* 14))
(let ((v1-67 s4-0))
(set! (-> obj l-control state meet data 0 quad) (-> v1-67 quad))
)
(let ((a0-65 (-> obj l-control))
(v1-69 s5-0)
)
(set! (-> a0-65 state meet data (+ (-> a0-65 state points-to-draw) -1) quad) (-> v1-69 quad))
)
)
)
)
(none)
)
(none)
)
)
+8 -16
View File
@@ -469,22 +469,14 @@
)
(vector-normalize! s3-1 (* 1.5 (-> obj enemy-info attack-shove-back)))
(set! (-> s3-1 y) (-> obj enemy-info attack-shove-up))
(let ((a1-10 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-10 from) (process->ppointer self))
(set! (-> a1-10 num-params) 2)
(set! (-> a1-10 message) 'attack)
(set! (-> a1-10 param 0) (the-as uint arg1))
(let ((v1-17 (new 'static 'attack-info :mask (attack-info-mask vector mode angle id))))
(set! (-> v1-17 id) arg2)
(set! (-> v1-17 angle) 'front)
(set! (-> v1-17 vector quad) (-> s3-1 quad))
(set! (-> v1-17 mode) (-> obj enemy-info attack-mode))
(set! (-> a1-10 param 1) (the-as uint v1-17))
)
(when (send-event-function arg0 a1-10)
(enemy-method-105 obj arg0)
#t
)
(when (send-event
arg0
'attack
arg1
(static-attack-info ((id arg2) (angle 'front) (vector s3-1) (mode (-> obj enemy-info attack-mode))))
)
(enemy-method-105 obj arg0)
#t
)
)
)
@@ -108,21 +108,14 @@
(vector-flatten! touched-from-dir touched-from-dir spike-quat)
(set! (-> touched-from-dir y) 0.0)
(vector-normalize! touched-from-dir 1.0)
(let ((evt (new 'stack-no-clear 'event-message-block)))
(set! (-> evt from) (process->ppointer self))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'attack)
(set! (-> evt param 0) (-> event param 0))
(let ((attack-info (new 'static 'attack-info :mask (attack-info-mask vector mode shove-back shove-up id))))
(set! (-> attack-info id) (the-as uint (-> self attack-id)))
(set! (-> attack-info mode) 'deadly)
(set! (-> attack-info shove-up) 24576.0)
(set! (-> attack-info shove-back) 16384.0)
(set! (-> attack-info vector quad) (-> touched-from-dir quad))
(set! (-> evt param 1) (the-as uint attack-info))
)
(send-event-function proc evt)
)
(send-event proc 'attack (-> event param 0) (static-attack-info ((id (the-as uint (-> self attack-id)))
(mode 'deadly)
(shove-up (meters 6))
(shove-back (meters 4))
(vector touched-from-dir)
)
)
)
)
(let ((frame-count (current-time)))
(set! (-> self no-overlap-timer) (the-as uint frame-count))
+78 -111
View File
@@ -726,123 +726,90 @@
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(local-vars (v1-6 vector) (sv-144 vector))
(with-pp
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(case arg2
(('touch 'bonk 'attack)
(set! sv-144 (the-as vector (send-event (ppointer->process (-> obj parent)) 'widow-get-center)))
(let* ((s1-0 arg0)
(s0-0 (if (type? s1-0 process-drawable)
s1-0
)
)
)
(let ((v1-5 sv-144))
(b! (not v1-5) cfg-15 :likely-delay (set! v1-6 sv-144))
)
(set! v1-6 (the-as vector s0-0))
(label cfg-15)
(cond
(v1-6
(let ((v1-9 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) sv-144))
(s1-1 (new 'stack-no-clear 'vector))
)
(set! (-> s1-1 x) (- (-> v1-9 z)))
(set! (-> s1-1 y) 0.0)
(set! (-> s1-1 z) (-> v1-9 x))
(set! (-> s1-1 w) 1.0)
(let ((v1-12
(vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-0) root trans) (-> obj root trans))
)
)
(set! (-> s1-1 y) 0.0)
(set! (-> v1-12 y) 0.0)
(if (< (vector-dot v1-12 s1-1) 0.0)
(vector-negate! s1-1 s1-1)
)
)
(vector-normalize! s1-1 16384.0)
(vector+! s1-1 s1-1 (-> (the-as process-drawable s0-0) root trans))
(vector-! s1-1 s1-1 sv-144)
(set! (-> s1-1 y) 0.0)
(vector-normalize! s1-1 204800.0)
(let ((v1-17 s1-1))
(let ((a0-19 s1-1))
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> a0-19 quad))
)
(.lvf vf5 (&-> (the-as vector sv-144) quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> v1-17 quad) vf6)
)
(vector-! s1-1 s1-1 (-> (the-as process-drawable s0-0) root trans))
(set! (-> s1-1 y) 8192.0)
(let ((a1-17 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-17 from) (process->ppointer pp))
(set! (-> a1-17 num-params) 2)
(set! (-> a1-17 message) 'attack)
(set! (-> a1-17 param 0) (the-as uint #f))
(let ((v1-23 (new 'static 'attack-info :mask (attack-info-mask vector mode id))))
(let* ((a0-24 *game-info*)
(a2-2 (+ (-> a0-24 attack-id) 1))
)
(set! (-> a0-24 attack-id) a2-2)
(set! (-> v1-23 id) a2-2)
)
(set! (-> v1-23 mode) 'shock)
(set! (-> v1-23 vector quad) (-> s1-1 quad))
(set! (-> a1-17 param 1) (the-as uint v1-23))
)
(send-event-function arg0 a1-17)
)
)
)
(else
(let ((a1-18 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-18 from) (process->ppointer pp))
(set! (-> a1-18 num-params) 2)
(set! (-> a1-18 message) 'attack)
(set! (-> a1-18 param 0) (the-as uint #f))
(let ((v1-28 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id))))
(let* ((a0-29 *game-info*)
(a2-4 (+ (-> a0-29 attack-id) 1))
)
(set! (-> a0-29 attack-id) a2-4)
(set! (-> v1-28 id) a2-4)
)
(set! (-> v1-28 mode) 'shock)
(set! (-> v1-28 shove-up) 8192.0)
(set! (-> v1-28 shove-back) 16384.0)
(set! (-> a1-18 param 1) (the-as uint v1-28))
)
(send-event-function arg0 a1-18)
)
)
)
)
(let ((v1-30 (the-as object (-> arg3 param 1))))
(if (or (!= arg0 *target*)
(and (= arg2 'attack)
(logtest? (attack-info-mask penetrate-using) (-> (the-as attack-info v1-30) mask))
(logtest? (penetrate dark-bomb) (-> (the-as attack-info v1-30) penetrate-using))
(rlet ((vf0 :class vf)
(vf4 :class vf)
(vf5 :class vf)
(vf6 :class vf)
)
(init-vf0-vector)
(case arg2
(('touch 'bonk 'attack)
(set! sv-144 (the-as vector (send-event (ppointer->process (-> obj parent)) 'widow-get-center)))
(let* ((s1-0 arg0)
(s0-0 (if (type? s1-0 process-drawable)
s1-0
)
)
)
(let ((v1-5 sv-144))
(b! (not v1-5) cfg-15 :likely-delay (set! v1-6 sv-144))
)
(set! v1-6 (the-as vector s0-0))
(label cfg-15)
(cond
(v1-6
(let ((v1-9 (vector-! (new 'stack-no-clear 'vector) (-> obj root trans) sv-144))
(s1-1 (new 'stack-no-clear 'vector))
)
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
(set! (-> s1-1 x) (- (-> v1-9 z)))
(set! (-> s1-1 y) 0.0)
(set! (-> s1-1 z) (-> v1-9 x))
(set! (-> s1-1 w) 1.0)
(let ((v1-12
(vector-! (new 'stack-no-clear 'vector) (-> (the-as process-drawable s0-0) root trans) (-> obj root trans))
)
)
(set! (-> s1-1 y) 0.0)
(set! (-> v1-12 y) 0.0)
(if (< (vector-dot v1-12 s1-1) 0.0)
(vector-negate! s1-1 s1-1)
)
)
(vector-normalize! s1-1 16384.0)
(vector+! s1-1 s1-1 (-> (the-as process-drawable s0-0) root trans))
(vector-! s1-1 s1-1 sv-144)
(set! (-> s1-1 y) 0.0)
(vector-normalize! s1-1 204800.0)
(let ((v1-17 s1-1))
(let ((a0-19 s1-1))
(.mov.vf vf6 vf0 :mask #b1000)
(.lvf vf4 (&-> a0-19 quad))
)
(.lvf vf5 (&-> (the-as vector sv-144) quad))
(.add.vf vf6 vf4 vf5 :mask #b111)
(.svf (&-> v1-17 quad) vf6)
)
(vector-! s1-1 s1-1 (-> (the-as process-drawable s0-0) root trans))
(set! (-> s1-1 y) 8192.0)
(send-event arg0 'attack #f (static-attack-info ((id (new-attack-id)) (mode 'shock) (vector s1-1))))
)
)
(else
(send-event
arg0
'attack
#f
(static-attack-info ((id (new-attack-id)) (mode 'shock) (shove-up (meters 2)) (shove-back (meters 4))))
)
)
)
)
(('jump)
(set! (-> obj floor) (-> (the-as vector (-> arg3 param 1)) y))
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
(let ((v1-30 (the-as object (-> arg3 param 1))))
(if (or (!= arg0 *target*) (and (= arg2 'attack)
(logtest? (attack-mask penetrate-using) (-> (the-as attack-info v1-30) mask))
(logtest? (penetrate dark-bomb) (-> (the-as attack-info v1-30) penetrate-using))
)
)
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
(('jump)
(set! (-> obj floor) (-> (the-as vector (-> arg3 param 1)) y))
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
)
+10 -19
View File
@@ -769,25 +769,16 @@
(defstate impact (vehicle-grenade)
:virtual #t
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(the-as object (case event-type
(('touched)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (-> event param 0))
(let ((v1-5 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-5 id) (-> self attack-id))
(set! (-> v1-5 mode) 'explode)
(set! (-> a1-2 param 1) (the-as uint v1-5))
)
(if (send-event-function proc a1-2)
#t
)
)
)
)
)
(the-as
object
(case event-type
(('touched)
(if (send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode))))
#t
)
)
)
)
)
:code (behavior ()
(let ((gp-0 (new 'stack-no-clear 'explosion-init-params)))
@@ -751,18 +751,7 @@
(set! (-> v1-6 action-mask) (collide-action solid))
)
(when (< (fill-and-probe-using-line-sphere *collide-cache* a1-3) 0.0)
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) (process->ppointer self))
(set! (-> a1-4 num-params) 2)
(set! (-> a1-4 message) 'attack)
(set! (-> a1-4 param 0) (-> event param 0))
(let ((v1-13 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-13 id) (-> self attack-id))
(set! (-> v1-13 mode) 'explode)
(set! (-> a1-4 param 1) (the-as uint v1-13))
)
(send-event-function proc a1-4)
)
(send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode))))
(let ((v1-15 (-> self notify-handle)))
(if (handle->process v1-15)
(send-event (-> v1-15 process 0) 'notify 'attack proc)
@@ -1400,25 +1400,9 @@
(let ((v1-16 (handle->process (-> gp-0 racer))))
(when v1-16
(when (logtest? (-> (the-as vehicle-racer v1-16) flags) (rigid-body-object-flag on-ground))
(let ((a1-13 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-13 from) (process->ppointer self))
(set! (-> a1-13 num-params) 2)
(set! (-> a1-13 message) 'attack-invinc)
(set! (-> a1-13 param 0) (the-as uint #f))
(let ((v1-23 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-24 *game-info*)
(a2-1 (+ (-> a0-24 attack-id) 1))
)
(set! (-> a0-24 attack-id) a2-1)
(set! (-> v1-23 id) a2-1)
)
(set! (-> v1-23 mode) 'instant-death)
(set! (-> a1-13 param 1) (the-as uint v1-23))
(if (send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'instant-death))))
(go-virtual fail)
)
(if (send-event-function *target* a1-13)
(go-virtual fail)
)
)
)
)
)
+3 -18
View File
@@ -667,7 +667,7 @@
)
(('attack)
(let ((v1-2 (the-as attack-info (-> event param 1))))
(when (and (logtest? (-> v1-2 mask) (attack-info-mask mode)) (= (-> v1-2 mode) 'board))
(when (and (logtest? (-> v1-2 mask) (attack-mask mode)) (= (-> v1-2 mode) 'board))
(cpad-set-buzz! (-> *cpad-list* cpads 0) 0 85 (seconds 0.1))
(go-virtual break-it)
)
@@ -1261,24 +1261,9 @@ This commonly includes things such as:
)
)
(when a0-7
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) (process->ppointer self))
(set! (-> a1-4 num-params) 2)
(set! (-> a1-4 message) 'attack)
(set! (-> a1-4 param 0) (-> event param 0))
(let ((a2-3 (new 'static 'attack-info :mask (attack-info-mask id))))
(let* ((v1-7 *game-info*)
(a3-2 (+ (-> v1-7 attack-id) 1))
)
(set! (-> v1-7 attack-id) a3-2)
(set! (-> a2-3 id) a3-2)
)
(set! (-> a1-4 param 1) (the-as uint a2-3))
(if (send-event a0-7 'attack (-> event param 0) (static-attack-info ((id (new-attack-id)))))
#f
)
(if (send-event-function a0-7 a1-4)
#f
)
)
)
)
)
@@ -253,23 +253,7 @@
:trans (behavior ()
(when (and (not (-> self killed-jak?))
(>= (- (current-time) (-> self state-time)) (seconds 0.225))
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer self))
(set! (-> a1-0 num-params) 2)
(set! (-> a1-0 message) 'attack-invinc)
(set! (-> a1-0 param 0) (the-as uint #f))
(let ((v1-8 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-3 *game-info*)
(a2-1 (+ (-> a0-3 attack-id) 1))
)
(set! (-> a0-3 attack-id) a2-1)
(set! (-> v1-8 id) a2-1)
)
(set! (-> v1-8 mode) 'big-explosion)
(set! (-> a1-0 param 1) (the-as uint v1-8))
)
(send-event-function *target* a1-0)
)
(send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'big-explosion))))
)
(set! (-> self killed-jak?) #t)
(setup
+20 -23
View File
@@ -708,29 +708,26 @@ For example for an elevator pre-compute the distance between the first and last
(vector-float*! s4-2 s4-2 -1.0)
)
)
(let ((a1-10 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-10 from) (process->ppointer self))
(set! (-> a1-10 num-params) 2)
(set! (-> a1-10 message) 'attack)
(set! (-> a1-10 param 0) (-> event param 0))
(let ((v1-32 (new 'static 'attack-info :mask (attack-info-mask vector mode shove-back shove-up control id))))
(set! (-> v1-32 id) (-> self attack-id))
(set! (-> v1-32 mode) 'burnup)
(set! (-> v1-32 vector quad) (-> s4-2 quad))
(set! (-> v1-32 shove-back) 409.6)
(set! (-> v1-32 shove-up) 12288.0)
(set! (-> v1-32 control) (if (focus-test? (the-as process-focusable gp-0) board)
1.0
0.0
)
)
(set! (-> a1-10 param 1) (the-as uint v1-32))
)
(when (send-event-function gp-0 a1-10)
(let ((v0-0 (current-time)))
(set! (-> self no-collision-timer) v0-0)
v0-0
)
(when (send-event
gp-0
'attack
(-> event param 0)
(static-attack-info ((id (-> self attack-id))
(mode 'burnup)
(vector s4-2)
(shove-back (meters 0.1))
(shove-up (meters 3))
(control (if (focus-test? (the-as process-focusable gp-0) board)
1.0
0.0
)
)
)
)
)
(let ((v0-0 (current-time)))
(set! (-> self no-collision-timer) v0-0)
v0-0
)
)
)
+30 -47
View File
@@ -522,60 +522,43 @@
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(local-vars (v0-1 object))
(with-pp
(case arg2
(('touched)
(let ((s5-0 arg0))
(when (if (type? s5-0 ginsu)
s5-0
)
(let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8))))
(let ((a0-5 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8))))
(vector+! s5-1 s5-1 a0-5)
)
(vector-float*! s5-1 s5-1 0.5)
(spawn (-> obj part) s5-1)
)
(set! v0-1 (+ (current-time) (seconds 0.125)))
(set! (-> obj grind-timer) (the-as time-frame v0-1))
v0-1
)
)
)
(('touch 'bonk 'attack)
(cond
((or (!= arg0 *target*) (focus-test? *target* dark))
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
(else
(let ((v1-15 (new 'stack-no-clear 'event-message-block)))
(set! (-> v1-15 from) (process->ppointer pp))
(set! (-> v1-15 num-params) 2)
(set! (-> v1-15 message) 'attack)
(set! (-> v1-15 param 0) (the-as uint #f))
(let ((a2-2 (new 'static 'attack-info :mask (attack-info-mask id))))
(let* ((a0-19 *game-info*)
(a3-2 (+ (-> a0-19 attack-id) 1))
)
(set! (-> a0-19 attack-id) a3-2)
(set! (-> a2-2 id) a3-2)
(case arg2
(('touched)
(let ((s5-0 arg0))
(when (if (type? s5-0 ginsu)
s5-0
)
(set! (-> v1-15 param 1) (the-as uint a2-2))
)
(send-event-function arg0 v1-15)
(let ((s5-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8))))
(let ((a0-5 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data 8))))
(vector+! s5-1 s5-1 a0-5)
)
#f
(vector-float*! s5-1 s5-1 0.5)
(spawn (-> obj part) s5-1)
)
(set! v0-1 (+ (current-time) (seconds 0.125)))
(set! (-> obj grind-timer) (the-as time-frame v0-1))
v0-1
)
)
(('trigger)
(set! v0-1 #t)
(set! (-> obj ambush-started) (the-as symbol v0-1))
v0-1
)
(else
)
(('touch 'bonk 'attack)
(cond
((or (!= arg0 *target*) (focus-test? *target* dark))
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
(else
(send-event arg0 'attack #f (static-attack-info ((id (new-attack-id)))))
#f
)
)
)
(('trigger)
(set! v0-1 #t)
(set! (-> obj ambush-started) (the-as symbol v0-1))
v0-1
)
(else
((method-of-type nav-enemy general-event-handler) obj arg0 arg1 arg2 arg3)
)
)
)
+1 -1
View File
@@ -201,7 +201,7 @@ This commonly includes things such as:
(vector-! (-> self hit-dir) (-> self root trans) (-> v1-10 root trans))
(vector-normalize! (-> self hit-dir) 1.0)
)
((logtest? (attack-info-mask attacker-velocity) (-> s5-1 mask))
((logtest? (attack-mask attacker-velocity) (-> s5-1 mask))
(vector-normalize-copy! (-> self hit-dir) (-> s5-1 attacker-velocity) 1.0)
)
(else
+1 -1
View File
@@ -251,7 +251,7 @@ This is why the scouts are technically killable by other means
(let ((attack-info (the-as attack-info (-> arg1 param 1))))
(case (-> arg1 message)
(('attack)
(if (and (logtest? (-> attack-info mask) (attack-info-mask mode)) (= (-> attack-info mode) 'board))
(if (and (logtest? (-> attack-info mask) (attack-mask mode)) (= (-> attack-info mode) 'board))
(set! hitpoints (-> obj hit-points))
)
)
@@ -728,22 +728,11 @@ This commonly includes things such as:
)
(('touched)
(let ((s4-0 proc))
(when (if (type? s4-0 process-drawable)
s4-0
)
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (-> event param 0))
(let ((v1-8 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-8 id) (-> self attack-id))
(set! (-> v1-8 mode) 'explode)
(set! (-> a1-2 param 1) (the-as uint v1-8))
)
(send-event-function proc a1-2)
(if (if (type? s4-0 process-drawable)
s4-0
)
(send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode))))
)
)
)
)
)
@@ -853,23 +842,8 @@ This commonly includes things such as:
(the-as (function gui-connection symbol) #f)
(the-as process #f)
)
(while (let ((a1-13 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-13 from) (process->ppointer self))
(set! (-> a1-13 num-params) 2)
(set! (-> a1-13 message) 'attack-invinc)
(set! (-> a1-13 param 0) (the-as uint #f))
(let ((v1-56 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-19 *game-info*)
(a2-11 (+ (-> a0-19 attack-id) 1))
)
(set! (-> a0-19 attack-id) a2-11)
(set! (-> v1-56 id) a2-11)
)
(set! (-> v1-56 mode) 'big-explosion)
(set! (-> a1-13 param 1) (the-as uint v1-56))
)
(not (send-event-function *target* a1-13))
)
(while (not (send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'big-explosion))))
)
(suspend)
)
(setup
@@ -528,38 +528,37 @@
(the-as
object
(when s5-0
(let ((a0-48 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat)))
(a1-19 (new 'stack-no-clear 'event-message-block))
)
(set! (-> a1-19 from) (process->ppointer self))
(set! (-> a1-19 num-params) 2)
(set! (-> a1-19 message) 'attack-or-shove)
(set! (-> a1-19 param 0) (-> arg3 param 0))
(let ((v1-40 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id))))
(set! (-> v1-40 id) (-> self attack-id))
(set! (-> v1-40 vector quad) (-> a0-48 quad))
(set! (-> v1-40 shove-back) (if (and (-> self next-state) (= (-> self next-state name) 'idle))
16384.0
49152.0
)
)
(set! (-> v1-40 shove-up) 24576.0)
(set! (-> v1-40 control) (if (focus-test? s5-0 board)
1.0
0.0
(let ((a0-48 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self root quat))))
(the-as
object
(when (send-event
s5-0
'attack-or-shove
(-> arg3 param 0)
(static-attack-info ((id (-> self attack-id))
(vector a0-48)
(shove-back (if (and (-> self next-state) (= (-> self next-state name) 'idle))
16384.0
49152.0
)
)
(shove-up (meters 6))
(control (if (focus-test? s5-0 board)
1.0
0.0
)
)
)
)
(set! (-> a1-19 param 1) (the-as uint v1-40))
)
)
(set! (-> self no-collision-timer) (current-time))
(let ((v1-45 (-> self root root-prim)))
(set! (-> v1-45 prim-core collide-as) (collide-spec))
(set! (-> v1-45 prim-core collide-with) (collide-spec))
)
0
)
)
(the-as object (when (send-event-function s5-0 a1-19)
(set! (-> self no-collision-timer) (current-time))
(let ((v1-45 (-> self root root-prim)))
(set! (-> v1-45 prim-core collide-as) (collide-spec))
(set! (-> v1-45 prim-core collide-with) (collide-spec))
)
0
)
)
)
)
)
@@ -341,21 +341,13 @@ This commonly includes things such as:
(-> s2-4 ppointer)
)
)
(let ((v1-68 (vector-reset! (new 'stack-no-clear 'vector)))
(a1-28 (new 'stack-no-clear 'event-message-block))
)
(set! (-> a1-28 from) (process->ppointer self))
(set! (-> a1-28 num-params) 2)
(set! (-> a1-28 message) 'attack)
(set! (-> a1-28 param 0) (the-as uint #f))
(let ((a0-50 (new 'static 'attack-info :mask (attack-info-mask vector invinc-time shove-up id))))
(set! (-> a0-50 id) (-> self attack-id))
(set! (-> a0-50 invinc-time) (seconds 3))
(set! (-> a0-50 vector quad) (-> v1-68 quad))
(set! (-> a0-50 shove-up) 12288.0)
(set! (-> a1-28 param 1) (the-as uint a0-50))
(let ((v1-68 (vector-reset! (new 'stack-no-clear 'vector))))
(send-event
(-> s3-3 cshape process)
'attack
#f
(static-attack-info ((id (-> self attack-id)) (invinc-time (seconds 3)) (vector v1-68) (shove-up (meters 3))))
)
(send-event-function (-> s3-3 cshape process) a1-28)
)
)
)
+2 -18
View File
@@ -798,23 +798,7 @@
(s0-2 (vector-! s0-1 sv-192 v1-42))
)
(vector-float*! s0-2 s0-2 0.5)
(let ((a1-21 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-21 from) (process->ppointer self))
(set! (-> a1-21 num-params) 2)
(set! (-> a1-21 message) 'shove)
(set! (-> a1-21 param 0) (-> event param 0))
(let ((v1-49 (new 'static 'attack-info :mask (attack-info-mask vector id))))
(let* ((a0-36 *game-info*)
(a2-11 (+ (-> a0-36 attack-id) 1))
)
(set! (-> a0-36 attack-id) a2-11)
(set! (-> v1-49 id) a2-11)
)
(set! (-> v1-49 vector quad) (-> s0-2 quad))
(set! (-> a1-21 param 1) (the-as uint v1-49))
)
(send-event-function proc a1-21)
)
(send-event proc 'shove (-> event param 0) (static-attack-info ((id (new-attack-id)) (vector s0-2))))
)
)
)
@@ -2222,7 +2206,7 @@ This commonly includes things such as:
(set! (-> a1-4 num-params) 2)
(set! (-> a1-4 message) 'attack)
(set! (-> a1-4 param 0) (-> event param 0))
(let ((v1-11 (new 'static 'attack-info :mask (attack-info-mask shove-up id damage))))
(let ((v1-11 (new 'static 'attack-info :mask (attack-mask shove-up id damage))))
(set! a2-3 (cond
((nonzero? s4-0)
(+ s4-0 10)
+3 -16
View File
@@ -844,22 +844,9 @@
(vector-normalize! s1-1 1.0)
(vector+float*! s1-1 s1-1 (-> obj root transv) 0.5)
(set! (-> s1-1 y) 20480.0)
(let ((a1-6 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-6 from) (process->ppointer self))
(set! (-> a1-6 num-params) 2)
(set! (-> a1-6 message) 'attack)
(set! (-> a1-6 param 0) (the-as uint arg1))
(let ((v1-16 (new 'static 'attack-info :mask (attack-info-mask vector mode angle id))))
(set! (-> v1-16 id) arg2)
(set! (-> v1-16 angle) 'front)
(set! (-> v1-16 vector quad) (-> s1-1 quad))
(set! (-> v1-16 mode) s2-0)
(set! (-> a1-6 param 1) (the-as uint v1-16))
)
(when (send-event-function arg0 a1-6)
(enemy-method-105 obj arg0)
#t
)
(when (send-event arg0 'attack arg1 (static-attack-info ((id arg2) (angle 'front) (vector s1-1) (mode s2-0))))
(enemy-method-105 obj arg0)
#t
)
)
)
@@ -1367,31 +1367,18 @@
(vector-flatten! s4-2 s4-2 s3-2)
)
(vector-normalize! s4-2 32768.0)
(let ((a1-14 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-14 from) (process->ppointer self))
(set! (-> a1-14 num-params) 2)
(set! (-> a1-14 message) 'attack)
(set! (-> a1-14 param 0) (-> event param 0))
(let ((v1-47 (new 'static 'attack-info :mask (attack-info-mask vector mode shove-up id))))
(let* ((a0-50 *game-info*)
(a2-9 (+ (-> a0-50 attack-id) 1))
)
(set! (-> a0-50 attack-id) a2-9)
(set! (-> v1-47 id) a2-9)
)
(set! (-> v1-47 mode) 'deadly)
(set! (-> v1-47 vector quad) (-> s4-2 quad))
(set! (-> v1-47 shove-up) 16384.0)
(set! (-> a1-14 param 1) (the-as uint v1-47))
)
(when (send-event-function proc a1-14)
(set! (-> self no-collision-timer) (current-time))
(let ((v1-52 (-> self root root-prim)))
(set! (-> v1-52 prim-core collide-as) (collide-spec))
(set! (-> v1-52 prim-core collide-with) (collide-spec))
)
0
(when (send-event
proc
'attack
(-> event param 0)
(static-attack-info ((id (new-attack-id)) (mode 'deadly) (vector s4-2) (shove-up (meters 4))))
)
(set! (-> self no-collision-timer) (current-time))
(let ((v1-52 (-> self root root-prim)))
(set! (-> v1-52 prim-core collide-as) (collide-spec))
(set! (-> v1-52 prim-core collide-with) (collide-spec))
)
0
)
)
)
@@ -2489,24 +2476,11 @@ This commonly includes things such as:
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
(('touched 'touch)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'attack)
(set! (-> a1-3 param 0) (-> event param 0))
(let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id))))
(let* ((a2-3 *game-info*)
(a3-2 (+ (-> a2-3 attack-id) 1))
)
(set! (-> a2-3 attack-id) a3-2)
(set! (-> v1-6 id) a3-2)
)
(set! (-> v1-6 mode) 'deadly)
(set! (-> v1-6 shove-back) 0.0)
(set! (-> v1-6 shove-up) 16384.0)
(set! (-> a1-3 param 1) (the-as uint v1-6))
)
(send-event-function proc a1-3)
(send-event
proc
'attack
(-> event param 0)
(static-attack-info ((id (new-attack-id)) (mode 'deadly) (shove-back (meters 0)) (shove-up (meters 4))))
)
)
)
@@ -667,13 +667,13 @@
(f30-0 (* 0.2 (the float (the int (* 4.99 (-> self stage-hit-points))))))
)
(when (!= (-> self stage-hit-points) 0.0)
(when (or (not (logtest? (-> (the-as attack-info s5-2) mask) (attack-info-mask id)))
(when (or (not (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id)))
(!= (-> self last-attack-id) (-> (the-as attack-info s5-2) id))
)
(if (logtest? (-> (the-as attack-info s5-2) mask) (attack-info-mask id))
(if (logtest? (-> (the-as attack-info s5-2) mask) (attack-mask id))
(set! (-> self last-attack-id) (-> (the-as attack-info s5-2) id))
)
(if (logtest? (attack-info-mask damage) (-> (the-as attack-info s5-2) mask))
(if (logtest? (attack-mask damage) (-> (the-as attack-info s5-2) mask))
(set! f28-0 (-> (the-as attack-info s5-2) damage))
)
(let* ((s4-1 arg0)
@@ -709,7 +709,7 @@
)
)
)
(if (and (logtest? (attack-info-mask penetrate-using) (-> (the-as attack-info s5-2) mask))
(if (and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask))
(logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using))
)
(set! f0-4 0.5)
@@ -717,7 +717,7 @@
(if (logtest? (-> *game-info* secrets) (game-secrets hero-mode))
(set! f0-4 (* 0.6666667 f0-4))
)
(when (not (and (-> self next-state) (let ((v1-109 (-> self next-state name)))
(if (not (and (-> self next-state) (let ((v1-109 (-> self next-state name)))
(or (= v1-109 'fall-down)
(= v1-109 'overload-recover)
(= v1-109 'tail-attack)
@@ -745,7 +745,7 @@
)
(metalkor-update-hud)
(cond
((and (logtest? (attack-info-mask penetrate-using) (-> (the-as attack-info s5-2) mask))
((and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s5-2) mask))
(logtest? (penetrate dark-bomb) (-> (the-as attack-info s5-2) penetrate-using))
(= (-> self stage-hit-points) 0.0)
)
@@ -822,30 +822,18 @@
(set! (-> s4-4 y) 0.0)
(vector-normalize! s4-4 32768.0)
(set! (-> s4-4 y) 24576.0)
(let ((a1-43 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-43 from) (process->ppointer self))
(set! (-> a1-43 num-params) 2)
(set! (-> a1-43 message) 'attack)
(set! (-> a1-43 param 0) (-> arg3 param 0))
(let ((v1-170 (new 'static 'attack-info :mask (attack-info-mask vector shove-up id))))
(let* ((a0-116 *game-info*)
(a2-15 (+ (-> a0-116 attack-id) 1))
)
(set! (-> a0-116 attack-id) a2-15)
(set! (-> v1-170 id) a2-15)
)
(set! (-> v1-170 vector quad) (-> s4-4 quad))
(set! (-> v1-170 shove-up) 24576.0)
(set! (-> a1-43 param 1) (the-as uint v1-170))
)
(when (send-event-function gp-5 a1-43)
(set! (-> self no-collision-timer) (current-time))
(let ((v1-175 (-> self root root-prim)))
(set! (-> v1-175 prim-core collide-as) (collide-spec))
(set! (-> v1-175 prim-core collide-with) (collide-spec))
)
0
(when (send-event
gp-5
'attack
(-> arg3 param 0)
(static-attack-info ((id (new-attack-id)) (vector s4-4) (shove-up (meters 6))))
)
(set! (-> self no-collision-timer) (current-time))
(let ((v1-175 (-> self root root-prim)))
(set! (-> v1-175 prim-core collide-as) (collide-spec))
(set! (-> v1-175 prim-core collide-with) (collide-spec))
)
0
)
)
)
+140 -151
View File
@@ -1397,158 +1397,147 @@
- looks at the target and handles attacking
@TODO Not extremely well understood yet"
(local-vars (sv-752 lightning-spec) (sv-768 int) (sv-784 symbol) (sv-800 mammoth))
(with-pp
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(t9-0 obj)
)
(mammoth-update-ik)
(dotimes (s5-0 4)
(enable-set! (-> obj joint-ik s5-0) (zero? (-> obj draw cur-lod)))
)
(when (!= (-> obj old-foot-flags) (-> obj foot-flags))
(let ((s5-1 (new 'static 'array uint32 4 #xa #xd #x1c #x19)))
(dotimes (s4-0 4)
(let ((s3-0 (vector<-cspace!
(new 'stack-no-clear 'vector)
(-> obj node-list data (-> (the-as (pointer int32) (&+ s5-1 (* s4-0 4)))))
)
)
(s2-0 (new 'stack-no-clear 'collide-query))
)
(when (logtest? (ash 1 s4-0) (-> obj foot-flags))
(when (not (logtest? (ash 1 s4-0) (-> obj old-foot-flags)))
(set! (-> s2-0 start-pos quad) (-> s3-0 quad))
(vector-reset! (-> s2-0 move-dist))
(+! (-> s2-0 start-pos y) 8192.0)
(set! (-> s2-0 move-dist y) -40960.0)
(let ((v1-27 s2-0))
(set! (-> v1-27 radius) 2048.0)
(set! (-> v1-27 collide-with) (-> obj enemy-info gnd-collide-with))
(set! (-> v1-27 ignore-process0) obj)
(set! (-> v1-27 ignore-process1) #f)
(set! (-> v1-27 ignore-pat) (-> obj root pat-ignore-mask))
(set! (-> v1-27 action-mask) (collide-action solid))
)
(if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0)
(set! (-> s3-0 y) (-> s2-0 best-other-tri intersect y))
)
(set! (-> obj foot-pos s4-0 quad) (-> s3-0 quad))
)
)
)
)
)
(set! (-> obj old-foot-flags) (-> obj foot-flags))
)
(dotimes (v1-37 4)
(when (logtest? (ash 1 v1-37) (-> obj foot-flags))
)
)
(when (and (< (- (current-time) (-> obj lightning-timer)) (seconds 3))
(< (-> obj lightning-attack-timer) (current-time))
)
(let ((s5-2 *target*))
(when s5-2
(let* ((v1-47 (get-trans s5-2 0))
(s0-1 (vector-! (new 'stack-no-clear 'vector) v1-47 (-> obj root trans)))
)
(when (< (vector-length s0-1) 57344.0)
(let ((s4-1 (new 'stack-no-clear 'event-message-block)))
(set! (-> s4-1 from) (process->ppointer pp))
(set! (-> s4-1 num-params) 2)
(set! (-> s4-1 message) 'attack)
(set! (-> s4-1 param 0) (the-as uint #f))
(let ((s3-1 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id))))
(let* ((a0-38 *game-info*)
(a1-12 (+ (-> a0-38 attack-id) 1))
)
(set! (-> a0-38 attack-id) a1-12)
(set! (-> s3-1 id) a1-12)
)
(set! (-> s3-1 vector quad)
(-> (vector-normalize! (vector-! (new 'stack-no-clear 'vector) v1-47 (-> obj root trans)) 1.0) quad)
)
(set! (-> s3-1 shove-back) 24576.0)
(set! (-> s3-1 shove-up) 12288.0)
(set! (-> s3-1 control) (if (focus-test? s5-2 board)
1.0
0.0
)
)
(set! (-> s4-1 param 1) (the-as uint s3-1))
)
(send-event-function s5-2 s4-1)
)
(let ((s2-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))
(s1-0 *mammoth-lightning-joint-tbl*)
(s4-2 (new 'stack-no-clear 'array 'uint32 4))
(s3-2 0)
)
(let ((f30-0 (vector-dot s0-1 s2-1)))
(dotimes (s0-2 (-> s1-0 length))
(let* ((v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> s1-0 s0-2))))
(f0-12 (vector-dot (vector-! (new 'stack-no-clear 'vector) v0-9 (-> obj root trans)) s2-1))
)
(when (or (and (< 0.0 f0-12) (< 0.0 f30-0)) (and (< f0-12 0.0) (< f30-0 0.0)))
(set! (-> s4-2 s3-2) (the-as uint (-> s1-0 s0-2)))
(+! s3-2 1)
(if (>= s3-2 3)
(goto cfg-60)
)
)
)
)
)
(label cfg-60)
(let ((s2-2 (get-process *default-dead-pool* lightning-tracker #x4000)))
(when s2-2
(let ((t9-11 (method-of-type lightning-tracker activate)))
(t9-11
(the-as lightning-tracker s2-2)
s5-2
(symbol->string (-> lightning-tracker symbol))
(the-as pointer #x70004000)
)
)
(let ((s5-3 run-function-in-process)
(s1-1 s2-2)
(s0-3 lightning-tracker-init)
)
(set! sv-752 (-> *lightning-spec-id-table* 1))
(set! sv-768 600)
(set! sv-784 (the-as symbol #f))
(set! sv-800 obj)
(let ((t2-0 (-> (the-as (pointer int32) (&+ s4-2 (* (get-rand-int obj s3-2) 4)))))
(t3-0 6)
)
((the-as (function object object object object object object object object none) s5-3)
s1-1
s0-3
sv-752
sv-768
sv-784
sv-800
t2-0
t3-0
)
)
)
(-> s2-2 ppointer)
)
)
)
(set! (-> obj lightning-attack-timer)
(+ (current-time) (the int (* 300.0 (get-rand-float-range obj 0.067 0.1))))
)
)
)
)
)
)
(mammoth-method-183 obj)
0
(none)
(let ((t9-0 (method-of-type nav-enemy track-target!)))
(t9-0 obj)
)
(mammoth-update-ik)
(dotimes (s5-0 4)
(enable-set! (-> obj joint-ik s5-0) (zero? (-> obj draw cur-lod)))
)
(when (!= (-> obj old-foot-flags) (-> obj foot-flags))
(let ((s5-1 (new 'static 'array uint32 4 #xa #xd #x1c #x19)))
(dotimes (s4-0 4)
(let ((s3-0 (vector<-cspace!
(new 'stack-no-clear 'vector)
(-> obj node-list data (-> (the-as (pointer int32) (&+ s5-1 (* s4-0 4)))))
)
)
(s2-0 (new 'stack-no-clear 'collide-query))
)
(when (logtest? (ash 1 s4-0) (-> obj foot-flags))
(when (not (logtest? (ash 1 s4-0) (-> obj old-foot-flags)))
(set! (-> s2-0 start-pos quad) (-> s3-0 quad))
(vector-reset! (-> s2-0 move-dist))
(+! (-> s2-0 start-pos y) 8192.0)
(set! (-> s2-0 move-dist y) -40960.0)
(let ((v1-27 s2-0))
(set! (-> v1-27 radius) 2048.0)
(set! (-> v1-27 collide-with) (-> obj enemy-info gnd-collide-with))
(set! (-> v1-27 ignore-process0) obj)
(set! (-> v1-27 ignore-process1) #f)
(set! (-> v1-27 ignore-pat) (-> obj root pat-ignore-mask))
(set! (-> v1-27 action-mask) (collide-action solid))
)
(if (>= (fill-and-probe-using-line-sphere *collide-cache* s2-0) 0.0)
(set! (-> s3-0 y) (-> s2-0 best-other-tri intersect y))
)
(set! (-> obj foot-pos s4-0 quad) (-> s3-0 quad))
)
)
)
)
)
(set! (-> obj old-foot-flags) (-> obj foot-flags))
)
(dotimes (v1-37 4)
(when (logtest? (ash 1 v1-37) (-> obj foot-flags))
)
)
(when (and (< (- (current-time) (-> obj lightning-timer)) (seconds 3))
(< (-> obj lightning-attack-timer) (current-time))
)
(let ((s5-2 *target*))
(when s5-2
(let* ((v1-47 (get-trans s5-2 0))
(s0-1 (vector-! (new 'stack-no-clear 'vector) v1-47 (-> obj root trans)))
)
(when (< (vector-length s0-1) 57344.0)
(send-event
s5-2
'attack
#f
(static-attack-info
((id (new-attack-id))
(vector (vector-normalize! (vector-! (new 'stack-no-clear 'vector) v1-47 (-> obj root trans)) 1.0))
(shove-back (meters 6))
(shove-up (meters 3))
(control (if (focus-test? s5-2 board)
1.0
0.0
)
)
)
)
)
(let ((s2-1 (vector-x-quaternion! (new 'stack-no-clear 'vector) (-> obj root quat)))
(s1-0 *mammoth-lightning-joint-tbl*)
(s4-2 (new 'stack-no-clear 'array 'uint32 4))
(s3-2 0)
)
(let ((f30-0 (vector-dot s0-1 s2-1)))
(dotimes (s0-2 (-> s1-0 length))
(let* ((v0-9 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj node-list data (-> s1-0 s0-2))))
(f0-12 (vector-dot (vector-! (new 'stack-no-clear 'vector) v0-9 (-> obj root trans)) s2-1))
)
(when (or (and (< 0.0 f0-12) (< 0.0 f30-0)) (and (< f0-12 0.0) (< f30-0 0.0)))
(set! (-> s4-2 s3-2) (the-as uint (-> s1-0 s0-2)))
(+! s3-2 1)
(if (>= s3-2 3)
(goto cfg-60)
)
)
)
)
)
(label cfg-60)
(let ((s2-2 (get-process *default-dead-pool* lightning-tracker #x4000)))
(when s2-2
(let ((t9-11 (method-of-type lightning-tracker activate)))
(t9-11
(the-as lightning-tracker s2-2)
s5-2
(symbol->string (-> lightning-tracker symbol))
(the-as pointer #x70004000)
)
)
(let ((s5-3 run-function-in-process)
(s1-1 s2-2)
(s0-3 lightning-tracker-init)
)
(set! sv-752 (-> *lightning-spec-id-table* 1))
(set! sv-768 600)
(set! sv-784 (the-as symbol #f))
(set! sv-800 obj)
(let ((t2-0 (-> (the-as (pointer int32) (&+ s4-2 (* (get-rand-int obj s3-2) 4)))))
(t3-0 6)
)
((the-as (function object object object object object object object object none) s5-3)
s1-1
s0-3
sv-752
sv-768
sv-784
sv-800
t2-0
t3-0
)
)
)
(-> s2-2 ppointer)
)
)
)
(set! (-> obj lightning-attack-timer)
(+ (current-time) (the int (* 300.0 (get-rand-float-range obj 0.067 0.1))))
)
)
)
)
)
)
(mammoth-method-183 obj)
0
(none)
)
(defmethod coin-flip? mammoth ((obj mammoth))
@@ -1261,7 +1261,7 @@
)
(sound-play "hit-squid")
)
(if (logtest? (attack-info-mask attacker-velocity) (-> arg1 mask))
(if (logtest? (attack-mask attacker-velocity) (-> arg1 mask))
(set! (-> gp-0 quad) (-> arg1 attacker-velocity quad))
(vector-! gp-0 (-> self root trans) gp-0)
)
@@ -1452,7 +1452,7 @@
)
)
)
((and (logtest? (attack-info-mask penetrate-using) (-> (the-as attack-info s4-0) mask))
((and (logtest? (attack-mask penetrate-using) (-> (the-as attack-info s4-0) mask))
(logtest? (penetrate dark-bomb) (-> (the-as attack-info s4-0) penetrate-using))
(or (not *target*) (not (logtest? (-> *target* focus-status) (focus-status dead))))
)
@@ -1513,26 +1513,14 @@
)
)
(when a0-66
(let ((a1-13 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-13 from) (process->ppointer self))
(set! (-> a1-13 num-params) 2)
(set! (-> a1-13 message) 'attack)
(set! (-> a1-13 param 0) (-> arg3 param 0))
(let ((v1-101 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(let* ((a2-6 *game-info*)
(a3-4 (+ (-> a2-6 attack-id) 1))
)
(set! (-> a2-6 attack-id) a3-4)
(set! (-> v1-101 id) a3-4)
(if (send-event
a0-66
'attack
(-> arg3 param 0)
(static-attack-info ((id (new-attack-id)) (shove-back (meters 6)) (shove-up (meters 3))))
)
(set! (-> v1-101 shove-back) 24576.0)
(set! (-> v1-101 shove-up) 12288.0)
(set! (-> a1-13 param 1) (the-as uint v1-101))
#f
)
(if (send-event-function a0-66 a1-13)
#f
)
)
)
)
)
+21 -24
View File
@@ -80,31 +80,28 @@
(vector-float*! s4-1 s4-1 -1.0)
)
)
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-7 from) (process->ppointer self))
(set! (-> a1-7 num-params) 2)
(set! (-> a1-7 message) 'attack)
(set! (-> a1-7 param 0) (-> event param 0))
(let ((v1-14 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id))))
(set! (-> v1-14 id) (-> self attack-id))
(set! (-> v1-14 vector quad) (-> s4-1 quad))
(set! (-> v1-14 shove-back) 12288.0)
(set! (-> v1-14 shove-up) 36864.0)
(set! (-> v1-14 control) (if (focus-test? (the-as process-focusable gp-0) board)
1.0
0.0
)
)
(set! (-> a1-7 param 1) (the-as uint v1-14))
)
(when (send-event-function gp-0 a1-7)
(set! (-> self no-collision-timer) (current-time))
(let ((v1-19 (-> self root root-prim)))
(set! (-> v1-19 prim-core collide-as) (collide-spec))
(set! (-> v1-19 prim-core collide-with) (collide-spec))
)
0
(when (send-event
gp-0
'attack
(-> event param 0)
(static-attack-info ((id (-> self attack-id))
(vector s4-1)
(shove-back (meters 3))
(shove-up (meters 9))
(control (if (focus-test? (the-as process-focusable gp-0) board)
1.0
0.0
)
)
)
)
)
(set! (-> self no-collision-timer) (current-time))
(let ((v1-19 (-> self root root-prim)))
(set! (-> v1-19 prim-core collide-as) (collide-spec))
(set! (-> v1-19 prim-core collide-with) (collide-spec))
)
0
)
)
)
+1 -1
View File
@@ -290,7 +290,7 @@
)
(the-as touching-shapes-entry (-> event param 0))
)
(if (logtest? (-> (the-as attack-info s3-0) mask) (attack-info-mask intersection))
(if (logtest? (-> (the-as attack-info s3-0) mask) (attack-mask intersection))
(go-virtual hit)
)
)
+2 -12
View File
@@ -278,18 +278,8 @@
(the-as basic #f)
)
(('touched)
(when (and (!= (-> proc type) target) (let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'attack)
(set! (-> a1-2 param 0) (-> event param 0))
(let ((v1-7 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-7 id) (-> self attack-id))
(set! (-> v1-7 mode) 'crush)
(set! (-> a1-2 param 1) (the-as uint v1-7))
)
(send-event-function proc a1-2)
)
(when (and (!= (-> proc type) target)
(send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'crush))))
)
(sound-play "block-hit")
(let ((v0-0 (the-as basic (-> proc entity))))
+4 -20
View File
@@ -189,27 +189,11 @@
(get-intersect-point (new 'stack-no-clear 'vector) a1-4 (-> self root) (the-as touching-shapes-entry s5-0))
)
)
(when (and (< (-> (get-trans (the-as process-focusable gp-0) 3) y) (-> s4-1 y))
(< 40960.0 (vector-vector-distance s4-1 (-> self root trans)))
)
(let ((a1-8 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-8 from) (process->ppointer self))
(set! (-> a1-8 num-params) 2)
(set! (-> a1-8 message) 'attack)
(set! (-> a1-8 param 0) s5-0)
(let ((v1-13 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-7 *game-info*)
(a2-5 (+ (-> a0-7 attack-id) 1))
)
(set! (-> a0-7 attack-id) a2-5)
(set! (-> v1-13 id) a2-5)
)
(set! (-> v1-13 mode) 'crush)
(set! (-> a1-8 param 1) (the-as uint v1-13))
)
(send-event-function gp-0 a1-8)
(if (and (< (-> (get-trans (the-as process-focusable gp-0) 3) y) (-> s4-1 y))
(< 40960.0 (vector-vector-distance s4-1 (-> self root trans)))
)
(send-event gp-0 'attack s5-0 (static-attack-info ((id (new-attack-id)) (mode 'crush))))
)
)
)
)
)
+74 -87
View File
@@ -665,102 +665,89 @@
)
(defmethod hosehead-method-197 hosehead ((obj hosehead))
(with-pp
(let ((s2-0 (new 'stack-no-clear 'matrix)))
(let* ((a2-0 (-> obj node-list data 12 bone transform))
(v1-2 (-> a2-0 quad 0))
(a0-1 (-> a2-0 quad 1))
(a1-0 (-> a2-0 quad 2))
(a2-1 (-> a2-0 trans quad))
)
(set! (-> s2-0 quad 0) v1-2)
(set! (-> s2-0 quad 1) a0-1)
(set! (-> s2-0 quad 2) a1-0)
(set! (-> s2-0 trans quad) a2-1)
)
(new 'stack-no-clear 'matrix)
(let ((s3-0 (new 'stack-no-clear 'collide-query))
(s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(seek! (-> obj lazer-length) 327680.0 (* 327680.0 (seconds-per-frame)))
(vector-normalize-copy! s5-0 (-> s2-0 vector 1) (-> obj lazer-length))
(matrix->trans s2-0 s4-0)
(set! (-> obj lazer-dist)
(lerp-scale 1.0 0.0 (point-line-distance (-> obj lazer-pos-sound) (-> obj target-pos) s4-0 s5-0) 0.0 40960.0)
)
(vector-! (-> obj lazer-pos-sound) (-> obj target-pos) (-> obj lazer-pos-sound))
(set! (-> s3-0 start-pos quad) (-> s4-0 quad))
(set! (-> s3-0 move-dist quad) (-> s5-0 quad))
(let ((v1-9 s3-0))
(set! (-> v1-9 radius) 40.96)
(set! (-> v1-9 collide-with)
(collide-spec backgnd jak bot enemy obstacle hit-by-player-list hit-by-others-list player-list)
)
(set! (-> v1-9 ignore-process0) #f)
(set! (-> v1-9 ignore-process1) #f)
(set! (-> v1-9 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-9 action-mask) (collide-action solid))
(let ((s2-0 (new 'stack-no-clear 'matrix)))
(let* ((a2-0 (-> obj node-list data 12 bone transform))
(v1-2 (-> a2-0 quad 0))
(a0-1 (-> a2-0 quad 1))
(a1-0 (-> a2-0 quad 2))
(a2-1 (-> a2-0 trans quad))
)
(set! (-> s2-0 quad 0) v1-2)
(set! (-> s2-0 quad 1) a0-1)
(set! (-> s2-0 quad 2) a1-0)
(set! (-> s2-0 trans quad) a2-1)
)
(new 'stack-no-clear 'matrix)
(let ((s3-0 (new 'stack-no-clear 'collide-query))
(s5-0 (new 'stack-no-clear 'vector))
(s4-0 (new 'stack-no-clear 'vector))
)
(let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* s3-0)))
(when (>= f0-7 0.0)
(vector-float*! s5-0 s5-0 f0-7)
(let* ((s2-2 (-> s3-0 best-other-tri collide-ptr))
(s3-1 (if (type? s2-2 collide-shape-prim)
s2-2
)
)
)
(when s3-1
(if (logtest? (-> (the-as collide-shape-prim s3-1) prim-core collide-as) (collide-spec enemy))
(go-hostile obj)
)
(when (logtest? (-> (the-as collide-shape-prim s3-1) prim-core collide-as) (collide-spec jak bot))
(let ((a1-10 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-10 from) (process->ppointer pp))
(set! (-> a1-10 num-params) 2)
(set! (-> a1-10 message) 'attack)
(set! (-> a1-10 param 0) (the-as uint #f))
(let ((v1-27 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-21 *game-info*)
(a2-7 (+ (-> a0-21 attack-id) 1))
)
(set! (-> a0-21 attack-id) a2-7)
(set! (-> v1-27 id) a2-7)
)
(set! (-> v1-27 mode) 'beam)
(set! (-> a1-10 param 1) (the-as uint v1-27))
)
(send-event-function (-> (the-as collide-shape-prim s3-1) cshape process) a1-10)
(seek! (-> obj lazer-length) 327680.0 (* 327680.0 (seconds-per-frame)))
(vector-normalize-copy! s5-0 (-> s2-0 vector 1) (-> obj lazer-length))
(matrix->trans s2-0 s4-0)
(set! (-> obj lazer-dist)
(lerp-scale 1.0 0.0 (point-line-distance (-> obj lazer-pos-sound) (-> obj target-pos) s4-0 s5-0) 0.0 40960.0)
)
(vector-! (-> obj lazer-pos-sound) (-> obj target-pos) (-> obj lazer-pos-sound))
(set! (-> s3-0 start-pos quad) (-> s4-0 quad))
(set! (-> s3-0 move-dist quad) (-> s5-0 quad))
(let ((v1-9 s3-0))
(set! (-> v1-9 radius) 40.96)
(set! (-> v1-9 collide-with)
(collide-spec backgnd jak bot enemy obstacle hit-by-player-list hit-by-others-list player-list)
)
(set! (-> v1-9 ignore-process0) #f)
(set! (-> v1-9 ignore-process1) #f)
(set! (-> v1-9 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-9 action-mask) (collide-action solid))
)
(let ((f0-7 (fill-and-probe-using-line-sphere *collide-cache* s3-0)))
(when (>= f0-7 0.0)
(vector-float*! s5-0 s5-0 f0-7)
(let* ((s2-2 (-> s3-0 best-other-tri collide-ptr))
(s3-1 (if (type? s2-2 collide-shape-prim)
s2-2
)
)
)
(when s3-1
(if (logtest? (-> (the-as collide-shape-prim s3-1) prim-core collide-as) (collide-spec enemy))
(go-hostile obj)
)
(if (logtest? (-> (the-as collide-shape-prim s3-1) prim-core collide-as) (collide-spec jak bot))
(send-event
(-> (the-as collide-shape-prim s3-1) cshape process)
'attack
#f
(static-attack-info ((id (new-attack-id)) (mode 'beam)))
)
)
)
)
)
)
(set! (-> *part-id-table* 1455 init-specs 4 initial-valuef) (vector-length s5-0))
(draw-beam (-> *part-id-table* 1455) s4-0 s5-0 #f #t)
(launch-particles (-> *part-id-table* 1456) s4-0)
(launch-particles (-> *part-id-table* 1457) (vector+! (new 'stack-no-clear 'vector) s5-0 s4-0))
)
(set! (-> *part-id-table* 1455 init-specs 4 initial-valuef) (vector-length s5-0))
(draw-beam (-> *part-id-table* 1455) s4-0 s5-0 #f #t)
(launch-particles (-> *part-id-table* 1456) s4-0)
(launch-particles (-> *part-id-table* 1457) (vector+! (new 'stack-no-clear 'vector) s5-0 s4-0))
)
(let ((s5-1 sound-play-by-spec)
(s4-1 (static-sound-spec "hosehead-lazer" :volume 0.0 :mask (pitch)))
)
(set! (-> s4-1 volume) (the int (* 1024.0 (lerp-scale 1.0 0.4 (-> obj lazer-dist) 1.0 0.0))))
(set! (-> s4-1 pitch-mod) 0)
(s5-1 s4-1 (-> obj lazer-sound) (-> obj lazer-pos-sound))
)
(let ((s5-2 sound-play-by-spec)
(s4-2 (static-sound-spec "lazer-sub" :volume 0.0 :mask (pitch)))
)
(set! (-> s4-2 volume) (the int (* 1024.0 (lerp-scale 1.0 0.0 (-> obj lazer-dist) 1.0 0.5))))
(set! (-> s4-2 pitch-mod) 0)
(s5-2 s4-2 (-> obj lazer-sound2) (-> obj lazer-pos-sound))
)
0
(none)
)
(let ((s5-1 sound-play-by-spec)
(s4-1 (static-sound-spec "hosehead-lazer" :volume 0.0 :mask (pitch)))
)
(set! (-> s4-1 volume) (the int (* 1024.0 (lerp-scale 1.0 0.4 (-> obj lazer-dist) 1.0 0.0))))
(set! (-> s4-1 pitch-mod) 0)
(s5-1 s4-1 (-> obj lazer-sound) (-> obj lazer-pos-sound))
)
(let ((s5-2 sound-play-by-spec)
(s4-2 (static-sound-spec "lazer-sub" :volume 0.0 :mask (pitch)))
)
(set! (-> s4-2 volume) (the int (* 1024.0 (lerp-scale 1.0 0.0 (-> obj lazer-dist) 1.0 0.5))))
(set! (-> s4-2 pitch-mod) 0)
(s5-2 s4-2 (-> obj lazer-sound2) (-> obj lazer-pos-sound))
)
0
(none)
)
(defmethod enemy-method-88 hosehead ((obj hosehead) (arg0 enemy-jump-info))
+26 -40
View File
@@ -795,49 +795,35 @@
(defmethod general-event-handler sew-gunturret ((obj sew-gunturret) (proc process) (arg2 int) (event-type symbol) (event event-message-block))
"Handles various events for the enemy
@TODO - unsure if there is a pattern for the events and this should have a more specific name"
(with-pp
(if (and (= event-type 'notify) (< 1 arg2) (= (-> event param 0) 'attack) (= (-> event param 1) *target*))
(set! (-> obj last-hit-time) (current-time))
)
(case event-type
(('start)
(let ((v0-0 (the-as object #t)))
(set! (-> obj can-shoot) (the-as symbol v0-0))
v0-0
)
(if (and (= event-type 'notify) (< 1 arg2) (= (-> event param 0) 'attack) (= (-> event param 1) *target*))
(set! (-> obj last-hit-time) (current-time))
)
(case event-type
(('start)
(let ((v0-0 (the-as object #t)))
(set! (-> obj can-shoot) (the-as symbol v0-0))
v0-0
)
(('stop)
(set! (-> obj can-shoot) #f)
)
(('stop)
(set! (-> obj can-shoot) #f)
#f
)
(('bonk)
(send-event proc 'target-mech-get-off (seconds 0.3))
(send-event
proc
'shove
#f
(static-attack-info ((id (new-attack-id)) (shove-back (meters 2)) (shove-up (meters 0.5))))
)
(('bonk)
(send-event proc 'target-mech-get-off (seconds 0.3))
(let ((evt (new 'stack-no-clear 'event-message-block)))
(set! (-> evt from) (process->ppointer pp))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'shove)
(set! (-> evt param 0) (the-as uint #f))
(let ((attack-info (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(let* ((game-info *game-info*)
(id (+ (-> game-info attack-id) 1))
)
(set! (-> game-info attack-id) id)
(set! (-> attack-info id) id)
)
(set! (-> attack-info shove-back) 8192.0)
(set! (-> attack-info shove-up) 2048.0)
(set! (-> evt param 1) (the-as uint attack-info))
)
(send-event-function proc evt)
)
#f
)
(('flash-state)
(-> obj flash-state)
)
(else
((method-of-type enemy general-event-handler) obj proc arg2 event-type event)
)
#f
)
(('flash-state)
(-> obj flash-state)
)
(else
((method-of-type enemy general-event-handler) obj proc arg2 event-type event)
)
)
)
+27 -65
View File
@@ -93,19 +93,11 @@
(if (< (vector-dot v1-5 hit-direction) 0.0)
(vector-float*! v1-5 v1-5 -1.0)
)
(let ((evt (new 'stack-no-clear 'event-message-block)))
(set! (-> evt from) (process->ppointer self))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'attack-or-shove)
(set! (-> evt param 0) (-> event param 0))
(let ((attack-info (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up id))))
(set! (-> attack-info id) (-> self attack-id))
(set! (-> attack-info vector quad) (-> v1-5 quad))
(set! (-> attack-info shove-back) 20480.0)
(set! (-> attack-info shove-up) 12288.0)
(set! (-> evt param 1) (the-as uint attack-info))
)
(send-event-function hit-proc evt)
(send-event
hit-proc
'attack-or-shove
(-> event param 0)
(static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 5)) (shove-up (meters 3))))
)
)
)
@@ -247,21 +239,14 @@ This commonly includes things such as:
)
)
)
(when hit-proc
(let ((evt (new 'stack-no-clear 'event-message-block)))
(set! (-> evt from) (process->ppointer self))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'attack-or-shove)
(set! (-> evt param 0) (-> event param 0))
(let ((attack-info (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(set! (-> attack-info id) (-> self attack-id))
(set! (-> attack-info shove-back) 20480.0)
(set! (-> attack-info shove-up) 8192.0)
(set! (-> evt param 1) (the-as uint attack-info))
(if hit-proc
(send-event
hit-proc
'attack-or-shove
(-> event param 0)
(static-attack-info ((id (-> self attack-id)) (shove-back (meters 5)) (shove-up (meters 2))))
)
(send-event-function hit-proc evt)
)
)
)
)
(('on)
@@ -441,21 +426,14 @@ This commonly includes things such as:
)
)
)
(when a0-2
(let ((a1-4 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-4 from) (process->ppointer self))
(set! (-> a1-4 num-params) 2)
(set! (-> a1-4 message) 'attack-or-shove)
(set! (-> a1-4 param 0) (-> event param 0))
(let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(set! (-> v1-6 id) (-> self attack-id))
(set! (-> v1-6 shove-back) 20480.0)
(set! (-> v1-6 shove-up) 8192.0)
(set! (-> a1-4 param 1) (the-as uint v1-6))
(if a0-2
(send-event
a0-2
'attack-or-shove
(-> event param 0)
(static-attack-info ((id (-> self attack-id)) (shove-back (meters 5)) (shove-up (meters 2))))
)
(send-event-function a0-2 a1-4)
)
)
)
)
)
@@ -572,19 +550,11 @@ This commonly includes things such as:
(if (< (vector-dot v1-5 hit-direction) 0.0)
(vector-float*! v1-5 v1-5 -1.0)
)
(let ((evt (new 'stack-no-clear 'event-message-block)))
(set! (-> evt from) (process->ppointer self))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'attack-or-shove)
(set! (-> evt param 0) (-> event param 0))
(let ((attack-info (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up id))))
(set! (-> attack-info id) (-> self attack-id))
(set! (-> attack-info vector quad) (-> v1-5 quad))
(set! (-> attack-info shove-back) 28672.0)
(set! (-> attack-info shove-up) 16384.0)
(set! (-> evt param 1) (the-as uint attack-info))
)
(send-event-function hit-proc evt)
(send-event
hit-proc
'attack-or-shove
(-> event param 0)
(static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 7)) (shove-up (meters 4))))
)
)
)
@@ -708,19 +678,11 @@ This commonly includes things such as:
(if (< (vector-dot v1-5 hit-direction) 0.0)
(vector-float*! v1-5 v1-5 -1.0)
)
(let ((evt (new 'stack-no-clear 'event-message-block)))
(set! (-> evt from) (process->ppointer self))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'attack-or-shove)
(set! (-> evt param 0) (-> event param 0))
(let ((attack-info (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up id))))
(set! (-> attack-info id) (-> self attack-id))
(set! (-> attack-info vector quad) (-> v1-5 quad))
(set! (-> attack-info shove-back) 16384.0)
(set! (-> attack-info shove-up) 8192.0)
(set! (-> evt param 1) (the-as uint attack-info))
)
(send-event-function hit-proc evt)
(send-event
hit-proc
'attack-or-shove
(-> event param 0)
(static-attack-info ((id (-> self attack-id)) (vector v1-5) (shove-back (meters 4)) (shove-up (meters 2))))
)
)
(set! (-> self no-collision-timer) (the-as uint (current-time)))
+48 -63
View File
@@ -815,35 +815,29 @@ This commonly includes things such as:
)
)
(when focus-proc
(let ((a0-4 (vector-normalize!
(vector-! (new 'stack-no-clear 'vector) (-> focus-proc root trans) (-> self root trans))
1.0
)
)
(evt (new 'stack-no-clear 'event-message-block))
)
(set! (-> evt from) (process->ppointer self))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'attack-or-shove)
(set! (-> evt param 0) (-> event param 0))
(let ((attack-info (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id))))
(let* ((game-info *game-info*)
(id (+ (-> game-info attack-id) 1))
)
(set! (-> game-info attack-id) id)
(set! (-> attack-info id) id)
)
(set! (-> attack-info vector quad) (-> a0-4 quad))
(set! (-> attack-info shove-back) 20480.0)
(set! (-> attack-info shove-up) 12288.0)
(set! (-> attack-info control) (if (focus-test? focus-proc board)
1.0
0.0
)
(let ((a0-4
(vector-normalize!
(vector-! (new 'stack-no-clear 'vector) (-> focus-proc root trans) (-> self root trans))
1.0
)
(set! (-> evt param 1) (the-as uint attack-info))
)
)
(send-event
focus-proc
'attack-or-shove
(-> event param 0)
(static-attack-info ((id (new-attack-id))
(vector a0-4)
(shove-back (meters 5))
(shove-up (meters 3))
(control (if (focus-test? focus-proc board)
1.0
0.0
)
)
)
)
)
(send-event-function focus-proc evt)
)
)
)
@@ -1099,50 +1093,41 @@ This commonly includes things such as:
;; WARN: Return type mismatch float vs none.
(defmethod attack-target! sew-wall ((obj sew-wall))
"If the target is close enough to the wall, hit it!"
(with-pp
(let ((target *target*))
(when target
(let ((dist-from-wall (vector-vector-xz-distance (get-trans target 0) (-> obj root trans)))
(deadly-radius (-> obj deadly-radius))
(prev-deadly-radius (-> obj prev-deadly-radius))
(let ((target *target*))
(when target
(let ((dist-from-wall (vector-vector-xz-distance (get-trans target 0) (-> obj root trans)))
(deadly-radius (-> obj deadly-radius))
(prev-deadly-radius (-> obj prev-deadly-radius))
)
(set! (-> obj prev-deadly-radius) deadly-radius)
(when (and (>= deadly-radius dist-from-wall) (>= dist-from-wall (+ -4096.0 prev-deadly-radius)))
(let ((cquery (new 'stack-no-clear 'collide-query)))
(set! (-> cquery start-pos quad) (-> obj root trans quad))
(+! (-> cquery start-pos y) 12288.0)
(vector-! (-> cquery move-dist) (get-trans target 3) (-> cquery start-pos))
(let ((v1-9 cquery))
(set! (-> v1-9 radius) 819.2)
(set! (-> v1-9 collide-with) (collide-spec backgnd))
(set! (-> v1-9 ignore-process0) obj)
(set! (-> v1-9 ignore-process1) #f)
(set! (-> v1-9 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-9 action-mask) (collide-action solid))
)
(set! (-> obj prev-deadly-radius) deadly-radius)
(when (and (>= deadly-radius dist-from-wall) (>= dist-from-wall (+ -4096.0 prev-deadly-radius)))
(let ((cquery (new 'stack-no-clear 'collide-query)))
(set! (-> cquery start-pos quad) (-> obj root trans quad))
(+! (-> cquery start-pos y) 12288.0)
(vector-! (-> cquery move-dist) (get-trans target 3) (-> cquery start-pos))
(let ((v1-9 cquery))
(set! (-> v1-9 radius) 819.2)
(set! (-> v1-9 collide-with) (collide-spec backgnd))
(set! (-> v1-9 ignore-process0) obj)
(set! (-> v1-9 ignore-process1) #f)
(set! (-> v1-9 ignore-pat) (new 'static 'pat-surface :noentity #x1 :nojak #x1 :probe #x1 :noendlessfall #x1))
(set! (-> v1-9 action-mask) (collide-action solid))
)
(when (< (fill-and-probe-using-line-sphere *collide-cache* cquery) 0.0)
(let ((evt (new 'stack-no-clear 'event-message-block)))
(set! (-> evt from) (process->ppointer pp))
(set! (-> evt num-params) 2)
(set! (-> evt message) 'attack)
(set! (-> evt param 0) (the-as uint #f))
(let ((attack-info (new 'static 'attack-info :mask (attack-info-mask mode id attacker-velocity))))
(set! (-> attack-info id) (-> obj attack-id))
(set! (-> attack-info mode) 'explode)
(set! (-> attack-info attacker-velocity quad) (-> cquery move-dist quad))
(set! (-> evt param 1) (the-as uint attack-info))
)
(send-event-function *target* evt)
)
(set! (-> obj deadly-radius) -1.0)
(when (< (fill-and-probe-using-line-sphere *collide-cache* cquery) 0.0)
(send-event
*target*
'attack
#f
(static-attack-info ((id (-> obj attack-id)) (mode 'explode) (attacker-velocity (-> cquery move-dist))))
)
(set! (-> obj deadly-radius) -1.0)
)
)
)
)
)
(none)
)
(none)
)
(defstate idle (sew-wall)
+14 -36
View File
@@ -1460,7 +1460,7 @@ This commonly includes things such as:
(vector-! (-> self hit-dir) (-> self root trans) (-> (the-as process-drawable a0-14) root trans))
(vector-normalize! (-> self hit-dir) 1.0)
)
((logtest? (attack-info-mask attacker-velocity) (-> (the-as attack-info s5-1) mask))
((logtest? (attack-mask attacker-velocity) (-> (the-as attack-info s5-1) mask))
(vector-normalize-copy! (-> self hit-dir) (-> (the-as attack-info s5-1) attacker-velocity) 1.0)
)
(else
@@ -1469,7 +1469,7 @@ This commonly includes things such as:
)
)
(set! (-> self hit-points)
(- (-> self hit-points) (if (logtest? (attack-info-mask damage) (-> (the-as attack-info s5-1) mask))
(- (-> self hit-points) (if (logtest? (attack-mask damage) (-> (the-as attack-info s5-1) mask))
(-> (the-as attack-info s5-1) damage)
1.0
)
@@ -2608,24 +2608,13 @@ This commonly includes things such as:
(when (!= (-> (the-as attack-info v1-1) id) (-> self incoming-attack-id))
(set! (-> self incoming-attack-id) (-> (the-as attack-info v1-1) id))
(stad-force-field-method-29 self (the-as touching-shapes-entry a1-1))
(let ((a1-2 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-2 from) (process->ppointer self))
(set! (-> a1-2 num-params) 2)
(set! (-> a1-2 message) 'shove)
(set! (-> a1-2 param 0) (-> event param 0))
(let ((v1-9 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up id))))
(let* ((a0-7 *game-info*)
(a2-3 (+ (-> a0-7 attack-id) 1))
)
(set! (-> a0-7 attack-id) a2-3)
(set! (-> v1-9 id) a2-3)
)
(set! (-> v1-9 vector quad) (-> self plane quad))
(set! (-> v1-9 shove-back) 4096.0)
(set! (-> v1-9 shove-up) 6144.0)
(set! (-> a1-2 param 1) (the-as uint v1-9))
(send-event
proc
'shove
(-> event param 0)
(static-attack-info
((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5)))
)
(send-event-function proc a1-2)
)
(when (< (-> self next-message-time) (current-time))
(set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0)))))
@@ -2638,24 +2627,13 @@ This commonly includes things such as:
(let ((a1-5 (-> event param 0)))
(stad-force-field-method-29 self (the-as touching-shapes-entry a1-5))
)
(let ((a1-6 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-6 from) (process->ppointer self))
(set! (-> a1-6 num-params) 2)
(set! (-> a1-6 message) 'shove)
(set! (-> a1-6 param 0) (-> event param 0))
(let ((v1-23 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up id))))
(let* ((a0-20 *game-info*)
(a2-6 (+ (-> a0-20 attack-id) 1))
)
(set! (-> a0-20 attack-id) a2-6)
(set! (-> v1-23 id) a2-6)
)
(set! (-> v1-23 vector quad) (-> self plane quad))
(set! (-> v1-23 shove-back) 4096.0)
(set! (-> v1-23 shove-up) 6144.0)
(set! (-> a1-6 param 1) (the-as uint v1-23))
(send-event
proc
'shove
(-> event param 0)
(static-attack-info
((id (new-attack-id)) (vector (-> self plane)) (shove-back (meters 1)) (shove-up (meters 1.5)))
)
(send-event-function proc a1-6)
)
(when (< (-> self next-message-time) (current-time))
(set! (-> self next-message-time) (+ (current-time) (the int (* 300.0 (rand-vu-float-range 2.0 5.0)))))
+16 -23
View File
@@ -635,30 +635,23 @@ This commonly includes things such as:
)
)
)
(when (and v1-2 ((method-of-type touching-shapes-entry prims-touching-action?)
(the-as touching-shapes-entry s5-0)
(-> v1-2 root)
(collide-action solid)
(collide-action)
)
)
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) (process->ppointer self))
(set! (-> a1-5 num-params) 2)
(set! (-> a1-5 message) 'attack-or-shove)
(set! (-> a1-5 param 0) s5-0)
(let ((v1-7 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id damage knock))))
(set! (-> v1-7 id) (-> self attack-id))
(set! (-> v1-7 shove-back) 12288.0)
(set! (-> v1-7 shove-up) 8192.0)
(set! (-> v1-7 mode) 'deadly)
(set! (-> v1-7 knock) (the-as uint 8))
(set! (-> v1-7 damage) 4.0)
(set! (-> a1-5 param 1) (the-as uint v1-7))
)
(send-event-function proc a1-5)
(if (and v1-2 ((method-of-type touching-shapes-entry prims-touching-action?)
(the-as touching-shapes-entry s5-0)
(-> v1-2 root)
(collide-action solid)
(collide-action)
)
)
(send-event proc 'attack-or-shove s5-0 (static-attack-info ((id (-> self attack-id))
(shove-back (meters 3))
(shove-up (meters 2))
(mode 'deadly)
(knock (the-as uint 8))
(damage 4.0)
)
)
)
)
)
)
)
)
+20 -54
View File
@@ -82,31 +82,24 @@
(vector-float*! s4-1 s4-1 -1.0)
)
)
(let ((a1-7 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-7 from) (process->ppointer self))
(set! (-> a1-7 num-params) 2)
(set! (-> a1-7 message) 'attack)
(set! (-> a1-7 param 0) (-> arg3 param 0))
(let ((v1-13 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up control id))))
(set! (-> v1-13 id) (-> self attack-id))
(set! (-> v1-13 vector quad) (-> s4-1 quad))
(set! (-> v1-13 shove-back) (-> self shove-vec z))
(set! (-> v1-13 shove-up) (-> self shove-vec y))
(set! (-> v1-13 control) (if (focus-test? gp-0 board)
1.0
0.0
)
)
(set! (-> a1-7 param 1) (the-as uint v1-13))
)
(when (send-event-function gp-0 a1-7)
(set! (-> self no-collision-timer) (the-as uint (current-time)))
(let ((v1-18 (-> self root root-prim)))
(set! (-> v1-18 prim-core collide-as) (collide-spec))
(set! (-> v1-18 prim-core collide-with) (collide-spec))
)
0
(when (send-event gp-0 'attack (-> arg3 param 0) (static-attack-info ((id (-> self attack-id))
(vector s4-1)
(shove-back (-> self shove-vec z))
(shove-up (-> self shove-vec y))
(control (if (focus-test? gp-0 board)
1.0
0.0
)
)
)
)
)
(set! (-> self no-collision-timer) (the-as uint (current-time)))
(let ((v1-18 (-> self root root-prim)))
(set! (-> v1-18 prim-core collide-as) (collide-spec))
(set! (-> v1-18 prim-core collide-with) (collide-spec))
)
0
)
)
)
@@ -1261,20 +1254,9 @@ This commonly includes things such as:
(set! (-> v1-5 ignore-pat) (-> self root pat-ignore-mask))
(set! (-> v1-5 action-mask) (collide-action solid))
)
(when (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'attack)
(set! (-> a1-3 param 0) (-> event param 0))
(let ((v1-12 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(set! (-> v1-12 id) (-> self attack-id))
(set! (-> v1-12 mode) 'explode)
(set! (-> a1-3 param 1) (the-as uint v1-12))
)
(send-event-function proc a1-3)
(if (< (fill-and-probe-using-line-sphere *collide-cache* a1-2) 0.0)
(send-event proc 'attack (-> event param 0) (static-attack-info ((id (-> self attack-id)) (mode 'explode))))
)
)
)
)
)
@@ -1579,23 +1561,7 @@ This commonly includes things such as:
TASK_MANAGER_FAIL_HOOK
(lambda :behavior task-manager
()
(let ((a1-0 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-0 from) (process->ppointer self))
(set! (-> a1-0 num-params) 2)
(set! (-> a1-0 message) 'attack-invinc)
(set! (-> a1-0 param 0) (the-as uint #f))
(let ((v1-3 (new 'static 'attack-info :mask (attack-info-mask mode id))))
(let* ((a0-1 *game-info*)
(a2-1 (+ (-> a0-1 attack-id) 1))
)
(set! (-> a0-1 attack-id) a2-1)
(set! (-> v1-3 id) a2-1)
)
(set! (-> v1-3 mode) 'big-explosion)
(set! (-> a1-0 param 1) (the-as uint v1-3))
)
(send-event-function *target* a1-0)
)
(send-event *target* 'attack-invinc #f (static-attack-info ((id (new-attack-id)) (mode 'big-explosion))))
(none)
)
)
+3 -3
View File
@@ -132,9 +132,9 @@
)
)
(mem-copy! (the-as pointer (-> self attack-info-rec)) (the-as pointer (-> arg3 param 1)) 160)
(when (not (logtest? (-> self attack-info-rec mask) (attack-info-mask attacker)))
(when (not (logtest? (-> self attack-info-rec mask) (attack-mask attacker)))
(set! (-> self attack-info-rec attacker) (process->handle arg0))
(logior! (-> self attack-info-rec mask) (attack-info-mask attacker))
(logior! (-> self attack-info-rec mask) (attack-mask attacker))
)
(go target-indax-hit 'shove (-> self attack-info-rec))
)
@@ -1349,7 +1349,7 @@
)
)
(combine! gp-0 arg1 self)
(when (not (logtest? (-> gp-0 mask) (attack-info-mask vector)))
(when (not (logtest? (-> gp-0 mask) (attack-mask vector)))
(vector-z-quaternion! (-> gp-0 vector) (-> self control quat-for-control))
(vector-xz-normalize! (-> gp-0 vector) (- (fabs (-> gp-0 shove-back))))
(set! (-> gp-0 vector y) (-> gp-0 shove-up))
+15 -18
View File
@@ -655,24 +655,21 @@
(if (and (= s2-0 v1-0) (focus-test? v1-0 indax))
(set! f0-0 0.6)
)
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) (process->ppointer self))
(set! (-> a1-5 num-params) 2)
(set! (-> a1-5 message) 'attack)
(set! (-> a1-5 param 0) (the-as uint arg1))
(let ((v1-9 (new 'static 'attack-info :mask (attack-info-mask mode shove-back shove-up id damage knock))))
(set! (-> v1-9 id) arg2)
(set! (-> v1-9 shove-back) (* f0-0 (-> obj enemy-info attack-shove-back)))
(set! (-> v1-9 shove-up) (* f0-0 (-> obj enemy-info attack-shove-up)))
(set! (-> v1-9 mode) (-> obj enemy-info attack-mode))
(set! (-> v1-9 damage) (the float (-> obj enemy-info attack-damage)))
(set! (-> v1-9 knock) (the-as uint 8))
(set! (-> a1-5 param 1) (the-as uint v1-9))
)
(when (send-event-function arg0 a1-5)
(enemy-method-105 obj arg0)
#t
)
(when (send-event
arg0
'attack
arg1
(static-attack-info ((id arg2)
(shove-back (* f0-0 (-> obj enemy-info attack-shove-back)))
(shove-up (* f0-0 (-> obj enemy-info attack-shove-up)))
(mode (-> obj enemy-info attack-mode))
(damage (the float (-> obj enemy-info attack-damage)))
(knock (the-as uint 8))
)
)
)
(enemy-method-105 obj arg0)
#t
)
)
)
+6 -18
View File
@@ -736,25 +736,13 @@
(let ((s5-2 (vector-! (new 'stack-no-clear 'vector) (get-trans gp-0 0) (-> self root trans))))
(when (< (vector-length s5-2) 16384.0)
(vector-normalize! s5-2 1.0)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'attack-or-shove)
(set! (-> a1-3 param 0) (the-as uint #f))
(let ((v1-13 (new 'static 'attack-info :mask (attack-info-mask vector shove-back shove-up id damage))))
(let* ((a0-6 *game-info*)
(a2-1 (+ (-> a0-6 attack-id) 1))
)
(set! (-> a0-6 attack-id) a2-1)
(set! (-> v1-13 id) a2-1)
)
(set! (-> v1-13 damage) 1.0)
(set! (-> v1-13 vector quad) (-> s5-2 quad))
(set! (-> v1-13 shove-back) 20480.0)
(set! (-> v1-13 shove-up) 12288.0)
(set! (-> a1-3 param 1) (the-as uint v1-13))
(send-event
gp-0
'attack-or-shove
#f
(static-attack-info
((id (new-attack-id)) (damage 1.0) (vector s5-2) (shove-back (meters 5)) (shove-up (meters 3)))
)
(send-event-function gp-0 a1-3)
)
)
)
+26 -84
View File
@@ -116,23 +116,11 @@
:event (behavior ((proc process) (arg1 int) (event-type symbol) (event event-message-block))
(case event-type
(('touch 'attack)
(let ((a1-3 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-3 from) (process->ppointer self))
(set! (-> a1-3 num-params) 2)
(set! (-> a1-3 message) 'attack)
(set! (-> a1-3 param 0) (-> event param 0))
(let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id))))
(let* ((a2-3 *game-info*)
(a3-2 (+ (-> a2-3 attack-id) 1))
)
(set! (-> a2-3 attack-id) a3-2)
(set! (-> v1-6 id) a3-2)
)
(set! (-> v1-6 shove-up) 12288.0)
(set! (-> v1-6 mode) 'tomb-spider)
(set! (-> a1-3 param 1) (the-as uint v1-6))
)
(send-event-function proc a1-3)
(send-event
proc
'attack
(-> event param 0)
(static-attack-info ((id (new-attack-id)) (shove-up (meters 3)) (mode 'tomb-spider)))
)
)
)
@@ -509,26 +497,14 @@
(local-vars (v0-0 object))
(case event-type
(('touch 'attack)
(when (not (-> self current-pause))
(let ((a1-5 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-5 from) (process->ppointer self))
(set! (-> a1-5 num-params) 2)
(set! (-> a1-5 message) 'attack)
(set! (-> a1-5 param 0) (-> event param 0))
(let ((v1-6 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id))))
(let* ((a2-3 *game-info*)
(a3-2 (+ (-> a2-3 attack-id) 1))
)
(set! (-> a2-3 attack-id) a3-2)
(set! (-> v1-6 id) a3-2)
)
(set! (-> v1-6 shove-up) 12288.0)
(set! (-> v1-6 mode) 'smush)
(set! (-> a1-5 param 1) (the-as uint v1-6))
(if (not (-> self current-pause))
(send-event
proc
'attack
(-> event param 0)
(static-attack-info ((id (new-attack-id)) (shove-up (meters 3)) (mode 'smush)))
)
(send-event-function proc a1-5)
)
)
)
(('end-mode 'reset)
(go-virtual idle)
@@ -936,13 +912,7 @@
(vector-normalize-copy! (-> self dir) s4-1 1.0)
)
(else
(let ((f30-1 (deg-seek
(vector-y-angle (-> self dir))
(vector-y-angle s4-1)
(* 5461.3335 (-> self clock seconds-per-frame))
)
)
)
(let ((f30-1 (deg-seek (vector-y-angle (-> self dir)) (vector-y-angle s4-1) (* 5461.3335 (seconds-per-frame)))))
(set-vector! (-> self dir) (sin f30-1) 0.0 (cos f30-1) 1.0)
)
)
@@ -958,48 +928,20 @@
)
)
(when (or (< (-> self distance) -40960.0) (< (-> self target-speed) -5.0))
(cond
((< (-> self mode) (the-as uint 10))
(let ((a1-23 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-23 from) (process->ppointer self))
(set! (-> a1-23 num-params) 2)
(set! (-> a1-23 message) 'attack)
(set! (-> a1-23 param 0) (the-as uint #f))
(let ((v1-109 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id))))
(let* ((a0-53 *game-info*)
(a2-13 (+ (-> a0-53 attack-id) 1))
)
(set! (-> a0-53 attack-id) a2-13)
(set! (-> v1-109 id) a2-13)
)
(set! (-> v1-109 shove-up) 12288.0)
(set! (-> v1-109 mode) 'smush)
(set! (-> a1-23 param 1) (the-as uint v1-109))
)
(send-event-function *target* a1-23)
)
)
(else
(let ((a1-24 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-24 from) (process->ppointer self))
(set! (-> a1-24 num-params) 2)
(set! (-> a1-24 message) 'attack)
(set! (-> a1-24 param 0) (the-as uint #f))
(let ((v1-114 (new 'static 'attack-info :mask (attack-info-mask mode shove-up id))))
(let* ((a0-58 *game-info*)
(a2-15 (+ (-> a0-58 attack-id) 1))
)
(set! (-> a0-58 attack-id) a2-15)
(set! (-> v1-114 id) a2-15)
)
(set! (-> v1-114 shove-up) 12288.0)
(set! (-> v1-114 mode) 'tomb-spider)
(set! (-> a1-24 param 1) (the-as uint v1-114))
)
(send-event-function *target* a1-24)
(if (< (-> self mode) (the-as uint 10))
(send-event
*target*
'attack
#f
(static-attack-info ((id (new-attack-id)) (shove-up (meters 3)) (mode 'smush)))
)
(send-event
*target*
'attack
#f
(static-attack-info ((id (new-attack-id)) (shove-up (meters 3)) (mode 'tomb-spider)))
)
)
)
)
(let ((f30-2 0.0)
(f26-0 0.0)
@@ -1049,9 +991,9 @@
(< (-> self target-speed) -5.0)
)
(set! f30-3 -20.0)
(seek! (-> self target-speed) f30-3 (* 20.0 (-> self clock seconds-per-frame)))
(seek! (-> self target-speed) f30-3 (* 20.0 (seconds-per-frame)))
)
(seek! (-> self target-speed) f30-3 (-> self clock seconds-per-frame))
(seek! (-> self target-speed) f30-3 (seconds-per-frame))
(when (or (!= (-> self target-speed) (-> self current-speed))
(>= (- (current-time) (-> self speed-time)) (seconds 0.2))
)
+5 -17
View File
@@ -243,23 +243,11 @@ This commonly includes things such as:
)
(('touch)
(when (= proc *target*)
(let ((a1-9 (new 'stack-no-clear 'event-message-block)))
(set! (-> a1-9 from) (process->ppointer self))
(set! (-> a1-9 num-params) 2)
(set! (-> a1-9 message) 'attack)
(set! (-> a1-9 param 0) (the-as uint #f))
(let ((v1-9 (new 'static 'attack-info :mask (attack-info-mask shove-back shove-up id))))
(let* ((a2-3 *game-info*)
(a3-3 (+ (-> a2-3 attack-id) 1))
)
(set! (-> a2-3 attack-id) a3-3)
(set! (-> v1-9 id) a3-3)
)
(set! (-> v1-9 shove-up) 8192.0)
(set! (-> v1-9 shove-back) 0.0)
(set! (-> a1-9 param 1) (the-as uint v1-9))
)
(send-event-function proc a1-9)
(send-event
proc
'attack
#f
(static-attack-info ((id (new-attack-id)) (shove-up (meters 2)) (shove-back (meters 0))))
)
(tomb-stair-block-collision #f)
)

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