Skip to content

Commit 3550c4c

Browse files
committed
Merge remote-tracking branch 'upstream/dev' into mewtwo-tp-jump
2 parents 5474f81 + 4e81e55 commit 3550c4c

File tree

31 files changed

+198
-290
lines changed

31 files changed

+198
-290
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ default = [
258258
"ken",
259259
"kirby",
260260
"koopa",
261-
# "koopag",
261+
"koopag",
262262
"koopajr",
263263
"krool",
264264
"link",

dynamic/src/consts.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -816,9 +816,8 @@ pub mod vars {
816816
pub mod mario {
817817
pub mod instance {
818818
// flags
819-
pub const NOKNOK_SHELL: i32 = 0x0100;
820-
pub const DISABLE_DSPECIAL_STALL: i32 = 0x0101;
821-
pub const SPECIAL_S_DISABLE_STALL: i32 = 0x0102;
819+
pub const DISABLE_DSPECIAL_STALL: i32 = 0x0100;
820+
pub const SPECIAL_S_DISABLE_STALL: i32 = 0x0101;
822821
}
823822

824823
pub mod status {

fighters/buddy/src/opff.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ unsafe fn blue_eggs_land_cancels(fighter: &mut L2CFighterCommon) {
2323
// 11F of landing lag plus one extra frame to subtract from the FAF to actually get that amount of lag
2424
let landing_lag = 12.0;
2525
if MotionModule::frame(fighter.module_accessor) < (special_n_fire_cancel_frame_ground - landing_lag) {
26-
MotionModule::change_motion_inherit_frame(fighter.module_accessor, Hash40::new("special_n"), 49.0 - landing_lag, 1.0, 0.0, false, false);
26+
MotionModule::set_frame_sync_anim_cmd(fighter.module_accessor, 49.0 - landing_lag, true, true, false);
2727
}
2828
LANDING_EFFECT(fighter, Hash40::new("sys_landing_smoke"), Hash40::new("top"), 0, 0, 0, 0, 0, 0, 0.9, 0, 0, 0, 0, 0, 0, false);
2929
//fighter.change_status_req(*FIGHTER_STATUS_KIND_LANDING, false);
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11

2-
#[skyline::hook(offset=0x6a7100)] // unadjusted for 13.0.2?
3-
pub fn stub_kill_screen() {}
2+
// #[skyline::hook(offset=0x6a7100)] // unadjusted for 13.0.2?
3+
// pub fn stub_kill_screen() {}
44

55
pub fn install() {
66
unsafe {
77
// linear hitstun patch
88
skyline::patching::Patch::in_text(0x62BA74).data(0xD2800000u32);
99
}
10-
skyline::install_hooks!(
11-
//stub_kill_screen,
12-
);
10+
// skyline::install_hooks!(
11+
// stub_kill_screen,
12+
// );
1313
}

fighters/common/src/function_hooks/stage_hazards.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,14 @@ unsafe fn lylat_no_rot(ctx: &mut skyline::hooks::InlineCtx) {
9898
// 0x2 - corneria
9999
// 0x3 - space battle (small ships)
100100
// 0x4 - default haz off space
101-
#[skyline::hook(offset = 0x297D68C, inline)]
102-
unsafe fn lylat_set_form_hazards_off(ctx: &mut skyline::hooks::InlineCtx) {
103-
// if get_current_stage_alt() == 0 {
104-
// *ctx.registers[8].x.as_mut() = 0x2;
105-
// } else {
106-
*ctx.registers[8].x.as_mut() = 0x4;
107-
// }
108-
}
101+
// #[skyline::hook(offset = 0x297D68C, inline)]
102+
// unsafe fn lylat_set_form_hazards_off(ctx: &mut skyline::hooks::InlineCtx) {
103+
// // if get_current_stage_alt() == 0 {
104+
// // *ctx.registers[8].x.as_mut() = 0x2;
105+
// // } else {
106+
// *ctx.registers[8].x.as_mut() = 0x4;
107+
// // }
108+
// }
109109

110110
pub fn install() {
111111
// NOTE: The 0xc80 is from the 13.0.1 -> 13.0.2 port

fighters/common/src/general_statuses/airdodge.rs

+2-7
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@ use globals::*;
66

77
pub fn install() {
88
skyline::nro::add_hook(nro_hook);
9-
Agent::new("fighter")
10-
.status(Pre, *FIGHTER_STATUS_KIND_ESCAPE_AIR, status_pre_EscapeAir)
11-
.status(Main, *FIGHTER_STATUS_KIND_ESCAPE_AIR, status_EscapeAir)
12-
.status(End, *FIGHTER_STATUS_KIND_ESCAPE_AIR, status_end_EscapeAir)
13-
.install();
149
}
1510

1611
fn nro_hook(info: &skyline::nro::NroInfo) {
@@ -152,9 +147,9 @@ pub unsafe fn status_end_EscapeAir(fighter: &mut L2CFighterCommon) -> L2CValue {
152147
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_DISABLE_LANDING_TURN);
153148
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_ENABLE_LANDING_CLIFF_STOP);
154149
}
155-
VarModule::off_flag(fighter.battle_object, vars::common::status::SHOULD_WAVELAND);
156-
VarModule::off_flag(fighter.battle_object, vars::common::instance::PERFECT_WAVEDASH);
157150
}
151+
VarModule::off_flag(fighter.battle_object, vars::common::status::SHOULD_WAVELAND);
152+
VarModule::off_flag(fighter.battle_object, vars::common::instance::PERFECT_WAVEDASH);
158153
VarModule::on_flag(fighter.battle_object, vars::common::instance::ENABLE_AIR_ESCAPE_MAGNET);
159154
0.into()
160155
}

fighters/common/src/general_statuses/attack/attackdash.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ fn nro_hook(info: &skyline::nro::NroInfo) {
1414
}
1515
pub fn install() {
1616
skyline::nro::add_hook(nro_hook);
17-
Agent::new("fighter")
18-
.status(Main, *FIGHTER_STATUS_KIND_ATTACK_DASH, status_AttackDash)
19-
.install();
17+
// Agent::new("fighter")
18+
// .status(Main, *FIGHTER_STATUS_KIND_ATTACK_DASH, status_AttackDash)
19+
// .install();
2020
}
2121

2222
#[skyline::hook(replace = L2CFighterCommon_status_pre_AttackDash)]

fighters/common/src/general_statuses/attack/attackx4.rs

+16-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ use globals::*;
55

66
pub fn install() {
77
skyline::nro::add_hook(nro_hook);
8-
Agent::new("fighter")
9-
.status(End, *FIGHTER_STATUS_KIND_ATTACK_HI4_START, status_end_AttackHi4Start)
10-
.status(End, *FIGHTER_STATUS_KIND_ATTACK_LW4_START, status_end_AttackLw4Start)
11-
.install();
8+
// Agent::new("fighter")
9+
// .status(End, *FIGHTER_STATUS_KIND_ATTACK_HI4_START, status_end_AttackHi4Start)
10+
// .status(End, *FIGHTER_STATUS_KIND_ATTACK_LW4_START, status_end_AttackLw4Start)
11+
// .install();
1212
}
1313

1414
fn nro_hook(info: &skyline::nro::NroInfo) {
@@ -19,7 +19,9 @@ fn nro_hook(info: &skyline::nro::NroInfo) {
1919
status_AttackHi4Start_Main,
2020
//status_AttackHi4Start_Common,
2121
status_AttackLw4Start_Main,
22+
bind_address_call_status_end_attackhi4start,
2223
status_end_AttackHi4Start,
24+
bind_address_call_status_end_attacklw4start,
2325
status_end_AttackLw4Start,
2426
);
2527
}
@@ -117,6 +119,11 @@ unsafe fn status_AttackHi4Start_Common(fighter: &mut L2CFighterCommon, motion: L
117119
fighter.sub_shift_status_main(L2CValue::Ptr(L2CFighterCommon_bind_address_call_status_AttackHi4Start_Main as *const () as _));
118120
}
119121

122+
#[skyline::hook(replace = L2CFighterCommon_bind_address_call_status_end_AttackHi4Start)]
123+
unsafe extern "C" fn bind_address_call_status_end_attackhi4start(fighter: &mut L2CFighterCommon, _agent: &mut L2CAgent) -> L2CValue {
124+
fighter.status_end_AttackHi4Start()
125+
}
126+
120127
#[skyline::hook(replace = L2CFighterCommon_status_end_AttackHi4Start)]
121128
unsafe fn status_end_AttackHi4Start(fighter: &mut L2CFighterCommon) -> L2CValue {
122129
VarModule::off_flag(fighter.battle_object, vars::common::instance::IS_DACUS);
@@ -207,6 +214,11 @@ unsafe fn status_AttackLw4Start_Main(fighter: &mut L2CFighterCommon) -> L2CValue
207214
return 0.into()
208215
}
209216

217+
#[skyline::hook(replace = L2CFighterCommon_bind_address_call_status_end_AttackLw4Start)]
218+
unsafe extern "C" fn bind_address_call_status_end_attacklw4start(fighter: &mut L2CFighterCommon, _agent: &mut L2CAgent) -> L2CValue {
219+
fighter.status_end_AttackLw4Start()
220+
}
221+
210222
#[skyline::hook(replace = L2CFighterCommon_status_end_AttackLw4Start)]
211223
unsafe fn status_end_AttackLw4Start(fighter: &mut L2CFighterCommon) -> L2CValue {
212224
VarModule::off_flag(fighter.battle_object, vars::common::instance::IS_DACUS);

fighters/common/src/general_statuses/damageflyreflect.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use globals::*;
44
// This file contains code for ceiling/wall/ground bounces
55

66
pub fn install() {
7-
Agent::new("fighter")
8-
.status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY, damage_fly_end)
9-
.status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_D, damage_fly_reflect_d_end)
10-
.status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_JUMP_BOARD, damage_fly_reflect_jump_board_end)
11-
.status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_LR, damage_fly_reflect_lr_end)
12-
.status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_ROLL, damage_fly_roll_end)
13-
.status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_METEOR, damage_fly_meteor_end)
14-
.install();
7+
// Agent::new("fighter")
8+
// .status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY, damage_fly_end)
9+
// .status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_D, damage_fly_reflect_d_end)
10+
// .status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_JUMP_BOARD, damage_fly_reflect_jump_board_end)
11+
// .status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_LR, damage_fly_reflect_lr_end)
12+
// .status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_ROLL, damage_fly_roll_end)
13+
// .status(End, *FIGHTER_STATUS_KIND_DAMAGE_FLY_METEOR, damage_fly_meteor_end)
14+
// .install();
1515
skyline::nro::add_hook(nro_hook);
1616
}
1717

