Skip to content

Commit 1f109b2

Browse files
authored
Merge pull request #2310 from HDR-Development/ryu-rework-smashline2
Ryu Rework + Ken Meter Reevaluation
2 parents 0e47b8e + 8a9444a commit 1f109b2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+5586
-5350
lines changed

dynamic/src/consts.rs

+9-5
Original file line numberDiff line numberDiff line change
@@ -1020,16 +1020,18 @@ pub mod vars {
10201020
pub const IS_ENABLE_FADC: i32 = 0x0102;
10211021
pub const IS_TARGET_COMBO_1: i32 = 0x0103;
10221022
pub const IS_TARGET_COMBO_2: i32 = 0x0104;
1023-
pub const IS_CURRENT_HADOKEN_EX: i32 = 0x0105;
10241023
pub const DISABLE_SPECIAL_S: i32 = 0x0106;
10251024
pub const IS_CURRENT_HADOKEN_AIR: i32 = 0x0107;
10261025
pub const DISABLE_SPECIAL_LW: i32 = 0x0108;
1026+
pub const IS_ENABLE_SPECIAL_LW_INSTALL: i32 = 0x0109;
10271027

10281028
// ints
10291029
pub const REPEAT_COUNT_LW: i32 = 0x0100;
10301030
pub const REPEAT_COUNT_HI: i32 = 0x0101;
1031-
pub const EX_SPECIAL_SCRIPTING: i32 = 0x0102;
1032-
pub const AIR_CHAIN_COMBO_NUM: i32 = 0x0103;
1031+
pub const SPECIAL_HI_FIRE_EFF_ID: i32 = 0x0104;
1032+
pub const SPECIAL_LW_FIRE_EFF_ID_0: i32 = 0x0105;
1033+
pub const SPECIAL_LW_FIRE_EFF_ID_1: i32 = 0x0106;
1034+
pub const SPECIAL_N_EX_NUM: i32 = 0x0107;
10331035
}
10341036
pub mod status {
10351037
// flags
@@ -1519,11 +1521,13 @@ pub mod statuses {
15191521
}
15201522

15211523
pub mod ryu {
1522-
pub const AIR_DASH: i32 = 0x202;
1524+
pub const INSTALL: i32 = 0x202;
1525+
pub const ATTACK_COMMAND_4: i32 = 0x203;
15231526
}
15241527

15251528
pub mod ken {
1526-
pub const ATTACK_COMMAND_4: i32 = 0x202;
1529+
pub const INSTALL: i32 = 0x202;
1530+
pub const ATTACK_COMMAND_4: i32 = 0x203;
15271531
}
15281532

15291533
pub mod buddy {

dynamic/src/ext.rs

+51
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ pub trait BomaExt {
513513

514514
/// check for hitfall (should be called once per frame)
515515
unsafe fn check_hitfall(&mut self);
516+
unsafe fn check_airdash(&mut self);
516517

517518
/// try to pickup an item nearby
518519
unsafe fn try_pickup_item(&mut self, range: f32, bone: Option<Hash40>, offset: Option<&Vector2f>) -> Option<&mut BattleObjectModuleAccessor> ;
@@ -1180,6 +1181,56 @@ impl BomaExt for BattleObjectModuleAccessor {
11801181
}
11811182
}
11821183

1184+
unsafe fn check_airdash(&mut self) {
1185+
if !self.is_status(*FIGHTER_STATUS_KIND_ESCAPE_AIR) {
1186+
return;
1187+
}
1188+
if self.status_frame() < 1 {
1189+
let speed_x = KineticModule::get_sum_speed_x(self, *KINETIC_ENERGY_RESERVE_ATTRIBUTE_MAIN);
1190+
let speed_y = KineticModule::get_sum_speed_y(self, *KINETIC_ENERGY_RESERVE_ATTRIBUTE_MAIN);
1191+
// lets make sure not to divide by zero
1192+
let speed_x_adjust = match speed_x {
1193+
0.0 => 0.01,
1194+
_ => 0.0
1195+
};
1196+
let angle = (speed_y/(speed_x + speed_x_adjust)).atan();
1197+
1198+
let pos = Vector3f { x: 0., y: 3., z: 0.};
1199+
let mut rot = Vector3f { x:0., y:0., z: (90. + 180. * angle/3.14159)};
1200+
1201+
if speed_x > 0. {
1202+
EffectModule::req_on_joint(self, Hash40::new("sys_whirlwind_r"), Hash40::new("top"),
1203+
&pos, &rot, 0.75, &Vector3f{x:0.0, y:0.0, z:0.0}, &Vector3f{x:0.0, y:0.0, z:0.0}, false, 0, 0, 0);
1204+
}else{
1205+
rot = Vector3f { x:0., y:0., z: (-90. + 180. * angle/3.14159)};
1206+
EffectModule::req_on_joint(self, Hash40::new("sys_whirlwind_l"), Hash40::new("top"),
1207+
&pos, &rot, 0.75, &Vector3f{x:0.0, y:0.0, z:0.0}, &Vector3f{x:0.0, y:0.0, z:0.0}, false, 0, 0, 0);
1208+
}
1209+
}
1210+
1211+
// if you have an escape_air_dash motion, change into it
1212+
if MotionModule::is_anim_resource(self, Hash40::new("escape_air_dash"))
1213+
&& !self.is_motion(Hash40::new("escape_air_dash"))
1214+
&& self.motion_frame() >= 1.0 {
1215+
MotionModule::change_motion(
1216+
self,
1217+
Hash40::new("escape_air_dash"),
1218+
self.motion_frame(),
1219+
1.0,
1220+
false,
1221+
0.0,
1222+
false,
1223+
false,
1224+
);
1225+
}
1226+
1227+
CancelModule::enable_cancel(self);
1228+
if self.is_situation(*SITUATION_KIND_AIR) {
1229+
let fighter = crate::util::get_fighter_common_from_accessor(self);
1230+
fighter.sub_air_check_fall_common();
1231+
}
1232+
}
1233+
11831234
unsafe fn try_pickup_item(&mut self, range: f32, bone: Option<Hash40>, offset: Option<&Vector2f>) -> Option<&mut BattleObjectModuleAccessor> {
11841235
use smash2::app::ItemManager;
11851236

fighters/common/src/misc.rs

+1-36
Original file line numberDiff line numberDiff line change
@@ -215,45 +215,10 @@ pub extern "C" fn airdash_mode(fighter: &mut L2CFighterCommon) {
215215
match utils::game_modes::get_custom_mode() {
216216
Some(modes) => {
217217
if modes.contains(&CustomMode::AirdashMode) {
218-
check_airdash(fighter);
218+
fighter.check_airdash();
219219
}
220220
},
221221
_ => {}
222222
}
223223
}
224224
}
225-
226-
unsafe fn check_airdash(fighter: &mut L2CFighterCommon) {
227-
if fighter.is_status(*FIGHTER_STATUS_KIND_ESCAPE_AIR) {
228-
if fighter.status_frame() < 1 {
229-
let speed_x = KineticModule::get_sum_speed_x(fighter.boma(), *KINETIC_ENERGY_RESERVE_ATTRIBUTE_MAIN);
230-
let speed_y = KineticModule::get_sum_speed_y(fighter.boma(), *KINETIC_ENERGY_RESERVE_ATTRIBUTE_MAIN);
231-
// lets make sure not to divide by zero
232-
let speed_x_adjust = if speed_x == 0.0 {
233-
0.01
234-
}
235-
else {
236-
0.0
237-
};
238-
let angle = (speed_y/(speed_x + speed_x_adjust)).atan();
239-
240-
let pos = Vector3f { x: 0., y: 3., z: 0.};
241-
let mut rot = Vector3f { x:0., y:0., z: (90. + 180. * angle/3.14159)};
242-
243-
if speed_x > 0. {
244-
EffectModule::req_on_joint(fighter.boma(), Hash40::new("sys_whirlwind_r"), Hash40::new("top"),
245-
&pos, &rot, 0.75, &Vector3f{x:0.0, y:0.0, z:0.0}, &Vector3f{x:0.0, y:0.0, z:0.0}, false, 0, 0, 0);
246-
}
247-
else{
248-
rot = Vector3f { x:0., y:0., z: (-90. + 180. * angle/3.14159)};
249-
EffectModule::req_on_joint(fighter.boma(), Hash40::new("sys_whirlwind_l"), Hash40::new("top"),
250-
&pos, &rot, 0.75, &Vector3f{x:0.0, y:0.0, z:0.0}, &Vector3f{x:0.0, y:0.0, z:0.0}, false, 0, 0, 0);
251-
}
252-
}
253-
254-
CancelModule::enable_cancel(fighter.boma());
255-
if fighter.is_situation(*SITUATION_KIND_AIR) {
256-
fighter.sub_air_check_fall_common();
257-
}
258-
}
259-
}

fighters/common/src/opff/shotos.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ unsafe fn training_mode_full_meter(fighter: &mut L2CFighterCommon, boma: &mut Ba
5858

5959
unsafe fn up_special_early_landing(fighter: &mut L2CFighterCommon) {
6060
if fighter.is_status(*FIGHTER_RYU_STATUS_KIND_SPECIAL_HI_JUMP)
61-
&& fighter.is_situation(*SITUATION_KIND_GROUND) {
61+
&& fighter.is_situation(*SITUATION_KIND_GROUND)
62+
&& fighter.motion_frame() >= 25.0 {
6263
fighter.change_status_req(*FIGHTER_RYU_STATUS_KIND_SPECIAL_HI_LANDING, false);
6364
}
6465
}

0 commit comments

Comments
 (0)