Skip to content

Commit 175e089

Browse files
authored
Merge pull request #2225 from jaccob101/djc-fixes
DJC fix pr fix
2 parents 5557080 + c65f7fa commit 175e089

File tree

3 files changed

+36
-19
lines changed

3 files changed

+36
-19
lines changed

fighters/common/src/djc.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ pub unsafe extern "C" fn attack_air_main_status(fighter: &mut L2CFighterCommon)
2323
/// Performs the leniency check for double jump canceling
2424
#[utils::export(common::djc)]
2525
pub unsafe extern "C" fn attack_air_main_status_loop(fighter: &mut L2CFighterCommon) -> L2CValue {
26+
if KineticModule::get_kinetic_type(fighter.module_accessor) == *FIGHTER_KINETIC_TYPE_JUMP_AERIAL_MOTION_2ND
27+
&& !fighter.is_in_hitlag()
28+
&& MotionModule::frame_2nd(fighter.module_accessor) >= 2.0
29+
&& fighter.global_table[CURRENT_FRAME].get_i32() <= ParamModule::get_int(fighter.battle_object, ParamType::Common, "djc_leniency_frame")
30+
&& ControlModule::check_button_off(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP) {
31+
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_NO_LIMIT_ONCE);
32+
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_MOTION_FALL);
33+
}
2634
if !fighter.status_AttackAir_Main_common().get_bool() {
2735
fighter.sub_air_check_superleaf_fall_slowly();
2836
if !fighter.global_table[IS_STOPPING].get_bool() {
@@ -48,7 +56,8 @@ pub unsafe extern "C" fn sub_attack_air_inherit_jump_aerial_motion_uniq_process_
4856
fighter.sub_attack_air_kind();
4957
if motion_kind == smash::hash40("jump_aerial_f") || motion_kind == smash::hash40("jump_aerial_b") {
5058
if !WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_IGNORE_2ND_MOTION)
51-
&& ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP) {
59+
&& (ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP)
60+
|| MotionModule::frame_2nd(fighter.module_accessor) < 2.0) {
5261
MotionModule::add_motion_2nd(fighter.module_accessor, Hash40::new_raw(motion_kind), frame, 1.0, false, 1.0);
5362
MotionModule::set_weight(fighter.module_accessor, 1.0, true);
5463
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_JUMP_AERIAL_MOTION_2ND);

fighters/peach/src/status/attack_air.rs

+8
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ unsafe extern "C" fn peach_attack_air_no_float_main_loop(fighter: &mut L2CFighte
8989
fighter.change_status(FIGHTER_PEACH_STATUS_KIND_UNIQ_FLOAT_START.into(), true.into());
9090
return 1.into();
9191
}
92+
if KineticModule::get_kinetic_type(fighter.module_accessor) == *FIGHTER_KINETIC_TYPE_JUMP_AERIAL_MOTION_2ND
93+
&& !fighter.is_in_hitlag()
94+
&& MotionModule::frame_2nd(fighter.module_accessor) >= 2.0
95+
&& fighter.global_table[CURRENT_FRAME].get_i32() <= ParamModule::get_int(fighter.battle_object, ParamType::Common, "djc_leniency_frame")
96+
&& ControlModule::check_button_off(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP) {
97+
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_NO_LIMIT_ONCE);
98+
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_MOTION_FALL);
99+
}
92100
if fighter.status_AttackAir_Main_common().get_bool() {
93101
return 0.into();
94102
}

fighters/trail/src/status/attack_air.rs

+18-18
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ pub unsafe fn init_attack_air(fighter: &mut L2CFighterCommon) -> L2CValue {
6161
fighter.sub_attack_air_kind();
6262
if motion_kind == smash::hash40("jump_aerial_f") || motion_kind == smash::hash40("jump_aerial_b") {
6363
if !WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_IGNORE_2ND_MOTION)
64-
&& ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP) {
64+
&& (ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP)
65+
|| MotionModule::frame_2nd(fighter.module_accessor) < 2.0) {
6566
MotionModule::add_motion_2nd(fighter.module_accessor, Hash40::new_raw(motion_kind), frame, 1.0, false, 1.0);
6667
MotionModule::set_weight(fighter.module_accessor, 1.0, true);
6768
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_JUMP_AERIAL_MOTION_2ND);
@@ -134,16 +135,13 @@ unsafe extern "C" fn sub_attack_air_n(fighter: &mut L2CFighterCommon) {
134135
return;
135136
}
136137
}
137-
if !WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_IGNORE_2ND_MOTION) {
138-
if ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP) {
139-
MotionModule::add_motion_2nd(fighter.module_accessor, Hash40::new_raw(motion_kind), frame, 1.0, false, 1.0);
140-
MotionModule::set_weight(fighter.module_accessor, 1.0, true);
141-
}
142-
}
143-
if ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP) {
138+
if !WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_IGNORE_2ND_MOTION)
139+
&& (ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP)
140+
|| MotionModule::frame_2nd(fighter.module_accessor) < 2.0) {
141+
MotionModule::add_motion_2nd(fighter.module_accessor, Hash40::new_raw(motion_kind), frame, 1.0, false, 1.0);
142+
MotionModule::set_weight(fighter.module_accessor, 1.0, true);
144143
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_JUMP_AERIAL_MOTION_2ND);
145-
}
146-
else {
144+
} else {
147145
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_NO_LIMIT_ONCE);
148146
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_MOTION_FALL);
149147
}
@@ -222,14 +220,16 @@ unsafe extern "C" fn sub_attack_air_f(fighter: &mut L2CFighterCommon) {
222220
return;
223221
}
224222
}
225-
if !WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_IGNORE_2ND_MOTION) {
226-
MotionModule::add_motion_2nd(fighter.module_accessor, Hash40::new_raw(motion_kind), frame, 1.0, false, 1.0);
227-
MotionModule::set_weight(fighter.module_accessor, 1.0, true);
228-
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_JUMP_AERIAL_MOTION_2ND);
229-
} else {
230-
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_NO_LIMIT_ONCE);
231-
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_MOTION_FALL);
232-
}
223+
if !WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_IGNORE_2ND_MOTION)
224+
&& (ControlModule::check_button_on(fighter.module_accessor, *CONTROL_PAD_BUTTON_JUMP)
225+
|| MotionModule::frame_2nd(fighter.module_accessor) < 2.0) {
226+
MotionModule::add_motion_2nd(fighter.module_accessor, Hash40::new_raw(motion_kind), frame, 1.0, false, 1.0);
227+
MotionModule::set_weight(fighter.module_accessor, 1.0, true);
228+
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_JUMP_AERIAL_MOTION_2ND);
229+
} else {
230+
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_JUMP_NO_LIMIT_ONCE);
231+
KineticModule::change_kinetic(fighter.module_accessor, *FIGHTER_KINETIC_TYPE_MOTION_FALL);
232+
}
233233
fighter.sub_attack_air_uniq_process_init();
234234
return;
235235
}

0 commit comments

Comments
 (0)