fighters/common/src/general_statuses/jump.rs

+24-23
Original file line numberDiff line numberDiff line change
@@ -6,26 +6,25 @@ use globals::*;
66

77
pub fn install() {
88
skyline::nro::add_hook(nro_hook);
9-
Agent::new("fighter")
10-
.status(Main, *FIGHTER_STATUS_KIND_JUMP, status_Jump)
11-
.status(Pre, *FIGHTER_STATUS_KIND_JUMP, status_pre_Jump)
12-
.install();
9+
// Agent::new("fighter")
10+
// .status(Main, *FIGHTER_STATUS_KIND_JUMP, status_Jump)
11+
// .status(Pre, *FIGHTER_STATUS_KIND_JUMP, status_pre_Jump)
12+
// .install();
1313
}
1414

1515
fn nro_hook(info: &skyline::nro::NroInfo) {
1616
if info.name == "common" {
1717
skyline::install_hooks!(
1818
status_Jump_Main,
19-
status_pre_Jump,
20-
status_Jump,
21-
//status_end_Jump,
22-
status_pre_Jump_Common,
23-
status_pre_Jump_Common_param,
24-
status_pre_Jump_sub,
19+
// status_pre_Jump,
20+
// status_Jump,
21+
// status_end_Jump,
22+
// status_pre_Jump_Common,
23+
// status_pre_Jump_Common_param,
24+
// status_pre_Jump_sub,
2525
status_pre_Jump_sub_param,
26-
//status_Jump_Main,
2726
// status_Jump_sub,
28-
//status_pre_JumpAerial_sub
27+
// status_pre_JumpAerial_sub
2928
);
3029
}
3130
}
@@ -40,34 +39,36 @@ unsafe fn status_pre_Jump(fighter: &mut L2CFighterCommon) -> L2CValue {
4039
}
4140

