├── .DS_Store ├── .github └── workflows │ └── rust_build.yml ├── .gitignore ├── Cargo.toml ├── const_to_typed.py ├── format_work_id.py ├── import_to_call.py ├── smash-macro ├── Cargo.toml └── src │ └── lib.rs └── src ├── app.rs ├── app ├── ai.rs ├── ai │ ├── export.rs │ └── impl_.rs ├── ai_extras.rs ├── ai_extras │ ├── ai_camera.rs │ ├── ai_dangerzone.rs │ ├── ai_debug.rs │ ├── ai_deprecated.rs │ ├── ai_koopag.rs │ ├── ai_notify_event.rs │ ├── ai_param.rs │ ├── ai_random.rs │ ├── ai_rule.rs │ ├── ai_stage.rs │ ├── ai_system.rs │ ├── ai_utility.rs │ ├── ai_weapon.rs │ └── analyst.rs ├── battle_object.rs ├── bosses.rs ├── bosses │ ├── boss_private.rs │ ├── crazyhand.rs │ ├── crazyhandbomb.rs │ ├── crazyhandgravityball.rs │ ├── crazyhandsearchlight.rs │ ├── darz.rs │ ├── darztearup.rs │ └── dracula2.rs ├── camera.rs ├── consts.rs ├── consts │ ├── ai.rs │ ├── ai │ │ ├── FighterAI.rs │ │ ├── FighterAIAct.rs │ │ ├── FighterAIAnalyst.rs │ │ └── FighterAIStat.rs │ ├── attack.rs │ ├── collision.rs │ ├── control.rs │ ├── cut_in.rs │ ├── fighters.rs │ ├── fighters │ │ ├── brave.rs │ │ ├── buddy.rs │ │ ├── demon.rs │ │ ├── diddy.rs │ │ ├── dolly.rs │ │ ├── edge.rs │ │ ├── element.rs │ │ └── jack.rs │ ├── kind.rs │ ├── misc.rs │ ├── status.rs │ ├── work.rs │ └── work │ │ ├── transition_groups.rs │ │ ├── transition_terms.rs │ │ └── work_ids.rs ├── debug.rs ├── events.rs ├── events │ └── link.rs ├── fighter.rs ├── global_parameter.rs ├── items.rs ├── items │ ├── akira.rs │ ├── andross.rs │ ├── androssshot.rs │ ├── backshield.rs │ ├── baitocrane.rs │ ├── beetle.rs │ ├── blackball.rs │ ├── bomberman.rs │ ├── bombermanbomb.rs │ ├── boomerang.rs │ ├── bossgalaga.rs │ ├── buddybomb.rs │ ├── chicken.rs │ ├── clubshot.rs │ ├── curryshot.rs │ ├── cyborg.rs │ ├── daisydaikon.rs │ ├── devil.rs │ ├── doll.rs │ ├── dragoonset.rs │ ├── dragoonsight.rs │ ├── driver.rs │ └── explosionbomb.rs ├── module_accessors.rs ├── modules.rs ├── modules │ ├── attack.rs │ ├── cancel.rs │ ├── damage.rs │ ├── item.rs │ ├── lua.rs │ ├── motion_animcmd.rs │ ├── posture.rs │ ├── status.rs │ └── work.rs ├── singletons.rs ├── singletons │ ├── battle_object_manager.rs │ ├── battle_object_world.rs │ ├── cut_in_manager.rs │ ├── executable_object_manager.rs │ ├── fighter_manager.rs │ ├── fighter_manager │ │ └── events.rs │ ├── fighter_snake_final_module.rs │ ├── item_manager.rs │ ├── item_param_accessor.rs │ └── stage_manager.rs ├── smashball.rs ├── smashballheavy.rs ├── specializers.rs ├── specializers │ ├── brave.rs │ ├── buddy.rs │ ├── cloud.rs │ ├── dedede.rs │ ├── demon.rs │ ├── diddy.rs │ ├── dolly.rs │ ├── donkey.rs │ ├── edge.rs │ ├── eflame.rs │ ├── elight.rs │ ├── falco.rs │ ├── fox.rs │ ├── gamewatch.rs │ ├── gaogaen.rs │ ├── gekkouga.rs │ ├── ike.rs │ └── inkling.rs ├── stage.rs ├── sv_global_parameter.rs └── sv_information.rs ├── cpp.rs ├── cpp ├── array.rs ├── binary_tree.rs ├── deque.rs ├── fixed_vec.rs ├── function.rs ├── hashmap.rs ├── linked_list.rs ├── misc.rs ├── optional.rs ├── shared_ptr.rs ├── simd.rs ├── string.rs └── vector.rs ├── lib.rs ├── lib_impl.rs ├── lib_impl ├── agent.rs ├── animcmd.rs ├── event.rs ├── inner_function.rs ├── lua.rs ├── msc.rs ├── rect.rs ├── table.rs ├── utility.rs └── value.rs ├── lua2cpp.rs ├── lua2cpp ├── agent_base.rs ├── agent_generated_base.rs ├── ai_action_base.rs ├── ai_action_base │ ├── class.rs │ └── cpp.rs ├── ai_analyst_base.rs ├── ai_analyst_base │ ├── class.rs │ └── cpp.rs ├── ai_base.rs ├── ai_base │ ├── class.rs │ └── cpp.rs ├── ai_mode_base.rs ├── ai_mode_base │ ├── class.rs │ └── cpp.rs ├── animcmd_effect_common.rs ├── animcmd_effect_common │ ├── class.rs │ └── cpp.rs ├── animcmd_expression_common.rs ├── animcmd_expression_common │ ├── class.rs │ └── cpp.rs ├── animcmd_game_common.rs ├── animcmd_game_common │ ├── class.rs │ └── cpp.rs ├── animcmd_sound_common.rs ├── base.rs ├── base │ ├── class.rs │ └── cpp.rs ├── common.rs ├── common │ ├── class.rs │ └── cpp.rs └── weapon.rs ├── phx.rs └── phx ├── fiber.rs └── vector.rs /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blu-dev/smash-rs/bdf75541fe603785290c95a588f5b0ce12dc4896/.DS_Store -------------------------------------------------------------------------------- /.github/workflows/rust_build.yml: -------------------------------------------------------------------------------- 1 | # Thanks to jugeeya for the GH action 2 | # https://github.com/ultimate-research/skyline-rs-template/blob/master/.github/workflows/rust_build.yml 3 | name: Rust 4 | 5 | on: 6 | push: 7 | branches: [ master ] # CHANGE "master" TO "main" IF THAT IS THE NAME OF YOUR MAIN BRANCH! 8 | pull_request: 9 | branches: [ master ] 10 | workflow_dispatch: 11 | 12 | jobs: 13 | tests: 14 | runs-on: ubuntu-latest 15 | container: 16 | image: jugeeya/cargo-skyline:2.1.0 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Perform size checks 20 | run: | 21 | PATH=$PATH:/root/.cargo/bin /root/.cargo/bin/cargo +skyline test --features type_assert 22 | env: 23 | HOME: /root 24 | # UNCOMMENT THE SECTION BELOW TO GET BETA RELEASES ON EVERY NEW COMMIT TO THE MAIN BRANCH 25 | # upload: 26 | # runs-on: ubuntu-latest 27 | # if: github.ref == 'refs/heads/master' 28 | # needs: 29 | # - plugin 30 | # steps: 31 | # - name: Download all artifacts 32 | # uses: actions/download-artifact@v2 33 | # - name: Update Release 34 | # uses: meeDamian/github-release@2.0 35 | # with: 36 | # token: ${{ secrets.GITHUB_TOKEN }} 37 | # prerelease: true 38 | # allow_override: true 39 | # gzip: false 40 | # tag: beta 41 | # name: beta 42 | # body: > 43 | # Beta built off of the latest code in the repository. 44 | # files: > 45 | # plugin/* 46 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | Cargo.lock 3 | /repr_weak/target 4 | /repr_weak/Cargo.lock 5 | .cargo 6 | out.rs 7 | in.rs -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "smash" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | skyline = { git = "https://github.com/ultimate-research/skyline-rs" } 10 | smash_macro = { path = "./smash-macro" } 11 | bitflags = "1.3.2" 12 | hash40 = { git = "https://github.com/BenHall-7/hash40-rs" } 13 | memoffset = { version = "0.6.5", optional = true } 14 | num_enum = "0.5.7" 15 | sealed = "0.4.0" 16 | thiserror = "1.0.37" 17 | 18 | [features] 19 | default = ["type_assert"] 20 | type_assert = ["memoffset"] 21 | extras = [ 22 | ] # This feature is for exposing extra information based on research, not symbols 23 | -------------------------------------------------------------------------------- /const_to_typed.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3.9 2 | from io import TextIOWrapper 3 | import sys 4 | 5 | def usage(): 6 | print('const_to_typed.py <-e | -b> [-p name]') 7 | sys.exit(2) 8 | 9 | def snake_to_pascal(string: str): 10 | lower = string.lower() 11 | pascal = lower[0].capitalize() 12 | was_prev_underscore = False 13 | for ch in lower[1:]: 14 | if ch == '_': 15 | was_prev_underscore = True 16 | continue 17 | if was_prev_underscore: 18 | pascal += ch.capitalize() 19 | else: 20 | pascal += ch 21 | was_prev_underscore = False 22 | return pascal 23 | 24 | if len(sys.argv) != 6: 25 | usage() 26 | 27 | def make_enum(type_name: str, repr_type: str, const_values, file: TextIOWrapper): 28 | file.write("#[repr(" + repr_type + ")]\n") 29 | file.write("pub enum " + type_name + " {\n") 30 | for name in const_values: 31 | file.write(" " + name[0] + " = 0x" + name[1] + ",\n") 32 | file.write("}\n") 33 | 34 | def make_bitflags(type_name: str, repr_type: str, const_values, file: TextIOWrapper): 35 | file.write("bitflags! {\n") 36 | file.write(" #[repr(C)]\n") 37 | file.write(" #[allow(non_upper_case_globals)]\n") 38 | file.write(" pub struct " + type_name + ": " + repr_type + " {\n") 39 | for name in const_values: 40 | file.write(" const " + name[0] + " = 0x" + name[1] + ";\n") 41 | file.write(" }\n}\n") 42 | 43 | repr_type = sys.argv[4] 44 | if repr_type != "i8" and repr_type != "u8" and repr_type != "i16" and repr_type != "u16" and repr_type != "i32" and repr_type != "u32" and repr_type != "i64" and repr_type != "u64": 45 | usage() 46 | 47 | file = open(sys.argv[1], 'r') 48 | lines = file.readlines() 49 | 50 | const_values = [] 51 | 52 | for line in lines: 53 | split = line.split(":") 54 | const_name = split[2] 55 | if const_name.startswith(sys.argv[3]): 56 | trimmed_const_name = const_name.strip().removeprefix(sys.argv[3] + "_") 57 | if trimmed_const_name != "TERM": 58 | const_values.append([snake_to_pascal(trimmed_const_name), split[1]]) 59 | 60 | type_name = snake_to_pascal(sys.argv[3].strip().removesuffix("_").removeprefix("_")) 61 | file.close() 62 | 63 | file = open(sys.argv[5], 'w') 64 | if sys.argv[2] == '-e': 65 | make_enum(type_name, repr_type, const_values, file) 66 | elif sys.argv[2] == '-b': 67 | make_bitflags(type_name, repr_type, const_values, file) 68 | else: 69 | usage() 70 | file.close() -------------------------------------------------------------------------------- /import_to_call.py: -------------------------------------------------------------------------------- 1 | #!/bin/python3.9 2 | import sys 3 | from typing import List 4 | 5 | def get_args(sig: str): 6 | start_index = sig.index("(", sig.index("fn ") + 3) + 1 7 | end_index = sig.index(")", start_index) 8 | arg_list = sig[start_index:end_index] 9 | out_args: List[str] = [] 10 | arg_count = arg_list.count(": ") 11 | current_arg = 0 12 | while current_arg < arg_count: 13 | end_index = arg_list.index(": ") 14 | out_args.append(arg_list[:end_index]) 15 | if current_arg + 1 != arg_count: 16 | start_index = arg_list.index(", ") + 2 17 | arg_list = arg_list[start_index:] 18 | current_arg += 1 19 | return out_args 20 | 21 | def get_name(sig: str): 22 | start_index = sig.index("fn ") + 3 23 | end_index = sig.index("(", start_index) 24 | return sig[start_index:end_index] 25 | 26 | if len(sys.argv) != 3: 27 | print("./import_to_call.py ") 28 | sys.exit(2) 29 | 30 | in_file = open(sys.argv[1], 'r') 31 | out_file = open(sys.argv[2], 'w') 32 | 33 | lines = in_file.readlines() 34 | in_file.close() 35 | out_file.write("use crate::*;\n\nmod impl_ {\n use crate::*;\n\n extern \"C\" {\n") 36 | filtered_lines: List[str] = [] 37 | for line in lines: 38 | out_file.write(" " + line) 39 | line = line.strip() 40 | if not line.startswith("pub(super) fn"): 41 | continue 42 | filtered_lines.append(line) 43 | 44 | out_file.write(" }\n}\n\n") 45 | 46 | for line in filtered_lines: 47 | params = get_args(line) 48 | func_name = get_name(line) 49 | func_call = "pub fn" + line.removeprefix("pub(super) fn") 50 | func_call = func_call.removesuffix(";") + " {" 51 | returns_vec = func_call.endswith("-> cpp::simd::Vector2 {") or func_call.endswith("-> cpp::simd::Vector3 {") or func_call.endswith("-> cpp::simd::Vector4 {") 52 | func_call = func_call.replace("-> cpp::simd::Vector", "-> phx::Vec").replace("*const ", "&").replace("*mut", "&mut").replace("&mut lua_State", "*mut lua_State") 53 | func_call += "\n unsafe {\n impl_::" + func_name + "(" 54 | for idx, param in enumerate(params): 55 | func_call += param 56 | if idx + 1 != len(params): 57 | func_call += ", " 58 | func_call += ")" 59 | if returns_vec: 60 | func_call += ".into()" 61 | func_call += "\n }\n}" 62 | out_file.write(func_call + "\n\n") -------------------------------------------------------------------------------- /smash-macro/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "smash_macro" 3 | version = "0.1.0" 4 | edition = "2018" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | proc-macro2 = "1.0" 10 | syn = { version = "1", features = ["full", "extra-traits"] } 11 | quote = "1.0" 12 | 13 | [lib] 14 | proc-macro = true -------------------------------------------------------------------------------- /src/app.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | #[allow(non_camel_case_types)] 3 | #[allow(non_upper_case_globals)] 4 | mod consts; 5 | 6 | 7 | mod ai_extras; 8 | pub mod ai; 9 | mod battle_object; 10 | mod bosses; 11 | pub mod camera; 12 | pub mod debug; 13 | mod events; 14 | pub mod fighter; 15 | pub mod global_parameter; 16 | mod items; 17 | mod module_accessors; 18 | mod modules; 19 | mod singletons; 20 | pub mod smashball; 21 | pub mod smashballheavy; 22 | mod specializers; 23 | pub mod stage; 24 | pub mod sv_global_parameter; 25 | pub mod sv_information; 26 | 27 | pub use ai_extras::*; 28 | pub use battle_object::*; 29 | pub use bosses::*; 30 | pub use consts::*; 31 | pub use events::*; 32 | pub use items::*; 33 | pub use module_accessors::*; 34 | pub use modules::*; 35 | pub use singletons::*; 36 | pub use specializers::*; 37 | 38 | #[repr(C)] 39 | pub struct FighterAIWeapon(u64); 40 | 41 | pub type FighterEntryID = u32; 42 | 43 | #[repr(C)] 44 | pub struct FighterEntry {} 45 | 46 | #[repr(C)] 47 | pub struct FighterInformation {} -------------------------------------------------------------------------------- /src/app/ai.rs: -------------------------------------------------------------------------------- 1 | mod impl_; 2 | mod export; 3 | 4 | pub use export::*; -------------------------------------------------------------------------------- /src/app/ai_extras.rs: -------------------------------------------------------------------------------- 1 | pub mod ai_camera; 2 | pub mod ai_dangerzone; 3 | pub mod ai_debug; 4 | pub mod ai_deprecated; 5 | pub mod ai_koopag; 6 | pub mod ai_notify_event; 7 | pub mod ai_param; 8 | pub mod ai_random; 9 | pub mod ai_rule; 10 | pub mod ai_stage; 11 | pub mod ai_system; 12 | pub mod ai_utility; 13 | pub mod ai_weapon; 14 | pub mod analyst; -------------------------------------------------------------------------------- /src/app/ai_extras/ai_camera.rs: -------------------------------------------------------------------------------- 1 | mod impl_ { 2 | extern "C" { 3 | #[link_name = "_ZN3app9ai_camera8dead_topEv"] 4 | pub(super) fn dead_top() -> f32; 5 | 6 | #[link_name = "_ZN3app9ai_camera11dead_bottomEv"] 7 | pub(super) fn dead_bottom() -> f32; 8 | 9 | #[link_name = "_ZN3app9ai_camera9dead_leftEv"] 10 | pub(super) fn dead_left() -> f32; 11 | 12 | #[link_name = "_ZN3app9ai_camera10dead_rightEv"] 13 | pub(super) fn dead_right() -> f32; 14 | } 15 | } 16 | 17 | pub fn dead_top() -> f32 { 18 | unsafe { 19 | impl_::dead_top() 20 | } 21 | } 22 | 23 | pub fn dead_bottom() -> f32 { 24 | unsafe { 25 | impl_::dead_bottom() 26 | } 27 | } 28 | 29 | pub fn dead_left() -> f32 { 30 | unsafe { 31 | impl_::dead_left() 32 | } 33 | } 34 | 35 | pub fn dead_right() -> f32 { 36 | unsafe { 37 | impl_::dead_right() 38 | } 39 | } -------------------------------------------------------------------------------- /src/app/ai_extras/ai_dangerzone.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app13ai_dangerzone8is_existEv"] 8 | pub(super) fn is_exist() -> bool; 9 | 10 | #[link_name = "_ZN3app13ai_dangerzone18check_line_segmentEP9lua_StateRKN3phx8Vector2fES6_"] 11 | pub(super) fn check_line_segment(state: *mut lua_State, line_a: *const phx::Vector2f, line_b: *const phx::Vector2f) -> bool; 12 | 13 | #[link_name = "_ZN3app13ai_dangerzone10center_posEi"] 14 | pub(super) fn center_pos(index: i32) -> cpp::simd::Vector4; 15 | 16 | #[link_name = "_ZN3app13ai_dangerzone5widthEi"] 17 | pub(super) fn width(index: i32) -> f32; 18 | } 19 | } 20 | 21 | pub fn is_exist() -> bool { 22 | unsafe { 23 | impl_::is_exist() 24 | } 25 | } 26 | 27 | pub fn check_line_segment(state: *mut lua_State, line_a: &phx::Vector2f, line_b: &phx::Vector2f) -> bool { 28 | unsafe { 29 | impl_::check_line_segment(state, line_a, line_b) 30 | } 31 | } 32 | 33 | pub fn center_pos(index: i32) -> phx::Vec4 { 34 | unsafe { 35 | impl_::center_pos(index).into() 36 | } 37 | } 38 | 39 | pub fn width(index: i32) -> f32 { 40 | unsafe { 41 | impl_::width(index) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/app/ai_extras/ai_debug.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | extern "C" { 6 | #[link_name = "_ZN3app8ai_debug20set_mode_action_nameEP9lua_StatePKc"] 7 | pub(super) fn set_mode_action_name(state: *mut lua_State, action_name: *const skyline::libc::c_char); 8 | 9 | #[link_name = "_ZN3app8ai_debug13draw_line_redERKN3phx8Vector2fES4_i"] 10 | pub(super) fn draw_line_red(line_a: *const phx::Vector2f, line_b: *const phx::Vector2f, index: i32); 11 | 12 | #[link_name = "_ZN3app8ai_debug15draw_line_greenERKN3phx8Vector2fES4_i"] 13 | pub(super) fn draw_line_green(line_a: *const phx::Vector2f, line_b: *const phx::Vector2f, index: i32); 14 | 15 | #[link_name = "_ZN3app8ai_debug15draw_circle_redERKN3phx8Vector2fEfi"] 16 | pub(super) fn draw_circle_red(center: *const phx::Vector2f, radius: f32, index: i32); 17 | 18 | #[link_name = "_ZN3app8ai_debug17draw_circle_greenERKN3phx8Vector2fEfi"] 19 | pub(super) fn draw_circle_green(center: *const phx::Vector2f, radius: f32, index: i32); 20 | } 21 | } 22 | 23 | pub fn set_mode_action_name(state: *mut lua_State, action_name: &str) { 24 | unsafe { 25 | impl_::set_mode_action_name(state, [action_name, "\0"].concat().as_bytes().as_ptr()) 26 | } 27 | } 28 | 29 | pub fn draw_line_red(line_a: &phx::Vector2f, line_b: &phx::Vector2f, index: i32) { 30 | unsafe { 31 | impl_::draw_line_red(line_a, line_b, index) 32 | } 33 | } 34 | 35 | pub fn draw_line_green(line_a: &phx::Vector2f, line_b: &phx::Vector2f, index: i32) { 36 | unsafe { 37 | impl_::draw_line_green(line_a, line_b, index) 38 | } 39 | } 40 | 41 | pub fn draw_circle_red(center: &phx::Vector2f, radius: f32, index: i32) { 42 | unsafe { 43 | impl_::draw_circle_red(center, radius, index) 44 | } 45 | } 46 | 47 | pub fn draw_circle_green(center: &phx::Vector2f, radius: f32, index: i32) { 48 | unsafe { 49 | impl_::draw_circle_green(center, radius, index) 50 | } 51 | } -------------------------------------------------------------------------------- /src/app/ai_extras/ai_deprecated.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app13ai_deprecated8range_inEP9lua_Stateff"] 8 | pub(super) fn range_in(state: *mut lua_State, range_min: f32, range_max: f32) -> bool; 9 | 10 | #[link_name = "_ZN3app13ai_deprecated11distance_inEP9lua_Stateff"] 11 | pub(super) fn distance_in(state: *mut lua_State, distance_min: f32, distance_max: f32) -> bool; 12 | 13 | #[link_name = "_ZN3app13ai_deprecated8other_inEP9lua_Stateff"] 14 | pub(super) fn other_in(state: *mut lua_State, other_min: f32, other_max: f32) -> bool; 15 | 16 | #[link_name = "_ZN3app13ai_deprecated17get_target_vectorEP9lua_Statef"] 17 | pub(super) fn get_target_vector(state: *mut lua_State, scale: f32) -> cpp::simd::Vector2; 18 | 19 | #[link_name = "_ZN3app13ai_deprecated13get_safe_fallEP9lua_State"] 20 | pub(super) fn get_safe_fall(state: *mut lua_State) -> cpp::simd::Vector2; 21 | 22 | #[link_name = "_ZN3app13ai_deprecated21get_safe_fall_currentEP9lua_State"] 23 | pub(super) fn get_safe_fall_current(state: *mut lua_State) -> cpp::simd::Vector2; 24 | 25 | #[link_name = "_ZN3app13ai_deprecated18find_meteor_targetEP9lua_State"] 26 | pub(super) fn find_meteor_target(state: *mut lua_State) -> bool; 27 | 28 | } 29 | } 30 | 31 | pub fn range_in(state: *mut lua_State, range_min: f32, range_max: f32) -> bool { 32 | unsafe { 33 | impl_::range_in(state, range_min, range_max) 34 | } 35 | } 36 | 37 | pub fn distance_in(state: *mut lua_State, distance_min: f32, distance_max: f32) -> bool { 38 | unsafe { 39 | impl_::distance_in(state, distance_min, distance_max) 40 | } 41 | } 42 | 43 | pub fn other_in(state: *mut lua_State, other_min: f32, other_max: f32) -> bool { 44 | unsafe { 45 | impl_::other_in(state, other_min, other_max) 46 | } 47 | } 48 | 49 | pub fn get_target_vector(state: *mut lua_State, scale: f32) -> phx::Vec2 { 50 | unsafe { 51 | impl_::get_target_vector(state, scale).into() 52 | } 53 | } 54 | 55 | pub fn get_safe_fall(state: *mut lua_State) -> phx::Vec2 { 56 | unsafe { 57 | impl_::get_safe_fall(state).into() 58 | } 59 | } 60 | 61 | pub fn get_safe_fall_current(state: *mut lua_State) -> phx::Vec2 { 62 | unsafe { 63 | impl_::get_safe_fall_current(state).into() 64 | } 65 | } 66 | 67 | pub fn find_meteor_target(state: *mut lua_State) -> bool { 68 | unsafe { 69 | impl_::find_meteor_target(state) 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/app/ai_extras/ai_notify_event.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app15ai_notify_event11motion_kindEP9lua_State"] 8 | pub(super) fn motion_kind(state: *mut lua_State) -> phx::Hash40; 9 | 10 | #[link_name = "_ZN3app15ai_notify_event11status_kindEP9lua_State"] 11 | pub(super) fn status_kind(state: *mut lua_State) -> i32; 12 | 13 | } 14 | } 15 | 16 | pub fn motion_kind(state: *mut lua_State) -> phx::Hash40 { 17 | unsafe { 18 | impl_::motion_kind(state) 19 | } 20 | } 21 | 22 | pub fn status_kind(state: *mut lua_State) -> i32 { 23 | unsafe { 24 | impl_::status_kind(state) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/ai_extras/ai_random.rs: -------------------------------------------------------------------------------- 1 | mod impl_ { 2 | extern "C" { 3 | #[link_name = "_ZN3app9ai_random9get_floatEv"] 4 | pub(super) fn get_float() -> f32; 5 | 6 | #[link_name = "_ZN3app9ai_random10is_percentEf"] 7 | pub(super) fn is_percent(percent: f32) -> bool; 8 | 9 | #[link_name = "_ZN3app9ai_random11range_floatEff"] 10 | pub(super) fn range_float(min: f32, max: f32) -> f32; 11 | 12 | #[link_name = "_ZN3app9ai_random9range_intEii"] 13 | pub(super) fn range_int(min: i32, max: i32) -> i32; 14 | 15 | } 16 | } 17 | 18 | pub fn get_float() -> f32 { 19 | unsafe { 20 | impl_::get_float() 21 | } 22 | } 23 | 24 | pub fn is_percent(percent: f32) -> bool { 25 | unsafe { 26 | impl_::is_percent(percent) 27 | } 28 | } 29 | 30 | pub fn range_float(min: f32, max: f32) -> f32 { 31 | unsafe { 32 | impl_::range_float(min, max) 33 | } 34 | } 35 | 36 | pub fn range_int(min: i32, max: i32) -> i32 { 37 | unsafe { 38 | impl_::range_int(min, max) 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/app/ai_extras/ai_rule.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app7ai_rule7is_1on1EP9lua_State"] 8 | pub(super) fn is_1on1(state: *mut lua_State) -> bool; 9 | 10 | #[link_name = "_ZN3app7ai_rule17is_blow_rate_highEP9lua_State"] 11 | pub(super) fn is_blow_rate_high(state: *mut lua_State) -> bool; 12 | 13 | #[link_name = "_ZN3app7ai_rule5is_hpEv"] 14 | pub(super) fn is_hp() -> bool; 15 | 16 | #[link_name = "_ZN3app7ai_rule15is_normal_meleeEv"] 17 | pub(super) fn is_normal_melee() -> bool; 18 | 19 | #[link_name = "_ZN3app7ai_rule15is_sudden_deathEv"] 20 | pub(super) fn is_sudden_death() -> bool; 21 | 22 | } 23 | } 24 | 25 | pub fn is_1on1(state: *mut lua_State) -> bool { 26 | unsafe { 27 | impl_::is_1on1(state) 28 | } 29 | } 30 | 31 | pub fn is_blow_rate_high(state: *mut lua_State) -> bool { 32 | unsafe { 33 | impl_::is_blow_rate_high(state) 34 | } 35 | } 36 | 37 | pub fn is_hp() -> bool { 38 | unsafe { 39 | impl_::is_hp() 40 | } 41 | } 42 | 43 | pub fn is_normal_melee() -> bool { 44 | unsafe { 45 | impl_::is_normal_melee() 46 | } 47 | } 48 | 49 | pub fn is_sudden_death() -> bool { 50 | unsafe { 51 | impl_::is_sudden_death() 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /src/app/ai_extras/ai_stage.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app8ai_stage24calc_offset_with_gravityERKN3phx8Vector2fERKNS1_8Vector3fE"] 8 | pub(super) fn calc_offset_with_gravity(offset: *const phx::Vector2f, position: *const phx::Vector3f) -> cpp::simd::Vector2; 9 | 10 | #[link_name = "_ZN3app8ai_stage10current_idEv"] 11 | pub(super) fn current_id() -> i32; 12 | 13 | #[link_name = "_ZN3app8ai_stage7is_1on1Ev"] 14 | pub(super) fn is_1on1() -> bool; 15 | 16 | #[link_name = "_ZN3app8ai_stage10is_gimmickEv"] 17 | pub(super) fn is_gimmick() -> bool; 18 | 19 | #[link_name = "_ZN3app8ai_stage10is_gravityEv"] 20 | pub(super) fn is_gravity() -> bool; 21 | 22 | #[link_name = "_ZN3app8ai_stage21is_in_norfair_capsuleEP9lua_State"] 23 | pub(super) fn is_in_norfair_capsule(state: *mut lua_State) -> bool; 24 | 25 | #[link_name = "_ZN3app8ai_stage16is_in_transitionEP9lua_State"] 26 | pub(super) fn is_in_transition(state: *mut lua_State) -> bool; 27 | 28 | #[link_name = "_ZN3app8ai_stage8is_smallEv"] 29 | pub(super) fn is_small() -> bool; 30 | 31 | #[link_name = "_ZN3app8ai_stage9is_smoothEv"] 32 | pub(super) fn is_smooth() -> bool; 33 | 34 | #[link_name = "_ZN3app8ai_stage8scroll_xEv"] 35 | pub(super) fn scroll_x() -> f32; 36 | 37 | } 38 | } 39 | 40 | pub fn calc_offset_with_gravity(offset: &phx::Vector2f, position: &phx::Vector3f) -> phx::Vec2 { 41 | unsafe { 42 | impl_::calc_offset_with_gravity(offset, position).into() 43 | } 44 | } 45 | 46 | pub fn current_id() -> i32 { 47 | unsafe { 48 | impl_::current_id() 49 | } 50 | } 51 | 52 | pub fn is_1on1() -> bool { 53 | unsafe { 54 | impl_::is_1on1() 55 | } 56 | } 57 | 58 | pub fn is_gimmick() -> bool { 59 | unsafe { 60 | impl_::is_gimmick() 61 | } 62 | } 63 | 64 | pub fn is_gravity() -> bool { 65 | unsafe { 66 | impl_::is_gravity() 67 | } 68 | } 69 | 70 | pub fn is_in_norfair_capsule(state: *mut lua_State) -> bool { 71 | unsafe { 72 | impl_::is_in_norfair_capsule(state) 73 | } 74 | } 75 | 76 | pub fn is_in_transition(state: *mut lua_State) -> bool { 77 | unsafe { 78 | impl_::is_in_transition(state) 79 | } 80 | } 81 | 82 | pub fn is_small() -> bool { 83 | unsafe { 84 | impl_::is_small() 85 | } 86 | } 87 | 88 | pub fn is_smooth() -> bool { 89 | unsafe { 90 | impl_::is_smooth() 91 | } 92 | } 93 | 94 | pub fn scroll_x() -> f32 { 95 | unsafe { 96 | impl_::scroll_x() 97 | } 98 | } 99 | 100 | -------------------------------------------------------------------------------- /src/app/ai_extras/ai_system.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app9ai_system10add_buttonEP9lua_StateNS_20ControlPadButtonKindE"] 8 | pub(super) fn add_button(state: *mut lua_State, button: app::ControlPadButton); 9 | 10 | #[link_name = "_ZN3app9ai_system9add_stickEP9lua_StateRKN3phx8Vector2fE"] 11 | pub(super) fn add_stick(state: *mut lua_State, offset: *const phx::Vector2f); 12 | 13 | #[link_name = "_ZN3app9ai_system13add_stick_absEP9lua_StateRKN3phx8Vector2fE"] 14 | pub(super) fn add_stick_abs(state: *mut lua_State, offset: *const phx::Vector2f); 15 | 16 | #[link_name = "_ZN3app9ai_system13add_stick_degEP9lua_Statef"] 17 | pub(super) fn add_stick_deg(state: *mut lua_State, deg: f32); 18 | 19 | #[link_name = "_ZN3app9ai_system11change_modeEP9lua_StateNS_9FighterAI4ModeE"] 20 | pub(super) fn change_mode(state: *mut lua_State, arg2: app::FighterAI::Mode); 21 | 22 | #[link_name = "_ZN3app9ai_system18change_mode_actionEP9lua_State"] 23 | pub(super) fn change_mode_action(state: *mut lua_State); 24 | 25 | #[link_name = "_ZN3app9ai_system13change_targetEP9lua_State"] 26 | pub(super) fn change_target(state: *mut lua_State); 27 | 28 | #[link_name = "_ZN3app9ai_system20change_target_randomEP9lua_State"] 29 | pub(super) fn change_target_random(state: *mut lua_State); 30 | 31 | #[link_name = "_ZN3app9ai_system28is_input_available_for_entryEP9lua_State"] 32 | pub(super) fn is_input_available_for_entry(state: *mut lua_State) -> bool; 33 | 34 | #[link_name = "_ZN3app9ai_system4modeEP9lua_State"] 35 | pub(super) fn mode(state: *mut lua_State) -> app::FighterAI::Mode; 36 | 37 | #[link_name = "_ZN3app9ai_system9prev_modeEP9lua_State"] 38 | pub(super) fn prev_mode(state: *mut lua_State) -> app::FighterAI::Mode; 39 | 40 | #[link_name = "_ZN3app9ai_system11reset_stickEP9lua_State"] 41 | pub(super) fn reset_stick(state: *mut lua_State); 42 | 43 | #[link_name = "_ZN3app9ai_system18set_action_id_noneEP9lua_State"] 44 | pub(super) fn set_action_id_none(state: *mut lua_State); 45 | 46 | #[link_name = "_ZN3app9ai_system16set_update_countEP9lua_Statei"] 47 | pub(super) fn set_update_count(state: *mut lua_State, update_count: i32); 48 | 49 | } 50 | } 51 | 52 | pub fn add_button(state: *mut lua_State, button: app::ControlPadButton) { 53 | unsafe { 54 | impl_::add_button(state, button) 55 | } 56 | } 57 | 58 | pub fn add_stick(state: *mut lua_State, offset: &phx::Vector2f) { 59 | unsafe { 60 | impl_::add_stick(state, offset) 61 | } 62 | } 63 | 64 | pub fn add_stick_abs(state: *mut lua_State, offset: &phx::Vector2f) { 65 | unsafe { 66 | impl_::add_stick_abs(state, offset) 67 | } 68 | } 69 | 70 | pub fn add_stick_deg(state: *mut lua_State, deg: f32) { 71 | unsafe { 72 | impl_::add_stick_deg(state, deg) 73 | } 74 | } 75 | 76 | pub fn change_mode(state: *mut lua_State, arg2: app::FighterAI::Mode) { 77 | unsafe { 78 | impl_::change_mode(state, arg2) 79 | } 80 | } 81 | 82 | pub fn change_mode_action(state: *mut lua_State) { 83 | unsafe { 84 | impl_::change_mode_action(state) 85 | } 86 | } 87 | 88 | pub fn change_target(state: *mut lua_State) { 89 | unsafe { 90 | impl_::change_target(state) 91 | } 92 | } 93 | 94 | pub fn change_target_random(state: *mut lua_State) { 95 | unsafe { 96 | impl_::change_target_random(state) 97 | } 98 | } 99 | 100 | pub fn is_input_available_for_entry(state: *mut lua_State) -> bool { 101 | unsafe { 102 | impl_::is_input_available_for_entry(state) 103 | } 104 | } 105 | 106 | pub fn mode(state: *mut lua_State) -> app::FighterAI::Mode { 107 | unsafe { 108 | impl_::mode(state) 109 | } 110 | } 111 | 112 | pub fn prev_mode(state: *mut lua_State) -> app::FighterAI::Mode { 113 | unsafe { 114 | impl_::prev_mode(state) 115 | } 116 | } 117 | 118 | pub fn reset_stick(state: *mut lua_State) { 119 | unsafe { 120 | impl_::reset_stick(state) 121 | } 122 | } 123 | 124 | pub fn set_action_id_none(state: *mut lua_State) { 125 | unsafe { 126 | impl_::set_action_id_none(state) 127 | } 128 | } 129 | 130 | pub fn set_update_count(state: *mut lua_State, update_count: i32) { 131 | unsafe { 132 | impl_::set_update_count(state, update_count) 133 | } 134 | } 135 | 136 | -------------------------------------------------------------------------------- /src/app/ai_extras/ai_utility.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app10ai_utility8get_kindEj"] 8 | pub(super) fn get_kind(battle_object_id: u32) -> app::FighterKind; 9 | 10 | } 11 | } 12 | 13 | pub fn get_kind(battle_object_id: u32) -> app::FighterKind { 14 | unsafe { 15 | impl_::get_kind(battle_object_id) 16 | } 17 | } -------------------------------------------------------------------------------- /src/app/ai_extras/ai_weapon.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app9ai_weapon4flagEP9lua_StatePKNS_15FighterAIWeaponE"] 8 | pub(super) fn flag(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> app::FighterAIWeaponFlag; 9 | 10 | #[link_name = "_ZN3app9ai_weapon14have_item_kindEP9lua_State"] 11 | pub(super) fn have_item_kind(state: *mut lua_State) -> app::ItemKind; 12 | 13 | #[link_name = "_ZN3app9ai_weapon4kindEP9lua_StatePKNS_15FighterAIWeaponE"] 14 | pub(super) fn kind(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> app::WeaponKind; 15 | 16 | #[link_name = "_ZN3app9ai_weapon23most_earliest_hit_frameEP9lua_State"] 17 | pub(super) fn most_earliest_hit_frame(state: *mut lua_State) -> i32; 18 | 19 | #[link_name = "_ZN3app9ai_weapon20most_earliest_weaponEP9lua_State"] 20 | pub(super) fn most_earliest_weapon(state: *mut lua_State) -> *mut app::FighterAIWeapon; 21 | 22 | #[link_name = "_ZN3app9ai_weapon5pos_xEP9lua_StatePKNS_15FighterAIWeaponE"] 23 | pub(super) fn pos_x(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> f32; 24 | 25 | #[link_name = "_ZN3app9ai_weapon12speed_lengthEP9lua_StatePKNS_15FighterAIWeaponE"] 26 | pub(super) fn speed_length(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> cpp::simd::Vector2; 27 | 28 | #[link_name = "_ZN3app9ai_weapon7speed_xEP9lua_StatePKNS_15FighterAIWeaponE"] 29 | pub(super) fn speed_x(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> f32; 30 | 31 | #[link_name = "_ZN3app9ai_weapon4typeEP9lua_StatePKNS_15FighterAIWeaponE"] 32 | pub(super) fn type_(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> app::FighterAIWeaponType; 33 | 34 | } 35 | } 36 | 37 | pub fn flag(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> app::FighterAIWeaponFlag { 38 | unsafe { 39 | impl_::flag(state, weapon) 40 | } 41 | } 42 | 43 | pub fn have_item_kind(state: *mut lua_State) -> app::ItemKind { 44 | unsafe { 45 | impl_::have_item_kind(state) 46 | } 47 | } 48 | 49 | pub fn kind(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> app::WeaponKind { 50 | unsafe { 51 | impl_::kind(state, weapon) 52 | } 53 | } 54 | 55 | pub fn most_earliest_hit_frame(state: *mut lua_State) -> i32 { 56 | unsafe { 57 | impl_::most_earliest_hit_frame(state) 58 | } 59 | } 60 | 61 | pub fn most_earliest_weapon(state: *mut lua_State) -> *mut app::FighterAIWeapon { 62 | unsafe { 63 | impl_::most_earliest_weapon(state) 64 | } 65 | } 66 | 67 | pub fn pos_x(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> f32 { 68 | unsafe { 69 | impl_::pos_x(state, weapon) 70 | } 71 | } 72 | 73 | pub fn speed_length(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> phx::Vec2 { 74 | unsafe { 75 | impl_::speed_length(state, weapon).into() 76 | } 77 | } 78 | 79 | pub fn speed_x(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> f32 { 80 | unsafe { 81 | impl_::speed_x(state, weapon) 82 | } 83 | } 84 | 85 | pub fn type_(state: *mut lua_State, weapon: *const app::FighterAIWeapon) -> app::FighterAIWeaponType { 86 | unsafe { 87 | impl_::type_(state, weapon) 88 | } 89 | } 90 | 91 | -------------------------------------------------------------------------------- /src/app/ai_extras/analyst.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app7analyst13chanced_frameEP9lua_State"] 8 | pub(super) fn chanced_frame(state: *mut lua_State) -> i32; 9 | 10 | #[link_name = "_ZN3app7analyst13change_statusEP9lua_StateNS_16FighterAIAnalyst8AIStatusE"] 11 | pub(super) fn change_status(state: *mut lua_State, status: app::FighterAIAnalyst::AIStatus); 12 | 13 | #[link_name = "_ZN3app7analyst17set_chanced_frameEP9lua_Statei"] 14 | pub(super) fn set_chanced_frame(state: *mut lua_State, chanced_frame: i32); 15 | 16 | #[link_name = "_ZN3app7analyst6statusEP9lua_State"] 17 | pub(super) fn status(state: *mut lua_State) -> app::FighterAIAnalyst::AIStatus; 18 | 19 | #[link_name = "_ZN3app7analyst12status_countEP9lua_State"] 20 | pub(super) fn status_count(state: *mut lua_State) -> i32; 21 | 22 | #[link_name = "_ZN3app7analyst11status_prevEP9lua_State"] 23 | pub(super) fn status_prev(state: *mut lua_State) -> app::FighterAIAnalyst::AIStatus; 24 | 25 | #[link_name = "_ZN3app7analyst20target_chanced_frameEP9lua_State"] 26 | pub(super) fn target_chanced_frame(state: *mut lua_State) -> i32; 27 | 28 | #[link_name = "_ZN3app7analyst13target_statusEP9lua_State"] 29 | pub(super) fn target_status(state: *mut lua_State) -> app::FighterAIAnalyst::AIStatus; 30 | 31 | #[link_name = "_ZN3app7analyst19target_status_countEP9lua_State"] 32 | pub(super) fn target_status_count(state: *mut lua_State) -> i32; 33 | 34 | #[link_name = "_ZN3app7analyst18target_status_prevEP9lua_State"] 35 | pub(super) fn target_status_prev(state: *mut lua_State) -> app::FighterAIAnalyst::AIStatus; 36 | 37 | } 38 | } 39 | 40 | pub fn chanced_frame(state: *mut lua_State) -> i32 { 41 | unsafe { 42 | impl_::chanced_frame(state) 43 | } 44 | } 45 | 46 | pub fn change_status(state: *mut lua_State, status: app::FighterAIAnalyst::AIStatus) { 47 | unsafe { 48 | impl_::change_status(state, status) 49 | } 50 | } 51 | 52 | pub fn set_chanced_frame(state: *mut lua_State, chanced_frame: i32) { 53 | unsafe { 54 | impl_::set_chanced_frame(state, chanced_frame) 55 | } 56 | } 57 | 58 | pub fn status(state: *mut lua_State) -> app::FighterAIAnalyst::AIStatus { 59 | unsafe { 60 | impl_::status(state) 61 | } 62 | } 63 | 64 | pub fn status_count(state: *mut lua_State) -> i32 { 65 | unsafe { 66 | impl_::status_count(state) 67 | } 68 | } 69 | 70 | pub fn status_prev(state: *mut lua_State) -> app::FighterAIAnalyst::AIStatus { 71 | unsafe { 72 | impl_::status_prev(state) 73 | } 74 | } 75 | 76 | pub fn target_chanced_frame(state: *mut lua_State) -> i32 { 77 | unsafe { 78 | impl_::target_chanced_frame(state) 79 | } 80 | } 81 | 82 | pub fn target_status(state: *mut lua_State) -> app::FighterAIAnalyst::AIStatus { 83 | unsafe { 84 | impl_::target_status(state) 85 | } 86 | } 87 | 88 | pub fn target_status_count(state: *mut lua_State) -> i32 { 89 | unsafe { 90 | impl_::target_status_count(state) 91 | } 92 | } 93 | 94 | pub fn target_status_prev(state: *mut lua_State) -> app::FighterAIAnalyst::AIStatus { 95 | unsafe { 96 | impl_::target_status_prev(state) 97 | } 98 | } -------------------------------------------------------------------------------- /src/app/battle_object.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | use std::ops::{Deref, DerefMut}; 4 | 5 | #[repr(C)] 6 | #[vtable_impl(BattleObject)] 7 | // #[derive(TypeAssert)] 8 | pub(crate) struct BattleObjectVTable { 9 | destructor: extern "C" fn(this: &mut BattleObject), 10 | } 11 | 12 | #[repr(C)] 13 | pub struct BattleObject { 14 | vtable: &'static BattleObjectVTable, 15 | pub battle_object_id: u32, 16 | pub kind: i32, 17 | pub entry_id: i32, 18 | pub agent_kind: phx::Hash40, 19 | pub module_accessor: *mut app::BattleObjectModuleAccessor, 20 | pub previous: *mut BattleObject, 21 | pub next: *mut BattleObject, 22 | pub unknown_byte1: u8, 23 | pub unknown_byte2: u8, 24 | pub status: u8, 25 | pub other_status: u8, 26 | pub mutex: cpp::Mutex, 27 | pub unknown_byte3: u8, 28 | pub unknown_byte4: u8, 29 | padding: [u8; 6], 30 | } 31 | 32 | #[repr(C)] 33 | pub struct Fighter { 34 | parent: BattleObject, 35 | // ... 36 | } 37 | 38 | impl Deref for Fighter { 39 | type Target = BattleObject; 40 | 41 | fn deref(&self) -> &Self::Target { 42 | &self.parent 43 | } 44 | } 45 | 46 | impl DerefMut for Fighter { 47 | fn deref_mut(&mut self) -> &mut Self::Target { 48 | &mut self.parent 49 | } 50 | } 51 | 52 | #[repr(C)] 53 | pub struct Weapon { 54 | parent: BattleObject, 55 | // ... 56 | } 57 | 58 | #[repr(C)] 59 | pub struct Enemy { 60 | parent: BattleObject, 61 | // ... 62 | } 63 | 64 | #[repr(C)] 65 | pub struct Gimmick { 66 | parent: BattleObject, 67 | // ... 68 | } 69 | 70 | #[repr(C)] 71 | pub struct Item { 72 | parent: BattleObject, 73 | // ... 74 | } 75 | -------------------------------------------------------------------------------- /src/app/bosses.rs: -------------------------------------------------------------------------------- 1 | pub mod boss_private; 2 | pub mod crazyhand; 3 | pub mod crazyhandbomb; 4 | pub mod crazyhandgravityball; 5 | pub mod crazyhandsearchlight; 6 | pub mod darz; 7 | pub mod darztearup; 8 | pub mod dracula2; 9 | -------------------------------------------------------------------------------- /src/app/bosses/crazyhand.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app9crazyhand16get_camera_rangeEv"] 8 | pub(super) fn get_camera_range() -> cpp::simd::Vector4; 9 | 10 | #[link_name = "_ZN3app9crazyhand14get_dead_rangeEv"] 11 | pub(super) fn get_dead_range() -> cpp::simd::Vector4; 12 | 13 | #[link_name = "_ZN3app9crazyhand25get_shrinked_camera_rangeEv"] 14 | pub(super) fn get_shrinked_camera_range() -> cpp::simd::Vector4; 15 | 16 | #[link_name = "_ZN3app9crazyhand23get_shrinked_dead_rangeEv"] 17 | pub(super) fn get_shrinked_dead_range() -> cpp::simd::Vector4; 18 | 19 | #[link_name = "_ZN3app9crazyhand13revert_cameraEv"] 20 | pub(super) fn revert_camera(); 21 | 22 | #[link_name = "_ZN3app9crazyhand16set_camera_rangeERKN3phx8Vector4fE"] 23 | pub(super) fn set_camera_range(range: *const lib::Rect); 24 | 25 | #[link_name = "_ZN3app9crazyhand14set_dead_rangeERKN3phx8Vector4fE"] 26 | pub(super) fn set_dead_range(range: *const lib::Rect); 27 | 28 | #[link_name = "_ZN3app9crazyhand14start_zoom_outEiRKN3phx8Vector4fE"] 29 | pub(super) fn start_zoom_out(arg: i32, range: *const lib::Rect); 30 | 31 | } 32 | } 33 | 34 | pub fn get_camera_range() -> lib::Rect { 35 | unsafe { 36 | impl_::get_camera_range().into() 37 | } 38 | } 39 | 40 | pub fn get_dead_range() -> lib::Rect { 41 | unsafe { 42 | impl_::get_dead_range().into() 43 | } 44 | } 45 | 46 | pub fn get_shrinked_camera_range() -> lib::Rect { 47 | unsafe { 48 | impl_::get_shrinked_camera_range().into() 49 | } 50 | } 51 | 52 | pub fn get_shrinked_dead_range() -> lib::Rect { 53 | unsafe { 54 | impl_::get_shrinked_dead_range().into() 55 | } 56 | } 57 | 58 | pub fn revert_camera() { 59 | unsafe { 60 | impl_::revert_camera() 61 | } 62 | } 63 | 64 | pub fn set_camera_range(range: &lib::Rect) { 65 | unsafe { 66 | impl_::set_camera_range(range) 67 | } 68 | } 69 | 70 | pub fn set_dead_range(range: &lib::Rect) { 71 | unsafe { 72 | impl_::set_dead_range(range) 73 | } 74 | } 75 | 76 | pub fn start_zoom_out(arg: i32, range: &lib::Rect) { 77 | unsafe { 78 | impl_::start_zoom_out(arg, range) 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /src/app/bosses/crazyhandbomb.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app13crazyhandbomb35send_event_parents_invincible_frameERNS_18ItemModuleAccessorEji"] 8 | pub(super) fn send_event_parents_invincible_frame(module_accessor: *mut app::ItemModuleAccessor, battle_object_id: u32, invincible_frame: i32); 9 | 10 | } 11 | } 12 | 13 | pub fn send_event_parents_invincible_frame(module_accessor: &mut app::ItemModuleAccessor, battle_object_id: u32, invincible_frame: i32) { 14 | unsafe { 15 | impl_::send_event_parents_invincible_frame(module_accessor, battle_object_id, invincible_frame) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/app/bosses/crazyhandgravityball.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app20crazyhandgravityball20send_catch_cut_eventERNS_18ItemModuleAccessorE"] 8 | pub(super) fn send_catch_cut_event(module_accessor: *mut app::ItemModuleAccessor); 9 | 10 | #[link_name = "_ZN3app20crazyhandgravityball20send_catch_end_eventERNS_18ItemModuleAccessorEi"] 11 | pub(super) fn send_catch_end_event(module_accessor: *mut app::ItemModuleAccessor, battle_object_id: i32); 12 | 13 | #[link_name = "_ZN3app20crazyhandgravityball22send_catch_start_eventERNS_18ItemModuleAccessorEi"] 14 | pub(super) fn send_catch_start_event(module_accessor: *mut app::ItemModuleAccessor, battle_object_id: i32); 15 | 16 | } 17 | } 18 | 19 | pub fn send_catch_cut_event(module_accessor: &mut app::ItemModuleAccessor) { 20 | unsafe { 21 | impl_::send_catch_cut_event(module_accessor) 22 | } 23 | } 24 | 25 | pub fn send_catch_end_event(module_accessor: &mut app::ItemModuleAccessor, battle_object_id: i32) { 26 | unsafe { 27 | impl_::send_catch_end_event(module_accessor, battle_object_id) 28 | } 29 | } 30 | 31 | pub fn send_catch_start_event(module_accessor: &mut app::ItemModuleAccessor, battle_object_id: i32) { 32 | unsafe { 33 | impl_::send_catch_start_event(module_accessor, battle_object_id) 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/app/bosses/crazyhandsearchlight.rs: -------------------------------------------------------------------------------- 1 | mod impl_ { 2 | extern "C" { 3 | #[link_name = "_ZN3app20crazyhandsearchlight17add_flower_damageEiff"] 4 | pub(super) fn add_flower_damage(battle_object_id: u32, frames: f32, damage: f32); 5 | 6 | } 7 | } 8 | 9 | pub fn add_flower_damage(battle_object_id: u32, frames: f32, damage: f32) { 10 | unsafe { 11 | impl_::add_flower_damage(battle_object_id, frames, damage) 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/app/bosses/darz.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app4darz9can_existEv"] 8 | pub(super) fn can_exist() -> bool; 9 | 10 | #[link_name = "_ZN3app4darz20get_look_at_rotationERKN3phx8Vector3fES4_S4_"] 11 | pub(super) fn get_look_at_rotation(arg1: *const phx::Vector3f, arg2: *const phx::Vector3f, arg3: *const phx::Vector3f) -> cpp::simd::Vector3; 12 | 13 | } 14 | } 15 | 16 | pub fn can_exist() -> bool { 17 | unsafe { 18 | impl_::can_exist() 19 | } 20 | } 21 | 22 | pub fn get_look_at_rotation(arg1: &phx::Vector3f, arg2: &phx::Vector3f, arg3: &phx::Vector3f) -> phx::Vector3f { 23 | unsafe { 24 | impl_::get_look_at_rotation(arg1, arg2, arg3).into() 25 | } 26 | } -------------------------------------------------------------------------------- /src/app/bosses/darztearup.rs: -------------------------------------------------------------------------------- 1 | mod impl_ { 2 | extern "C" { 3 | #[link_name = "_ZN3app10darztearup19cancel_fighter_slowEi"] 4 | pub(super) fn cancel_fighter_slow(entry_id: i32); 5 | 6 | #[link_name = "_ZN3app10darztearup16set_fighter_slowEiii"] 7 | pub(super) fn set_fighter_slow(entry_id: i32, magnitude: i32, frames: i32); 8 | 9 | } 10 | } 11 | 12 | pub fn cancel_fighter_slow(entry_id: i32) { 13 | unsafe { 14 | impl_::cancel_fighter_slow(entry_id) 15 | } 16 | } 17 | 18 | pub fn set_fighter_slow(entry_id: i32, magnitude: i32, frames: i32) { 19 | unsafe { 20 | impl_::set_fighter_slow(entry_id, magnitude, frames) 21 | } 22 | } 23 | 24 | -------------------------------------------------------------------------------- /src/app/bosses/dracula2.rs: -------------------------------------------------------------------------------- 1 | mod impl_ { 2 | extern "C" { 3 | #[link_name = "_ZN3app8dracula233notify_melee_start_to_hud_managerEv"] 4 | pub(super) fn notify_melee_start_to_hud_manager(); 5 | 6 | } 7 | } 8 | 9 | pub fn notify_melee_start_to_hud_manager() { 10 | unsafe { 11 | impl_::notify_melee_start_to_hud_manager() 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/app/camera.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app6camera15check_dead_areaERKN3phx8Vector3fE"] 8 | pub(super) fn check_dead_area(pos: *const phx::Vector3f) -> bool; 9 | 10 | #[link_name = "_ZN3app6camera22get_camera_limit_rangeEv"] 11 | pub(super) fn get_camera_limit_range() -> cpp::simd::Vector4; 12 | 13 | #[link_name = "_ZN3app6camera16get_camera_rangeEv"] 14 | pub(super) fn get_camera_range() -> cpp::simd::Vector4; 15 | 16 | #[link_name = "_ZN3app6camera13get_dead_areaEv"] 17 | pub(super) fn get_dead_area() -> cpp::simd::Vector4; 18 | 19 | #[link_name = "_ZN3app6camera13set_auto_zoomEb"] 20 | pub(super) fn set_auto_zoom(auto_zoom: bool); 21 | 22 | #[link_name = "_ZN3app6camera10target_posEv"] 23 | pub(super) fn target_pos() -> cpp::simd::Vector3; 24 | 25 | } 26 | } 27 | 28 | pub fn check_dead_area(pos: &phx::Vector3f) -> bool { 29 | unsafe { 30 | impl_::check_dead_area(pos) 31 | } 32 | } 33 | 34 | pub fn get_camera_limit_range() -> lib::Rect { 35 | unsafe { 36 | impl_::get_camera_limit_range().into() 37 | } 38 | } 39 | 40 | pub fn get_camera_range() -> lib::Rect { 41 | unsafe { 42 | impl_::get_camera_range().into() 43 | } 44 | } 45 | 46 | pub fn get_dead_area() -> lib::Rect { 47 | unsafe { 48 | impl_::get_dead_area().into() 49 | } 50 | } 51 | 52 | pub fn set_auto_zoom(auto_zoom: bool) { 53 | unsafe { 54 | impl_::set_auto_zoom(auto_zoom) 55 | } 56 | } 57 | 58 | pub fn target_pos() -> phx::Vec3 { 59 | unsafe { 60 | impl_::target_pos().into() 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/app/consts.rs: -------------------------------------------------------------------------------- 1 | mod ai; 2 | mod attack; 3 | mod collision; 4 | mod control; 5 | mod cut_in; 6 | mod fighters; 7 | mod kind; 8 | mod misc; 9 | mod status; 10 | mod work; 11 | 12 | pub use ai::*; 13 | pub use attack::*; 14 | pub use collision::*; 15 | pub use control::*; 16 | pub use cut_in::*; 17 | pub use fighters::*; 18 | pub use kind::*; 19 | pub use misc::*; 20 | pub use status::*; 21 | pub use work::*; -------------------------------------------------------------------------------- /src/app/consts/ai.rs: -------------------------------------------------------------------------------- 1 | pub mod FighterAI; 2 | pub mod FighterAIAct; 3 | pub mod FighterAIAnalyst; 4 | pub mod FighterAIStat; 5 | 6 | #[repr(u8)] 7 | pub enum FighterAICPType { 8 | Normal = 0x0, 9 | Stay = 0x1, 10 | Walk = 0x2, 11 | Jump = 0x3, 12 | Squat = 0x4, 13 | Escape = 0x5, 14 | EscapeNoRoll = 0x6, 15 | Chicken = 0x7, 16 | Attacknear = 0x8, 17 | Freak = 0x9, 18 | Cooperate = 0xA, 19 | Item = 0xB, 20 | Itemless = 0xC, 21 | Zako1 = 0xD, 22 | Zako2 = 0xE, 23 | Allstar = 0xF, 24 | StrongZako1 = 0x10, 25 | StrongZako2 = 0x11, 26 | Metal = 0x12, 27 | Giant = 0x13, 28 | Koopag = 0x14, 29 | Attackp1 = 0x15, 30 | Attackp2 = 0x16, 31 | Attackp3 = 0x17, 32 | Attackp4 = 0x18, 33 | TrainingSpecial = 0x19, 34 | TrainingSmashS = 0x1A, 35 | Appealer = 0x1B, 36 | Shielder = 0x1C, 37 | Swimmer = 0x1D, 38 | Shooter = 0x1E, 39 | Swinger = 0x1F, 40 | KirbyCopy = 0x20, 41 | SmashFLow = 0x21, 42 | Sham = 0x22, 43 | Challenger = 0x23, 44 | Manual = 0x24, 45 | Kiiladarz1 = 0x25, 46 | Kiiladarz2 = 0x26, 47 | Debug = 0x27, 48 | ParamMax = 0x28, 49 | ShdKirby = 0x29, 50 | } 51 | 52 | #[repr(u8)] 53 | pub enum FighterAICPSlideType { 54 | MeleeCP = 0x0, 55 | None = 0x1, 56 | Weak = 0x2, 57 | Strong = 0x3 58 | } 59 | 60 | #[repr(u32)] 61 | pub enum FighterAIUniqStat { 62 | Null = 0x0, 63 | GroundFree = 0x1, 64 | AirFree = 0x2, 65 | Dash = 0x3, 66 | Down = 0x4, 67 | Damage = 0x5, 68 | Cliff = 0x6, 69 | CliffAct = 0x7, 70 | Ladder = 0x8, 71 | Piyo = 0x9, 72 | PiyoS = 0xA, 73 | PiyoL = 0xB, 74 | Catch = 0xC, 75 | CatchEnd = 0xD, 76 | Swim = 0xE, 77 | AtWall = 0xF, 78 | FallSp = 0x10, 79 | Dragoon = 0x11, 80 | Genesis = 0x12, 81 | Killer = 0x13, 82 | Warpstar = 0x14, 83 | Attack = 0x15, 84 | AttackGround = 0x16, 85 | AtkHold = 0x17, 86 | AtkHoldFast = 0x18, 87 | AtkCatch = 0x19, 88 | Guard = 0x1A, 89 | Counter = 0x1B, 90 | JumpSquat = 0x1C, 91 | Fixdmg = 0x1D, 92 | Escape = 0x1E, 93 | Rebirth = 0x1F, 94 | LucarioSpecialS = 0x20, 95 | LucarioSpecialSC2 = 0x21, 96 | GamewatchSpecialLw = 0x22, 97 | Barrel = 0x23, 98 | Spring = 0x24, 99 | MewtwoThrown = 0x25, 100 | MasterSpecialN = 0x26, 101 | } 102 | 103 | impl FighterAIUniqStat { 104 | #[deprecated = "This constant holds the same value as AtkCatch, it doesn't appear to go used in game so be cautious when using it"] 105 | pub const GUARD_BREAK_ATTACK: FighterAIUniqStat = FighterAIUniqStat::AtkCatch; 106 | } 107 | 108 | #[repr(u32)] 109 | pub enum FighterAIWeaponType { 110 | Weapon = 0x0, 111 | Item = 0x1, 112 | Stage = 0x2, 113 | Fighter = 0x3, 114 | Drop = 0x4, 115 | Item2 = 0x5, 116 | Enemy = 0x6, 117 | } 118 | 119 | 120 | #[repr(u32)] 121 | pub enum FighterAIAttackPhase { 122 | None = 0x0, 123 | Prepare = 0x1, 124 | Start = 0x2, 125 | Active = 0x3, 126 | End = 0x4, 127 | } 128 | 129 | 130 | bitflags! { 131 | #[repr(C)] 132 | pub struct FighterAICPFlag: u16 { 133 | const Run = 0x1; 134 | const Attack = 0x2; 135 | const AtkAir = 0x4; 136 | const AtkJump = 0x8; 137 | const Shot = 0x10; 138 | const Shield = 0x20; 139 | const ChkFt = 0x40; 140 | const ChkZone = 0x80; 141 | const NearFt = 0x100; 142 | const Roll = 0x200; 143 | const Passive = 0x400; 144 | } 145 | } 146 | 147 | bitflags! { 148 | #[repr(C)] 149 | pub struct FighterAIWeaponFlag: u16 { 150 | const Enable = 0x1; 151 | const Accel = 0x2; 152 | const FloorSet = 0x4; 153 | const OnScreen = 0x8; 154 | const Shield = 0x10; 155 | const Reflector = 0x20; 156 | const Absorber = 0x40; 157 | const PutInPocket = 0x80; 158 | const Capture = 0x100; 159 | const NoAttack = 0x200; 160 | const SpeedDamage = 0x400; 161 | const Explosion30 = 0x800; 162 | const Explosion10 = 0x1000; 163 | const Eatable = 0x2000; 164 | const NotShot = 0x4000; 165 | } 166 | } -------------------------------------------------------------------------------- /src/app/consts/ai/FighterAI.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum Mode { 3 | None = 0x0, 4 | Attack = 0x1, 5 | Defend = 0x2, 6 | Return = 0x3, 7 | Away = 0x4, 8 | Chase = 0x5, 9 | Refuge = 0x6, 10 | Ladder = 0x7, 11 | Piyo = 0x8, 12 | DropChase = 0x9, 13 | DropGet = 0xA, 14 | ItemShoot = 0xB, 15 | Dragoon = 0xC, 16 | Final = 0xD, 17 | Hammer = 0xE, 18 | Catch = 0xF, 19 | Swim = 0x10, 20 | Relax = 0x11, 21 | Center = 0x12, 22 | AttackAbs = 0x13, 23 | DefendAbs = 0x14, 24 | StageTargetChase = 0x15, 25 | StageTarget = 0x16, 26 | StageGimmick = 0x17, 27 | Fireflower = 0x18, 28 | MewtwoThrown = 0x19, 29 | Child = 0x1A, 30 | ChildChase = 0x1B, 31 | ChildDown = 0x1C, 32 | ChildRet = 0x1D, 33 | ChildLadder = 0x1E, 34 | ChildPiyo = 0x1F, 35 | ChildCatch = 0x20, 36 | ChildSwim = 0x21, 37 | ChildStageGimmick = 0x22 38 | } -------------------------------------------------------------------------------- /src/app/consts/ai/FighterAIAct.rs: -------------------------------------------------------------------------------- 1 | #[repr(u16)] 2 | pub enum CmdId { 3 | Null = 0x0, 4 | Ground = 0x6030, 5 | G_AtkN = 0x6031, 6 | G_AtkF = 0x6032, 7 | G_AtkU = 0x6033, 8 | G_AtkD = 0x6034, 9 | G_SmashF = 0x6035, 10 | G_SmashU = 0x6036, 11 | G_SmashD = 0x6037, 12 | G_BlowN = 0x6038, 13 | G_BlowF = 0x6039, 14 | G_BlowU = 0x603A, 15 | G_BlowD = 0x603B, 16 | G_Catch = 0x603C, 17 | G_None = 0x603D, 18 | Air = 0x6040, 19 | A_AtkN = 0x6041, 20 | A_AtkF = 0x6042, 21 | A_AtkB = 0x6043, 22 | A_AtkU = 0x6044, 23 | A_AtkD = 0x6045, 24 | A_BlowN = 0x6046, 25 | A_BlowF = 0x6047, 26 | A_BlowU = 0x6048, 27 | A_BlowD = 0x6049, 28 | BlowCustomize = 0x6050, 29 | G_BlowN2 = 0x6051, 30 | G_BlowF2 = 0x6052, 31 | G_BlowU2 = 0x6053, 32 | G_BlowD2 = 0x6054, 33 | A_BlowN2 = 0x6055, 34 | A_BlowF2 = 0x6056, 35 | A_BlowU2 = 0x6057, 36 | A_BlowD2 = 0x6058, 37 | G_BlowN3 = 0x6059, 38 | G_BlowF3 = 0x605A, 39 | G_BlowU3 = 0x605B, 40 | G_BlowD3 = 0x605C, 41 | A_BlowN3 = 0x605D, 42 | A_BlowF3 = 0x605E, 43 | A_BlowU3 = 0x605F, 44 | A_BlowD3 = 0x6060, 45 | G_BlowN4 = 0x6061, 46 | G_BlowF4 = 0x6062, 47 | G_BlowU4 = 0x6063, 48 | G_BlowD4 = 0x6064, 49 | A_BlowN4 = 0x6065, 50 | A_BlowF4 = 0x6066, 51 | A_BlowU4 = 0x6067, 52 | A_BlowD4 = 0x6068, 53 | BlowCustomizeEnd = 0x6069, 54 | RyuGround = 0x6070, 55 | G_Atk2N = 0x6071, 56 | G_Atk2F = 0x6072, 57 | G_Atk2U = 0x6073, 58 | G_Atk2D = 0x6074, 59 | G_Blow2N = 0x6075, 60 | G_Blow2F = 0x6076, 61 | G_Blow2U = 0x6077, 62 | RyuAir = 0x6080, 63 | A_Blow2N = 0x6081, 64 | A_Blow2F = 0x6082, 65 | A_Blow2U = 0x6083, 66 | Etc = 0x6090, 67 | G_DashAttack = 0x6091, 68 | G_DashCatch = 0x6092, 69 | G_TurnCatch = 0x6093, 70 | A_Catch = 0x6094, 71 | BraveGround = 0x6100, 72 | G_BraveBlowF2 = 0x6101, 73 | G_BraveBlowF3 = 0x6102, 74 | BraveAir = 0x6110, 75 | A_BraveBlowF2 = 0x6111, 76 | A_BraveBlowF3 = 0x6112, 77 | DollyGround = 0x6120, 78 | G_BlowB = 0x6121, 79 | G_BlowSuper1 = 0x6122, 80 | G_BlowSuper2 = 0x6123, 81 | G_Blow3N = 0x6124, 82 | G_Blow3F = 0x6125, 83 | G_Blow3B = 0x6126, 84 | G_Blow3U = 0x6127, 85 | G_Blow3D = 0x6128, 86 | DollyAir = 0x6130, 87 | A_BlowB = 0x6131, 88 | A_Blow3N = 0x6132, 89 | A_Blow3F = 0x6133, 90 | A_Blow3B = 0x6134, 91 | A_Blow3U = 0x6135, 92 | A_Blow3D = 0x6136, 93 | MasterGround = 0x6140, 94 | G_MasterBlowF2 = 0x6141, 95 | MasterAir = 0x6150, 96 | A_MasterBlowF2 = 0x6151, 97 | TantanGround = 0x6160, 98 | G_TantanAtkFR = 0x6161, 99 | G_TantanSmashFR = 0x6162, 100 | TantanAir = 0x6170, 101 | A_TantanAtkF2 = 0x6171, 102 | A_TantanAtkB2 = 0x6172, 103 | A_TantanAtkNR = 0x6173, 104 | A_TantanAtkFR = 0x6174, 105 | A_TantanAtkBR = 0x6175, 106 | A_TantanAtkFR2 = 0x6176, 107 | A_TantanAtkBR2 = 0x6177, 108 | PickelGround = 0x6180, 109 | G_PickelBlowF2 = 0x6181, 110 | PickelAir = 0x6190, 111 | A_PickelBlowF2 = 0x6191, 112 | DemonGround = 0x6200, 113 | G_DemonAtkStand1 = 0x6201, 114 | G_DemonAtkStand2 = 0x6202, 115 | G_DemonAtkStand3 = 0x6203, 116 | G_DemonAtkStand4 = 0x6204, 117 | G_DemonAtkStand5 = 0x6205, 118 | G_DemonAtkStand6 = 0x6206, 119 | G_DemonAtkSquat1 = 0x6207, 120 | G_DemonAtkSquat2 = 0x6208, 121 | G_DemonAtkSquat3 = 0x6209, 122 | G_DemonAtkSquat4 = 0x620A, 123 | G_DemonAtkCatch = 0x620B, 124 | G_DemonAtkStep2 = 0x620C, 125 | G_DemonAtkStep2f = 0x620D, 126 | G_DemonAtkStep2l = 0x620E, 127 | G_DemonAtkStep2s = 0x620F, 128 | G_DemonAtkRage = 0x6210, 129 | } 130 | 131 | impl CmdId { 132 | pub const DEMON_AIR: CmdId = CmdId::G_DemonAtkRage; // Probably a bug on the devs end, every other one of these starts/stops at new values 133 | pub const GROUND_NUM: usize = 0xD; 134 | pub const AIR_NUM: usize = 0x9; 135 | pub const COMMAND_NUM: usize = 0x16; 136 | pub const COMMAND_CUSTOMIZE_NUM: usize = 0x2E; 137 | } 138 | 139 | #[repr(u16)] 140 | pub enum ReqId { 141 | Ground = 0x6010, 142 | G_QuickRangeC = 0x6011, 143 | G_QuickRangeS = 0x6012, 144 | G_PowerRangeS = 0x6013, 145 | G_Dash = 0x6014, 146 | G_Lower = 0x6015, 147 | G_ShotL = 0x6016, 148 | G_Term = 0x6017, 149 | Air = 0x6020, 150 | A_Near = 0x6021, 151 | A_F = 0x6022, 152 | A_B = 0x6023, 153 | A_U = 0x6024, 154 | A_D = 0x6025, 155 | A_Meteor = 0x6026, 156 | G_GuardCancel = 0x6027, 157 | G_JumpSustain = 0x6028, 158 | G_Feint = 0x6029, 159 | A_Feint = 0x602A, 160 | A_Term = 0x602B, 161 | } 162 | 163 | impl ReqId { 164 | pub const NUM: usize = 0x10; 165 | } -------------------------------------------------------------------------------- /src/app/consts/ai/FighterAIAnalyst.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum AIStatus { 3 | FreeStop = 0x0, 4 | FreeDash = 0x1, 5 | FreeRun = 0x2, 6 | FreeRunBrake = 0x3, 7 | JumpSquat = 0x4, 8 | Landing = 0x5, 9 | SpFall = 0x6, 10 | Damaged = 0x7, 11 | DamagedCancelable = 0x8, 12 | Catch = 0x9, 13 | Down = 0xA, 14 | Cliff = 0xB, 15 | CliffOff = 0xC, 16 | AttackPrepare = 0xD, 17 | Attack = 0xE, 18 | GroundAttackPrepare = 0xF, 19 | GroundAttack = 0x10, 20 | AttackEnd = 0x11, 21 | AttackHold = 0x12, 22 | CounterHold = 0x13, 23 | CounterEnd = 0x14, 24 | Shield = 0x15, 25 | ShieldOff = 0x16, 26 | Escape = 0x17, 27 | Piyo = 0x18, 28 | Rebirth = 0x19, 29 | } -------------------------------------------------------------------------------- /src/app/consts/attack.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug, Copy, Clone, Eq, PartialEq)] 2 | #[repr(u8)] 3 | pub enum AttackSetOffKind { 4 | Off = 0x0, 5 | On = 0x1, 6 | Thru = 0x2, 7 | NoStop = 0x3, 8 | } 9 | 10 | #[derive(Debug, Copy, Clone, Eq, PartialEq)] 11 | #[repr(u8)] 12 | pub enum AttackLRCheck { 13 | Pos = 0x0, 14 | Speed = 0x1, 15 | LR = 0x2, 16 | Forward = 0x3, 17 | Backward = 0x4, 18 | Part = 0x5, 19 | BackSlash = 0x6, 20 | Left = 0x7, 21 | Right = 0x8, 22 | } 23 | 24 | #[derive(Debug, Copy, Clone, Eq, PartialEq)] 25 | #[repr(u8)] 26 | pub enum AttackRegion { 27 | None = 0x0, 28 | Head = 0x1, 29 | Body = 0x2, 30 | Hip = 0x3, 31 | Punch = 0x4, 32 | Elbow = 0x5, 33 | Kick = 0x6, 34 | Knee = 0x7, 35 | Throw = 0x8, 36 | Object = 0x9, 37 | Sword = 0xA, 38 | Hammer = 0xB, 39 | Bomb = 0xC, 40 | Spin = 0xD, 41 | Bite = 0xE, 42 | Magic = 0xF, 43 | PSI = 0x10, 44 | Palutena = 0x11, 45 | Aura = 0x12, 46 | Bat = 0x13, 47 | Parasol = 0x14, 48 | Pikmin = 0x15, 49 | Water = 0x16, 50 | Whip = 0x17, 51 | Tail = 0x18, 52 | Energy = 0x19, 53 | } 54 | -------------------------------------------------------------------------------- /src/app/consts/cut_in.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum CutInType { 3 | None = 0x0, 4 | LightingBowArrow = 0x1, 5 | KoCamera = 0x2, 6 | FighterSpecialZoom = 0x3, 7 | Finish = 0x4, 8 | FinalStartCamera = 0x5, 9 | MotionCamera = 0x6, 10 | } 11 | 12 | #[repr(u32)] 13 | pub enum CutInSubType { 14 | None = 0x0, 15 | TrailFinish = 0x1, 16 | } 17 | 18 | #[repr(u32)] 19 | pub enum CutInPriority { 20 | None = 0x0, 21 | KoCamera = 0x1, 22 | Finish = 0x2, 23 | Final = 0x3, 24 | } -------------------------------------------------------------------------------- /src/app/consts/fighters.rs: -------------------------------------------------------------------------------- 1 | mod brave; 2 | mod buddy; 3 | mod demon; 4 | mod diddy; 5 | mod dolly; 6 | mod edge; 7 | mod element; 8 | mod jack; 9 | 10 | pub use brave::*; 11 | pub use buddy::*; 12 | pub use demon::*; 13 | pub use diddy::*; 14 | pub use dolly::*; 15 | pub use edge::*; 16 | pub use element::*; 17 | pub use jack::*; -------------------------------------------------------------------------------- /src/app/consts/fighters/brave.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum FighterBraveSpecialLwCommand { 3 | None = 0xFFFFFFFF, 4 | Cure = 0x0, 5 | Flash1 = 0x1, 6 | Flash2 = 0x2, 7 | Explosion1 = 0x3, 8 | Explosion2 = 0x4, 9 | Deathball1 = 0x5, 10 | Deathball2 = 0x6, 11 | Fullburst = 0x7, 12 | Crash = 0x8, 13 | Steel = 0x9, 14 | SpeedUp = 0xA, 15 | AttackUp = 0xB, 16 | Reflect = 0xC, 17 | Sleep = 0xD, 18 | Various = 0xE, 19 | Flying = 0xF, 20 | Firesword = 0x10, 21 | Icesword = 0x11, 22 | Ironsword = 0x12, 23 | Devilsword = 0x13, 24 | Charge = 0x14, 25 | Num = 0x15, 26 | } 27 | 28 | impl FighterBraveSpecialLwCommand { 29 | pub const LIST_MAX: u8 = 0x4; 30 | } 31 | 32 | #[repr(u32)] 33 | pub enum FighterBraveSpecialLwVariousKind { 34 | None = 0xFFFFFFFF, 35 | Sleep = 0x0, 36 | Spycloak = 0x1, 37 | Flower = 0x2, 38 | Poison = 0x3, 39 | Slow = 0x4, 40 | Invincible = 0x5, 41 | Big = 0x6, 42 | Small = 0x7, 43 | SpEmpty = 0x8, 44 | SpFull = 0x9, 45 | CommandCure = 0xA, 46 | CommandFlash1 = 0xB, 47 | CommandFlash2 = 0xC, 48 | CommandExplosion1 = 0xD, 49 | CommandExplosion2 = 0xE, 50 | CommandDeathball1 = 0xF, 51 | CommandDeathball2 = 0x10, 52 | CommandFullburst = 0x11, 53 | CommandCrash = 0x12, 54 | CommandSteel = 0x13, 55 | CommandSpeedUp = 0x14, 56 | CommandAttackUp = 0x15, 57 | CommandReflect = 0x16, 58 | CommandSleep = 0x17, 59 | CommandFlying = 0x18, 60 | CommandFiresword = 0x19, 61 | CommandIcesword = 0x1A, 62 | CommandIronsword = 0x1B, 63 | CommandDevilsword = 0x1C, 64 | CommandCharge = 0x1D, 65 | } 66 | 67 | #[repr(u32)] 68 | pub enum FighterBraveFinalModuleCall { 69 | StartInit = 0x0, 70 | StartExit = 0x1, 71 | ReadyInit = 0x2, 72 | ReadyExec = 0x3, 73 | ReadyExitPre = 0x4, 74 | ReadyExit = 0x5, 75 | Scene01InitPre = 0x6, 76 | Scene01Init = 0x7, 77 | Scene01Exec = 0x8, 78 | Scene01Exit = 0x9, 79 | EndInit = 0xA, 80 | EndExec = 0xB, 81 | EndExit = 0xC, 82 | Num = 0xD, 83 | } -------------------------------------------------------------------------------- /src/app/consts/fighters/buddy.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum FighterBuddyFinalModuleCall { 3 | StartInit = 0x0, 4 | StartExit = 0x1, 5 | ReadyInit = 0x2, 6 | ReadyExec = 0x3, 7 | ReadyExitPre = 0x4, 8 | ReadyExit = 0x5, 9 | Scene01Init = 0x6, 10 | Scene01ExecFixPos = 0x7, 11 | Scene01Exit = 0x8, 12 | Scene02Init = 0x9, 13 | Scene02ExecFixPos = 0xA, 14 | Scene02Exit = 0xB, 15 | Scene03Init = 0xC, 16 | Scene03ExecFixPos = 0xD, 17 | Scene03Exit = 0xE, 18 | Scene04Init = 0xF, 19 | Scene04ExecFixPos = 0x10, 20 | Scene04Exit = 0x11, 21 | EndInit = 0x12, 22 | EndExec = 0x13, 23 | EndExit = 0x14, 24 | Num = 0x15, 25 | } -------------------------------------------------------------------------------- /src/app/consts/fighters/demon.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum FighterDemonFinalModuleCall { 3 | StartInit = 0x0, 4 | StartExit = 0x1, 5 | ReadyInit = 0x2, 6 | ReadyExec = 0x3, 7 | ReadyExit = 0x4, 8 | Scene01Init = 0x5, 9 | Scene01Exec = 0x6, 10 | Scene01Exit = 0x7, 11 | EndInit = 0x8, 12 | EndExec = 0x9, 13 | EndExit = 0xA, 14 | Num = 0xB, 15 | } -------------------------------------------------------------------------------- /src/app/consts/fighters/diddy.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum FighterDiddyFinalDir { 3 | None = 0xFFFFFFFF, 4 | Up = 0x0, 5 | Down = 0x1, 6 | Right = 0x2, 7 | Left = 0x3, 8 | } 9 | -------------------------------------------------------------------------------- /src/app/consts/fighters/dolly.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum FighterDollyFinalModuleCall { 3 | StartInit = 0x0, 4 | StartExit = 0x1, 5 | ReadyInit = 0x2, 6 | ReadyExec = 0x3, 7 | ReadyExitPre = 0x4, 8 | ReadyExit = 0x5, 9 | Scene01Init = 0x6, 10 | Scene01Exit = 0x7, 11 | Scene02Init = 0x8, 12 | Scene02Exit = 0x9, 13 | Scene02ExecFixPos = 0xA, 14 | Scene03Init = 0xB, 15 | Scene03ExecFixPos = 0xC, 16 | Scene03Exit = 0xD, 17 | Scene04Init = 0xE, 18 | Scene04Exit = 0xF, 19 | Scene05Init = 0x10, 20 | Scene05ExecFixPos = 0x11, 21 | Scene05Exit = 0x12, 22 | EndInit = 0x13, 23 | EndExec = 0x14, 24 | EndExit = 0x15, 25 | Num = 0x16, 26 | } -------------------------------------------------------------------------------- /src/app/consts/fighters/edge.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum FighterEdgeFinalModuleCall { 3 | StartInit = 0x0, 4 | StartExit = 0x1, 5 | ReadyInit = 0x2, 6 | ReadyExec = 0x3, 7 | ReadyExitPre = 0x4, 8 | ReadyExit = 0x5, 9 | Scene01InitPre = 0x6, 10 | Scene01Init = 0x7, 11 | Scene01Exec = 0x8, 12 | Scene01Exit = 0x9, 13 | EndInit = 0xA, 14 | EndExec = 0xB, 15 | EndExit = 0xC, 16 | Num = 0xD, 17 | } -------------------------------------------------------------------------------- /src/app/consts/fighters/element.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum FighterElementFinalModuleCall { 3 | StartInit = 0x0, 4 | StartExit = 0x1, 5 | ReadyInit = 0x2, 6 | ReadyExec = 0x3, 7 | ReadyExitPre = 0x4, 8 | ReadyExit = 0x5, 9 | Scene01Init = 0x6, 10 | Scene01Exec = 0x7, 11 | Scene01Exit = 0x8, 12 | Scene02Init = 0x9, 13 | Scene02Exec = 0xA, 14 | Scene02Exit = 0xB, 15 | EndInit = 0xC, 16 | EndExec = 0xD, 17 | EndExit = 0xE, 18 | Num = 0xF, 19 | } 20 | -------------------------------------------------------------------------------- /src/app/consts/fighters/jack.rs: -------------------------------------------------------------------------------- 1 | #[repr(u32)] 2 | pub enum FighterJackFinalModuleCall { 3 | StartInit = 0x0, 4 | StartExit = 0x1, 5 | ReadyInit = 0x2, 6 | ReadyExec = 0x3, 7 | ReadyExitPre = 0x4, 8 | ReadyExit = 0x5, 9 | Scene01InitPre = 0x6, 10 | Scene01Init = 0x7, 11 | Scene01Exec = 0x8, 12 | Scene01Exit = 0x9, 13 | Scene02Init = 0xA, 14 | Scene02Exec = 0xB, 15 | Scene02Exit = 0xC, 16 | EndInit = 0xD, 17 | EndExec = 0xE, 18 | EndExit = 0xF, 19 | Num = 0x10, 20 | } -------------------------------------------------------------------------------- /src/app/consts/misc.rs: -------------------------------------------------------------------------------- 1 | bitflags! { 2 | #[repr(C)] 3 | #[allow(non_upper_case_globals)] 4 | pub struct FighterFacial: u32 { 5 | const None = 0x1; 6 | const Curry = 0x2; 7 | const Damage = 0x4; 8 | const Special = 0x8; 9 | const Pikmin = 0x10; 10 | const FinalFear = 0x20; 11 | const BombFear = 0x40; 12 | const Special2 = 0x80; 13 | const Finish = 0x100; 14 | const Poison = 0x200; 15 | const Stop = 0x400; 16 | const Sleep = 0x800; 17 | const Fistdown = 0x1000; 18 | } 19 | } 20 | 21 | #[repr(C)] 22 | pub struct FighterAvailableFinal(u32); -------------------------------------------------------------------------------- /src/app/consts/work.rs: -------------------------------------------------------------------------------- 1 | #[allow(dead_code)] 2 | pub mod transition_groups; 3 | 4 | #[allow(dead_code)] 5 | pub mod transition_terms; 6 | 7 | #[allow(dead_code)] 8 | pub mod work_ids; 9 | 10 | #[repr(u32)] 11 | pub enum BossCommonParamFloat { 12 | HpMin = 0x0, 13 | HpMax = 0x1, 14 | MultiPlayHpMul = 0x2, 15 | MultiCpuPlayHpMul = 0x3, 16 | MultiPlayPowerMul = 0x4, 17 | Final2ndHpMulMin = 0x5, 18 | Final2ndHpMulMax = 0x6, 19 | Final2ndPowerMulMin = 0x7, 20 | Final2ndPowerMulMax = 0x8, 21 | Final2ndHardHpMulMin = 0x9, 22 | Final2ndHardHpMulMax = 0xA, 23 | Final2ndHardPowerMulMin = 0xB, 24 | Final2ndHardPowerMulMax = 0xC, 25 | VeryEasyWaitTimeMul = 0xD, 26 | VeryEasyHpMul = 0xE, 27 | VeryEasyPowerMul = 0xF, 28 | StandardHpMul = 0x10, 29 | Standard2ndHpMul = 0x11, 30 | AngryWaitFrameMul = 0x12, 31 | TargetSearchNearestMul = 0x13, 32 | TargetSearchMostDamagedMul = 0x14, 33 | TargetSearchSelectedMul = 0x15, 34 | DamageMaxLv0 = 0x16, 35 | DamageMaxLv10 = 0x17, 36 | DamageMaxOverMul = 0x18, 37 | } 38 | 39 | #[repr(u32)] 40 | pub enum BossCommonParamInt { 41 | TargetSearchSelectedCountThreshold = 0x0, 42 | BossStopFrame = 0x1, 43 | BossSlowMag1st = 0x2, 44 | BossSlowFrame1st = 0x3, 45 | BossSlowMag2nd = 0x4, 46 | BossSlowFrame2nd = 0x5, 47 | BgmFadeTime = 0x6, 48 | SeFadeTime = 0x7, 49 | } -------------------------------------------------------------------------------- /src/app/debug.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app5debug17add_debug_commandEP9lua_StatePKci"] 8 | pub(super) fn add_debug_command(state: *mut lua_State, name: *const u8, arg: i32); 9 | 10 | #[link_name = "_ZN3app5debug9draw_lineEP9lua_StateRKN3phx8Vector2fES6_i"] 11 | pub(super) fn draw_line(state: *mut lua_State, pos_a: *const phx::Vector2f, pos_b: *const phx::Vector2f, frames: i32); 12 | 13 | #[link_name = "_ZN3app5debug9log_fatalEPKc"] 14 | pub(super) fn log_fatal(text: *const u8); 15 | 16 | #[link_name = "_ZN3app5debug8log_infoEPKc"] 17 | pub(super) fn log_info(text: *const u8); 18 | 19 | #[link_name = "_ZN3app5debug14set_draw_colorEP9lua_Stateffff"] 20 | pub(super) fn set_draw_color(state: *mut lua_State, r: f32, g: f32, b: f32, a: f32); 21 | 22 | } 23 | } 24 | 25 | pub fn add_debug_command(state: *mut lua_State, name: &str, arg: i32) { 26 | unsafe { 27 | impl_::add_debug_command(state, c_str!(name), arg) 28 | } 29 | } 30 | 31 | pub fn draw_line(state: *mut lua_State, pos_a: &phx::Vector2f, pos_b: &phx::Vector2f, frames: i32) { 32 | unsafe { 33 | impl_::draw_line(state, pos_a, pos_b, frames) 34 | } 35 | } 36 | 37 | pub fn log_fatal(text: &str) { 38 | unsafe { 39 | impl_::log_fatal(c_str!(text)) 40 | } 41 | } 42 | 43 | pub fn log_info(text: &str) { 44 | unsafe { 45 | impl_::log_info(c_str!(text)) 46 | } 47 | } 48 | 49 | pub fn set_draw_color(state: *mut lua_State, r: f32, g: f32, b: f32, a: f32) { 50 | unsafe { 51 | impl_::set_draw_color(state, r, g, b, a) 52 | } 53 | } 54 | 55 | -------------------------------------------------------------------------------- /src/app/events.rs: -------------------------------------------------------------------------------- 1 | mod link; 2 | 3 | pub use link::*; -------------------------------------------------------------------------------- /src/app/global_parameter.rs: -------------------------------------------------------------------------------- 1 | mod impl_ { 2 | extern "C" { 3 | #[link_name = "_ZN3app16global_parameter14is_boss_battleEv"] 4 | pub(super) fn is_boss_battle() -> bool; 5 | 6 | #[link_name = "_ZN3app16global_parameter14is_team_battleEv"] 7 | pub(super) fn is_team_battle() -> bool; 8 | 9 | #[link_name = "_ZN3app16global_parameter17is_spirits_battleEv"] 10 | pub(super) fn is_spirits_battle() -> bool; 11 | 12 | #[link_name = "_ZN3app16global_parameter30is_team_battle_and_team_attackEv"] 13 | pub(super) fn is_team_battle_and_team_attack() -> bool; 14 | } 15 | } 16 | 17 | pub fn is_boss_battle() -> bool { 18 | unsafe { 19 | impl_::is_boss_battle() 20 | } 21 | } 22 | 23 | pub fn is_team_battle() -> bool { 24 | unsafe { 25 | impl_::is_team_battle() 26 | } 27 | } 28 | 29 | pub fn is_spirits_battle() -> bool { 30 | unsafe { 31 | impl_::is_spirits_battle() 32 | } 33 | } 34 | 35 | pub fn is_team_battle_and_team_attack() -> bool { 36 | unsafe { 37 | impl_::is_team_battle_and_team_attack() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/app/items.rs: -------------------------------------------------------------------------------- 1 | pub mod akira; 2 | pub mod andross; 3 | pub mod androssshot; 4 | pub mod backshield; 5 | pub mod baitocrane; 6 | pub mod beetle; 7 | pub mod blackball; 8 | pub mod bomberman; 9 | pub mod bombermanbomb; 10 | pub mod boomerang; 11 | pub mod bossgalaga; 12 | pub mod buddybomb; 13 | pub mod chicken; 14 | pub mod clubshot; 15 | pub mod curryshot; 16 | pub mod cyborg; 17 | #[allow(non_snake_case)] 18 | pub mod daisydaikon; 19 | pub mod devil; 20 | #[allow(non_snake_case)] 21 | pub mod doll; 22 | pub mod dragoonset; 23 | pub mod dragoonsight; 24 | pub mod driver; 25 | #[allow(non_snake_case)] 26 | pub mod explosionbomb; -------------------------------------------------------------------------------- /src/app/items/akira.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app5akira14set_all_shieldERNS_26BattleObjectModuleAccessorE"] 8 | pub(super) fn set_all_shield(module_accessor: *mut app::BattleObjectModuleAccessor); 9 | 10 | #[link_name = "_ZN3app5akira17set_bullet_shieldERNS_26BattleObjectModuleAccessorE"] 11 | pub(super) fn set_bullet_shield(module_accessor: *mut app::BattleObjectModuleAccessor); 12 | 13 | } 14 | } 15 | 16 | pub fn set_all_shield(module_accessor: &mut app::BattleObjectModuleAccessor) { 17 | unsafe { 18 | impl_::set_all_shield(module_accessor) 19 | } 20 | } 21 | 22 | pub fn set_bullet_shield(module_accessor: &mut app::BattleObjectModuleAccessor) { 23 | unsafe { 24 | impl_::set_bullet_shield(module_accessor) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/items/andross.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app7andross26get_stage_andross_positionEv"] 8 | pub(super) fn get_stage_andross_position() -> cpp::simd::Vector3; 9 | } 10 | } 11 | 12 | pub fn get_stage_andross_position() -> phx::Vec3 { 13 | unsafe { 14 | impl_::get_stage_andross_position().into() 15 | } 16 | } -------------------------------------------------------------------------------- /src/app/items/androssshot.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app11androssshot9hit_checkERNS_18ItemModuleAccessorE"] 8 | pub(super) fn hit_check(module_accessor: *mut app::ItemModuleAccessor); 9 | 10 | #[link_name = "_ZN3app11androssshot14is_valid_pos_zEff"] 11 | pub(super) fn is_valid_pos_z(pos_z: f32, clip_far_offset: f32) -> bool; 12 | 13 | } 14 | } 15 | 16 | pub fn hit_check(module_accessor: &mut app::ItemModuleAccessor) { 17 | unsafe { 18 | impl_::hit_check(module_accessor) 19 | } 20 | } 21 | 22 | pub fn is_valid_pos_z(pos_z: f32, clip_far_offset: f32) -> bool { 23 | unsafe { 24 | impl_::is_valid_pos_z(pos_z, clip_far_offset) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/items/backshield.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app10backshield20is_enable_backshieldEPKNS_26BattleObjectModuleAccessorE"] 8 | pub(super) fn is_enable_backshield(module_accessor: *const app::BattleObjectModuleAccessor) -> bool; 9 | 10 | #[link_name = "_ZN3app10backshield27is_force_visible_backshieldEPKNS_26BattleObjectModuleAccessorE"] 11 | pub(super) fn is_force_visible_backshield(module_accessor: *const app::BattleObjectModuleAccessor) -> bool; 12 | 13 | #[link_name = "_ZN3app10backshield21is_visible_backshieldEPKNS_26BattleObjectModuleAccessorE"] 14 | pub(super) fn is_visible_backshield(module_accessor: *const app::BattleObjectModuleAccessor) -> bool; 15 | 16 | #[link_name = "_ZN3app10backshield13set_reflectorERNS_26BattleObjectModuleAccessorE"] 17 | pub(super) fn set_reflector(module_accessor: *mut app::BattleObjectModuleAccessor); 18 | 19 | } 20 | } 21 | 22 | pub fn is_enable_backshield(module_accessor: &app::BattleObjectModuleAccessor) -> bool { 23 | unsafe { 24 | impl_::is_enable_backshield(module_accessor) 25 | } 26 | } 27 | 28 | pub fn is_force_visible_backshield(module_accessor: &app::BattleObjectModuleAccessor) -> bool { 29 | unsafe { 30 | impl_::is_force_visible_backshield(module_accessor) 31 | } 32 | } 33 | 34 | pub fn is_visible_backshield(module_accessor: &app::BattleObjectModuleAccessor) -> bool { 35 | unsafe { 36 | impl_::is_visible_backshield(module_accessor) 37 | } 38 | } 39 | 40 | pub fn set_reflector(module_accessor: &mut app::BattleObjectModuleAccessor) { 41 | unsafe { 42 | impl_::set_reflector(module_accessor) 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/app/items/baitocrane.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app10baitocrane16add_camera_rangeERNS_26BattleObjectModuleAccessorEff"] 8 | pub(super) fn add_camera_range(module_accessor: *mut app::BattleObjectModuleAccessor, top: f32, bottom: f32); 9 | 10 | #[link_name = "_ZN3app10baitocrane28is_enable_capture_baitocraneERKNS_26BattleObjectModuleAccessorE"] 11 | pub(super) fn is_enable_capture_baitocrane(module_accessor: *const app::BattleObjectModuleAccessor) -> bool; 12 | 13 | #[link_name = "_ZN3app10baitocrane8set_grabERNS_26BattleObjectModuleAccessorE"] 14 | pub(super) fn set_grab(module_accessor: *mut app::BattleObjectModuleAccessor); 15 | 16 | } 17 | } 18 | 19 | pub fn add_camera_range(module_accessor: &mut app::BattleObjectModuleAccessor, top: f32, bottom: f32) { 20 | unsafe { 21 | impl_::add_camera_range(module_accessor, top, bottom) 22 | } 23 | } 24 | 25 | pub fn is_enable_capture_baitocrane(module_accessor: &app::BattleObjectModuleAccessor) -> bool { 26 | unsafe { 27 | impl_::is_enable_capture_baitocrane(module_accessor) 28 | } 29 | } 30 | 31 | pub fn set_grab(module_accessor: &mut app::BattleObjectModuleAccessor) { 32 | unsafe { 33 | impl_::set_grab(module_accessor) 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/app/items/beetle.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app6beetle24is_enable_capture_beetleERKNS_26BattleObjectModuleAccessorE"] 8 | pub(super) fn is_enable_capture_beetle(module_accessor: *const app::BattleObjectModuleAccessor) -> bool; 9 | 10 | #[link_name = "_ZN3app6beetle8set_grabERNS_26BattleObjectModuleAccessorE"] 11 | pub(super) fn set_grab(module_accessor: *mut app::BattleObjectModuleAccessor); 12 | 13 | } 14 | } 15 | 16 | pub fn is_enable_capture_beetle(module_accessor: &app::BattleObjectModuleAccessor) -> bool { 17 | unsafe { 18 | impl_::is_enable_capture_beetle(module_accessor) 19 | } 20 | } 21 | 22 | pub fn set_grab(module_accessor: &mut app::BattleObjectModuleAccessor) { 23 | unsafe { 24 | impl_::set_grab(module_accessor) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/items/blackball.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app9blackball18add_suction_energyERNS_18ItemModuleAccessorEj"] 8 | pub(super) fn add_suction_energy(module_accessor: *mut app::ItemModuleAccessor, receiver_obj_id: u32); 9 | 10 | #[link_name = "_ZN3app9blackball29set_attack_offset_back_line_zERNS_18ItemModuleAccessorE"] 11 | pub(super) fn set_attack_offset_back_line_z(module_accessor: *mut app::ItemModuleAccessor); 12 | 13 | #[link_name = "_ZN3app9blackball18start_item_captureERNS_18ItemModuleAccessorE"] 14 | pub(super) fn start_item_capture(module_accessor: *mut app::ItemModuleAccessor); 15 | 16 | #[link_name = "_ZN3app9blackball20start_weapon_captureERNS_18ItemModuleAccessorEj"] 17 | pub(super) fn start_weapon_capture(module_accessor: *mut app::ItemModuleAccessor, battle_object_id: u32); 18 | 19 | } 20 | } 21 | 22 | pub fn add_suction_energy(module_accessor: &mut app::ItemModuleAccessor, receiver_obj_id: u32) { 23 | unsafe { 24 | impl_::add_suction_energy(module_accessor, receiver_obj_id) 25 | } 26 | } 27 | 28 | pub fn set_attack_offset_back_line_z(module_accessor: &mut app::ItemModuleAccessor) { 29 | unsafe { 30 | impl_::set_attack_offset_back_line_z(module_accessor) 31 | } 32 | } 33 | 34 | pub fn start_item_capture(module_accessor: &mut app::ItemModuleAccessor) { 35 | unsafe { 36 | impl_::start_item_capture(module_accessor) 37 | } 38 | } 39 | 40 | pub fn start_weapon_capture(module_accessor: &mut app::ItemModuleAccessor, battle_object_id: u32) { 41 | unsafe { 42 | impl_::start_weapon_capture(module_accessor, battle_object_id) 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/app/items/bomberman.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app9bomberman16create_item_haveERNS_18ItemModuleAccessorENS_8ItemKindEN3phx6Hash40E"] 8 | pub(super) fn create_item_have(module_accessor: *mut app::ItemModuleAccessor, item_kind: app::ItemKind, node: phx::Hash40) -> u32; 9 | 10 | #[link_name = "_ZN3app9bomberman8put_itemERNS_18ItemModuleAccessorEjRKN3phx8Vector3fE"] 11 | pub(super) fn put_item(module_accessor: *mut app::ItemModuleAccessor, battle_object_id: u32, offset: *const phx::Vector3f); 12 | 13 | #[link_name = "_ZN3app9bomberman10set_searchERNS_18ItemModuleAccessorEN3phx6Hash40E"] 14 | pub(super) fn set_search(module_accessor: *mut app::ItemModuleAccessor, param_name: phx::Hash40); 15 | 16 | } 17 | } 18 | 19 | pub fn create_item_have(module_accessor: &mut app::ItemModuleAccessor, item_kind: app::ItemKind, node: phx::Hash40) -> u32 { 20 | unsafe { 21 | impl_::create_item_have(module_accessor, item_kind, node) 22 | } 23 | } 24 | 25 | pub fn put_item(module_accessor: &mut app::ItemModuleAccessor, battle_object_id: u32, offset: &phx::Vector3f) { 26 | unsafe { 27 | impl_::put_item(module_accessor, battle_object_id, offset) 28 | } 29 | } 30 | 31 | pub fn set_search(module_accessor: &mut app::ItemModuleAccessor, param_name: phx::Hash40) { 32 | unsafe { 33 | impl_::set_search(module_accessor, param_name) 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/app/items/bombermanbomb.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app13bombermanbomb24send_event_bomberman_hitERNS_18ItemModuleAccessorEjRKN3phx8Vector3fE"] 8 | pub(super) fn send_event_bomberman_hit(module_accessor: *mut app::ItemModuleAccessor, battle_object_id: u32, pos: *const phx::Vector3f); 9 | 10 | } 11 | } 12 | 13 | pub fn send_event_bomberman_hit(module_accessor: &mut app::ItemModuleAccessor, battle_object_id: u32, pos: &phx::Vector3f) { 14 | unsafe { 15 | impl_::send_event_bomberman_hit(module_accessor, battle_object_id, pos) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/app/items/boomerang.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app9boomerang23is_catch_area_hit_checkERNS_18ItemModuleAccessorERKN3phx8Vector3fES6_f"] 8 | pub(super) fn is_catch_area_hit_check(module_accessor: *mut app::ItemModuleAccessor, arg2: *const phx::Vector3f, arg3: *const phx::Vector3f, arg4: f32) -> bool; 9 | 10 | #[link_name = "_ZN3app9boomerang16send_event_catchERNS_18ItemModuleAccessorE"] 11 | pub(super) fn send_event_catch(module_accessor: *mut app::ItemModuleAccessor) -> bool; 12 | } 13 | } 14 | 15 | pub fn is_catch_area_hit_check(module_accessor: &mut app::ItemModuleAccessor, arg2: &phx::Vector3f, arg3: &phx::Vector3f, arg4: f32) -> bool { 16 | unsafe { 17 | impl_::is_catch_area_hit_check(module_accessor, arg2, arg3, arg4) 18 | } 19 | } 20 | 21 | pub fn send_event_catch(module_accessor: &mut app::ItemModuleAccessor) -> bool { 22 | unsafe { 23 | impl_::send_event_catch(module_accessor) 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/app/items/bossgalaga.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app10bossgalaga28is_enable_capture_bossgalagaERKNS_26BattleObjectModuleAccessorE"] 8 | pub(super) fn is_enable_capture_bossgalaga(module_accessor: *const app::BattleObjectModuleAccessor) -> bool; 9 | 10 | #[link_name = "_ZN3app10bossgalaga8set_grabERNS_18ItemModuleAccessorEfff"] 11 | pub(super) fn set_grab(module_accessor: *mut app::ItemModuleAccessor, pos_x: f32, pos_y: f32, pos_z: f32); 12 | 13 | } 14 | } 15 | 16 | pub fn is_enable_capture_bossgalaga(module_accessor: &app::BattleObjectModuleAccessor) -> bool { 17 | unsafe { 18 | impl_::is_enable_capture_bossgalaga(module_accessor) 19 | } 20 | } 21 | 22 | pub fn set_grab(module_accessor: &mut app::ItemModuleAccessor, pos_x: f32, pos_y: f32, pos_z: f32) { 23 | unsafe { 24 | impl_::set_grab(module_accessor, pos_x, pos_y, pos_z) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/items/chicken.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app7chicken17is_behind_fighterERNS_18ItemModuleAccessorE"] 8 | pub(super) fn is_behind_fighter(module_accessor: *mut app::ItemModuleAccessor) -> bool; 9 | 10 | #[link_name = "_ZN3app7chicken16is_front_fighterERNS_18ItemModuleAccessorE"] 11 | pub(super) fn is_front_fighter(module_accessor: *mut app::ItemModuleAccessor) -> bool; 12 | 13 | } 14 | } 15 | 16 | pub fn is_behind_fighter(module_accessor: &mut app::ItemModuleAccessor) -> bool { 17 | unsafe { 18 | impl_::is_behind_fighter(module_accessor) 19 | } 20 | } 21 | 22 | pub fn is_front_fighter(module_accessor: &mut app::ItemModuleAccessor) -> bool { 23 | unsafe { 24 | impl_::is_front_fighter(module_accessor) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/items/clubshot.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app8clubshot18check_roll_up_areaERNS_18ItemModuleAccessorE"] 8 | pub(super) fn check_roll_up_area(module_accessor: *mut app::ItemModuleAccessor) -> bool; 9 | 10 | } 11 | } 12 | 13 | pub fn check_roll_up_area(module_accessor: &mut app::ItemModuleAccessor) -> bool { 14 | unsafe { 15 | impl_::check_roll_up_area(module_accessor) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/app/items/curryshot.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app9curryshot20init_log_attack_infoERNS_18ItemModuleAccessorE"] 8 | pub(super) fn init_log_attack_info(module_accessor: *mut app::ItemModuleAccessor); 9 | 10 | #[link_name = "_ZN3app9curryshot15is_preview_modeEv"] 11 | pub(super) fn is_preview_mode() -> bool; 12 | 13 | } 14 | } 15 | 16 | pub fn init_log_attack_info(module_accessor: &mut app::ItemModuleAccessor) { 17 | unsafe { 18 | impl_::init_log_attack_info(module_accessor) 19 | } 20 | } 21 | 22 | pub fn is_preview_mode() -> bool { 23 | unsafe { 24 | impl_::is_preview_mode() 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/items/cyborg.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app6cyborg13set_reflectorERNS_18ItemModuleAccessorE"] 8 | pub(super) fn set_reflector(module_accessor: *mut app::ItemModuleAccessor); 9 | 10 | } 11 | } 12 | 13 | pub fn set_reflector(module_accessor: &mut app::ItemModuleAccessor) { 14 | unsafe { 15 | impl_::set_reflector(module_accessor) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/app/items/devil.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app5devil14IT_MOVE_CAMERAERNS_18ItemModuleAccessorEbff"] 8 | pub(super) fn IT_MOVE_CAMERA(module_accessor: *mut app::ItemModuleAccessor, is_add: bool, x: f32, y: f32); 9 | 10 | #[link_name = "_ZN3app5devil23get_camera_devil_offsetEv"] 11 | pub(super) fn get_camera_devil_offset() -> cpp::simd::Vector2; 12 | 13 | #[link_name = "_ZN3app5devil24get_stage_devil_positionEv"] 14 | pub(super) fn get_stage_devil_position() -> cpp::simd::Vector2; 15 | 16 | #[link_name = "_ZN3app5devil20is_camera_mode_meleeEv"] 17 | pub(super) fn is_camera_mode_melee() -> bool; 18 | 19 | #[link_name = "_ZN3app5devil25set_camera_devil_fix_modeEb"] 20 | pub(super) fn set_camera_devil_fix_mode(is_fixed: bool); 21 | 22 | #[link_name = "_ZN3app5devil33set_camera_devil_interpolate_rateEf"] 23 | pub(super) fn set_camera_devil_interpolate_rate(rate: f32); 24 | 25 | #[link_name = "_ZN3app5devil21set_camera_devil_modeEb"] 26 | pub(super) fn set_camera_devil_mode(mode: bool); 27 | 28 | #[link_name = "_ZN3app5devil23set_camera_devil_offsetEff"] 29 | pub(super) fn set_camera_devil_offset(x: f32, y: f32); 30 | 31 | } 32 | } 33 | 34 | #[allow(non_snake_case)] 35 | pub fn IT_MOVE_CAMERA(module_accessor: &mut app::ItemModuleAccessor, is_add: bool, x: f32, y: f32) { 36 | unsafe { 37 | impl_::IT_MOVE_CAMERA(module_accessor, is_add, x, y) 38 | } 39 | } 40 | 41 | pub fn get_camera_devil_offset() -> phx::Vector2f { 42 | unsafe { 43 | impl_::get_camera_devil_offset().into() 44 | } 45 | } 46 | 47 | pub fn get_stage_devil_position() -> phx::Vector2f { 48 | unsafe { 49 | impl_::get_stage_devil_position().into() 50 | } 51 | } 52 | 53 | pub fn is_camera_mode_melee() -> bool { 54 | unsafe { 55 | impl_::is_camera_mode_melee() 56 | } 57 | } 58 | 59 | pub fn set_camera_devil_fix_mode(is_fixed: bool) { 60 | unsafe { 61 | impl_::set_camera_devil_fix_mode(is_fixed) 62 | } 63 | } 64 | 65 | pub fn set_camera_devil_interpolate_rate(rate: f32) { 66 | unsafe { 67 | impl_::set_camera_devil_interpolate_rate(rate) 68 | } 69 | } 70 | 71 | pub fn set_camera_devil_mode(mode: bool) { 72 | unsafe { 73 | impl_::set_camera_devil_mode(mode) 74 | } 75 | } 76 | 77 | pub fn set_camera_devil_offset(x: f32, y: f32) { 78 | unsafe { 79 | impl_::set_camera_devil_offset(x, y) 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /src/app/items/doll.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app4doll22DOLL_HIT_DATA_OFFSET_1Ev"] 8 | pub(super) fn DOLL_HIT_DATA_OFFSET_1() -> cpp::simd::Vector3; 9 | 10 | #[link_name = "_ZN3app4doll22DOLL_HIT_DATA_OFFSET_2Ev"] 11 | pub(super) fn DOLL_HIT_DATA_OFFSET_2() -> cpp::simd::Vector3; 12 | 13 | #[link_name = "_ZN3app4doll18DOLL_HIT_DATA_SIZEEv"] 14 | pub(super) fn DOLL_HIT_DATA_SIZE() -> f32; 15 | 16 | #[link_name = "_ZN3app4doll9DOLL_LIFEEv"] 17 | pub(super) fn DOLL_LIFE() -> f32; 18 | 19 | #[link_name = "_ZN3app4doll17DOLL_LIFE_DEC_MULEv"] 20 | pub(super) fn DOLL_LIFE_DEC_MUL() -> f32; 21 | 22 | #[link_name = "_ZN3app4doll17DOLL_MAX_DEGREE_YEv"] 23 | pub(super) fn DOLL_MAX_DEGREE_Y() -> f32; 24 | 25 | #[link_name = "_ZN3app4doll17DOLL_MIN_DEGREE_YEv"] 26 | pub(super) fn DOLL_MIN_DEGREE_Y() -> f32; 27 | 28 | #[link_name = "_ZN3app4doll14DOLL_POWER_MAXEv"] 29 | pub(super) fn DOLL_POWER_MAX() -> f32; 30 | 31 | #[link_name = "_ZN3app4doll14DOLL_POWER_MINEv"] 32 | pub(super) fn DOLL_POWER_MIN() -> f32; 33 | 34 | #[link_name = "_ZN3app4doll17DOLL_REACTION_MULEv"] 35 | pub(super) fn DOLL_REACTION_MUL() -> f32; 36 | 37 | #[link_name = "_ZN3app4doll18DOLL_ROT_SPEED_MAXEv"] 38 | pub(super) fn DOLL_ROT_SPEED_MAX() -> f32; 39 | 40 | #[link_name = "_ZN3app4doll18DOLL_ROT_SPEED_MINEv"] 41 | pub(super) fn DOLL_ROT_SPEED_MIN() -> f32; 42 | 43 | #[link_name = "_ZN3app4doll16DOLL_ROT_SPEED_ZEv"] 44 | pub(super) fn DOLL_ROT_SPEED_Z() -> f32; 45 | 46 | #[link_name = "_ZN3app4doll16DOLL_ROT_Z_RATIOEv"] 47 | pub(super) fn DOLL_ROT_Z_RATIO() -> f32; 48 | 49 | #[link_name = "_ZN3app4doll15DOLL_SHAPE_TYPEEv"] 50 | pub(super) fn DOLL_SHAPE_TYPE() -> i32; 51 | 52 | #[link_name = "_ZN3app4doll18DOLL_SMASH_ACCEL_YEv"] 53 | pub(super) fn DOLL_SMASH_ACCEL_Y() -> f32; 54 | 55 | #[link_name = "_ZN3app4doll22DOLL_SMASH_MAX_SPEED_XEv"] 56 | pub(super) fn DOLL_SMASH_MAX_SPEED_X() -> f32; 57 | 58 | #[link_name = "_ZN3app4doll22DOLL_SMASH_MAX_SPEED_YEv"] 59 | pub(super) fn DOLL_SMASH_MAX_SPEED_Y() -> f32; 60 | 61 | #[link_name = "_ZN3app4doll12DOLL_SPEED_YEv"] 62 | pub(super) fn DOLL_SPEED_Y() -> f32; 63 | 64 | } 65 | } 66 | 67 | pub fn DOLL_HIT_DATA_OFFSET_1() -> cpp::simd::Vector3 { 68 | unsafe { 69 | impl_::DOLL_HIT_DATA_OFFSET_1() 70 | } 71 | } 72 | 73 | pub fn DOLL_HIT_DATA_OFFSET_2() -> cpp::simd::Vector3 { 74 | unsafe { 75 | impl_::DOLL_HIT_DATA_OFFSET_2() 76 | } 77 | } 78 | 79 | pub fn DOLL_HIT_DATA_SIZE() -> f32 { 80 | unsafe { 81 | impl_::DOLL_HIT_DATA_SIZE() 82 | } 83 | } 84 | 85 | pub fn DOLL_LIFE() -> f32 { 86 | unsafe { 87 | impl_::DOLL_LIFE() 88 | } 89 | } 90 | 91 | pub fn DOLL_LIFE_DEC_MUL() -> f32 { 92 | unsafe { 93 | impl_::DOLL_LIFE_DEC_MUL() 94 | } 95 | } 96 | 97 | pub fn DOLL_MAX_DEGREE_Y() -> f32 { 98 | unsafe { 99 | impl_::DOLL_MAX_DEGREE_Y() 100 | } 101 | } 102 | 103 | pub fn DOLL_MIN_DEGREE_Y() -> f32 { 104 | unsafe { 105 | impl_::DOLL_MIN_DEGREE_Y() 106 | } 107 | } 108 | 109 | pub fn DOLL_POWER_MAX() -> f32 { 110 | unsafe { 111 | impl_::DOLL_POWER_MAX() 112 | } 113 | } 114 | 115 | pub fn DOLL_POWER_MIN() -> f32 { 116 | unsafe { 117 | impl_::DOLL_POWER_MIN() 118 | } 119 | } 120 | 121 | pub fn DOLL_REACTION_MUL() -> f32 { 122 | unsafe { 123 | impl_::DOLL_REACTION_MUL() 124 | } 125 | } 126 | 127 | pub fn DOLL_ROT_SPEED_MAX() -> f32 { 128 | unsafe { 129 | impl_::DOLL_ROT_SPEED_MAX() 130 | } 131 | } 132 | 133 | pub fn DOLL_ROT_SPEED_MIN() -> f32 { 134 | unsafe { 135 | impl_::DOLL_ROT_SPEED_MIN() 136 | } 137 | } 138 | 139 | pub fn DOLL_ROT_SPEED_Z() -> f32 { 140 | unsafe { 141 | impl_::DOLL_ROT_SPEED_Z() 142 | } 143 | } 144 | 145 | pub fn DOLL_ROT_Z_RATIO() -> f32 { 146 | unsafe { 147 | impl_::DOLL_ROT_Z_RATIO() 148 | } 149 | } 150 | 151 | pub fn DOLL_SHAPE_TYPE() -> i32 { 152 | unsafe { 153 | impl_::DOLL_SHAPE_TYPE() 154 | } 155 | } 156 | 157 | pub fn DOLL_SMASH_ACCEL_Y() -> f32 { 158 | unsafe { 159 | impl_::DOLL_SMASH_ACCEL_Y() 160 | } 161 | } 162 | 163 | pub fn DOLL_SMASH_MAX_SPEED_X() -> f32 { 164 | unsafe { 165 | impl_::DOLL_SMASH_MAX_SPEED_X() 166 | } 167 | } 168 | 169 | pub fn DOLL_SMASH_MAX_SPEED_Y() -> f32 { 170 | unsafe { 171 | impl_::DOLL_SMASH_MAX_SPEED_Y() 172 | } 173 | } 174 | 175 | pub fn DOLL_SPEED_Y() -> f32 { 176 | unsafe { 177 | impl_::DOLL_SPEED_Y() 178 | } 179 | } 180 | 181 | -------------------------------------------------------------------------------- /src/app/items/dragoonset.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app10dragoonset18calc_dragoonsight2Eff"] 8 | pub(super) fn calc_dragoonsight2(arg1: f32, arg2: f32); 9 | 10 | #[link_name = "_ZN3app10dragoonset34get_stage_dragoon_camera_rectangleEv"] 11 | pub(super) fn get_stage_dragoon_camera_rectangle() -> cpp::simd::Vector4; 12 | 13 | } 14 | } 15 | 16 | pub fn calc_dragoonsight2(arg1: f32, arg2: f32) { 17 | unsafe { 18 | impl_::calc_dragoonsight2(arg1, arg2) 19 | } 20 | } 21 | 22 | pub fn get_stage_dragoon_camera_rectangle() -> lib::Rect { 23 | unsafe { 24 | impl_::get_stage_dragoon_camera_rectangle().into() 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/items/dragoonsight.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app12dragoonsight17calc_dragoonsightEbff"] 8 | pub(super) fn calc_dragoonsight(arg1: bool, arg2: f32, arg3: f32) -> cpp::simd::Vector4; 9 | 10 | #[link_name = "_ZN3app12dragoonsight39get_rotation_with_calc_camera_directionEv"] 11 | pub(super) fn get_rotation_with_calc_camera_direction() -> cpp::simd::Vector2; 12 | 13 | #[link_name = "_ZN3app12dragoonsight23set_dragoonsight_effectERNS_18ItemModuleAccessorEb"] 14 | pub(super) fn set_dragoonsight_effect(module_accessor: *mut app::ItemModuleAccessor, arg: bool); 15 | 16 | } 17 | } 18 | 19 | pub fn calc_dragoonsight(arg1: bool, arg2: f32, arg3: f32) -> phx::Vector4f { 20 | unsafe { 21 | impl_::calc_dragoonsight(arg1, arg2, arg3).into() 22 | } 23 | } 24 | 25 | pub fn get_rotation_with_calc_camera_direction() -> phx::Vector2f { 26 | unsafe { 27 | impl_::get_rotation_with_calc_camera_direction().into() 28 | } 29 | } 30 | 31 | pub fn set_dragoonsight_effect(module_accessor: &mut app::ItemModuleAccessor, arg: bool) { 32 | unsafe { 33 | impl_::set_dragoonsight_effect(module_accessor, arg) 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/app/items/driver.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app6driver14get_center_posEj"] 8 | pub(super) fn get_center_pos(battle_object_id: u32) -> cpp::simd::Vector3; 9 | 10 | #[link_name = "_ZN3app6driver21get_rhombus_front_posERNS_18ItemModuleAccessorE"] 11 | pub(super) fn get_rhombus_front_pos(module_accessor: *mut app::ItemModuleAccessor) -> cpp::simd::Vector2; 12 | 13 | #[link_name = "_ZN3app6driver10link_catchERNS_18ItemModuleAccessorEj"] 14 | pub(super) fn link_catch(module_accessor: *mut app::ItemModuleAccessor, battle_object_id: u32) -> bool; 15 | 16 | #[link_name = "_ZN3app6driver10set_attackERNS_18ItemModuleAccessorEii"] 17 | pub(super) fn set_attack(module_accessor: *mut app::ItemModuleAccessor, id: i32, arg: i32); 18 | 19 | } 20 | } 21 | 22 | pub fn get_center_pos(battle_object_id: u32) -> phx::Vector3f { 23 | unsafe { 24 | impl_::get_center_pos(battle_object_id).into() 25 | } 26 | } 27 | 28 | pub fn get_rhombus_front_pos(module_accessor: &mut app::ItemModuleAccessor) -> phx::Vector2f { 29 | unsafe { 30 | impl_::get_rhombus_front_pos(module_accessor).into() 31 | } 32 | } 33 | 34 | pub fn link_catch(module_accessor: &mut app::ItemModuleAccessor, battle_object_id: u32) -> bool { 35 | unsafe { 36 | impl_::link_catch(module_accessor, battle_object_id) 37 | } 38 | } 39 | 40 | pub fn set_attack(module_accessor: &mut app::ItemModuleAccessor, id: i32, arg: i32) { 41 | unsafe { 42 | impl_::set_attack(module_accessor, id, arg) 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/app/modules.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod attack; 4 | mod cancel; 5 | mod damage; 6 | mod item; 7 | mod lua; 8 | mod motion_animcmd; 9 | mod posture; 10 | mod status; 11 | mod work; 12 | 13 | pub use attack::*; 14 | pub use cancel::*; 15 | pub use damage::*; 16 | pub use item::*; 17 | pub use lua::*; 18 | pub use motion_animcmd::*; 19 | pub use posture::*; 20 | pub use status::*; 21 | pub use work::*; 22 | 23 | #[repr(C)] 24 | #[vtable_impl(Module)] 25 | struct ModuleVTable { 26 | destructor: extern "C" fn(this: &mut Module), 27 | deleter: extern "C" fn(this: &mut Module), 28 | is_virtual: extern "C" fn(this: &Module) -> bool, 29 | handle_int_msc_cmd: extern "C" fn(this: &mut Module, command: &lib::MscCommand) -> lib::TValue, 30 | handle_float_msc_cmd: 31 | extern "C" fn(this: &mut Module, command: &lib::MscCommand) -> lib::TValue, 32 | } 33 | 34 | /// The fundamental base type for the majority of Smash Ultimate's modules. 35 | /// 36 | /// Smash Ultimate takes its module system from Smash 4 and expands upon it. 37 | /// 38 | /// Due to the nature of fighter/weapon code being written primarily in Lua, transpiled to C++, 39 | /// and then compiled into relocatable character modules (the NRO files), many calls in Ultimate 40 | /// are exported as symbols. However, the MSC environment still exists in Ultimate even though it 41 | /// is wrapped up nicely in Lua and overall very hidden away. 42 | /// 43 | /// Every module (for most objects there are ~50 modules) inherits from a base class (named here 44 | /// simply as `Module`)lib:: and must support the following operations: 45 | /// 1. Check if it is implemented or an empty module. If it is an empty module, `Module::is_virtual` will 46 | /// return true. 47 | /// 2. Handle MSC commands that will return an integer 48 | /// 3. Handle MSC commands that will return a float 49 | /// 50 | /// Not every module actually has an implementation which will handle the MSC commands, and some don't 51 | /// really need to. That being said, when they do it can provide insights into their *non*-exported methods. 52 | /// 53 | /// For example, all that is exported by the main executable for [`CancelModule`] is [`CancelModule::is_enable_cancel`] 54 | /// and [`CancelModule::enable_cancel`]. You can access two more methods through the use of the following MSC commands 55 | /// via `app::sv_module_access::cancel`: 56 | /// * `MA_MSC_CMD_CANCEL_UNABLE_CANCEL` -> [`CancelModule::unable_cancel`] 57 | /// * `MA_MSC_CMD_CANCEL_UNABLE_CANCEL_STATUS` -> [`CancelModule::unable_cancel_status`] 58 | /// 59 | /// In addition to the three operations specified above, every module also has the following methods: 60 | /// * `initialize` - Called when the object is created/constructed 61 | /// * `finalize` - Called when the object is destroyed 62 | /// * `start_module` - Called when the object enters into play. For example, `Module::initialize` will be called 63 | /// on Mario's fireballs at the start of the game, but `Module::start_module` will be called when they are summoned 64 | /// during his neutral special, and `Module::end_module` will be called when they disappear 65 | /// * `end_module` - Called when the object exits play. 66 | /// 67 | /// These are usually the first methods in the Module's vtable immediately following the required implementations. 68 | #[repr(C)] 69 | pub struct Module { 70 | vtable: &'static ModuleVTable, 71 | } 72 | -------------------------------------------------------------------------------- /src/app/modules/damage.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | extern "C" { 5 | #[link_name = "_ZN3app20DamageTransactorImpl19calc_reaction_frameEf"] 6 | pub(super) fn calc_reaction_frame(damage: f32) -> f32; 7 | } 8 | } 9 | 10 | #[allow(non_snake_case)] 11 | pub mod DamageTransactorImpl { 12 | use super::impl_; 13 | 14 | pub fn calc_reaction_frame(damage: f32) -> f32 { 15 | unsafe { 16 | impl_::calc_reaction_frame(damage) 17 | } 18 | } 19 | } 20 | 21 | #[repr(C)] 22 | pub struct DamageInfo { 23 | pub damage: f32, 24 | pub damage_add: f32, 25 | pub damage_add_reaction: f32, 26 | pub power_max: f32, 27 | pub reaction_max: f32, 28 | unknown: [u8; 0x14C], 29 | pub damage_lr: f32, 30 | padding: [f32; 3], 31 | pub attack_pos: phx::Vector3f, 32 | padding2: f32, 33 | pub attack_speed: phx::Vector2f, 34 | padding3: u64, 35 | pub damage_add_2nd: f32, 36 | pub owner_object_id: u32, 37 | pub shake_scale: f32, 38 | pub catch_absolute: bool, 39 | pub no_dead_damage_fly_effect: bool, 40 | padding4: [u8; 0x22] 41 | } 42 | 43 | #[cfg(feature = "type_assert")] 44 | impl DamageInfo { 45 | pub fn assert() { 46 | assert_eq!(size_of!(DamageInfo), 0x1C0); 47 | assert_eq!(offset_of!(DamageInfo, damage), 0x0); 48 | assert_eq!(offset_of!(DamageInfo, damage_add), 0x4); 49 | assert_eq!(offset_of!(DamageInfo, damage_add_reaction), 0x8); 50 | assert_eq!(offset_of!(DamageInfo, power_max), 0xC); 51 | assert_eq!(offset_of!(DamageInfo, reaction_max), 0x10); 52 | assert_eq!(offset_of!(DamageInfo, damage_lr), 0x160); 53 | assert_eq!(offset_of!(DamageInfo, attack_pos), 0x170); 54 | assert_eq!(offset_of!(DamageInfo, attack_speed), 0x180); 55 | assert_eq!(offset_of!(DamageInfo, damage_add_2nd), 0x190); 56 | assert_eq!(offset_of!(DamageInfo, owner_object_id), 0x194); 57 | assert_eq!(offset_of!(DamageInfo, shake_scale), 0x198); 58 | assert_eq!(offset_of!(DamageInfo, catch_absolute), 0x19C); 59 | assert_eq!(offset_of!(DamageInfo, no_dead_damage_fly_effect), 0x19D); 60 | } 61 | } -------------------------------------------------------------------------------- /src/app/modules/item.rs: -------------------------------------------------------------------------------- 1 | 2 | #[allow(non_snake_case)] 3 | pub mod FighterItemModuleImpl { 4 | use crate::*; 5 | mod impl_ { 6 | use crate::*; 7 | 8 | extern "C" { 9 | #[link_name = "_ZN3app21FighterItemModuleImpl30get_fighter_throw_param_memberEN3phx6Hash40ES2_"] 10 | pub(super) fn get_fighter_throw_param_member(struct_name: phx::Hash40, field_name: phx::Hash40) -> f32; 11 | 12 | } 13 | } 14 | 15 | pub fn get_fighter_throw_param_member(struct_name: phx::Hash40, field_name: phx::Hash40) -> f32 { 16 | unsafe { 17 | impl_::get_fighter_throw_param_member(struct_name, field_name) 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/app/modules/lua.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | #[repr(C)] 4 | #[vtable_impl(LuaModule)] 5 | // #[derive(TypeAssert)] 6 | // #[size = 0x168] 7 | pub(crate) struct LuaModuleVTable { 8 | 9 | } 10 | 11 | #[repr(C)] 12 | pub struct LuaModule { 13 | vtable: &'static LuaModuleVTable, 14 | owner: *mut app::BattleObjectModuleAccessor 15 | } -------------------------------------------------------------------------------- /src/app/singletons.rs: -------------------------------------------------------------------------------- 1 | mod battle_object_manager; 2 | mod battle_object_world; 3 | mod cut_in_manager; 4 | mod executable_object_manager; 5 | mod fighter_manager; 6 | mod fighter_snake_final_module; 7 | mod item_manager; 8 | mod item_param_accessor; 9 | mod stage_manager; 10 | 11 | pub use battle_object_manager::*; 12 | pub use battle_object_world::*; 13 | pub use cut_in_manager::*; 14 | pub use executable_object_manager::*; 15 | pub use fighter_manager::*; 16 | pub use fighter_snake_final_module::*; 17 | pub use item_manager::*; 18 | pub use item_param_accessor::*; 19 | pub use stage_manager::*; 20 | -------------------------------------------------------------------------------- /src/app/singletons/battle_object_world.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3lib9SingletonIN3app17BattleObjectWorldEE9instance_E"] 8 | pub(super) static INSTANCE: *mut app::BattleObjectWorld; 9 | 10 | #[link_name = "_ZN3app8lua_bind35BattleObjectWorld__gravity_pos_implEPNS_17BattleObjectWorldE"] 11 | pub(super) fn gravity_pos(battle_object_world: *const app::BattleObjectWorld) -> cpp::simd::Vector3; 12 | 13 | #[link_name = "_ZN3app8lua_bind49BattleObjectWorld__gravity_speed_coefficient_implEPNS_17BattleObjectWorldE"] 14 | pub(super) fn gravity_speed_coefficient(battle_object_world: *const app::BattleObjectWorld) -> f32; 15 | 16 | #[link_name = "_ZN3app8lua_bind42BattleObjectWorld__is_disable_reverse_implEPNS_17BattleObjectWorldE"] 17 | pub(super) fn is_disable_reverse(battle_object_world: *const app::BattleObjectWorld) -> bool; 18 | 19 | #[link_name = "_ZN3app8lua_bind41BattleObjectWorld__is_gravity_normal_implEPNS_17BattleObjectWorldE"] 20 | pub(super) fn is_gravity_normal(battle_object_world: *const app::BattleObjectWorld) -> bool; 21 | 22 | #[link_name = "_ZN3app8lua_bind31BattleObjectWorld__is_move_implEPNS_17BattleObjectWorldE"] 23 | pub(super) fn is_move(battle_object_world: *const app::BattleObjectWorld) -> bool; 24 | 25 | #[link_name = "_ZN3app8lua_bind34BattleObjectWorld__move_speed_implEPNS_17BattleObjectWorldE"] 26 | pub(super) fn move_speed(battle_object_world: *const app::BattleObjectWorld) -> *const cpp::simd::Vector3; 27 | 28 | #[link_name = "_ZN3app8lua_bind31BattleObjectWorld__scale_z_implEPNS_17BattleObjectWorldE"] 29 | pub(super) fn scale_z(battle_object_world: *const app::BattleObjectWorld) -> f32; 30 | } 31 | } 32 | 33 | #[repr(C)] 34 | pub struct BattleObjectWorld { 35 | pub gravity_speed: f32, 36 | pub gravity_speed_coefficient: f32, 37 | scale_z: f32, 38 | unk1: bool, 39 | pub gravity_pos: cpp::simd::Vector3, 40 | move_speed: cpp::simd::Vector3, 41 | unk2: u64, 42 | unk3: u64, 43 | unk4: *const u64, 44 | unk5: *const u64, 45 | unk6: u64, 46 | is_stop_battle_objects: bool, 47 | pub is_gravity_normal: bool, 48 | is_move: bool, 49 | unk7: bool, 50 | unk8: bool, 51 | is_disable_reverse: bool, 52 | unk9: bool, 53 | unk10: bool, 54 | unk11: *const u64, 55 | } 56 | 57 | impl BattleObjectWorld { 58 | pub fn instance() -> Option<&'static Self> { 59 | unsafe { 60 | impl_::INSTANCE.as_ref() 61 | } 62 | } 63 | 64 | pub fn instance_mut() -> Option<&'static mut Self> { 65 | unsafe { 66 | impl_::INSTANCE.as_mut() 67 | } 68 | } 69 | 70 | pub fn gravity_pos(&self) -> phx::Vector3f { 71 | unsafe { 72 | impl_::gravity_pos(self).into() 73 | } 74 | } 75 | 76 | pub fn gravity_speed_coefficient(&self) -> f32 { 77 | unsafe { 78 | impl_::gravity_speed_coefficient(self) 79 | } 80 | } 81 | 82 | pub fn is_disable_reverse(&self) -> bool { 83 | unsafe { 84 | impl_::is_disable_reverse(self) 85 | } 86 | } 87 | 88 | pub fn is_gravity_normal(&self) -> bool { 89 | unsafe { 90 | impl_::is_gravity_normal(self) 91 | } 92 | } 93 | 94 | pub fn is_move(&self) -> bool { 95 | unsafe { 96 | impl_::is_move(self) 97 | } 98 | } 99 | 100 | pub fn move_speed(&self) -> &phx::Vector3f { 101 | unsafe { 102 | &*(impl_::move_speed(self) as *const phx::Vector3f) 103 | } 104 | } 105 | 106 | pub fn scale_z(&self) -> f32 { 107 | unsafe { 108 | impl_::scale_z(self) 109 | } 110 | } 111 | } 112 | -------------------------------------------------------------------------------- /src/app/singletons/executable_object_manager.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | #[repr(C)] 4 | pub struct ExecutableObject { 5 | name: *const u8, 6 | category: i32, 7 | padding: u32, 8 | run_on_frame_advance: bool, 9 | padding2: [u8; 0x2F], 10 | function: *mut ExecutableFunction, 11 | } 12 | 13 | #[repr(C)] 14 | pub struct ExecutableFunctionVTable { 15 | destructor: extern "C" fn(&mut ExecutableFunction), 16 | deleter: extern "C" fn(&mut ExecutableFunction), 17 | copy_into: extern "C" fn(&ExecutableFunction, &mut ExecutableFunction), 18 | copy_from: extern "C" fn(&mut ExecutableFunction, &ExecutableFunction), 19 | destructor2: extern "C" fn(&mut ExecutableFunction), 20 | deleter2: extern "C" fn(&mut ExecutableFunction), 21 | call: extern "C" fn(&ExecutableFunction), 22 | } 23 | 24 | #[repr(C)] 25 | pub struct ExecutableFunction { 26 | vtable: &'static ExecutableFunctionVTable, 27 | unk: u64, 28 | abs_function_or_vtable_offset: u64, 29 | shift_and_is_virtual: u64, 30 | object: u64, 31 | } 32 | 33 | #[repr(C)] 34 | pub struct ExecutableObjectManager { 35 | pub current_category: i32, 36 | pub should_category_run: [i32; 10], 37 | pub unk_category: [i32; 10], 38 | pub objects_by_category: [cpp::Deque>; 10], 39 | } 40 | -------------------------------------------------------------------------------- /src/app/singletons/fighter_snake_final_module.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app23FighterSnakeFinalModule9end_finalERNS_26BattleObjectModuleAccessorE"] 8 | pub(super) fn end_final(module_accessor: *mut app::BattleObjectModuleAccessor); 9 | 10 | #[link_name = "_ZN3app23FighterSnakeFinalModule22get_guide_point_offsetEii"] 11 | pub(super) fn get_guide_point_offset(missile_num: i32, point_num: i32) -> cpp::simd::Vector3; 12 | 13 | #[link_name = "_ZN3app23FighterSnakeFinalModule21get_lock_on_directionERKN3phx8Vector3fES4_fRS2_"] 14 | pub(super) fn get_lock_on_direction(arg1: *const phx::Vector3f, arg2: *const phx::Vector3f, arg3: f32, arg4: *mut phx::Vector3f) -> f32; 15 | 16 | #[link_name = "_ZN3app23FighterSnakeFinalModule20get_lock_on_positionEi"] 17 | pub(super) fn get_lock_on_position(missile_num: i32) -> cpp::simd::Vector3; 18 | 19 | #[link_name = "_ZN3app23FighterSnakeFinalModule20get_lock_on_rotationERKN3phx8Vector3fES4_"] 20 | pub(super) fn get_lock_on_rotation(arg1: *const phx::Vector3f, arg2: *const phx::Vector3f) -> cpp::simd::Vector3; 21 | 22 | #[link_name = "_ZN3app23FighterSnakeFinalModule20get_missile_positionEi"] 23 | pub(super) fn get_missile_position(missile_num: i32) -> cpp::simd::Vector3; 24 | 25 | #[link_name = "_ZN3app23FighterSnakeFinalModule18initialize_reticleERNS_26BattleObjectModuleAccessorE"] 26 | pub(super) fn initialize_reticle(module_accessor: *mut app::BattleObjectModuleAccessor); 27 | 28 | #[link_name = "_ZN3app23FighterSnakeFinalModule7lock_onERNS_26BattleObjectModuleAccessorE"] 29 | pub(super) fn lock_on(module_accessor: *mut app::BattleObjectModuleAccessor); 30 | 31 | #[link_name = "_ZN3app23FighterSnakeFinalModule13lock_on_readyERNS_26BattleObjectModuleAccessorE"] 32 | pub(super) fn lock_on_ready(module_accessor: *mut app::BattleObjectModuleAccessor); 33 | 34 | #[link_name = "_ZN3app23FighterSnakeFinalModule5startERNS_26BattleObjectModuleAccessorE"] 35 | pub(super) fn start(module_accessor: *mut app::BattleObjectModuleAccessor); 36 | 37 | #[link_name = "_ZN3app23FighterSnakeFinalModule14start_zoom_outERNS_26BattleObjectModuleAccessorEi"] 38 | pub(super) fn start_zoom_out(module_accessor: *mut app::BattleObjectModuleAccessor, arg: i32); 39 | 40 | #[link_name = "_ZN3app23FighterSnakeFinalModule14update_reticleERNS_26BattleObjectModuleAccessorEff"] 41 | pub(super) fn update_reticle(module_accessor: *mut app::BattleObjectModuleAccessor, x: f32, y: f32); 42 | 43 | } 44 | } 45 | 46 | pub fn end_final(module_accessor: &mut app::BattleObjectModuleAccessor) { 47 | unsafe { 48 | impl_::end_final(module_accessor) 49 | } 50 | } 51 | 52 | pub fn get_guide_point_offset(missile_num: i32, point_num: i32) -> phx::Vector3f { 53 | unsafe { 54 | impl_::get_guide_point_offset(missile_num, point_num).into() 55 | } 56 | } 57 | 58 | pub fn get_lock_on_direction(arg1: &phx::Vector3f, arg2: &phx::Vector3f, arg3: f32, arg4: &mut phx::Vector3f) -> f32 { 59 | unsafe { 60 | impl_::get_lock_on_direction(arg1, arg2, arg3, arg4) 61 | } 62 | } 63 | 64 | pub fn get_lock_on_position(missile_num: i32) -> phx::Vector3f { 65 | unsafe { 66 | impl_::get_lock_on_position(missile_num).into() 67 | } 68 | } 69 | 70 | pub fn get_lock_on_rotation(arg1: &phx::Vector3f, arg2: &phx::Vector3f) -> phx::Vector3f { 71 | unsafe { 72 | impl_::get_lock_on_rotation(arg1, arg2).into() 73 | } 74 | } 75 | 76 | pub fn get_missile_position(missile_num: i32) -> phx::Vector3f { 77 | unsafe { 78 | impl_::get_missile_position(missile_num).into() 79 | } 80 | } 81 | 82 | pub fn initialize_reticle(module_accessor: &mut app::BattleObjectModuleAccessor) { 83 | unsafe { 84 | impl_::initialize_reticle(module_accessor) 85 | } 86 | } 87 | 88 | pub fn lock_on(module_accessor: &mut app::BattleObjectModuleAccessor) { 89 | unsafe { 90 | impl_::lock_on(module_accessor) 91 | } 92 | } 93 | 94 | pub fn lock_on_ready(module_accessor: &mut app::BattleObjectModuleAccessor) { 95 | unsafe { 96 | impl_::lock_on_ready(module_accessor) 97 | } 98 | } 99 | 100 | pub fn start(module_accessor: &mut app::BattleObjectModuleAccessor) { 101 | unsafe { 102 | impl_::start(module_accessor) 103 | } 104 | } 105 | 106 | pub fn start_zoom_out(module_accessor: &mut app::BattleObjectModuleAccessor, arg: i32) { 107 | unsafe { 108 | impl_::start_zoom_out(module_accessor, arg) 109 | } 110 | } 111 | 112 | pub fn update_reticle(module_accessor: &mut app::BattleObjectModuleAccessor, x: f32, y: f32) { 113 | unsafe { 114 | impl_::update_reticle(module_accessor, x, y) 115 | } 116 | } 117 | 118 | -------------------------------------------------------------------------------- /src/app/singletons/item_manager.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3lib9SingletonIN3app11ItemManagerEE9instance_E"] 8 | pub(super) static INSTANCE: *mut app::ItemManager; 9 | 10 | #[link_name = "_ZN3app8lua_bind47ItemManager__find_active_item_from_area_id_implEPNS_11ItemManagerEj"] 11 | pub(super) fn find_active_item_from_area_id(manager: *const app::ItemManager, arg2: u32) -> *const skyline::libc::c_void; 12 | 13 | #[link_name = "_ZN3app8lua_bind42ItemManager__find_active_item_from_id_implEPNS_11ItemManagerEj"] 14 | pub(super) fn find_active_item_from_id(manager: *const app::ItemManager, battle_object_id: u32) -> *const skyline::libc::c_void; 15 | 16 | #[link_name = "_ZN3app8lua_bind33ItemManager__get_active_item_implEPNS_11ItemManagerEm"] 17 | pub(super) fn get_active_item(manager: *const app::ItemManager, arg2: u64) -> *const skyline::libc::c_void; 18 | 19 | #[link_name = "_ZN3app8lua_bind44ItemManager__get_num_of_active_item_all_implEPNS_11ItemManagerE"] 20 | pub(super) fn get_num_of_active_item_all(manager: *const app::ItemManager) -> usize; 21 | 22 | #[link_name = "_ZN3app8lua_bind41ItemManager__get_num_of_ownered_item_implEPNS_11ItemManagerEjNS_8ItemKindE"] 23 | pub(super) fn get_num_of_ownered_item(manager: *const app::ItemManager, battle_object_id: u32, item_kind: app::ItemKind) -> usize; 24 | 25 | #[link_name = "_ZN3app8lua_bind52ItemManager__is_change_fighter_restart_position_implEPNS_11ItemManagerE"] 26 | pub(super) fn is_change_fighter_restart_position(manager: *const app::ItemManager) -> bool; 27 | 28 | #[link_name = "_ZN3app8lua_bind37ItemManager__remove_item_from_id_implEPNS_11ItemManagerEj"] 29 | pub(super) fn remove_item_from_id(manager: *const app::ItemManager, battle_object_id: u32); 30 | } 31 | } 32 | 33 | #[repr(C)] 34 | pub struct ItemManager {} 35 | 36 | impl ItemManager { 37 | pub fn instance() -> Option<&'static Self> { 38 | unsafe { 39 | impl_::INSTANCE.as_ref() 40 | } 41 | } 42 | 43 | pub fn instance_mut() -> Option<&'static mut Self> { 44 | unsafe { 45 | impl_::INSTANCE.as_mut() 46 | } 47 | } 48 | 49 | pub fn find_active_item_from_area_id(&self, arg2: u32) -> *const skyline::libc::c_void { 50 | unsafe { 51 | impl_::find_active_item_from_area_id(self, arg2) 52 | } 53 | } 54 | 55 | pub fn find_active_item_from_id(&self, battle_object_id: u32) -> *const skyline::libc::c_void { 56 | unsafe { 57 | impl_::find_active_item_from_id(self, battle_object_id) 58 | } 59 | } 60 | 61 | pub fn get_active_item(&self, arg2: u64) -> *const skyline::libc::c_void { 62 | unsafe { 63 | impl_::get_active_item(self, arg2) 64 | } 65 | } 66 | 67 | pub fn get_num_of_active_item_all(&self) -> usize { 68 | unsafe { 69 | impl_::get_num_of_active_item_all(self) 70 | } 71 | } 72 | 73 | pub fn get_num_of_ownered_item(&self, battle_object_id: u32, item_kind: app::ItemKind) -> usize { 74 | unsafe { 75 | impl_::get_num_of_ownered_item(self, battle_object_id, item_kind) 76 | } 77 | } 78 | 79 | pub fn is_change_fighter_restart_position(&self) -> bool { 80 | unsafe { 81 | impl_::is_change_fighter_restart_position(self) 82 | } 83 | } 84 | 85 | pub fn remove_item_from_id(&self, battle_object_id: u32) { 86 | unsafe { 87 | impl_::remove_item_from_id(self, battle_object_id) 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /src/app/singletons/item_param_accessor.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3lib9SingletonIN3app17ItemParamAccessorEE9instance_E"] 8 | pub(super) static INSTANCE: *mut app::ItemParamAccessor; 9 | 10 | #[link_name = "_ZN3app8lua_bind45ItemParamAccessor__boss_common_param_int_implEPNS_17ItemParamAccessorENS_8ItemKindENS_18BossCommonParamIntE"] 11 | pub(super) fn boss_common_param_int(param_accessor: *const app::ItemParamAccessor, item_kind: app::ItemKind, param: app::BossCommonParamInt) -> i32; 12 | 13 | #[link_name = "_ZN3app8lua_bind44ItemParamAccessor__get_self_param_float_implEPNS_17ItemParamAccessorENS_8ItemKindEN3phx6Hash40E"] 14 | pub(super) fn get_self_param_float(param_accessor: *const app::ItemParamAccessor, item_kind: app::ItemKind, param_name: phx::Hash40) -> f32; 15 | 16 | #[link_name = "_ZN3app8lua_bind42ItemParamAccessor__get_self_param_int_implEPNS_17ItemParamAccessorENS_8ItemKindEN3phx6Hash40E"] 17 | pub(super) fn get_self_param_int(param_accessor: *const app::ItemParamAccessor, item_kind: app::ItemKind, param_name: phx::Hash40) -> i32; 18 | 19 | #[link_name = "_ZN3app8lua_bind43ItemParamAccessor__is_valid_self_param_implEPNS_17ItemParamAccessorENS_8ItemKindEN3phx6Hash40E"] 20 | pub(super) fn is_valid_self_param(param_accessor: *const app::ItemParamAccessor, item_kind: app::ItemKind, param_name: phx::Hash40) -> bool; 21 | } 22 | } 23 | 24 | #[repr(C)] 25 | pub struct ItemParamAccessor {} 26 | 27 | impl ItemParamAccessor { 28 | pub fn instance() -> Option<&'static Self> { 29 | unsafe { 30 | impl_::INSTANCE.as_ref() 31 | } 32 | } 33 | 34 | pub fn instance_mut() -> Option<&'static mut Self> { 35 | unsafe { 36 | impl_::INSTANCE.as_mut() 37 | } 38 | } 39 | 40 | pub fn boss_common_param_int(&self, item_kind: app::ItemKind, param: app::BossCommonParamInt) -> i32 { 41 | unsafe { 42 | impl_::boss_common_param_int(self, item_kind, param) 43 | } 44 | } 45 | 46 | pub fn get_self_param_float(&self, item_kind: app::ItemKind, param_name: phx::Hash40) -> f32 { 47 | unsafe { 48 | impl_::get_self_param_float(self, item_kind, param_name) 49 | } 50 | } 51 | 52 | pub fn get_self_param_int(&self, item_kind: app::ItemKind, param_name: phx::Hash40) -> i32 { 53 | unsafe { 54 | impl_::get_self_param_int(self, item_kind, param_name) 55 | } 56 | } 57 | 58 | pub fn is_valid_self_param(&self, item_kind: app::ItemKind, param_name: phx::Hash40) -> bool { 59 | unsafe { 60 | impl_::is_valid_self_param(self, item_kind, param_name) 61 | } 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/app/singletons/stage_manager.rs: -------------------------------------------------------------------------------- 1 | mod impl_ { 2 | use crate::*; 3 | 4 | extern "C" { 5 | #[link_name = "_ZN3lib9SingletonIN3app12StageManagerEE9instance_E"] 6 | pub(super) static INSTANCE: *mut app::StageManager; 7 | 8 | #[link_name = "_ZN3app8lua_bind46StageManager__is_discretion_final_enabled_implEPNS_12StageManagerE"] 9 | pub(super) fn is_discretion_final_enabled(manager: *const app::StageManager) -> bool; 10 | 11 | #[link_name = "_ZN3app8lua_bind33StageManager__stage_all_stop_implEPNS_12StageManagerEb"] 12 | pub(super) fn stage_all_stop(manager: *mut app::StageManager, stop: bool); 13 | } 14 | } 15 | 16 | #[repr(C)] 17 | pub struct StageManager { 18 | data: [u8; 0x260], 19 | } 20 | 21 | impl StageManager { 22 | pub fn instance() -> Option<&'static Self> { 23 | unsafe { 24 | impl_::INSTANCE.as_ref() 25 | } 26 | } 27 | 28 | pub fn instance_mut() -> Option<&'static mut Self> { 29 | unsafe { 30 | impl_::INSTANCE.as_mut() 31 | } 32 | } 33 | 34 | pub fn is_discretion_final_enabled(&self) -> bool { 35 | unsafe { 36 | impl_::is_discretion_final_enabled(self) 37 | } 38 | } 39 | 40 | pub fn stage_all_stop(&mut self, stop: bool) { 41 | unsafe { 42 | impl_::stage_all_stop(self, stop) 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/app/smashball.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app9smashball13chase_fighterERNS_18ItemModuleAccessorE"] 8 | pub(super) fn chase_fighter(module_accessor: *mut app::ItemModuleAccessor); 9 | 10 | #[link_name = "_ZN3app9smashball19escape_from_fighterERNS_18ItemModuleAccessorE"] 11 | pub(super) fn escape_from_fighter(module_accessor: *mut app::ItemModuleAccessor); 12 | 13 | #[link_name = "_ZN3app9smashball23force_clear_post_effectERNS_18ItemModuleAccessorE"] 14 | pub(super) fn force_clear_post_effect(module_accessor: *mut app::ItemModuleAccessor); 15 | 16 | #[link_name = "_ZN3app9smashball14get_auto_handiEj"] 17 | pub(super) fn get_auto_handi(arg1: u32) -> f32; 18 | 19 | #[link_name = "_ZN3app9smashball26get_equip_draw_ability_numENS_14FighterEntryIDE"] 20 | pub(super) fn get_equip_draw_ability_num(entry_id: app::FighterEntryID) -> u32; 21 | 22 | #[link_name = "_ZN3app9smashball16is_training_modeEv"] 23 | pub(super) fn is_training_mode() -> bool; 24 | 25 | #[link_name = "_ZN3app9smashball15set_post_effectERNS_18ItemModuleAccessorEjb"] 26 | pub(super) fn set_post_effect(module_accessor: *mut app::ItemModuleAccessor, arg2: u32, arg3: bool); 27 | } 28 | } 29 | 30 | pub fn chase_fighter(module_accessor: &mut app::ItemModuleAccessor) { 31 | unsafe { 32 | impl_::chase_fighter(module_accessor) 33 | } 34 | } 35 | 36 | pub fn escape_from_fighter(module_accessor: &mut app::ItemModuleAccessor) { 37 | unsafe { 38 | impl_::escape_from_fighter(module_accessor) 39 | } 40 | } 41 | 42 | pub fn force_clear_post_effect(module_accessor: &mut app::ItemModuleAccessor) { 43 | unsafe { 44 | impl_::force_clear_post_effect(module_accessor) 45 | } 46 | } 47 | 48 | pub fn get_auto_handi(arg1: u32) -> f32 { 49 | unsafe { 50 | impl_::get_auto_handi(arg1) 51 | } 52 | } 53 | 54 | pub fn get_equip_draw_ability_num(entry_id: app::FighterEntryID) -> u32 { 55 | unsafe { 56 | impl_::get_equip_draw_ability_num(entry_id) 57 | } 58 | } 59 | 60 | pub fn is_training_mode() -> bool { 61 | unsafe { 62 | impl_::is_training_mode() 63 | } 64 | } 65 | 66 | pub fn set_post_effect(module_accessor: &mut app::ItemModuleAccessor, arg2: u32, arg3: bool) { 67 | unsafe { 68 | impl_::set_post_effect(module_accessor, arg2, arg3) 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /src/app/smashballheavy.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app14smashballheavy23force_clear_post_effectERNS_18ItemModuleAccessorE"] 8 | pub(super) fn force_clear_post_effect(module_accessor: *mut app::ItemModuleAccessor); 9 | 10 | #[link_name = "_ZN3app14smashballheavy14get_auto_handiEj"] 11 | pub(super) fn get_auto_handi(arg1: u32) -> f32; 12 | 13 | #[link_name = "_ZN3app14smashballheavy23get_fighter_entry_countEv"] 14 | pub(super) fn get_fighter_entry_count() -> u32; 15 | 16 | #[link_name = "_ZN3app14smashballheavy15set_post_effectERNS_18ItemModuleAccessorEjb"] 17 | pub(super) fn set_post_effect(module_accessor: *mut app::ItemModuleAccessor, arg2: u32, arg3: bool); 18 | } 19 | } 20 | 21 | pub fn force_clear_post_effect(module_accessor: &mut app::ItemModuleAccessor) { 22 | unsafe { 23 | impl_::force_clear_post_effect(module_accessor) 24 | } 25 | } 26 | 27 | pub fn get_auto_handi(arg1: u32) -> f32 { 28 | unsafe { 29 | impl_::get_auto_handi(arg1) 30 | } 31 | } 32 | 33 | pub fn get_fighter_entry_count() -> u32 { 34 | unsafe { 35 | impl_::get_fighter_entry_count() 36 | } 37 | } 38 | 39 | pub fn set_post_effect(module_accessor: &mut app::ItemModuleAccessor, arg2: u32, arg3: bool) { 40 | unsafe { 41 | impl_::set_post_effect(module_accessor, arg2, arg3) 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/app/specializers.rs: -------------------------------------------------------------------------------- 1 | pub mod brave; 2 | pub mod buddy; 3 | pub mod cloud; 4 | pub mod dedede; 5 | pub mod demon; 6 | pub mod diddy; 7 | pub mod dolly; 8 | pub mod donkey; 9 | pub mod edge; 10 | pub mod eflame; 11 | pub mod elight; 12 | pub mod falco; 13 | pub mod fox; 14 | pub mod gamewatch; 15 | pub mod gaogaen; 16 | pub mod gekkouga; 17 | pub mod ike; -------------------------------------------------------------------------------- /src/app/specializers/buddy.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app24FighterSpecializer_Buddy17call_final_moduleERNS_7FighterEi"] 8 | pub(super) fn call_final_module(fighter: *mut app::Fighter, call_arg: app::FighterBuddyFinalModuleCall); 9 | 10 | #[link_name = "_ZN3app24FighterSpecializer_Buddy24final_module_hit_successEv"] 11 | pub(super) fn final_module_hit_success() -> bool; 12 | 13 | #[link_name = "_ZN3app24FighterSpecializer_Buddy31update_special_n_partner_motionERNS_7FighterEb"] 14 | pub(super) fn update_special_n_partner_motion(fighter: *mut app::Fighter, arg: bool); 15 | 16 | } 17 | } 18 | 19 | pub fn call_final_module(fighter: &mut app::Fighter, call_arg: app::FighterBuddyFinalModuleCall) { 20 | unsafe { 21 | impl_::call_final_module(fighter, call_arg) 22 | } 23 | } 24 | 25 | pub fn final_module_hit_success() -> bool { 26 | unsafe { 27 | impl_::final_module_hit_success() 28 | } 29 | } 30 | 31 | pub fn update_special_n_partner_motion(fighter: &mut app::Fighter, arg: bool) { 32 | unsafe { 33 | impl_::update_special_n_partner_motion(fighter, arg) 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /src/app/specializers/cloud.rs: -------------------------------------------------------------------------------- 1 | mod impl_ { 2 | extern "C" { 3 | #[link_name = "_ZN3app24FighterSpecializer_Cloud20display_final_windowEb"] 4 | pub(super) fn display_final_window(arg: bool); 5 | 6 | #[link_name = "_ZN3app24FighterSpecializer_Cloud27display_final_window_final2Eb"] 7 | pub(super) fn display_final_window_final2(arg: bool); 8 | 9 | #[link_name = "_ZN3app24FighterSpecializer_Cloud20is_camera_off_final2Ev"] 10 | pub(super) fn is_camera_off_final2() -> bool; 11 | 12 | } 13 | } 14 | 15 | pub fn display_final_window(arg: bool) { 16 | unsafe { 17 | impl_::display_final_window(arg) 18 | } 19 | } 20 | 21 | pub fn display_final_window_final2(arg: bool) { 22 | unsafe { 23 | impl_::display_final_window_final2(arg) 24 | } 25 | } 26 | 27 | pub fn is_camera_off_final2() -> bool { 28 | unsafe { 29 | impl_::is_camera_off_final2() 30 | } 31 | } 32 | 33 | -------------------------------------------------------------------------------- /src/app/specializers/dedede.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app25FighterSpecializer_Dedede28check_special_s_pickup_goldoERNS_7FighterE"] 8 | pub(super) fn check_special_s_pickup_goldo(fighter: *mut app::Fighter) -> bool; 9 | 10 | #[link_name = "_ZN3app25FighterSpecializer_Dedede29end_special_n_shot_object_hitERNS_7FighterE"] 11 | pub(super) fn end_special_n_shot_object_hit(fighter: *mut app::Fighter); 12 | 13 | } 14 | } 15 | 16 | pub fn check_special_s_pickup_goldo(fighter: &mut app::Fighter) -> bool { 17 | unsafe { 18 | impl_::check_special_s_pickup_goldo(fighter) 19 | } 20 | } 21 | 22 | pub fn end_special_n_shot_object_hit(fighter: &mut app::Fighter) { 23 | unsafe { 24 | impl_::end_special_n_shot_object_hit(fighter) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/specializers/diddy.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app24FighterSpecializer_Diddy23final_decide_target_dirERNS_26BattleObjectModuleAccessorEb"] 8 | pub(super) fn final_decide_target_dir(module_accessor: *mut app::BattleObjectModuleAccessor, arg: bool) -> bool; 9 | 10 | #[link_name = "_ZN3app24FighterSpecializer_Diddy23final_finish_attack_dirERNS_21FighterModuleAccessorE"] 11 | pub(super) fn final_finish_attack_dir(module_accessor: *mut app::FighterModuleAccessor) -> bool; 12 | 13 | } 14 | } 15 | 16 | pub fn final_decide_target_dir(module_accessor: &mut app::BattleObjectModuleAccessor, arg: bool) -> bool { 17 | unsafe { 18 | impl_::final_decide_target_dir(module_accessor, arg) 19 | } 20 | } 21 | 22 | pub fn final_finish_attack_dir(module_accessor: &mut app::FighterModuleAccessor) -> bool { 23 | unsafe { 24 | impl_::final_finish_attack_dir(module_accessor) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/specializers/dolly.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app24FighterSpecializer_Dolly17call_final_moduleERNS_7FighterEi"] 8 | pub(super) fn call_final_module(arg1: *mut app::Fighter, call_arg: app::FighterDollyFinalModuleCall); 9 | 10 | #[link_name = "_ZN3app24FighterSpecializer_Dolly19check_special_air_bERNS_26BattleObjectModuleAccessorEf"] 11 | pub(super) fn check_special_air_b(module_accessor: *mut app::BattleObjectModuleAccessor, lr: f32) -> bool; 12 | 13 | #[link_name = "_ZN3app24FighterSpecializer_Dolly24final_module_hit_successEv"] 14 | pub(super) fn final_module_hit_success() -> bool; 15 | 16 | #[link_name = "_ZN3app24FighterSpecializer_Dolly23update_opponent_lr_1on1ERNS_26BattleObjectModuleAccessorEi"] 17 | pub(super) fn update_opponent_lr_1on1(module_accessor: *mut app::BattleObjectModuleAccessor, status_kind: i32); 18 | 19 | } 20 | } 21 | 22 | pub fn call_final_module(arg1: &mut app::Fighter, call_arg: app::FighterDollyFinalModuleCall) { 23 | unsafe { 24 | impl_::call_final_module(arg1, call_arg) 25 | } 26 | } 27 | 28 | pub fn check_special_air_b(module_accessor: &mut app::BattleObjectModuleAccessor, lr: f32) -> bool { 29 | unsafe { 30 | impl_::check_special_air_b(module_accessor, lr) 31 | } 32 | } 33 | 34 | pub fn final_module_hit_success() -> bool { 35 | unsafe { 36 | impl_::final_module_hit_success() 37 | } 38 | } 39 | 40 | pub fn update_opponent_lr_1on1(module_accessor: &mut app::BattleObjectModuleAccessor, status_kind: i32) { 41 | unsafe { 42 | impl_::update_opponent_lr_1on1(module_accessor, status_kind) 43 | } 44 | } 45 | 46 | -------------------------------------------------------------------------------- /src/app/specializers/donkey.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app25FighterSpecializer_Donkey16apply_lift_paramERNS_21FighterModuleAccessorEb"] 8 | pub(super) fn apply_lift_param(module_accessor: *mut app::FighterModuleAccessor, on_off: bool); } 9 | } 10 | 11 | pub fn apply_lift_param(module_accessor: &mut app::FighterModuleAccessor, on_off: bool) { 12 | unsafe { 13 | impl_::apply_lift_param(module_accessor, on_off) 14 | } 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/app/specializers/edge.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app23FighterSpecializer_Edge20attack_lw4_ray_checkERNS_26BattleObjectModuleAccessorE"] 8 | pub(super) fn attack_lw4_ray_check(module_accessor: *mut app::BattleObjectModuleAccessor); 9 | 10 | #[link_name = "_ZN3app23FighterSpecializer_Edge17call_final_moduleERNS_7FighterEi"] 11 | pub(super) fn call_final_module(fighter: *mut app::Fighter, call_arg: app::FighterEdgeFinalModuleCall); 12 | 13 | #[link_name = "_ZN3app23FighterSpecializer_Edge28clear_special_hi_jostle_areaERNS_26BattleObjectModuleAccessorE"] 14 | pub(super) fn clear_special_hi_jostle_area(module_accessor: *mut app::BattleObjectModuleAccessor); 15 | 16 | #[link_name = "_ZN3app23FighterSpecializer_Edge24final_module_hit_successEv"] 17 | pub(super) fn final_module_hit_success() -> bool; 18 | 19 | #[link_name = "_ZN3app23FighterSpecializer_Edge32set_one_winged_light_weight_dataERNS_7FighterEb"] 20 | pub(super) fn set_one_winged_light_weight_data(fighter: *mut app::Fighter, arg: bool); 21 | 22 | #[link_name = "_ZN3app23FighterSpecializer_Edge30set_pierce_effect_attack_air_fERNS_26BattleObjectModuleAccessorE"] 23 | pub(super) fn set_pierce_effect_attack_air_f(module_accessor: *mut app::BattleObjectModuleAccessor); 24 | 25 | #[link_name = "_ZN3app23FighterSpecializer_Edge26set_special_hi_jostle_areaERNS_26BattleObjectModuleAccessorE"] 26 | pub(super) fn set_special_hi_jostle_area(module_accessor: *mut app::BattleObjectModuleAccessor); 27 | 28 | #[link_name = "_ZN3app23FighterSpecializer_Edge18set_vec_target_posERNS_26BattleObjectModuleAccessorEiN3phx6Hash40ERKNS3_8Vector2fEj"] 29 | pub(super) fn set_vec_target_pos(module_accessor: *mut app::BattleObjectModuleAccessor, attack_id: i32, bone: phx::Hash40, pos: *const phx::Vector2f, frames: u32); 30 | 31 | } 32 | } 33 | 34 | pub fn attack_lw4_ray_check(module_accessor: &mut app::BattleObjectModuleAccessor) { 35 | unsafe { 36 | impl_::attack_lw4_ray_check(module_accessor) 37 | } 38 | } 39 | 40 | pub fn call_final_module(fighter: &mut app::Fighter, call_arg: app::FighterEdgeFinalModuleCall) { 41 | unsafe { 42 | impl_::call_final_module(fighter, call_arg) 43 | } 44 | } 45 | 46 | pub fn clear_special_hi_jostle_area(module_accessor: &mut app::BattleObjectModuleAccessor) { 47 | unsafe { 48 | impl_::clear_special_hi_jostle_area(module_accessor) 49 | } 50 | } 51 | 52 | pub fn final_module_hit_success() -> bool { 53 | unsafe { 54 | impl_::final_module_hit_success() 55 | } 56 | } 57 | 58 | pub fn set_one_winged_light_weight_data(fighter: &mut app::Fighter, arg: bool) { 59 | unsafe { 60 | impl_::set_one_winged_light_weight_data(fighter, arg) 61 | } 62 | } 63 | 64 | pub fn set_pierce_effect_attack_air_f(module_accessor: &mut app::BattleObjectModuleAccessor) { 65 | unsafe { 66 | impl_::set_pierce_effect_attack_air_f(module_accessor) 67 | } 68 | } 69 | 70 | pub fn set_special_hi_jostle_area(module_accessor: &mut app::BattleObjectModuleAccessor) { 71 | unsafe { 72 | impl_::set_special_hi_jostle_area(module_accessor) 73 | } 74 | } 75 | 76 | pub fn set_vec_target_pos(module_accessor: &mut app::BattleObjectModuleAccessor, attack_id: i32, bone: phx::Hash40, pos: &phx::Vector2f, frames: u32) { 77 | unsafe { 78 | impl_::set_vec_target_pos(module_accessor, attack_id, bone, pos, frames) 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /src/app/specializers/eflame.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app25FighterSpecializer_EFlame19attach_esword_diverERNS_21FighterModuleAccessorE"] 8 | pub(super) fn attach_esword_diver(module_accessor: *mut app::FighterModuleAccessor); 9 | 10 | #[link_name = "_ZN3app25FighterSpecializer_EFlame17call_final_moduleERNS_7FighterEi"] 11 | pub(super) fn call_final_module(fighter: *mut app::Fighter, call_arg: app::FighterElementFinalModuleCall); 12 | 13 | #[link_name = "_ZN3app25FighterSpecializer_EFlame19detach_esword_diverERNS_21FighterModuleAccessorE"] 14 | pub(super) fn detach_esword_diver(module_accessor: *mut app::FighterModuleAccessor); 15 | 16 | #[link_name = "_ZN3app25FighterSpecializer_EFlame24final_module_hit_successEv"] 17 | pub(super) fn final_module_hit_success() -> bool; 18 | 19 | #[link_name = "_ZN3app25FighterSpecializer_EFlame22kirby_esword_update_lrERNS_21FighterModuleAccessorE"] 20 | pub(super) fn kirby_esword_update_lr(module_accessor: *mut app::FighterModuleAccessor); 21 | 22 | #[link_name = "_ZN3app25FighterSpecializer_EFlame25set_target_fighter_offsetEiRKN3phx8Vector3fE"] 23 | pub(super) fn set_target_fighter_offset(arg: i32, offset: *const phx::Vector3f); 24 | 25 | } 26 | } 27 | 28 | pub fn attach_esword_diver(module_accessor: &mut app::FighterModuleAccessor) { 29 | unsafe { 30 | impl_::attach_esword_diver(module_accessor) 31 | } 32 | } 33 | 34 | pub fn call_final_module(fighter: &mut app::Fighter, call_arg: app::FighterElementFinalModuleCall) { 35 | unsafe { 36 | impl_::call_final_module(fighter, call_arg) 37 | } 38 | } 39 | 40 | pub fn detach_esword_diver(module_accessor: &mut app::FighterModuleAccessor) { 41 | unsafe { 42 | impl_::detach_esword_diver(module_accessor) 43 | } 44 | } 45 | 46 | pub fn final_module_hit_success() -> bool { 47 | unsafe { 48 | impl_::final_module_hit_success() 49 | } 50 | } 51 | 52 | pub fn kirby_esword_update_lr(module_accessor: &mut app::FighterModuleAccessor) { 53 | unsafe { 54 | impl_::kirby_esword_update_lr(module_accessor) 55 | } 56 | } 57 | 58 | pub fn set_target_fighter_offset(arg: i32, offset: &phx::Vector3f) { 59 | unsafe { 60 | impl_::set_target_fighter_offset(arg, offset) 61 | } 62 | } 63 | 64 | -------------------------------------------------------------------------------- /src/app/specializers/elight.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app25FighterSpecializer_ELight19attach_esword_diverERNS_21FighterModuleAccessorE"] 8 | pub(super) fn attach_esword_diver(module_accessor: *mut app::FighterModuleAccessor); 9 | 10 | #[link_name = "_ZN3app25FighterSpecializer_ELight17call_final_moduleERNS_7FighterEi"] 11 | pub(super) fn call_final_module(fighter: *mut app::Fighter, call_arg: app::FighterElementFinalModuleCall); 12 | 13 | #[link_name = "_ZN3app25FighterSpecializer_ELight19detach_esword_diverERNS_21FighterModuleAccessorE"] 14 | pub(super) fn detach_esword_diver(module_accessor: *mut app::FighterModuleAccessor); 15 | 16 | #[link_name = "_ZN3app25FighterSpecializer_ELight24final_module_hit_successEv"] 17 | pub(super) fn final_module_hit_success() -> bool; 18 | 19 | #[link_name = "_ZN3app25FighterSpecializer_ELight28is_inside_camera_range_waistERNS_21FighterModuleAccessorE"] 20 | pub(super) fn is_inside_camera_range_waist(module_accessor: *mut app::FighterModuleAccessor) -> bool; 21 | 22 | #[link_name = "_ZN3app25FighterSpecializer_ELight16is_training_zoomEv"] 23 | pub(super) fn is_training_zoom() -> bool; 24 | 25 | #[link_name = "_ZN3app25FighterSpecializer_ELight22kirby_esword_update_lrERNS_21FighterModuleAccessorE"] 26 | pub(super) fn kirby_esword_update_lr(module_accessor: *mut app::FighterModuleAccessor); 27 | 28 | } 29 | } 30 | 31 | pub fn attach_esword_diver(module_accessor: &mut app::FighterModuleAccessor) { 32 | unsafe { 33 | impl_::attach_esword_diver(module_accessor) 34 | } 35 | } 36 | 37 | pub fn call_final_module(fighter: &mut app::Fighter, call_arg: app::FighterElementFinalModuleCall) { 38 | unsafe { 39 | impl_::call_final_module(fighter, call_arg) 40 | } 41 | } 42 | 43 | pub fn detach_esword_diver(module_accessor: &mut app::FighterModuleAccessor) { 44 | unsafe { 45 | impl_::detach_esword_diver(module_accessor) 46 | } 47 | } 48 | 49 | pub fn final_module_hit_success() -> bool { 50 | unsafe { 51 | impl_::final_module_hit_success() 52 | } 53 | } 54 | 55 | pub fn is_inside_camera_range_waist(module_accessor: &mut app::FighterModuleAccessor) -> bool { 56 | unsafe { 57 | impl_::is_inside_camera_range_waist(module_accessor) 58 | } 59 | } 60 | 61 | pub fn is_training_zoom() -> bool { 62 | unsafe { 63 | impl_::is_training_zoom() 64 | } 65 | } 66 | 67 | pub fn kirby_esword_update_lr(module_accessor: &mut app::FighterModuleAccessor) { 68 | unsafe { 69 | impl_::kirby_esword_update_lr(module_accessor) 70 | } 71 | } 72 | 73 | -------------------------------------------------------------------------------- /src/app/specializers/falco.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app24FighterSpecializer_Falco14final_end_execERNS_7FighterE"] 8 | pub(super) fn final_end_exec(fighter: *mut app::Fighter); 9 | 10 | #[link_name = "_ZN3app24FighterSpecializer_Falco14final_end_exitERNS_7FighterE"] 11 | pub(super) fn final_end_exit(fighter: *mut app::Fighter); 12 | 13 | #[link_name = "_ZN3app24FighterSpecializer_Falco14final_end_initERNS_7FighterE"] 14 | pub(super) fn final_end_init(fighter: *mut app::Fighter); 15 | 16 | #[link_name = "_ZN3app24FighterSpecializer_Falco16final_ready_execERNS_7FighterE"] 17 | pub(super) fn final_ready_exec(fighter: *mut app::Fighter); 18 | 19 | #[link_name = "_ZN3app24FighterSpecializer_Falco16final_ready_exitERNS_7FighterE"] 20 | pub(super) fn final_ready_exit(fighter: *mut app::Fighter); 21 | 22 | #[link_name = "_ZN3app24FighterSpecializer_Falco20final_ready_exit_preERNS_7FighterE"] 23 | pub(super) fn final_ready_exit_pre(fighter: *mut app::Fighter); 24 | 25 | #[link_name = "_ZN3app24FighterSpecializer_Falco16final_ready_initERNS_7FighterE"] 26 | pub(super) fn final_ready_init(fighter: *mut app::Fighter); 27 | 28 | #[link_name = "_ZN3app24FighterSpecializer_Falco26final_remove_screen_effectEv"] 29 | pub(super) fn final_remove_screen_effect(); 30 | 31 | #[link_name = "_ZN3app24FighterSpecializer_Falco26final_scene01_exec_fix_posERNS_7FighterE"] 32 | pub(super) fn final_scene01_exec_fix_pos(fighter: *mut app::Fighter); 33 | 34 | #[link_name = "_ZN3app24FighterSpecializer_Falco18final_scene01_exitERNS_7FighterE"] 35 | pub(super) fn final_scene01_exit(fighter: *mut app::Fighter); 36 | 37 | #[link_name = "_ZN3app24FighterSpecializer_Falco18final_scene01_initERNS_7FighterE"] 38 | pub(super) fn final_scene01_init(fighter: *mut app::Fighter); 39 | 40 | #[link_name = "_ZN3app24FighterSpecializer_Falco16final_start_exitERNS_7FighterE"] 41 | pub(super) fn final_start_exit(fighter: *mut app::Fighter); 42 | 43 | #[link_name = "_ZN3app24FighterSpecializer_Falco16final_start_initERNS_7FighterE"] 44 | pub(super) fn final_start_init(fighter: *mut app::Fighter); 45 | 46 | } 47 | } 48 | 49 | pub fn final_end_exec(fighter: &mut app::Fighter) { 50 | unsafe { 51 | impl_::final_end_exec(fighter) 52 | } 53 | } 54 | 55 | pub fn final_end_exit(fighter: &mut app::Fighter) { 56 | unsafe { 57 | impl_::final_end_exit(fighter) 58 | } 59 | } 60 | 61 | pub fn final_end_init(fighter: &mut app::Fighter) { 62 | unsafe { 63 | impl_::final_end_init(fighter) 64 | } 65 | } 66 | 67 | pub fn final_ready_exec(fighter: &mut app::Fighter) { 68 | unsafe { 69 | impl_::final_ready_exec(fighter) 70 | } 71 | } 72 | 73 | pub fn final_ready_exit(fighter: &mut app::Fighter) { 74 | unsafe { 75 | impl_::final_ready_exit(fighter) 76 | } 77 | } 78 | 79 | pub fn final_ready_exit_pre(fighter: &mut app::Fighter) { 80 | unsafe { 81 | impl_::final_ready_exit_pre(fighter) 82 | } 83 | } 84 | 85 | pub fn final_ready_init(fighter: &mut app::Fighter) { 86 | unsafe { 87 | impl_::final_ready_init(fighter) 88 | } 89 | } 90 | 91 | pub fn final_remove_screen_effect() { 92 | unsafe { 93 | impl_::final_remove_screen_effect() 94 | } 95 | } 96 | 97 | pub fn final_scene01_exec_fix_pos(fighter: &mut app::Fighter) { 98 | unsafe { 99 | impl_::final_scene01_exec_fix_pos(fighter) 100 | } 101 | } 102 | 103 | pub fn final_scene01_exit(fighter: &mut app::Fighter) { 104 | unsafe { 105 | impl_::final_scene01_exit(fighter) 106 | } 107 | } 108 | 109 | pub fn final_scene01_init(fighter: &mut app::Fighter) { 110 | unsafe { 111 | impl_::final_scene01_init(fighter) 112 | } 113 | } 114 | 115 | pub fn final_start_exit(fighter: &mut app::Fighter) { 116 | unsafe { 117 | impl_::final_start_exit(fighter) 118 | } 119 | } 120 | 121 | pub fn final_start_init(fighter: &mut app::Fighter) { 122 | unsafe { 123 | impl_::final_start_init(fighter) 124 | } 125 | } 126 | 127 | -------------------------------------------------------------------------------- /src/app/specializers/fox.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app22FighterSpecializer_Fox14final_end_execERNS_7FighterE"] 8 | pub(super) fn final_end_exec(fighter: *mut app::Fighter); 9 | 10 | #[link_name = "_ZN3app22FighterSpecializer_Fox14final_end_exitERNS_7FighterE"] 11 | pub(super) fn final_end_exit(fighter: *mut app::Fighter); 12 | 13 | #[link_name = "_ZN3app22FighterSpecializer_Fox14final_end_initERNS_7FighterE"] 14 | pub(super) fn final_end_init(fighter: *mut app::Fighter); 15 | 16 | #[link_name = "_ZN3app22FighterSpecializer_Fox16final_ready_execERNS_7FighterE"] 17 | pub(super) fn final_ready_exec(fighter: *mut app::Fighter); 18 | 19 | #[link_name = "_ZN3app22FighterSpecializer_Fox16final_ready_exitERNS_7FighterE"] 20 | pub(super) fn final_ready_exit(fighter: *mut app::Fighter); 21 | 22 | #[link_name = "_ZN3app22FighterSpecializer_Fox20final_ready_exit_preERNS_7FighterE"] 23 | pub(super) fn final_ready_exit_pre(fighter: *mut app::Fighter); 24 | 25 | #[link_name = "_ZN3app22FighterSpecializer_Fox16final_ready_initERNS_7FighterE"] 26 | pub(super) fn final_ready_init(fighter: *mut app::Fighter); 27 | 28 | #[link_name = "_ZN3app22FighterSpecializer_Fox26final_remove_screen_effectEv"] 29 | pub(super) fn final_remove_screen_effect(); 30 | 31 | #[link_name = "_ZN3app22FighterSpecializer_Fox26final_scene01_exec_fix_posERNS_7FighterE"] 32 | pub(super) fn final_scene01_exec_fix_pos(fighter: *mut app::Fighter); 33 | 34 | #[link_name = "_ZN3app22FighterSpecializer_Fox18final_scene01_exitERNS_7FighterE"] 35 | pub(super) fn final_scene01_exit(fighter: *mut app::Fighter); 36 | 37 | #[link_name = "_ZN3app22FighterSpecializer_Fox18final_scene01_initERNS_7FighterE"] 38 | pub(super) fn final_scene01_init(fighter: *mut app::Fighter); 39 | 40 | #[link_name = "_ZN3app22FighterSpecializer_Fox16final_start_exitERNS_7FighterE"] 41 | pub(super) fn final_start_exit(fighter: *mut app::Fighter); 42 | 43 | #[link_name = "_ZN3app22FighterSpecializer_Fox16final_start_initERNS_7FighterE"] 44 | pub(super) fn final_start_init(fighter: *mut app::Fighter); 45 | 46 | } 47 | } 48 | 49 | pub fn final_end_exec(fighter: &mut app::Fighter) { 50 | unsafe { 51 | impl_::final_end_exec(fighter) 52 | } 53 | } 54 | 55 | pub fn final_end_exit(fighter: &mut app::Fighter) { 56 | unsafe { 57 | impl_::final_end_exit(fighter) 58 | } 59 | } 60 | 61 | pub fn final_end_init(fighter: &mut app::Fighter) { 62 | unsafe { 63 | impl_::final_end_init(fighter) 64 | } 65 | } 66 | 67 | pub fn final_ready_exec(fighter: &mut app::Fighter) { 68 | unsafe { 69 | impl_::final_ready_exec(fighter) 70 | } 71 | } 72 | 73 | pub fn final_ready_exit(fighter: &mut app::Fighter) { 74 | unsafe { 75 | impl_::final_ready_exit(fighter) 76 | } 77 | } 78 | 79 | pub fn final_ready_exit_pre(fighter: &mut app::Fighter) { 80 | unsafe { 81 | impl_::final_ready_exit_pre(fighter) 82 | } 83 | } 84 | 85 | pub fn final_ready_init(fighter: &mut app::Fighter) { 86 | unsafe { 87 | impl_::final_ready_init(fighter) 88 | } 89 | } 90 | 91 | pub fn final_remove_screen_effect() { 92 | unsafe { 93 | impl_::final_remove_screen_effect() 94 | } 95 | } 96 | 97 | pub fn final_scene01_exec_fix_pos(fighter: &mut app::Fighter) { 98 | unsafe { 99 | impl_::final_scene01_exec_fix_pos(fighter) 100 | } 101 | } 102 | 103 | pub fn final_scene01_exit(fighter: &mut app::Fighter) { 104 | unsafe { 105 | impl_::final_scene01_exit(fighter) 106 | } 107 | } 108 | 109 | pub fn final_scene01_init(fighter: &mut app::Fighter) { 110 | unsafe { 111 | impl_::final_scene01_init(fighter) 112 | } 113 | } 114 | 115 | pub fn final_start_exit(fighter: &mut app::Fighter) { 116 | unsafe { 117 | impl_::final_start_exit(fighter) 118 | } 119 | } 120 | 121 | pub fn final_start_init(fighter: &mut app::Fighter) { 122 | unsafe { 123 | impl_::final_start_init(fighter) 124 | } 125 | } 126 | 127 | -------------------------------------------------------------------------------- /src/app/specializers/gamewatch.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app28FighterSpecializer_GameWatch10init_panelERNS_26BattleObjectModuleAccessorE"] 8 | pub(super) fn init_panel(module_accessor: *mut app::BattleObjectModuleAccessor); 9 | 10 | } 11 | } 12 | 13 | pub fn init_panel(module_accessor: &mut app::BattleObjectModuleAccessor) { 14 | unsafe { 15 | impl_::init_panel(module_accessor) 16 | } 17 | } 18 | 19 | -------------------------------------------------------------------------------- /src/app/specializers/gaogaen.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app26FighterSpecializer_Gaogaen13generate_ropeERNS_21FighterModuleAccessorE"] 8 | pub(super) fn generate_rope(module_accessor: *mut app::FighterModuleAccessor); 9 | 10 | #[link_name = "_ZN3app26FighterSpecializer_Gaogaen11revenge_offERNS_7FighterEb"] 11 | pub(super) fn revenge_off(fighter: *mut app::Fighter, turn_off: bool); 12 | 13 | } 14 | } 15 | 16 | pub fn generate_rope(module_accessor: &mut app::FighterModuleAccessor) { 17 | unsafe { 18 | impl_::generate_rope(module_accessor) 19 | } 20 | } 21 | 22 | pub fn revenge_off(fighter: &mut app::Fighter, turn_off: bool) { 23 | unsafe { 24 | impl_::revenge_off(fighter, turn_off) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/specializers/gekkouga.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app27FighterSpecializer_Gekkouga24set_effect_visible_groupEb"] 8 | pub(super) fn set_effect_visible_group(arg: bool); 9 | 10 | #[link_name = "_ZN3app27FighterSpecializer_Gekkouga42set_special_s_transition_term_forbid_groupERNS_21FighterModuleAccessorEb"] 11 | pub(super) fn set_special_s_transition_term_forbid_group(module_accessor: *mut app::FighterModuleAccessor, enable: bool); 12 | 13 | } 14 | } 15 | 16 | pub fn set_effect_visible_group(arg: bool) { 17 | unsafe { 18 | impl_::set_effect_visible_group(arg) 19 | } 20 | } 21 | 22 | pub fn set_special_s_transition_term_forbid_group(module_accessor: &mut app::FighterModuleAccessor, enable: bool) { 23 | unsafe { 24 | impl_::set_special_s_transition_term_forbid_group(module_accessor, enable) 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/specializers/ike.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app22FighterSpecializer_Ike25get_final_target_pos_baseERNS_21FighterModuleAccessorE"] 8 | pub(super) fn get_final_target_pos_base(module_accessor: *mut app::FighterModuleAccessor) -> cpp::simd::Vector2; 9 | 10 | #[link_name = "_ZN3app22FighterSpecializer_Ike30get_final_target_pos_base_workERNS_21FighterModuleAccessorE"] 11 | pub(super) fn get_final_target_pos_base_work(module_accessor: *mut app::FighterModuleAccessor) -> cpp::simd::Vector2; 12 | 13 | } 14 | } 15 | 16 | pub fn get_final_target_pos_base(module_accessor: &mut app::FighterModuleAccessor) -> phx::Vec2 { 17 | unsafe { 18 | impl_::get_final_target_pos_base(module_accessor).into() 19 | } 20 | } 21 | 22 | pub fn get_final_target_pos_base_work(module_accessor: &mut app::FighterModuleAccessor) -> phx::Vec2 { 23 | unsafe { 24 | impl_::get_final_target_pos_base_work(module_accessor).into() 25 | } 26 | } 27 | 28 | -------------------------------------------------------------------------------- /src/app/specializers/inkling.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app26FighterSpecializer_Inkling10change_inkERNS_7FighterEf"] 8 | pub(super) fn change_ink(fighter: *mut app::Fighter, amount: f32); 9 | 10 | #[link_name = "_ZN3app26FighterSpecializer_Inkling19check_roller_groundERNS_7FighterERKN3phx8Vector2fES6_RS4_S7_b"] 11 | pub(super) fn check_roller_ground(fighter: *mut app::Fighter, joint_pos: *const phx::Vector2f, y_velocity: *const phx::Vector2f, arg: *mut phx::Vector2f, arg2: *mut phx::Vector2f, arg3: bool) -> bool; 12 | 13 | #[link_name = "_ZN3app26FighterSpecializer_Inkling18generate_rollerinkERNS_7FighterE"] 14 | pub(super) fn generate_rollerink(fighter: *mut app::Fighter); 15 | 16 | #[link_name = "_ZN3app26FighterSpecializer_Inkling11get_ink_maxERNS_7FighterE"] 17 | pub(super) fn get_ink_max(fighter: *mut app::Fighter) -> f32; 18 | 19 | #[link_name = "_ZN3app26FighterSpecializer_Inkling15get_ink_work_idEj"] 20 | pub(super) fn get_ink_work_id(fighter_kind: app::FighterKind) -> i32; 21 | 22 | #[link_name = "_ZN3app26FighterSpecializer_Inkling23get_roller_check_velo_yERNS_7FighterE"] 23 | pub(super) fn get_roller_check_velo_y(fighter: *mut app::Fighter) -> cpp::simd::Vector2; 24 | 25 | #[link_name = "_ZN3app26FighterSpecializer_Inkling22get_sub_ink_special_lwERNS_7FighterE"] 26 | pub(super) fn get_sub_ink_special_lw(fighter: *mut app::Fighter) -> f32; 27 | 28 | #[link_name = "_ZN3app26FighterSpecializer_Inkling21get_sub_ink_special_nERNS_7FighterE"] 29 | pub(super) fn get_sub_ink_special_n(fighter: *mut app::Fighter) -> f32; 30 | 31 | #[link_name = "_ZN3app26FighterSpecializer_Inkling15is_body_visibleERNS_7FighterE"] 32 | pub(super) fn is_body_visible(fighter: *mut app::Fighter) -> bool; 33 | 34 | #[link_name = "_ZN3app26FighterSpecializer_Inkling22is_paintable_rollerinkERNS_7FighterE"] 35 | pub(super) fn is_paintable_rollerink(fighter: *mut app::Fighter) -> bool; 36 | 37 | #[link_name = "_ZN3app26FighterSpecializer_Inkling8lack_inkERNS_7FighterE"] 38 | pub(super) fn lack_ink(fighter: *mut app::Fighter); 39 | 40 | #[link_name = "_ZN3app26FighterSpecializer_Inkling13request_paintERNS_7FighterEN3phx6Hash40ERNS3_8Vector3fERNS3_8Vector2fEf"] 41 | pub(super) fn request_paint(fighter: *mut app::Fighter, joint: phx::Hash40, joint_offset: *mut phx::Vector3f, arg: *mut phx::Vector2f, arg2: f32); 42 | 43 | } 44 | } 45 | 46 | pub fn change_ink(fighter: &mut app::Fighter, amount: f32) { 47 | unsafe { 48 | impl_::change_ink(fighter, amount) 49 | } 50 | } 51 | 52 | pub fn check_roller_ground(fighter: &mut app::Fighter, joint_pos: &phx::Vector2f, y_velocity: &phx::Vector2f, arg: &mut phx::Vector2f, arg2: &mut phx::Vector2f, arg3: bool) -> bool { 53 | unsafe { 54 | impl_::check_roller_ground(fighter, joint_pos, y_velocity, arg, arg2, arg3) 55 | } 56 | } 57 | 58 | pub fn generate_rollerink(fighter: &mut app::Fighter) { 59 | unsafe { 60 | impl_::generate_rollerink(fighter) 61 | } 62 | } 63 | 64 | pub fn get_ink_max(fighter: &mut app::Fighter) -> f32 { 65 | unsafe { 66 | impl_::get_ink_max(fighter) 67 | } 68 | } 69 | 70 | pub fn get_ink_work_id(fighter_kind: app::FighterKind) -> i32 { 71 | unsafe { 72 | impl_::get_ink_work_id(fighter_kind) 73 | } 74 | } 75 | 76 | pub fn get_roller_check_velo_y(fighter: &mut app::Fighter) -> phx::Vec2 { 77 | unsafe { 78 | impl_::get_roller_check_velo_y(fighter).into() 79 | } 80 | } 81 | 82 | pub fn get_sub_ink_special_lw(fighter: &mut app::Fighter) -> f32 { 83 | unsafe { 84 | impl_::get_sub_ink_special_lw(fighter) 85 | } 86 | } 87 | 88 | pub fn get_sub_ink_special_n(fighter: &mut app::Fighter) -> f32 { 89 | unsafe { 90 | impl_::get_sub_ink_special_n(fighter) 91 | } 92 | } 93 | 94 | pub fn is_body_visible(fighter: &mut app::Fighter) -> bool { 95 | unsafe { 96 | impl_::is_body_visible(fighter) 97 | } 98 | } 99 | 100 | pub fn is_paintable_rollerink(fighter: &mut app::Fighter) -> bool { 101 | unsafe { 102 | impl_::is_paintable_rollerink(fighter) 103 | } 104 | } 105 | 106 | pub fn lack_ink(fighter: &mut app::Fighter) { 107 | unsafe { 108 | impl_::lack_ink(fighter) 109 | } 110 | } 111 | 112 | pub fn request_paint(fighter: &mut app::Fighter, joint: phx::Hash40, joint_offset: &mut phx::Vector3f, arg: &mut phx::Vector2f, arg2: f32) { 113 | unsafe { 114 | impl_::request_paint(fighter, joint, joint_offset, arg, arg2) 115 | } 116 | } 117 | 118 | -------------------------------------------------------------------------------- /src/app/stage.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app5stage11back_line_zEv"] 8 | pub(super) fn back_line_z() -> f32; 9 | 10 | #[link_name = "_ZN3app5stage24calc_offset_with_gravityERKN3phx8Vector2fERKNS1_8Vector3fE"] 11 | pub(super) fn calc_offset_with_gravity(offset: *const phx::Vector2f, position: *const phx::Vector3f) -> cpp::simd::Vector2; 12 | 13 | #[link_name = "_ZN3app5stage20get_gravity_positionEv"] 14 | pub(super) fn get_gravity_position() -> cpp::simd::Vector3; 15 | 16 | #[link_name = "_ZN3app5stage18get_smashball_rectEv"] 17 | pub(super) fn get_smashball_rect() -> cpp::simd::Vector4; 18 | 19 | #[link_name = "_ZN3app5stage12get_stage_idEv"] 20 | pub(super) fn get_stage_id() -> i32; 21 | 22 | #[link_name = "_ZN3app5stage24get_stage_position_deltaEv"] 23 | pub(super) fn get_stage_position_delta() -> cpp::simd::Vector3; 24 | 25 | #[link_name = "_ZN3app5stage31is_exist_item_generate_positionEv"] 26 | pub(super) fn is_exist_item_generate_position() -> bool; 27 | 28 | #[link_name = "_ZN3app5stage13is_flat_stageEv"] 29 | pub(super) fn is_flat_stage() -> bool; 30 | 31 | #[link_name = "_ZN3app5stage26is_looking_at_stage_centerEP9lua_State"] 32 | pub(super) fn is_looking_at_stage_center(state: *mut lua_State) -> bool; 33 | 34 | #[link_name = "_ZN3app5stage17is_normal_gravityEv"] 35 | pub(super) fn is_normal_gravity() -> bool; 36 | 37 | #[link_name = "_ZN3app5stage32is_the_stage_needs_render_offsetEv"] 38 | pub(super) fn is_the_stage_needs_render_offset() -> bool; 39 | 40 | #[link_name = "_ZN3app5stage22item_generate_positionEv"] 41 | pub(super) fn item_generate_position() -> cpp::simd::Vector3; 42 | 43 | #[link_name = "_ZN3app5stage30item_generate_position_in_rectEffffRN3phx8Vector3fE"] 44 | pub(super) fn item_generate_position_in_rect(arg1: f32, arg2: f32, arg3: f32, arg4: f32, arg5: *const phx::Vector3f) -> cpp::simd::Vector3; 45 | 46 | #[link_name = "_ZN3app5stage30item_generate_position_nearestERKN3phx8Vector3fEi"] 47 | pub(super) fn item_generate_position_nearest(arg1: *const phx::Vector3f, arg2: i32) -> cpp::simd::Vector3; 48 | 49 | #[link_name = "_ZN3app5stage18lr_to_stage_centerEP9lua_State"] 50 | pub(super) fn lr_to_stage_center(state: *mut lua_State) -> f32; 51 | } 52 | } 53 | 54 | pub fn back_line_z() -> f32 { 55 | unsafe { 56 | impl_::back_line_z() 57 | } 58 | } 59 | 60 | pub fn calc_offset_with_gravity(offset: &phx::Vector2f, position: &phx::Vector3f) -> phx::Vec2 { 61 | unsafe { 62 | impl_::calc_offset_with_gravity(offset, position).into() 63 | } 64 | } 65 | 66 | pub fn get_gravity_position() -> phx::Vector3f { 67 | unsafe { 68 | impl_::get_gravity_position().into() 69 | } 70 | } 71 | 72 | pub fn get_smashball_rect() -> lib::Rect { 73 | unsafe { 74 | impl_::get_smashball_rect().into() 75 | } 76 | } 77 | 78 | pub fn get_stage_id() -> i32 { 79 | unsafe { 80 | impl_::get_stage_id() 81 | } 82 | } 83 | 84 | pub fn get_stage_position_delta() -> phx::Vector3f { 85 | unsafe { 86 | impl_::get_stage_position_delta().into() 87 | } 88 | } 89 | 90 | pub fn is_exist_item_generate_position() -> bool { 91 | unsafe { 92 | impl_::is_exist_item_generate_position() 93 | } 94 | } 95 | 96 | pub fn is_flat_stage() -> bool { 97 | unsafe { 98 | impl_::is_flat_stage() 99 | } 100 | } 101 | 102 | pub fn is_looking_at_stage_center(state: &mut lua_State) -> bool { 103 | unsafe { 104 | impl_::is_looking_at_stage_center(state) 105 | } 106 | } 107 | 108 | pub fn is_normal_gravity() -> bool { 109 | unsafe { 110 | impl_::is_normal_gravity() 111 | } 112 | } 113 | 114 | pub fn is_the_stage_needs_render_offset() -> bool { 115 | unsafe { 116 | impl_::is_the_stage_needs_render_offset() 117 | } 118 | } 119 | 120 | pub fn item_generate_position() -> phx::Vector3f { 121 | unsafe { 122 | impl_::item_generate_position().into() 123 | } 124 | } 125 | 126 | pub fn item_generate_position_in_rect(arg1: f32, arg2: f32, arg3: f32, arg4: f32, arg5: &phx::Vector3f) -> phx::Vector3f { 127 | unsafe { 128 | impl_::item_generate_position_in_rect(arg1, arg2, arg3, arg4, arg5).into() 129 | } 130 | } 131 | 132 | pub fn item_generate_position_nearest(arg1: &phx::Vector3f, arg2: i32) -> phx::Vector3f { 133 | unsafe { 134 | impl_::item_generate_position_nearest(arg1, arg2).into() 135 | } 136 | } 137 | 138 | pub fn lr_to_stage_center(state: &mut lua_State) -> f32 { 139 | unsafe { 140 | impl_::lr_to_stage_center(state) 141 | } 142 | } 143 | -------------------------------------------------------------------------------- /src/app/sv_global_parameter.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | mod impl_ { 4 | use crate::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN3app19sv_global_parameter28melee_melee_info_item_appearEv"] 8 | pub(super) fn melee_melee_info_item_appear() -> phx::Hash40; 9 | 10 | #[link_name = "_ZN3app19sv_global_parameter15melee_rule_modeEv"] 11 | pub(super) fn melee_rule_mode() -> phx::Hash40; 12 | 13 | #[link_name = "_ZN3app19sv_global_parameter15melee_rule_typeEv"] 14 | pub(super) fn melee_rule_type() -> phx::Hash40; 15 | } 16 | } 17 | 18 | pub fn melee_melee_info_item_appear() -> phx::Hash40 { 19 | unsafe { 20 | impl_::melee_melee_info_item_appear() 21 | } 22 | } 23 | 24 | pub fn melee_rule_mode() -> phx::Hash40 { 25 | unsafe { 26 | impl_::melee_rule_mode() 27 | } 28 | } 29 | 30 | pub fn melee_rule_type() -> phx::Hash40 { 31 | unsafe { 32 | impl_::melee_rule_type() 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/cpp.rs: -------------------------------------------------------------------------------- 1 | mod array; 2 | mod binary_tree; 3 | mod deque; 4 | mod fixed_vec; 5 | mod function; 6 | mod hashmap; 7 | mod linked_list; 8 | mod misc; 9 | mod optional; 10 | mod shared_ptr; 11 | pub mod simd; 12 | mod string; 13 | mod vector; 14 | 15 | pub use array::*; 16 | pub use binary_tree::*; 17 | pub use deque::*; 18 | pub use fixed_vec::*; 19 | pub use function::*; 20 | pub use hashmap::*; 21 | pub use linked_list::*; 22 | pub use misc::*; 23 | pub use optional::*; 24 | pub use shared_ptr::*; 25 | pub use string::*; 26 | pub use vector::*; 27 | -------------------------------------------------------------------------------- /src/cpp/array.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{ 2 | Index, 3 | IndexMut 4 | }; 5 | 6 | macro_rules! impl_array_methods { 7 | ($name:ident) => { 8 | impl $name { 9 | pub fn as_slice<'a>(&'a self) -> &'a [T] { 10 | unsafe { 11 | std::slice::from_raw_parts(self.data, self.count) 12 | } 13 | } 14 | 15 | pub fn as_slice_mut<'a>(&'a mut self) -> &'a mut [T] { 16 | unsafe { 17 | std::slice::from_raw_parts_mut(self.data, self.count) 18 | } 19 | } 20 | 21 | pub fn len(&self) -> usize { 22 | self.count 23 | } 24 | 25 | pub fn as_ptr(&self) -> *const T { 26 | self.data 27 | } 28 | 29 | pub fn as_mut_ptr(&self) -> *mut T { 30 | self.data 31 | } 32 | 33 | pub fn iter(&self) -> std::slice::Iter<'_, T> { 34 | self.as_slice().iter() 35 | } 36 | 37 | pub fn iter_mut(&mut self) -> std::slice::IterMut<'_, T> { 38 | self.as_slice_mut().iter_mut() 39 | } 40 | 41 | pub fn get<'a>(&'a self, index: usize) -> Option<&'a T> { 42 | self.as_slice().get(index) 43 | } 44 | 45 | pub fn get_mut<'a>(&'a mut self, index: usize) -> Option<&'a mut T> { 46 | self.as_slice_mut().get_mut(index) 47 | } 48 | } 49 | 50 | impl Index for $name { 51 | type Output = T; 52 | 53 | fn index(&self, index: usize) -> &Self::Output { 54 | &self.as_slice()[index] 55 | } 56 | } 57 | 58 | impl IndexMut for $name { 59 | fn index_mut(&mut self, index: usize) -> &mut Self::Output { 60 | &mut self.as_slice_mut()[index] 61 | } 62 | } 63 | } 64 | } 65 | 66 | #[repr(C)] 67 | pub struct Array { 68 | data: *mut T, 69 | count: usize 70 | } 71 | 72 | #[repr(C)] 73 | pub struct Array2 { 74 | count: usize, 75 | data: *mut T, 76 | } 77 | 78 | impl_array_methods!(Array); 79 | impl_array_methods!(Array2); -------------------------------------------------------------------------------- /src/cpp/deque.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{Index, IndexMut}; 2 | 3 | #[repr(C)] 4 | pub struct SplitBuffer { 5 | first: *mut *mut T, 6 | begin: *mut *mut T, 7 | end: *mut *mut T, 8 | end_cap: *mut *mut T, 9 | } 10 | 11 | impl SplitBuffer { 12 | pub const fn block_size() -> usize { 13 | if std::mem::size_of::() < 0x100 { 14 | 0x1000 / std::mem::size_of::() 15 | } else { 16 | 0x10 17 | } 18 | } 19 | 20 | pub fn len(&self) -> usize { 21 | unsafe { self.end.offset_from(self.begin) as usize } 22 | } 23 | 24 | pub fn is_empty(&self) -> bool { 25 | self.len() == 0 26 | } 27 | 28 | pub fn capacity(&self) -> usize { 29 | unsafe { self.end_cap.offset_from(self.first) as usize } 30 | } 31 | 32 | pub fn get_buffer(&self, idx: usize) -> Option<&[T]> { 33 | if idx >= self.len() { 34 | None 35 | } else { 36 | Some(unsafe { 37 | std::slice::from_raw_parts( 38 | *self.begin.add(idx), 39 | Self::block_size() 40 | ) 41 | }) 42 | } 43 | } 44 | 45 | pub fn get_buffer_mut(&mut self, idx: usize) -> Option<&mut [T]> { 46 | if idx >= self.len() { 47 | None 48 | } else { 49 | Some(unsafe { 50 | std::slice::from_raw_parts_mut( 51 | *self.begin.add(idx), 52 | Self::block_size() 53 | ) 54 | }) 55 | } 56 | } 57 | } 58 | 59 | #[repr(C)] 60 | pub struct Deque { 61 | buffer: SplitBuffer, 62 | start_index: usize, 63 | length: usize 64 | } 65 | 66 | impl Deque { 67 | const fn split_index(index: usize) -> (usize, usize) { 68 | let block_size = SplitBuffer::::block_size(); 69 | (index / block_size, index % block_size) 70 | } 71 | 72 | pub fn len(&self) -> usize { 73 | self.length 74 | } 75 | 76 | pub fn is_empty(&self) -> bool { 77 | self.length == 0 78 | } 79 | 80 | pub fn get(&self, index: usize) -> Option<&T> { 81 | if index >= self.length { 82 | None 83 | } else { 84 | let (block, item) = Self::split_index(index); 85 | self.buffer 86 | .get_buffer(block) 87 | .and_then(|buffer| buffer.get(item)) 88 | } 89 | } 90 | 91 | pub fn get_mut(&mut self, index: usize) -> Option<&mut T> { 92 | if index >= self.length { 93 | None 94 | } else { 95 | let (block, item) = Self::split_index(index); 96 | self.buffer 97 | .get_buffer_mut(block) 98 | .and_then(|buffer| buffer.get_mut(item)) 99 | } 100 | } 101 | } 102 | 103 | struct DequeIterator<'a, T> { 104 | deque: &'a Deque, 105 | current: usize, 106 | } 107 | 108 | struct DequeIteratorMut<'a, T> { 109 | deque: &'a mut Deque, 110 | current: usize 111 | } 112 | 113 | impl<'a, T> Iterator for DequeIterator<'a, T> { 114 | type Item = &'a T; 115 | 116 | fn next(&mut self) -> Option { 117 | let output = self.deque.get(self.current); 118 | self.current += 1; 119 | output 120 | } 121 | } 122 | 123 | impl<'a, T> Iterator for DequeIteratorMut<'a, T> { 124 | type Item = &'a mut T; 125 | 126 | fn next(&mut self) -> Option { 127 | let output = self.deque.get_mut(self.current); 128 | self.current += 1; 129 | unsafe { std::mem::transmute::, Option<&'a mut T>>(output) } 130 | } 131 | } 132 | 133 | impl Index for Deque { 134 | type Output = T; 135 | 136 | fn index(&self, index: usize) -> &Self::Output { 137 | self.get(index).unwrap() 138 | } 139 | } 140 | 141 | impl IndexMut for Deque { 142 | fn index_mut(&mut self, index: usize) -> &mut Self::Output { 143 | self.get_mut(index).unwrap() 144 | } 145 | } -------------------------------------------------------------------------------- /src/cpp/function.rs: -------------------------------------------------------------------------------- 1 | use skyline::libc::c_void; 2 | 3 | #[repr(C)] 4 | pub struct FunctionBase { 5 | vtable: *const *const c_void 6 | } -------------------------------------------------------------------------------- /src/cpp/linked_list.rs: -------------------------------------------------------------------------------- 1 | use std::{ops::{ 2 | Deref, 3 | DerefMut 4 | }, marker::PhantomData}; 5 | 6 | 7 | 8 | #[repr(C)] 9 | pub struct LinkedList { 10 | length: usize, 11 | start: *mut LinkedListNode, 12 | end: *mut LinkedListNode 13 | } 14 | 15 | impl LinkedList { 16 | pub fn len(&self) -> usize { 17 | self.length 18 | } 19 | 20 | /// Only use this for comparisons during an iter, it is not safe to use elsewhere 21 | unsafe fn as_node(&self) -> *mut LinkedListNode { 22 | &self.start as *const *mut LinkedListNode as *mut LinkedListNode 23 | } 24 | 25 | pub fn iter(&self) -> LinkedListIter<'_, T> { 26 | LinkedListIter { 27 | term: unsafe { 28 | self.as_node() 29 | }, 30 | current: unsafe { 31 | self.as_node() 32 | }, 33 | phantom: PhantomData 34 | } 35 | } 36 | 37 | pub fn iter_mut(&mut self) -> LinkedListIterMut<'_, T> { 38 | LinkedListIterMut { 39 | term: unsafe { 40 | self.as_node() 41 | }, 42 | current: unsafe { 43 | self.as_node() 44 | }, 45 | phantom: PhantomData 46 | } 47 | } 48 | 49 | pub fn add_to_front(&mut self, data: T) { 50 | let next_node = Box::leak(Box::new(LinkedListNode { 51 | next: self.start, 52 | prev: unsafe { 53 | self.as_node() 54 | }, 55 | data 56 | })); 57 | 58 | if self.length > 0 { 59 | unsafe { 60 | (*self.start).prev = next_node; 61 | } 62 | } 63 | self.start = next_node; 64 | self.length += 1; 65 | } 66 | 67 | pub fn add_to_back(&mut self, data: T) { 68 | let next_node = Box::leak(Box::new(LinkedListNode { 69 | next: unsafe { 70 | self.as_node() 71 | }, 72 | prev: self.end, 73 | data 74 | })); 75 | 76 | if self.length > 0 { 77 | unsafe { 78 | (*self.end).next = next_node; 79 | } 80 | } 81 | self.end = next_node; 82 | } 83 | } 84 | 85 | #[repr(C)] 86 | pub struct LinkedListNode { 87 | next: *mut LinkedListNode, 88 | prev: *mut LinkedListNode, 89 | data: T, 90 | } 91 | 92 | impl LinkedListNode { 93 | pub fn next(&self) -> *mut LinkedListNode { 94 | self.next 95 | } 96 | 97 | pub fn prev(&self) -> *mut LinkedListNode { 98 | self.prev 99 | } 100 | } 101 | 102 | impl Deref for LinkedListNode { 103 | type Target = T; 104 | 105 | fn deref(&self) -> &Self::Target { 106 | &self.data 107 | } 108 | } 109 | 110 | impl DerefMut for LinkedListNode { 111 | fn deref_mut(&mut self) -> &mut Self::Target { 112 | &mut self.data 113 | } 114 | } 115 | 116 | impl AsRef for LinkedListNode { 117 | fn as_ref(&self) -> &T { 118 | &self.data 119 | } 120 | } 121 | 122 | impl AsMut for LinkedListNode { 123 | fn as_mut(&mut self) -> &mut T { 124 | &mut self.data 125 | } 126 | } 127 | 128 | pub struct LinkedListIter<'a, T> { 129 | term: *mut LinkedListNode, 130 | current: *mut LinkedListNode, 131 | phantom: PhantomData<&'a T> 132 | } 133 | 134 | pub struct LinkedListIterMut<'a, T> { 135 | term: *mut LinkedListNode, 136 | current: *mut LinkedListNode, 137 | phantom: PhantomData<&'a mut T> 138 | } 139 | 140 | impl<'a, T> Iterator for LinkedListIter<'a, T> { 141 | type Item = &'a T; 142 | 143 | fn next(&mut self) -> Option { 144 | unsafe { 145 | if (*self.current).next == self.term { 146 | None 147 | } else { 148 | self.current = (*self.current).next; 149 | Some((*self.current).as_ref()) 150 | } 151 | } 152 | } 153 | } 154 | 155 | impl<'a, T> Iterator for LinkedListIterMut<'a, T> { 156 | type Item = &'a mut T; 157 | 158 | fn next(&mut self) -> Option { 159 | unsafe { 160 | if (*self.current).next == self.term { 161 | None 162 | } else { 163 | self.current = (*self.current).next; 164 | Some((*self.current).as_mut()) 165 | } 166 | } 167 | } 168 | } -------------------------------------------------------------------------------- /src/cpp/misc.rs: -------------------------------------------------------------------------------- 1 | #[repr(align(8))] 2 | pub struct Mutex([u8; 32]); 3 | -------------------------------------------------------------------------------- /src/cpp/optional.rs: -------------------------------------------------------------------------------- 1 | // Based on boost optional 2 | #[repr(C)] 3 | pub struct Optional { 4 | pub tag: bool, 5 | pub item: T 6 | } 7 | 8 | impl Optional { 9 | pub fn into_option(self) -> Option { 10 | let Self { tag, item } = self; 11 | if tag { 12 | Some(item) 13 | } else { 14 | None 15 | } 16 | } 17 | 18 | pub fn is(&self) -> bool { 19 | self.tag 20 | } 21 | } 22 | 23 | impl Into> for Optional { 24 | fn into(self) -> Option { 25 | let Self { tag, item } = self; 26 | if tag { 27 | Some(item) 28 | } else { 29 | None 30 | } 31 | } 32 | } 33 | 34 | impl From> for Optional { 35 | fn from(other: Option) -> Self { 36 | match other { 37 | Some(item) => Optional { 38 | tag: true, 39 | item 40 | }, 41 | None => Optional { 42 | tag: false, 43 | item: unsafe { std::mem::zeroed() } 44 | } 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /src/cpp/shared_ptr.rs: -------------------------------------------------------------------------------- 1 | #[repr(C)] 2 | pub struct SharedPtr { 3 | data: *mut T, 4 | shared_weak_count: *mut () 5 | } 6 | 7 | impl std::ops::Deref for SharedPtr { 8 | type Target = T; 9 | 10 | fn deref(&self) -> &Self::Target { 11 | unsafe { &*self.data } 12 | } 13 | } 14 | 15 | impl std::ops::DerefMut for SharedPtr { 16 | fn deref_mut(&mut self) -> &mut Self::Target { 17 | unsafe { &mut *self.data } 18 | } 19 | } -------------------------------------------------------------------------------- /src/cpp/simd.rs: -------------------------------------------------------------------------------- 1 | #[repr(simd)] 2 | pub struct Vector2 { 3 | pub vec: [f32; 2] 4 | } 5 | 6 | #[repr(simd)] 7 | pub struct Vector3 { 8 | pub vec: [f32; 3] 9 | } 10 | 11 | #[repr(simd)] 12 | pub struct Vector4 { 13 | pub vec: [f32; 4] 14 | } 15 | -------------------------------------------------------------------------------- /src/cpp/string.rs: -------------------------------------------------------------------------------- 1 | use std::fmt::Debug; 2 | 3 | use skyline::libc::c_char; 4 | 5 | #[repr(C)] 6 | pub struct String { 7 | data: [u8; 0x18], 8 | } 9 | 10 | impl String { 11 | fn is_compact(&self) -> bool { 12 | self.data[0] & 1 == 0 13 | } 14 | 15 | pub fn len(&self) -> usize { 16 | if self.is_compact() { 17 | (self.data[0] >> 1) as usize 18 | } else { 19 | unsafe { *(self.data.as_ptr().add(0x8) as *const usize) } 20 | } 21 | } 22 | 23 | pub fn max_length(&self) -> usize { 24 | if self.is_compact() { 25 | 0x16 26 | } else { 27 | unsafe { *(self.data.as_ptr() as *const usize) - 1 } 28 | } 29 | } 30 | 31 | pub fn capacity(&self) -> usize { 32 | if self.is_compact() { 33 | 0x17 34 | } else { 35 | unsafe { *(self.data.as_ptr() as *const usize) } 36 | } 37 | } 38 | 39 | pub fn c_string(&self) -> *const c_char { 40 | if self.is_compact() { 41 | unsafe { self.data.as_ptr().add(1) as *const c_char } 42 | } else { 43 | unsafe { *(self.data.as_ptr().add(0x10) as *const *const c_char) } 44 | } 45 | } 46 | 47 | pub fn to_str(&self) -> &str { 48 | let len = self.len(); 49 | let c_string = self.c_string(); 50 | unsafe { std::str::from_utf8_unchecked(std::slice::from_raw_parts(c_string, len)) } 51 | } 52 | 53 | pub fn to_string(&self) -> std::string::String { 54 | self.to_str().to_string() 55 | } 56 | } 57 | 58 | impl Debug for String { 59 | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 60 | f.write_str(self.to_str()) 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/lib.rs: -------------------------------------------------------------------------------- 1 | #![feature(repr_simd)] 2 | #![feature(simd_ffi)] 3 | #![feature(const_trait_impl)] 4 | #![feature(pointer_byte_offsets)] 5 | #![allow(incomplete_features)] 6 | #![allow(improper_ctypes)] // For simd 7 | #![allow(non_snake_case)] 8 | pub mod app; 9 | pub mod cpp; 10 | mod lib_impl; 11 | pub mod lua2cpp; 12 | pub mod phx; 13 | 14 | pub use lib_impl::lib; 15 | 16 | pub(crate) use smash_macro::*; 17 | 18 | #[macro_use] 19 | extern crate bitflags; 20 | 21 | #[macro_export] 22 | macro_rules! size_of { 23 | ($ty:tt) => { 24 | std::mem::size_of::<$ty>() 25 | }; 26 | } 27 | 28 | #[macro_export] 29 | macro_rules! c_str { 30 | ($s:expr) => { 31 | [$s, "\0"].concat().as_bytes().as_ptr() 32 | }; 33 | } 34 | 35 | #[cfg(feature = "type_assert")] 36 | #[macro_use] 37 | extern crate memoffset; 38 | 39 | #[allow(non_camel_case_types)] 40 | #[repr(C)] 41 | pub struct lua_State(u64); 42 | 43 | #[cfg(feature = "type_assert")] 44 | pub fn validate() { 45 | app::LinkEvent::assert(); 46 | app::LinkEventCapture::assert(); 47 | app::LinkEventCaptureItem::assert(); 48 | app::LinkEventCaptureDriver::assert(); 49 | app::LinkEventCaptureMimikkyu::assert(); 50 | app::LinkEventCapturePulled::assert(); 51 | app::LinkEventFinal::assert(); 52 | app::LinkEventMask::assert(); 53 | app::LinkEventPos::assert(); 54 | app::LinkEventStarShot::assert(); 55 | app::LinkEventThrow::assert(); 56 | app::LinkEventTouchItem::assert(); 57 | app::LinkEventYoshiTamagoDamageEffect::assert(); 58 | app::FighterCloudLinkEventFinal::assert(); 59 | app::FighterInklingLinkEventPaint::assert(); 60 | app::FighterPikminLinkEventWeaponPikminChangeMotion::assert(); 61 | app::FighterPikminLinkEventWeaponPikminChangeStatus::assert(); 62 | app::FighterPikminLinkEventWeaponPikminConstraint::assert(); 63 | app::FighterPikminLinkEventWeaponOnFlag::assert(); 64 | app::FighterPikminLinkEventWeaponSetFloat::assert(); 65 | app::FighterPikminLinkEventWeaponSetInt::assert(); 66 | app::FighterPikminLinkEventWeaponSetPowerMulStatus::assert(); 67 | app::FighterPikminLinkEventWeaponSyncLR::assert(); 68 | app::FighterPikminLinkEventWeaponSyncPos::assert(); 69 | app::FighterPokemonLinkEventChange::assert(); 70 | app::FighterRidleyLinkEventMotion::assert(); 71 | app::FighterRyuLinkEventFinalDeadDamage::assert(); 72 | app::FighterRyuLinkEventFinalMoveTarget::assert(); 73 | app::FighterElementLinkEventChange::assert(); 74 | app::WeaponPickelTrolleyLinkEventConfirmMaterial::assert(); 75 | app::WeaponPickelTrolleyLinkEventConsumeMaterial::assert(); 76 | app::WeaponPickelTrolleyLinkEventDestroyed::assert(); 77 | app::WeaponPickelTrolleyLinkEventGetParam::assert(); 78 | app::WeaponPickelTrolleyLinkEventRemoveIfDistance::assert(); 79 | app::WeaponPickelTrolleyLinkEventRemoveRailByGeneration::assert(); 80 | app::WeaponPickelTrolleyLinkEventTurnTorchOn::assert(); 81 | app::WeaponRobotHominglaserLinkEventBurst::assert(); 82 | app::WeaponRobotHominglaserLinkEventSearch::assert(); 83 | app::WeaponShizueFishingrodLinkEventCliff::assert(); 84 | app::WeaponShizueFishingrodLinkEventCut::assert(); 85 | app::WeaponShizueFishingrodLinkEventReel::assert(); 86 | app::WeaponShizueFishingrodLinkEventShoot::assert(); 87 | 88 | app::AttackAbsoluteData::assert(); 89 | app::AttackData::assert(); 90 | app::DamageInfo::assert(); 91 | 92 | lib::L2CValue::assert(); 93 | lib::L2CValueHack::assert(); 94 | 95 | lua2cpp::L2CAgentBase::assert(); 96 | lua2cpp::L2CAgentGeneratedBase::assert(); 97 | lua2cpp::L2CFighterBase::assert(); 98 | lua2cpp::L2CFighterCommon::assert(); 99 | lua2cpp::L2CWeaponCommon::assert(); 100 | 101 | lua2cpp::L2CFighterAIBase::assert(); 102 | lua2cpp::L2CFighterAIActionBase::assert(); 103 | lua2cpp::L2CFighterAIAnalystBase::assert(); 104 | lua2cpp::L2CFighterAIModeBase::assert(); 105 | 106 | lua2cpp::L2CFighterAnimcmdEffectCommon::assert(); 107 | lua2cpp::L2CFighterAnimcmdExpressionCommon::assert(); 108 | lua2cpp::L2CFighterAnimcmdGameCommon::assert(); 109 | lua2cpp::L2CFighterAnimcmdSoundCommon::assert(); 110 | } 111 | -------------------------------------------------------------------------------- /src/lib_impl.rs: -------------------------------------------------------------------------------- 1 | mod agent; 2 | mod animcmd; 3 | mod event; 4 | mod inner_function; 5 | mod lua; 6 | mod msc; 7 | mod rect; 8 | mod table; 9 | mod utility; 10 | mod value; 11 | 12 | pub mod lib { 13 | use super::*; 14 | 15 | pub mod utility { 16 | pub use super::super::utility::*; 17 | } 18 | 19 | pub use agent::*; 20 | pub use animcmd::*; 21 | pub use event::*; 22 | pub use inner_function::*; 23 | pub use lua::*; 24 | pub use msc::*; 25 | pub use rect::*; 26 | pub use table::*; 27 | pub use value::*; 28 | } -------------------------------------------------------------------------------- /src/lib_impl/animcmd.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | pub type LuaAnimcmdContinueYield = extern "C" fn(*mut lua_State, f32) -> bool; 4 | 5 | #[repr(C)] 6 | #[derive(TypeAssert)] 7 | #[size = 0x40] 8 | pub struct LuaAnimcmdSubState { 9 | #[offset = 0x00] 10 | agent: *mut AnimcmdAgent, 11 | #[offset = 0x08] 12 | coroutine_name: phx::Hash40, 13 | #[offset = 0x10] 14 | _x10: u64, 15 | #[offset = 0x18] 16 | wait_timer_sub: f32, 17 | #[offset = 0x1C] 18 | wait_timer_mul_sub: f32, 19 | #[offset = 0x20] 20 | current_frame: f32, 21 | #[offset = 0x24] 22 | enable_frame_advance: f32, 23 | #[offset = 0x28] 24 | coroutine_index: i32, 25 | #[offset = 0x2C] 26 | enabled: bool, 27 | #[offset = 0x2D] 28 | _x2D: bool, 29 | #[offset = 0x2E] 30 | is_available: bool, 31 | #[offset = 0x2F] 32 | is_yielding: bool, 33 | #[offset = 0x30] 34 | should_continue_yielding: LuaAnimcmdContinueYield, 35 | #[offset = 0x38] 36 | target_frame: f32, 37 | } 38 | 39 | #[repr(C)] 40 | #[derive(TypeAssert)] 41 | #[size = 0xC] 42 | pub struct LuaAnimcmdExecutionState { 43 | #[offset = 0x0] 44 | rate: f32, 45 | #[offset = 0x4] 46 | elapsed_frames: f32, 47 | #[offset = 0x8] 48 | is_excute: bool, 49 | #[offset = 0x9] 50 | _x9: bool, 51 | } 52 | 53 | #[repr(C)] 54 | #[derive(TypeAssert)] 55 | #[size = 0x98] 56 | pub struct LuaAnimcmdState { 57 | #[offset = 0x00] 58 | current_state: LuaAnimcmdSubState, 59 | #[offset = 0x40] 60 | backup_state: LuaAnimcmdSubState, 61 | #[offset = 0x80] 62 | execution_state: LuaAnimcmdExecutionState, 63 | #[offset = 0x8C] 64 | backup_execution_state: LuaAnimcmdExecutionState, 65 | } 66 | 67 | #[repr(C)] 68 | #[derive(TypeAssert)] 69 | #[size = 0x2A0] 70 | pub struct AnimcmdAgent { 71 | #[offset = 0x000] 72 | pub thread_info: *mut lib::LuaThreadInfo, 73 | #[offset = 0x008] 74 | pub accessor: lib::LuaStateAccessor, 75 | #[offset = 0x1C8] 76 | pub animcmd_state: LuaAnimcmdState, 77 | #[offset = 0x260] 78 | pub function_map: cpp::HashMap, 79 | #[offset = 0x288] 80 | pub _x268: i32, 81 | #[offset = 0x290] 82 | pub lua2cpp_agent: *mut lib::L2CAgent, 83 | #[offset = 0x298] 84 | pub is_using_lua2cpp: bool, 85 | } 86 | -------------------------------------------------------------------------------- /src/lib_impl/inner_function.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | #[repr(C)] 4 | pub struct L2CInnerFunctionBase { 5 | function: *mut cpp::FunctionBase, 6 | ref_count: u32, 7 | } -------------------------------------------------------------------------------- /src/lib_impl/lua.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | use app::*; 4 | 5 | #[repr(C)] 6 | #[derive(TypeAssert)] 7 | #[size = 0x1C0] 8 | pub struct LuaStateAccessor { 9 | #[offset = 0x000] 10 | pub _x0: [u64; 3], 11 | #[offset = 0x018] 12 | pub posture_module: *mut Module, 13 | #[offset = 0x020] 14 | pub _x20: u64, 15 | #[offset = 0x028] 16 | pub status_module: *mut StatusModule, 17 | #[offset = 0x030] 18 | pub control_module: *mut Module, 19 | #[offset = 0x038] 20 | pub work_module: *mut WorkModule, 21 | #[offset = 0x040] 22 | pub ground_module: *mut Module, 23 | #[offset = 0x048] 24 | pub camera_module: *mut Module, 25 | #[offset = 0x050] 26 | pub kinetic_module: *mut Module, 27 | #[offset = 0x058] 28 | pub color_blend_module: *mut Module, 29 | #[offset = 0x060] 30 | pub model_module: *mut Module, 31 | #[offset = 0x068] 32 | pub physics_module: *mut Module, 33 | #[offset = 0x070] 34 | pub motion_module: *mut Module, 35 | #[offset = 0x078] 36 | pub stop_module: *mut Module, 37 | #[offset = 0x080] 38 | pub article_module: *mut Module, 39 | #[offset = 0x088] 40 | pub attack_module: *mut Module, 41 | #[offset = 0x090] 42 | pub damage_module: *mut Module, 43 | #[offset = 0x098] 44 | pub hit_module: *mut Module, 45 | #[offset = 0x0A0] 46 | pub combo_module: *mut Module, 47 | #[offset = 0x0A8] 48 | pub area_module: *mut Module, 49 | #[offset = 0x0B0] 50 | pub item_module: *mut Module, 51 | #[offset = 0x0B8] 52 | pub link_module: *mut Module, 53 | #[offset = 0x0C0] 54 | pub team_module: *mut Module, 55 | #[offset = 0x0C8] 56 | pub search_module: *mut Module, 57 | #[offset = 0x0D0] 58 | pub unk_module_1: *mut Module, 59 | #[offset = 0x0D8] 60 | pub turn_module: *mut Module, 61 | #[offset = 0x0E0] 62 | pub reflect_module: *mut Module, 63 | #[offset = 0x0E8] 64 | pub shield_module: *mut Module, 65 | #[offset = 0x0F0] 66 | pub absorber_module: *mut Module, 67 | #[offset = 0x0F8] 68 | pub reflector_module: *mut Module, 69 | #[offset = 0x100] 70 | pub jostle_module: *mut Module, 71 | #[offset = 0x108] 72 | pub catch_module: *mut Module, 73 | #[offset = 0x110] 74 | pub cancel_module: *mut CancelModule, 75 | #[offset = 0x118] 76 | pub unk_module_2: *mut Module, 77 | #[offset = 0x120] 78 | pub capture_module: *mut Module, 79 | #[offset = 0x128] 80 | pub effect_module: *mut Module, 81 | #[offset = 0x130] 82 | pub sound_module: *mut Module, 83 | #[offset = 0x138] 84 | pub visibility_module: *mut Module, 85 | #[offset = 0x140] 86 | pub grab_module: *mut Module, 87 | #[offset = 0x148] 88 | pub slope_module: *mut Module, 89 | #[offset = 0x150] 90 | pub shake_module: *mut Module, 91 | #[offset = 0x158] 92 | pub slow_module: *mut Module, 93 | #[offset = 0x160] 94 | pub unk_module_3: *mut Module, 95 | #[offset = 0x168] 96 | pub shadow_module: *mut Module, 97 | #[offset = 0x170] 98 | pub motion_animcmd_module: *mut MotionAnimcmdModule, 99 | #[offset = 0x178] 100 | pub lua_module: *mut LuaModule, 101 | #[offset = 0x180] 102 | pub ink_paint_module: *mut Module, 103 | #[offset = 0x188] 104 | pub _x188: u64, 105 | #[offset = 0x190] 106 | pub battle_object_id: u32, 107 | #[offset = 0x194] 108 | pub _x194: u32, 109 | #[offset = 0x198] 110 | pub agent_kind: i32, 111 | #[offset = 0x19C] 112 | pub entry_id: app::FighterEntryID, 113 | #[offset = 0x1A0] 114 | pub module_accessor: *mut BattleObjectModuleAccessor, 115 | #[offset = 0x1A8] 116 | pub battle_object: *mut BattleObject, 117 | #[offset = 0x1B0] 118 | pub animcmd_state: *mut lib::LuaAnimcmdState, 119 | #[offset = 0x1B8] 120 | pub animcmd_exec_state: *mut lib::LuaAnimcmdExecutionState, 121 | } 122 | 123 | #[repr(C)] 124 | #[derive(TypeAssert)] 125 | #[size = 0x30] 126 | pub struct LuaThread { 127 | #[offset = 0x00] 128 | vtable: *const *const skyline::libc::c_void, 129 | #[offset = 0x08] 130 | state: *mut lua_State, 131 | #[offset = 0x10] 132 | _xC: u32, 133 | #[offset = 0x18] 134 | thread_name: phx::Hash40, 135 | #[offset = 0x20] 136 | parent_thread_name: phx::Hash40, 137 | #[offset = 0x28] 138 | _x28: u32, 139 | #[offset = 0x2C] 140 | _x2C: u32, 141 | } 142 | 143 | #[repr(C)] 144 | #[derive(TypeAssert)] 145 | #[size = 0x50] 146 | pub struct LuaThreadInfo { 147 | #[offset = 0x00] 148 | thread: *mut LuaThread, 149 | #[offset = 0x08] 150 | coroutines: [lib::TValue; 4], 151 | #[offset = 0x48] 152 | is_release_control: bool, 153 | } 154 | -------------------------------------------------------------------------------- /src/lib_impl/msc.rs: -------------------------------------------------------------------------------- 1 | use crate::*; 2 | 3 | /// The structure to represent an MSC command. 4 | /// 5 | /// Despite being mostly abstracted away via module and lua calls, MSC commands are 6 | /// still used in ultimate, and you can find remnants of them throughout the fighter/weapon/item 7 | /// code and the lua consts. For example, the following is an MSC command: 8 | /// ```rs 9 | /// pub fn unable_cancel_status(fighter: &mut L2CFighterCommon) { 10 | /// fighter.clear_lua_stack(); 11 | /// fighter.push_lua_stack(L2CValue::new(app::msc_cmd::CANCEL_UNABLE_CANCEL_STATUS)); 12 | /// app::sv_module_access::cancel(fighter.lua_state); 13 | /// fighter.pop_lua_stack(1); 14 | /// } 15 | /// ``` 16 | /// 17 | /// These commands will get sent off to the respective handler in these structures. 18 | #[repr(C)] 19 | #[derive(TypeAssert)] 20 | #[size = 0x10] 21 | pub struct MscCommand { 22 | #[offset = 0x0] payload: *mut MscCommandPayload, 23 | #[offset = 0x8] output_count: u32 24 | } 25 | 26 | impl MscCommand { 27 | /// Gets the payload of the command 28 | pub fn payload<'a>(&'a self) -> &'a MscCommandPayload { 29 | unsafe { 30 | &*self.payload 31 | } 32 | } 33 | 34 | /// Gets the number of outputs this command returned. 35 | /// 36 | /// ### Notes 37 | /// The number of outputs is an undefined quantity until after the command 38 | /// has been handled properly. 39 | pub fn get_output_count(&self) -> usize { 40 | self.output_count as usize 41 | } 42 | } 43 | 44 | /// The fundamental data type for [luac](https://www.lua.org/source/5.1/lua.h.html) 45 | /// 46 | /// This type is similar to the [`lib::L2CValue`], however it isn't used in any exported APIs by the executable(s). 47 | #[repr(C)] 48 | #[derive(TypeAssert)] 49 | #[size = 0x10] 50 | pub struct TValue { 51 | #[offset = 0x0] data: u64, 52 | #[offset = 0x8] tag_type: u32 53 | } 54 | 55 | /// The structure to represent the command request for a [`MscCommand`] 56 | /// 57 | /// It comes packaged with everything the receiver needs to know about the command. 58 | #[repr(C)] 59 | #[derive(TypeAssert)] 60 | #[size = 0x18] 61 | pub struct MscCommandPayload { 62 | #[offset = 0x00] args: *const TValue, 63 | #[offset = 0x08] arg_count: u32, 64 | _padding: u32, 65 | #[offset = 0x10] lua_state: *mut lua_State 66 | } 67 | 68 | impl MscCommandPayload { 69 | /// Returns the arguments of the payload if the field is populated. 70 | /// 71 | /// ### Notes 72 | /// The `args` field doesn't always need to be populated, as the default behavior is 73 | /// likely to first check if `lua_state` is `null`, and if not to pull the args off of 74 | /// its stack. 75 | pub fn default_args<'a>(&'a self) -> Option<&'a [TValue]> { 76 | if self.args.is_null() || self.arg_count == 0 { 77 | None 78 | } else { 79 | Some(unsafe { std::slice::from_raw_parts(self.args, self.arg_count as usize) }) 80 | } 81 | } 82 | 83 | /// Returns the number of arguments in this command 84 | pub fn arg_count(&self) -> usize { 85 | self.arg_count as usize 86 | } 87 | 88 | /// Returns the `lua_State` which owns this command 89 | pub fn lua_state(&self) -> *mut lua_State { 90 | self.lua_state 91 | } 92 | } -------------------------------------------------------------------------------- /src/lib_impl/rect.rs: -------------------------------------------------------------------------------- 1 | use std::mem::MaybeUninit; 2 | 3 | use crate::*; 4 | 5 | extern "C" { 6 | #[link_name = "\u{1}_ZN3app8lua_bind35lib__Rect__load_from_l2c_table_implEPN3lib4RectERKNS1_8L2CValueE"] 7 | fn load_from_l2c_table(rect: *mut Rect, table: *const lib::L2CValue); 8 | 9 | #[link_name = "\u{1}_ZN3app8lua_bind31lib__Rect__store_l2c_table_implEPKN3lib4RectE"] 10 | fn store_l2c_table(rect: *const Rect) -> lib::L2CValueHack; 11 | } 12 | 13 | #[derive(Debug, Copy, Clone, PartialEq, TypeAssert)] 14 | #[repr(C)] 15 | #[size = 0x10] 16 | pub struct Rect { 17 | #[offset = 0x0] pub left: f32, 18 | #[offset = 0x4] pub right: f32, 19 | #[offset = 0x8] pub top: f32, 20 | #[offset = 0xC] pub bottom: f32 21 | } 22 | 23 | impl Rect { 24 | pub fn new(left: f32, right: f32, top: f32, bottom: f32) -> Self { 25 | Self { 26 | left, 27 | right, 28 | top, 29 | bottom 30 | } 31 | } 32 | 33 | pub fn area(&self) -> f32 { 34 | let width = (self.right - self.left).abs(); 35 | let height = (self.top - self.bottom).abs(); 36 | width * height 37 | } 38 | } 39 | 40 | impl From for Rect { 41 | fn from(val: lib::L2CValue) -> Self { 42 | unsafe { 43 | let mut value = MaybeUninit::uninit(); 44 | load_from_l2c_table(value.as_mut_ptr(), &val); 45 | value.assume_init() 46 | } 47 | } 48 | } 49 | 50 | impl From<&lib::L2CValue> for Rect { 51 | fn from(val: &lib::L2CValue) -> Self { 52 | unsafe { 53 | let mut value = MaybeUninit::uninit(); 54 | load_from_l2c_table(value.as_mut_ptr(), val); 55 | value.assume_init() 56 | } 57 | } 58 | } 59 | 60 | impl Into for Rect { 61 | fn into(self) -> lib::L2CValue { 62 | unsafe { 63 | store_l2c_table(&self).into() 64 | } 65 | } 66 | } 67 | 68 | impl From for Rect { 69 | fn from(other: cpp::simd::Vector4) -> Self { 70 | Rect { 71 | left: other.vec[0], 72 | right: other.vec[1], 73 | top: other.vec[2], 74 | bottom: other.vec[3] 75 | } 76 | } 77 | } 78 | 79 | impl Into for Rect { 80 | fn into(self) -> cpp::simd::Vector4 { 81 | cpp::simd::Vector4 { 82 | vec: [self.left, self.right, self.top, self.bottom] 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /src/lib_impl/table.rs: -------------------------------------------------------------------------------- 1 | use std::{ops::{Index, IndexMut}, mem::MaybeUninit}; 2 | 3 | use crate::*; 4 | 5 | extern "C" { 6 | #[link_name = "\u{1}_ZN3lib8L2CTableC1Ei"] 7 | fn table_ctor(table: *mut L2CTable, array_cap: i32); 8 | 9 | #[allow(dead_code)] 10 | #[link_name = "\u{1}_ZN3lib8L2CTable14find_metatableERKN3phx6Hash40E"] 11 | fn find_metatable(table: *mut L2CTable, key: *const phx::Hash40) -> *mut lib::L2CValue; 12 | } 13 | 14 | #[repr(C)] 15 | #[derive(TypeAssert)] 16 | #[size = 0x48] 17 | pub struct L2CTable { 18 | #[offset = 0x00] ref_count: u32, 19 | padding: u32, 20 | #[offset = 0x08] array: cpp::Vector, 21 | #[offset = 0x20] map: cpp::Tree, 22 | #[offset = 0x38] agent: *mut lib::L2CAgent, 23 | #[offset = 0x40] metatable: *mut L2CTable 24 | } 25 | 26 | impl L2CTable { 27 | pub(crate) fn initialize_raw_memory(this: *mut Self, cap: i32) { 28 | unsafe { 29 | table_ctor(this, cap); 30 | } 31 | } 32 | 33 | pub fn new() -> Self { 34 | Self::new_with_capacity(0) 35 | } 36 | 37 | pub fn new_with_capacity(capacity: i32) -> Self { 38 | unsafe { 39 | let mut table = MaybeUninit::uninit(); 40 | table_ctor(table.as_mut_ptr(), capacity); 41 | table.assume_init() 42 | } 43 | } 44 | 45 | pub fn rc(&self) -> usize { 46 | self.ref_count as usize 47 | } 48 | 49 | pub fn array_length(&self) -> usize { 50 | self.array.len() 51 | } 52 | 53 | pub fn array_iter(&self) -> cpp::VectorIter { 54 | self.array.iter() 55 | } 56 | 57 | pub fn map_length(&self) -> usize { 58 | self.map.len() 59 | } 60 | 61 | pub fn map_iter(&self) -> cpp::TreeKeyValueIter { 62 | self.map.iter() 63 | } 64 | 65 | pub fn metatable(&self) -> Option<&L2CTable> { 66 | unsafe { 67 | self.metatable.as_ref() 68 | } 69 | } 70 | 71 | pub fn metatable_mut(&mut self) -> Option<&mut L2CTable> { 72 | unsafe { 73 | self.metatable.as_mut() 74 | } 75 | } 76 | 77 | pub fn get_array(&self, index: usize) -> Option<&lib::L2CValue> { 78 | self.array.get(index) 79 | } 80 | 81 | pub fn get_array_mut(&mut self, index: usize) -> Option<&mut lib::L2CValue> { 82 | self.array.get_mut(index) 83 | } 84 | 85 | pub fn get_map(&self, key: phx::Hash40) -> Option<&lib::L2CValue> { 86 | self.map.get(&key) 87 | } 88 | 89 | pub fn get_map_mut(&mut self, key: phx::Hash40) -> Option<&mut lib::L2CValue> { 90 | self.map.get_mut(&key) 91 | } 92 | } 93 | 94 | impl Index for L2CTable { 95 | type Output = lib::L2CValue; 96 | 97 | fn index(&self, index: usize) -> &Self::Output { 98 | &self.array[index] 99 | } 100 | } 101 | 102 | impl IndexMut for L2CTable { 103 | fn index_mut(&mut self, index: usize) -> &mut Self::Output { 104 | &mut self.array[index] 105 | } 106 | } 107 | 108 | impl Index for L2CTable { 109 | type Output = lib::L2CValue; 110 | 111 | fn index(&self, index: phx::Hash40) -> &Self::Output { 112 | &self.map[index] 113 | } 114 | } 115 | 116 | impl IndexMut for L2CTable { 117 | fn index_mut(&mut self, index: phx::Hash40) -> &mut Self::Output { 118 | &mut self.map[index] 119 | } 120 | } -------------------------------------------------------------------------------- /src/lib_impl/utility.rs: -------------------------------------------------------------------------------- 1 | use std::mem::MaybeUninit; 2 | 3 | use skyline::libc::{c_void, c_char}; 4 | 5 | extern "C" { 6 | #[link_name = "\u{1}_ZN3lib7utility8VariadicC1Ev"] 7 | fn ctor(variadic: *mut Variadic); 8 | 9 | #[link_name = "\u{1}_ZN3lib7utility8VariadicD1Ev"] 10 | fn dtor(variadic: *mut Variadic); 11 | 12 | #[link_name = "\u{1}_ZNK3lib7utility8Variadic10get_formatEv"] 13 | fn get_format(variadic: *const Variadic) -> *const c_char; 14 | } 15 | 16 | #[repr(C)] 17 | pub struct Variadic { 18 | variadic_type: *const c_void 19 | } 20 | 21 | impl Variadic { 22 | pub fn new() -> Self { 23 | unsafe { 24 | let mut value = MaybeUninit::uninit(); 25 | ctor(value.as_mut_ptr()); 26 | value.assume_init() 27 | } 28 | } 29 | 30 | pub fn get_format(&self) -> Option { 31 | unsafe { 32 | let format = get_format(self); 33 | if format.is_null() { 34 | None 35 | } else { 36 | Some(skyline::from_c_str(format)) 37 | } 38 | } 39 | } 40 | 41 | pub fn get_format_cstr(&self) -> *const c_char { 42 | unsafe { 43 | get_format(self) 44 | } 45 | } 46 | } 47 | 48 | impl Drop for Variadic { 49 | fn drop(&mut self) { 50 | unsafe { 51 | dtor(self); 52 | } 53 | } 54 | } -------------------------------------------------------------------------------- /src/lua2cpp.rs: -------------------------------------------------------------------------------- 1 | mod agent_base; 2 | mod agent_generated_base; 3 | mod ai_action_base; 4 | mod ai_analyst_base; 5 | mod ai_base; 6 | mod ai_mode_base; 7 | mod animcmd_effect_common; 8 | mod animcmd_expression_common; 9 | mod animcmd_game_common; 10 | mod animcmd_sound_common; 11 | mod base; 12 | mod common; 13 | mod weapon; 14 | 15 | pub use agent_base::*; 16 | pub use agent_generated_base::*; 17 | pub use ai_action_base::*; 18 | pub use ai_analyst_base::*; 19 | pub use ai_base::*; 20 | pub use ai_mode_base::*; 21 | pub use animcmd_effect_common::*; 22 | pub use animcmd_expression_common::*; 23 | pub use animcmd_game_common::*; 24 | pub use animcmd_sound_common::*; 25 | pub use base::*; 26 | pub use common::*; 27 | pub use weapon::*; -------------------------------------------------------------------------------- /src/lua2cpp/agent_generated_base.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{Deref, DerefMut}; 2 | 3 | use crate::*; 4 | 5 | #[repr(C)] 6 | pub struct L2CAgentGeneratedBase { 7 | agent_base: lua2cpp::L2CAgentBase 8 | } 9 | 10 | impl Deref for L2CAgentGeneratedBase { 11 | type Target = lua2cpp::L2CAgentBase; 12 | 13 | fn deref(&self) -> &Self::Target { 14 | &self.agent_base 15 | } 16 | } 17 | 18 | impl DerefMut for L2CAgentGeneratedBase { 19 | fn deref_mut(&mut self) -> &mut Self::Target { 20 | &mut self.agent_base 21 | } 22 | } 23 | 24 | impl L2CAgentGeneratedBase { 25 | pub fn construct_bind_const_value_table() { 26 | unsafe { 27 | construct_bind_const_value_table() 28 | } 29 | } 30 | } 31 | 32 | #[cfg(feature = "type_assert")] 33 | impl L2CAgentGeneratedBase { 34 | pub fn assert() { 35 | assert_eq!(size_of!(L2CAgentGeneratedBase), 0xC8); 36 | assert_eq!(offset_of!(L2CAgentGeneratedBase, agent_base), 0x0); 37 | } 38 | } 39 | 40 | extern "C" { 41 | #[link_name = "_ZN7lua2cpp21L2CAgentGeneratedBase32construct_bind_const_value_tableEv"] 42 | fn construct_bind_const_value_table(); 43 | } -------------------------------------------------------------------------------- /src/lua2cpp/ai_action_base.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | mod class; 3 | mod cpp; 4 | 5 | pub use class::*; -------------------------------------------------------------------------------- /src/lua2cpp/ai_analyst_base.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | mod class; 3 | mod cpp; 4 | 5 | pub use class::*; -------------------------------------------------------------------------------- /src/lua2cpp/ai_analyst_base/class.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{Deref, DerefMut}; 2 | 3 | use crate::*; 4 | 5 | use super::cpp::*; 6 | 7 | #[repr(C)] 8 | pub struct L2CFighterAIAnalystBase { 9 | ai_base: lua2cpp::L2CFighterAIBase, 10 | pub global_table: lib::L2CValue, 11 | pub private_table: lib::L2CValue, 12 | } 13 | 14 | impl Deref for L2CFighterAIAnalystBase { 15 | type Target = lua2cpp::L2CFighterAIBase; 16 | 17 | fn deref(&self) -> &Self::Target { 18 | &self.ai_base 19 | } 20 | } 21 | 22 | impl DerefMut for L2CFighterAIAnalystBase { 23 | fn deref_mut(&mut self) -> &mut Self::Target { 24 | &mut self.ai_base 25 | } 26 | } 27 | 28 | impl L2CFighterAIAnalystBase { 29 | pub fn main_func__analyst_global_variables(&mut self) { 30 | unsafe { 31 | main_func__analyst_global_variables(self) 32 | } 33 | } 34 | 35 | pub fn main_func__analyst_private_variables(&mut self) { 36 | unsafe { 37 | main_func__analyst_private_variables(self) 38 | } 39 | } 40 | 41 | pub fn change_status(&mut self, arg1: lib::L2CValue) { 42 | unsafe { 43 | change_status(self, arg1.into()) 44 | } 45 | } 46 | 47 | pub fn update_status(&mut self) { 48 | unsafe { 49 | update_status(self) 50 | } 51 | } 52 | 53 | pub fn update_chanced_frame(&mut self) { 54 | unsafe { 55 | update_chanced_frame(self) 56 | } 57 | } 58 | 59 | pub fn ENTRY(&mut self) -> lib::L2CValue { 60 | unsafe { 61 | ENTRY(self).into() 62 | } 63 | } 64 | 65 | pub fn init_lines(&mut self) { 66 | unsafe { 67 | init_lines(self) 68 | } 69 | } 70 | 71 | pub fn init_events(&mut self) { 72 | unsafe { 73 | init_events(self) 74 | } 75 | } 76 | 77 | pub fn init_global_variables(&mut self) { 78 | unsafe { 79 | init_global_variables(self) 80 | } 81 | } 82 | 83 | pub fn init_private_variables(&mut self) { 84 | unsafe { 85 | init_private_variables(self) 86 | } 87 | } 88 | 89 | pub fn call_function_update(&mut self) -> lib::L2CValue { 90 | unsafe { 91 | call_function_update(self).into() 92 | } 93 | } 94 | 95 | pub fn call_event_on_dead(&mut self) -> lib::L2CValue { 96 | unsafe { 97 | call_event_on_dead(self).into() 98 | } 99 | } 100 | } 101 | 102 | #[cfg(feature = "type_assert")] 103 | impl L2CFighterAIAnalystBase { 104 | pub fn assert() { 105 | assert_eq!(size_of!(L2CFighterAIAnalystBase), 0x178); 106 | assert_eq!(offset_of!(L2CFighterAIAnalystBase, ai_base), 0x0); 107 | assert_eq!(offset_of!(L2CFighterAIAnalystBase, global_table), 0x158); 108 | assert_eq!(offset_of!(L2CFighterAIAnalystBase, private_table), 0x168); 109 | } 110 | } -------------------------------------------------------------------------------- /src/lua2cpp/ai_analyst_base/cpp.rs: -------------------------------------------------------------------------------- 1 | 2 | use crate::*; 3 | 4 | use super::class::*; 5 | 6 | extern "C" { 7 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase35main_func__analyst_global_variablesEv"] 8 | pub(super) fn main_func__analyst_global_variables(this: *mut L2CFighterAIAnalystBase); 9 | 10 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase36main_func__analyst_private_variablesEv"] 11 | pub(super) fn main_func__analyst_private_variables(this: *mut L2CFighterAIAnalystBase); 12 | 13 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase13change_statusEN3lib8L2CValueE"] 14 | pub(super) fn change_status(this: *mut L2CFighterAIAnalystBase, arg1: lib::L2CValueHack); 15 | 16 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase13update_statusEv"] 17 | pub(super) fn update_status(this: *mut L2CFighterAIAnalystBase); 18 | 19 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase20update_chanced_frameEv"] 20 | pub(super) fn update_chanced_frame(this: *mut L2CFighterAIAnalystBase); 21 | 22 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase5ENTRYEv"] 23 | pub(super) fn ENTRY(this: *mut L2CFighterAIAnalystBase) -> lib::L2CValueHack; 24 | 25 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase10init_linesEv"] 26 | pub(super) fn init_lines(this: *mut L2CFighterAIAnalystBase); 27 | 28 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase11init_eventsEv"] 29 | pub(super) fn init_events(this: *mut L2CFighterAIAnalystBase); 30 | 31 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase21init_global_variablesEv"] 32 | pub(super) fn init_global_variables(this: *mut L2CFighterAIAnalystBase); 33 | 34 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase22init_private_variablesEv"] 35 | pub(super) fn init_private_variables(this: *mut L2CFighterAIAnalystBase); 36 | 37 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase20call_function_updateEv"] 38 | pub(super) fn call_function_update(this: *mut L2CFighterAIAnalystBase) -> lib::L2CValueHack; 39 | 40 | #[link_name = "_ZN7lua2cpp23L2CFighterAIAnalystBase18call_event_on_deadEv"] 41 | pub(super) fn call_event_on_dead(this: *mut L2CFighterAIAnalystBase) -> lib::L2CValueHack; 42 | } -------------------------------------------------------------------------------- /src/lua2cpp/ai_base.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | mod class; 3 | mod cpp; 4 | 5 | pub use class::*; -------------------------------------------------------------------------------- /src/lua2cpp/ai_mode_base.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | mod class; 3 | mod cpp; 4 | 5 | pub use class::*; -------------------------------------------------------------------------------- /src/lua2cpp/animcmd_effect_common.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | mod class; 3 | mod cpp; 4 | 5 | pub use class::*; -------------------------------------------------------------------------------- /src/lua2cpp/animcmd_expression_common.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | mod class; 3 | mod cpp; 4 | 5 | pub use class::*; -------------------------------------------------------------------------------- /src/lua2cpp/animcmd_game_common.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | mod class; 3 | mod cpp; 4 | 5 | pub use class::*; -------------------------------------------------------------------------------- /src/lua2cpp/animcmd_sound_common.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{Deref, DerefMut}; 2 | 3 | use crate::*; 4 | 5 | #[repr(C)] 6 | pub struct L2CFighterAnimcmdSoundCommon { 7 | agent_base: lua2cpp::L2CAgentBase 8 | } 9 | 10 | impl Deref for L2CFighterAnimcmdSoundCommon { 11 | type Target = lua2cpp::L2CAgentBase; 12 | 13 | fn deref(&self) -> &Self::Target { 14 | &self.agent_base 15 | } 16 | } 17 | 18 | impl DerefMut for L2CFighterAnimcmdSoundCommon { 19 | fn deref_mut(&mut self) -> &mut Self::Target { 20 | &mut self.agent_base 21 | } 22 | } 23 | 24 | impl L2CFighterAnimcmdSoundCommon { 25 | #[allow(non_snake_case)] 26 | pub fn sound_CapturePulledWiifitHi(&mut self) -> lib::L2CValue { 27 | unsafe { 28 | sound_CapturePulledWiifitHi(self).into() 29 | } 30 | } 31 | } 32 | 33 | #[cfg(feature = "type_assert")] 34 | impl L2CFighterAnimcmdSoundCommon { 35 | pub fn assert() { 36 | assert_eq!(size_of!(L2CFighterAnimcmdSoundCommon), 0xC8); 37 | assert_eq!(offset_of!(L2CFighterAnimcmdSoundCommon, agent_base), 0x0); 38 | } 39 | } 40 | 41 | extern "C" { 42 | #[link_name = "_ZN7lua2cpp28L2CFighterAnimcmdSoundCommon27sound_CapturePulledWiifitHiEv"] 43 | fn sound_CapturePulledWiifitHi(this: *mut L2CFighterAnimcmdSoundCommon) -> lib::L2CValueHack; 44 | } -------------------------------------------------------------------------------- /src/lua2cpp/base.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | mod class; 3 | mod cpp; 4 | 5 | pub use class::*; -------------------------------------------------------------------------------- /src/lua2cpp/common.rs: -------------------------------------------------------------------------------- 1 | #[allow(non_snake_case)] 2 | mod class; 3 | mod cpp; 4 | 5 | pub use class::*; -------------------------------------------------------------------------------- /src/lua2cpp/weapon.rs: -------------------------------------------------------------------------------- 1 | use std::ops::{Deref, DerefMut}; 2 | 3 | use crate::*; 4 | 5 | extern "C" { 6 | #[link_name = "_ZN7lua2cpp15L2CWeaponCommon26sub_weapon_common_settingsEv"] 7 | fn sub_weapon_common_settings(this: *mut L2CWeaponCommon); 8 | 9 | #[link_name = "_ZN7lua2cpp15L2CWeaponCommon35sub_set_ground_correct_by_situationEN3lib8L2CValueE"] 10 | fn sub_set_ground_correct_by_situation(this: *mut L2CWeaponCommon, arg1: lib::L2CValueHack) -> lib::L2CValueHack; 11 | 12 | #[link_name = "_ZN7lua2cpp15L2CWeaponCommon45sub_ground_module_is_touch_all_consider_speedEv"] 13 | fn sub_ground_module_is_touch_all_consider_speed(this: *mut L2CWeaponCommon) -> lib::L2CValueHack; 14 | } 15 | 16 | #[repr(C)] 17 | pub struct L2CWeaponCommon { 18 | fighter_base: lua2cpp::L2CFighterBase 19 | } 20 | 21 | impl Deref for L2CWeaponCommon { 22 | type Target = lua2cpp::L2CFighterBase; 23 | 24 | fn deref(&self) -> &Self::Target { 25 | &self.fighter_base 26 | } 27 | } 28 | 29 | impl DerefMut for L2CWeaponCommon { 30 | fn deref_mut(&mut self) -> &mut Self::Target { 31 | &mut self.fighter_base 32 | } 33 | } 34 | 35 | impl L2CWeaponCommon { 36 | pub fn sub_weapon_common_settings(&mut self) { 37 | unsafe { 38 | sub_weapon_common_settings(self) 39 | } 40 | } 41 | 42 | pub fn sub_set_ground_correct_by_situation(&mut self, arg1: lib::L2CValue) -> lib::L2CValue { 43 | unsafe { 44 | sub_set_ground_correct_by_situation(self, arg1.into()).into() 45 | } 46 | } 47 | 48 | pub fn sub_ground_module_is_touch_all_consider_speed(&mut self) -> lib::L2CValue { 49 | unsafe { 50 | sub_ground_module_is_touch_all_consider_speed(self).into() 51 | } 52 | } 53 | } 54 | 55 | #[cfg(feature = "type_assert")] 56 | impl L2CWeaponCommon { 57 | pub fn assert() { 58 | assert_eq!(size_of!(L2CWeaponCommon), 0x118); 59 | assert_eq!(offset_of!(L2CWeaponCommon, fighter_base), 0x0); 60 | } 61 | } -------------------------------------------------------------------------------- /src/phx.rs: -------------------------------------------------------------------------------- 1 | pub use hash40::*; 2 | 3 | mod fiber; 4 | mod vector; 5 | 6 | pub use fiber::*; 7 | pub use vector::*; -------------------------------------------------------------------------------- /src/phx/fiber.rs: -------------------------------------------------------------------------------- 1 | use std::mem::MaybeUninit; 2 | 3 | use skyline::libc::{ 4 | c_void, 5 | c_char 6 | }; 7 | 8 | extern "C" { 9 | #[link_name = "\u{1}_ZN3phx5FiberC1Ev"] 10 | fn fiber_ctor(fiber: *mut Fiber); 11 | 12 | #[link_name = "\u{1}_ZN3phx5Fiber17get_current_fiberEv"] 13 | fn get_current_fiber() -> *mut Fiber; 14 | 15 | #[link_name = "\u{1}_ZN3phx5Fiber8finalizeEv"] 16 | fn finalize(fiber: *mut Fiber); 17 | 18 | #[allow(dead_code)] 19 | #[link_name = "\u{1}_ZN3phx5Fiber5setupENSt3__18functionIFPS0_vEEEPKcm"] 20 | fn setup(fiber: *mut Fiber, setup_fn: *const c_void, name: *const c_char, stack_size: usize); 21 | 22 | #[link_name = "\u{1}_ZNK3phx5Fiber6statusEv"] 23 | fn status(fiber: *mut Fiber) -> u32; 24 | 25 | #[link_name = "\u{1}_ZN3phx5Fiber15switch_to_fiberEPS0_"] 26 | fn switch_to_fiber(fiber: *mut Fiber); 27 | 28 | #[link_name = "\u{1}_ZN3phx5FiberD1Ev"] 29 | fn fiber_dtor(fiber: *mut Fiber); 30 | } 31 | 32 | #[derive(Debug)] 33 | #[repr(C)] 34 | pub struct Fiber { 35 | os_fiber_type: *const c_void 36 | } 37 | 38 | impl Fiber { 39 | pub fn new() -> Fiber { 40 | unsafe { 41 | let mut fiber = MaybeUninit::::uninit(); 42 | fiber_ctor(fiber.as_mut_ptr()); 43 | fiber.assume_init() 44 | } 45 | } 46 | 47 | pub fn current() -> Option<&'static mut Fiber> { 48 | unsafe { 49 | get_current_fiber().as_mut() 50 | } 51 | } 52 | 53 | pub fn finalize(&mut self) { 54 | unsafe { 55 | finalize(self) 56 | } 57 | } 58 | 59 | pub fn setup(&mut self) -> ! { 60 | unimplemented!() 61 | } 62 | 63 | pub fn status(&mut self) -> u32 { 64 | unsafe { 65 | status(self) 66 | } 67 | } 68 | 69 | pub fn switch_to_fiber(&mut self) { 70 | unsafe { 71 | switch_to_fiber(self) 72 | } 73 | } 74 | } 75 | 76 | impl Drop for Fiber { 77 | fn drop(&mut self) { 78 | unsafe { 79 | fiber_dtor(self) 80 | } 81 | } 82 | } --------------------------------------------------------------------------------