Skip to content

Commit 2f8c105

Browse files
committed
Refinement
1 parent 7361eaf commit 2f8c105

File tree

6 files changed

+151
-15
lines changed

6 files changed

+151
-15
lines changed

fighters/edge/src/acmd/specials.rs

+37
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
use super::*;
22

3+
#[acmd_script( agent = "edge", scripts = ["game_specialnstart", "game_specialairnstart"] , category = ACMD_GAME , low_priority)]
4+
unsafe fn edge_special_n_start(fighter: &mut L2CAgentBase) {
5+
let lua_state = fighter.lua_state_agent;
6+
let boma = fighter.boma();
7+
frame(lua_state, 20.0);
8+
FT_MOTION_RATE_RANGE(fighter, 20.0, 32.0, 8.0);
9+
if is_excute(fighter) {
10+
WorkModule::set_int(boma, *FIGHTER_EDGE_SPECIAL_N_S, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CHARGE_KIND);
11+
}
12+
frame(lua_state, 32.0);
13+
FT_MOTION_RATE_RANGE(fighter, 32.0, 79.0, 51.0);
14+
if is_excute(fighter) {
15+
WorkModule::set_int(boma, *FIGHTER_EDGE_SPECIAL_N_M, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CHARGE_KIND);
16+
}
17+
frame(lua_state, 79.0);
18+
FT_MOTION_RATE(fighter, 1.2);
19+
frame(lua_state, 99.0);
20+
FT_MOTION_RATE(fighter, 1.0);
21+
frame(lua_state, 100.0);
22+
if is_excute(fighter) {
23+
WorkModule::set_int(boma, *FIGHTER_EDGE_SPECIAL_N_L, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CHARGE_KIND);
24+
}
25+
frame(lua_state, 105.0);
26+
FT_MOTION_RATE(fighter, 1.6);
27+
frame(lua_state, 115.0);
28+
FT_MOTION_RATE(fighter, 1.0);
29+
frame(lua_state, 120.0);
30+
if is_excute(fighter) {
31+
ArticleModule::generate_article(boma, *FIGHTER_EDGE_GENERATE_ARTICLE_FIRE, false, -1);
32+
}
33+
frame(lua_state, 140.0);
34+
if is_excute(fighter) {
35+
WorkModule::on_flag(boma, *FIGHTER_EDGE_STATUS_SPECIAL_N_FLAG_ENABLE_FALL_SPEED);
36+
}
37+
}
38+
339
#[acmd_script( agent = "edge", scripts = ["game_specialn1", "game_specialairn1"] , category = ACMD_GAME , low_priority)]
440
unsafe fn edge_special_n1_game(fighter: &mut L2CAgentBase) {
541
let lua_state = fighter.lua_state_agent;
@@ -522,6 +558,7 @@ unsafe fn edge_special_lw_hit_effect(fighter: &mut L2CAgentBase) {
522558

523559
pub fn install() {
524560
install_acmd_scripts!(
561+
edge_special_n_start,
525562
edge_special_n1_game,
526563
edge_special_n2_game,
527564
//game_specialhistart,

fighters/edge/src/status/edge_fire_fly.rs

-13
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,6 @@ use super::*;
22
use globals::*;
33
use utils::consts::vars::edge;
44

5-
// #[status_script(agent = "edge", status = FIGHTER_STATUS_KIND_SPECIAL_N, condition = LUA_SCRIPT_STATUS_FUNC_STATUS_MAIN)]
6-
// unsafe fn special_n_main(fighter: &mut L2CFighterCommon) -> L2CValue {
7-
// let ret = original!(fighter);
8-
// WorkModule::unable_transition_term_group(fighter.module_accessor, *FIGHTER_STATUS_TRANSITION_GROUP_CHK_GROUND_ESCAPE);
9-
// ret
10-
// }
11-
125
#[status_script(agent = "edge_fire", status = WEAPON_EDGE_FIRE_STATUS_KIND_FLY_S, condition = LUA_SCRIPT_STATUS_FUNC_STATUS_MAIN)]
136
unsafe fn fly_s_main(fighter: &mut L2CWeaponCommon) -> L2CValue {
147
let life = WorkModule::get_param_int(fighter.module_accessor, hash40("param_fire"), hash40("life_s"));
@@ -90,12 +83,7 @@ unsafe extern "C" fn sub_fly(fighter: &mut L2CWeaponCommon, status: L2CValue) ->
9083
}
9184
}
9285
if !WorkModule::is_flag(fighter.module_accessor, *WEAPON_EDGE_FIRE_INSTANCE_WORK_ID_FLAG_ATTACK) {
93-
94-
9586
return 0.into()
96-
// if !GroundModule::is_touch(fighter.module_accessor, *GROUND_TOUCH_FLAG_ALL as u32) {
97-
// return 0.into()
98-
// }
9987
}
10088

10189
fighter.change_status(status, false.into());
@@ -104,7 +92,6 @@ unsafe extern "C" fn sub_fly(fighter: &mut L2CWeaponCommon, status: L2CValue) ->
10492

10593
pub fn install() {
10694
install_status_scripts!(
107-
//special_n_main,
10895
fly_s_main,
10996
fly_m_main,
11097
);

fighters/edge/src/status/mod.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
use super::*;
22

3+
mod special_n;
34
mod special_hi;
45
mod edge_fire_fly;
56

67
pub fn install() {
8+
special_n::install();
79
special_hi::install();
810
edge_fire_fly::install();
911
}

fighters/edge/src/status/special_n.rs

+110
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
use super::*;
2+
use globals::*;
3+
use utils::consts::vars::edge;
4+
5+
#[status_script(agent = "edge", status = FIGHTER_STATUS_KIND_SPECIAL_N, condition = LUA_SCRIPT_STATUS_FUNC_STATUS_MAIN)]
6+
unsafe fn special_n_main(fighter: &mut L2CFighterCommon) -> L2CValue {
7+
fighter.sub_change_motion_by_situation(Hash40::new("special_n_start").into(), Hash40::new("special_air_n_start").into(), false.into());
8+
fighter.sub_set_special_start_common_kinetic_setting(hash40("param_special_n").into());
9+
special_hi_set_kinetics(fighter, true);
10+
WorkModule::set_int(fighter.module_accessor, *FIGHTER_EDGE_SPECIAL_N_NONE, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CHARGE_KIND);
11+
WorkModule::off_flag(fighter.module_accessor, *FIGHTER_EDGE_STATUS_SPECIAL_N_FLAG_REQUEST_SHOOT);
12+
WorkModule::set_int(fighter.module_accessor, -1, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS);
13+
WorkModule::enable_transition_term(fighter.module_accessor, *FIGHTER_STATUS_TRANSITION_GROUP_CHK_GROUND_GUARD);
14+
WorkModule::enable_transition_term(fighter.module_accessor, *FIGHTER_STATUS_TRANSITION_GROUP_CHK_GROUND_JUMP);
15+
WorkModule::enable_transition_term(fighter.module_accessor, *FIGHTER_STATUS_TRANSITION_GROUP_CHK_AIR_ESCAPE);
16+
ControlModule::set_add_jump_mini_button_life(fighter.module_accessor, 8);
17+
fighter.main_shift(special_n_main_loop)
18+
}
19+
20+
unsafe extern "C" fn special_n_main_loop(fighter: &mut L2CFighterCommon) -> L2CValue {
21+
if !StatusModule::is_changing(fighter.module_accessor) {
22+
fighter.sub_change_motion_by_situation(Hash40::new("special_n_start").into(), Hash40::new("special_air_n_start").into(), true.into());
23+
fighter.sub_exec_special_start_common_kinetic_setting(hash40("param_special_n").into());
24+
special_hi_set_kinetics(fighter, false);
25+
}
26+
if ControlModule::check_button_off(fighter.module_accessor, *CONTROL_PAD_BUTTON_SPECIAL) {
27+
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_EDGE_STATUS_SPECIAL_N_FLAG_REQUEST_SHOOT);
28+
}
29+
if WorkModule::is_flag(fighter.module_accessor, *FIGHTER_EDGE_STATUS_SPECIAL_N_FLAG_REQUEST_SHOOT) {
30+
if WorkModule::get_int(fighter.module_accessor, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CHARGE_KIND) != *FIGHTER_EDGE_SPECIAL_N_NONE {
31+
fighter.change_status(FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_SHOOT.into(), false.into());
32+
return 0.into()
33+
}
34+
}
35+
if MotionModule::is_end(fighter.module_accessor) {
36+
let status = if fighter.is_situation(*SITUATION_KIND_GROUND) { *FIGHTER_STATUS_KIND_WAIT } else { *FIGHTER_STATUS_KIND_FALL };
37+
fighter.change_status(status.into(), false.into());
38+
}
39+
let cancel_start_frame = WorkModule::get_param_int(fighter.module_accessor, hash40("param_special_n"), hash40("cancel_start_frame"));
40+
if cancel_start_frame > fighter.status_frame() {
41+
if fighter.is_situation(*SITUATION_KIND_AIR) {
42+
let mut speed_y = KineticModule::get_sum_speed_y(fighter.module_accessor, *KINETIC_ENERGY_RESERVE_ATTRIBUTE_MAIN);
43+
let unk1 = WorkModule::get_param_float(fighter.module_accessor, hash40("param_special_n"), 0x18ecc76f9d);
44+
if unk1 < speed_y {
45+
speed_y = unk1;
46+
}
47+
sv_kinetic_energy!(set_speed, fighter, FIGHTER_KINETIC_ENERGY_ID_GRAVITY, speed_y);
48+
}
49+
}
50+
else {
51+
if fighter.sub_check_command_guard().get_bool() {
52+
if fighter.is_situation(*SITUATION_KIND_GROUND) {
53+
WorkModule::set_int(fighter.module_accessor, *FIGHTER_STATUS_KIND_GUARD_ON, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS);
54+
fighter.change_status(FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL.into(), false.into());
55+
return 1.into()
56+
}
57+
else {
58+
if !WorkModule::is_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_DISABLE_ESCAPE_AIR) {
59+
WorkModule::set_int(fighter.module_accessor, *FIGHTER_STATUS_KIND_ESCAPE_AIR, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS);
60+
fighter.change_status(FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL.into(), false.into());
61+
return 1.into()
62+
}
63+
}
64+
}
65+
else {
66+
if fighter.is_situation(*SITUATION_KIND_AIR) {
67+
if fighter.sub_check_jump_in_charging().get_bool() {
68+
WorkModule::set_int(fighter.module_accessor, *FIGHTER_STATUS_KIND_JUMP_AERIAL, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS);
69+
fighter.change_status(FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL.into(), true.into());
70+
}
71+
}
72+
else {
73+
if (fighter.is_cat_flag(Cat1::JumpButton) || (ControlModule::is_enable_flick_jump(fighter.module_accessor) && fighter.is_cat_flag(Cat1::Jump) && fighter.sub_check_button_frick().get_bool())) {
74+
WorkModule::set_int(fighter.module_accessor, *FIGHTER_STATUS_KIND_JUMP_SQUAT, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS);
75+
fighter.change_status(FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL.into(), true.into());
76+
}
77+
else {
78+
if fighter.is_cat_flag(Cat2::StickEscapeF) {
79+
WorkModule::set_int(fighter.module_accessor, *FIGHTER_STATUS_KIND_ESCAPE_F, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS);
80+
fighter.change_status(FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL.into(), true.into());
81+
}
82+
else if fighter.is_cat_flag(Cat2::StickEscapeB) {
83+
WorkModule::set_int(fighter.module_accessor, *FIGHTER_STATUS_KIND_ESCAPE_B, *FIGHTER_EDGE_STATUS_SPECIAL_N_WORK_INT_CANCEL_STATUS);
84+
fighter.change_status(FIGHTER_EDGE_STATUS_KIND_SPECIAL_N_CANCEL.into(), true.into());
85+
}
86+
}
87+
}
88+
}
89+
}
90+
91+
return 0.into()
92+
}
93+
94+
unsafe extern "C" fn special_hi_set_kinetics(fighter: &mut L2CFighterCommon, param_1: bool) {
95+
if fighter.is_situation(*SITUATION_KIND_AIR) {
96+
if !param_1 && fighter.is_prev_situation(*SITUATION_KIND_AIR) {
97+
return;
98+
}
99+
sv_kinetic_energy!(set_needs_set_param, fighter, FIGHTER_KINETIC_ENERGY_ID_GRAVITY, false);
100+
if KineticModule::is_enable_energy(fighter.module_accessor, *FIGHTER_KINETIC_ENERGY_ID_CONTROL) {
101+
sv_kinetic_energy!(set_needs_set_param, fighter, FIGHTER_KINETIC_ENERGY_ID_CONTROL, false);
102+
}
103+
}
104+
}
105+
106+
pub fn install() {
107+
install_status_scripts!(
108+
special_n_main,
109+
);
110+
}

romfs/source/fighter/common/param/fighter_param.prcxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2825,7 +2825,7 @@
28252825
<float hash="dive_speed_y">3.239</float>
28262826
<float hash="weight">80</float>
28272827
<float hash="landing_attack_air_frame_f">12</float>
2828-
<float hash="landing_attack_air_frame_b">13</float>
2828+
<float hash="landing_attack_air_frame_b">15</float>
28292829
<float hash="landing_attack_air_frame_hi">14</float>
28302830
<float hash="landing_attack_air_frame_lw">30</float>
28312831
<int hash="landing_heavy_frame">4</int>

romfs/source/fighter/edge/param/vl.prcxml

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@
158158
<int hash="life_m">120</int>
159159
<float hash="speed_x_m">0.01</float>
160160
<float hash="accel_x_m">0.07</float>
161-
<float hash="max_speed_x_m">0.95</float>
161+
<float hash="max_speed_x_m">0.75</float>
162162
</struct>
163163
<hash40 index="1">dummy</hash40>
164164
<hash40 index="2">dummy</hash40>

0 commit comments

Comments
 (0)