4241
#[skyline::hook(replace = L2CFighterCommon_status_pre_Jump_Common)]
43-
unsafe extern "C" fn status_pre_Jump_Common(fighter: &mut L2CFighterCommon) {
44-
fighter.status_pre_Jump_Common_param(L2CValue::Bool(true));
42+
unsafe extern "C" fn status_pre_Jump_Common(fighter: &mut L2CFighterCommon) -> L2CValue {
43+
fighter.status_pre_Jump_Common_param(L2CValue::Bool(true))
4544
}
4645

4746
#[skyline::hook(replace = L2CFighterCommon_status_pre_Jump_Common_param)]
4847
unsafe extern "C" fn status_pre_Jump_Common_param(fighter: &mut L2CFighterCommon, arg: L2CValue) -> L2CValue {
4948
//println!("status_pre_Jump_Common_param");
5049
if WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_HAMMER) {
5150
StatusModule::set_status_kind_interrupt(fighter.module_accessor, *FIGHTER_STATUS_KIND_HAMMER_JUMP);
52-
L2CValue::Bool(true)
53-
} else if WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_SCREW) && arg.get_bool() {
51+
return true.into();
52+
}
53+
if WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_SCREW) && arg.get_bool() {
5454
let screw_jump_count = WorkModule::get_int(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_INT_SCREW_JUMP_COUNT);
5555
if screw_jump_count < *FIGHTER_STATUS_SCREW_JUMP_COUNT_MAX {
5656
StatusModule::set_status_kind_interrupt(fighter.module_accessor, *FIGHTER_STATUS_KIND_ITEM_SCREW_JUMP);
57+
return true.into();
5758
}
58-
L2CValue::Bool(true)
59-
} else if ItemModule::get_have_item_kind(fighter.module_accessor, 0) == *ITEM_KIND_GENESISSET {
59+
}
60+
if ItemModule::get_have_item_kind(fighter.module_accessor, 0) == *ITEM_KIND_GENESISSET {
6061
StatusModule::set_status_kind_interrupt(fighter.module_accessor, *FIGHTER_STATUS_KIND_ITEM_SHOOT_JUMP);
61-
L2CValue::Bool(true)
62-
} else if WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_BOARD) {
62+
return true.into();
63+
}
64+
if WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_BOARD) {
6365
WorkModule::off_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_BOARD);
6466
if !WorkModule::is_flag(fighter.module_accessor, *FIGHTER_STATUS_WORK_ID_FLAG_RESERVE_JUMP_MINI) {
6567
StatusModule::set_status_kind_interrupt(fighter.module_accessor, *FIGHTER_STATUS_KIND_GIMMICK_JUMP_BOARD);
68+
return true.into();
6669
}
67-
L2CValue::Bool(true)
68-
} else {
69-
L2CValue::Bool(false)
7070
}
71+
false.into()
7172
}
7273

7374
#[skyline::hook(replace = L2CFighterCommon_status_pre_Jump_sub)]

fighters/common/src/general_statuses/jumpsquat.rs

+11-6
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ use utils::game_modes::CustomMode;
66

77
pub fn install() {
88
skyline::nro::add_hook(nro_hook);
9-
Agent::new("fighter")
10-
.status(Exec, *FIGHTER_STATUS_KIND_JUMP_SQUAT, status_exec_JumpSquat)
11-
.status(End, *FIGHTER_STATUS_KIND_JUMP_SQUAT, status_end_JumpSquat)
12-
.status(Main, *FIGHTER_STATUS_KIND_JUMP_SQUAT, status_JumpSquat)
13-
.install();
9+
// Agent::new("fighter")
10+
// .status(Exec, *FIGHTER_STATUS_KIND_JUMP_SQUAT, status_exec_JumpSquat)
11+
// .status(End, *FIGHTER_STATUS_KIND_JUMP_SQUAT, status_end_JumpSquat)
12+
// .status(Main, *FIGHTER_STATUS_KIND_JUMP_SQUAT, status_JumpSquat)
13+
// .install();
1414
}
1515

1616
fn nro_hook(info: &skyline::nro::NroInfo) {
@@ -25,6 +25,7 @@ fn nro_hook(info: &skyline::nro::NroInfo) {
2525
sub_jump_squat_uniq_check_sub_mini_attack,
2626
sub_status_JumpSquat_check_stick_lr_update,
2727
status_JumpSquat,
28+
bind_address_call_status_end_JumpSquat,
2829
status_end_JumpSquat,
2930
);
3031
}
@@ -182,7 +183,11 @@ unsafe fn status_JumpSquat_Main(fighter: &mut L2CFighterCommon) -> L2CValue {
182183
}
183184

184185
// end status stuff
185-
// no symbol since you can't call `fighter.status_end_JumpSquat()`, and replacing `bind_call_...` makes no sense here
186+
#[skyline::hook(replace = L2CFighterCommon_bind_address_call_status_end_JumpSquat)]
187+
unsafe fn bind_address_call_status_end_JumpSquat(fighter: &mut L2CFighterCommon, _agent: &mut L2CAgent) -> L2CValue {
188+
fighter.status_end_JumpSquat()
189+
}
190+
186191
#[skyline::hook(replace = L2CFighterCommon_status_end_JumpSquat)]
187192
unsafe fn status_end_JumpSquat(fighter: &mut L2CFighterCommon) -> L2CValue {
188193
InputModule::disable_persist(fighter.battle_object);

fighters/common/src/general_statuses/mod.rs

+3-44
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ mod catch;
2727
mod damage;
2828
mod escape;
2929
mod dead;
30-
mod damageflyreflect;
30+
// mod damageflyreflect;
3131
mod down;
3232
// [LUA-REPLACE-REBASE]
3333
// [SHOULD-CHANGE]
@@ -695,49 +695,8 @@ pub fn install() {
695695
damage::install();
696696
escape::install();
697697
dead::install();
698-
damageflyreflect::install();
698+
// damageflyreflect::install();
699699
down::install();
700700

701701
skyline::nro::add_hook(nro_hook);
702-
}
703-
704-
pub fn general_mechanics_status_script_nro_hooks(nro: &skyline::nro::NroInfo) {
705-
match nro.name {
706-
"common" => {
707-
skyline::install_hooks!(
708-
//status_jump_squat_hook, //Smash4 shorthop aerials (aerials can be buffered out of jumpsquat - no shorthop aerial macro)
709-
status_main_jumpsquat_hook, //Melee shorthop aerials (no buffered aerials - no shorthop aerial macro)
710-
);
711-
},
712-
_ => (),
713-
}
714-
}
715-
716-
/*
717-
Thought process here... for smash4 you can buffer an aerial out of jumpsquat...
718-
so we clear buffer right before jumpsquat (status_JumpSquat runs once right as you enter that status)
719-
For melee, you can't buffer aerials in jumpsquat, so we clear the buffer just after jumpsquat (or in this case since status_end_JumpSquat just didn't cooperate, during Jumpsquat)
720-
so that any aerials you buffered during JS aren't taken into account.
721-
*/
722-
723-
//Smash4 style shorthop aerials
724-
#[skyline::hook(replace = smash::lua2cpp::L2CFighterCommon_status_JumpSquat)]
725-
pub unsafe fn status_jump_squat_hook(fighter: &mut L2CFighterCommon) -> L2CValue {
726-
let boma = app::sv_system::battle_object_module_accessor(fighter.lua_state_agent);
727-
if (ControlModule::get_command_flag_cat(boma, 0) & *FIGHTER_PAD_CMD_CAT1_FLAG_AIR_ESCAPE) == 0 {
728-
ControlModule::clear_command(boma, true);
729-
WorkModule::off_flag(boma, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_MINI_ATTACK);
730-
}
731-
original!()(fighter)
732-
}
733-
734-
//Melee style shorthop aerials
735-
#[skyline::hook(replace = smash::lua2cpp::L2CFighterCommon_status_JumpSquat_Main)] //prolly better to use status_end_JumpSquat but for some reason it seemed like it wasn't being called
736-
pub unsafe fn status_main_jumpsquat_hook(fighter: &mut L2CFighterCommon) -> L2CValue {
737-
let boma = app::sv_system::battle_object_module_accessor(fighter.lua_state_agent);
738-
if MotionModule::frame(boma) <= 3.0 && (ControlModule::get_command_flag_cat(boma, 0) & *FIGHTER_PAD_CMD_CAT1_FLAG_AIR_ESCAPE) == 0 { //during JS and you're not inputting an airdodge...
739-
ControlModule::clear_command(boma, true);
740-
WorkModule::off_flag(boma, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_MINI_ATTACK);
741-
}
742-
original!()(fighter)
743-
}
702+
}

0 commit comments

Comments
 (0)