Skip to content

Commit d7c09bd

Browse files
authored
Merge pull request HDR-Development#2255 from robertyur/Sora-run-loop
Sora run loop fix
2 parents e5fcbce + e802372 commit d7c09bd

File tree

3 files changed

+21
-15
lines changed

3 files changed

+21
-15
lines changed

fighters/trail/src/acmd/other.rs

+21-2
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ unsafe fn escape_air_game(fighter: &mut L2CAgentBase) {
190190
unsafe fn escape_air_slide_game(fighter: &mut L2CAgentBase) {
191191
let lua_state = fighter.lua_state_agent;
192192
let boma = fighter.boma();
193-
194193
frame(lua_state, 29.0);
195194
if is_excute(fighter) {
196195
WorkModule::on_flag(boma, *FIGHTER_STATUS_ESCAPE_AIR_FLAG_SLIDE_ENABLE_CONTROL);
@@ -201,6 +200,25 @@ unsafe fn escape_air_slide_game(fighter: &mut L2CAgentBase) {
201200
}
202201
}
203202

203+
#[acmd_script( agent = "trail", script = "sound_run" , category = ACMD_SOUND , low_priority)]
204+
unsafe fn run_sound(fighter: &mut L2CAgentBase) {
205+
let lua_state = fighter.lua_state_agent;
206+
let boma = fighter.boma();
207+
for _ in 0..i32::MAX {
208+
frame(lua_state, 1.0);
209+
if is_excute(fighter) {
210+
PLAY_SE(fighter, Hash40::new("se_trail_step_right_l"));
211+
}
212+
frame(lua_state, 16.0);
213+
if is_excute(fighter) {
214+
PLAY_SE(fighter, Hash40::new("se_trail_step_left_l"));
215+
}
216+
fighter.clear_lua_stack();
217+
sv_animcmd::wait_loop_sync_mot(lua_state);
218+
fighter.pop_lua_stack(1);
219+
}
220+
}
221+
204222
pub fn install() {
205223
install_acmd_scripts!(
206224
escape_air_game,
@@ -212,6 +230,7 @@ pub fn install() {
212230
damageflylw_sound,
213231
damageflyn_sound,
214232
damageflyroll_sound,
215-
damageflytop_sound
233+
damageflytop_sound,
234+
run_sound,
216235
);
217236
}

fighters/trail/src/acmd/smashes.rs

-1
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ unsafe fn effect_attacklw4(fighter: &mut L2CAgentBase) {
164164
}
165165
}
166166

167-
168167
pub fn install() {
169168
install_acmd_scripts!(
170169
game_attacks4,

fighters/trail/src/opff.rs

-12
Original file line numberDiff line numberDiff line change
@@ -317,17 +317,6 @@ unsafe fn training_cycle(fighter: &mut L2CFighterCommon, boma: &mut BattleObject
317317
}
318318
}
319319

320-
// plays footstep sounds during sora's new run animation (acmd does not seem to work for this, as it will not loop)
321-
unsafe fn run_sfx(fighter: &mut L2CFighterCommon, frame: f32) {
322-
if fighter.is_motion(Hash40::new("run")) {
323-
if frame as i32 == 30 {
324-
PLAY_SE(fighter, Hash40::new("se_trail_step_left_l"));
325-
} else if frame as i32 == 16 {
326-
PLAY_SE(fighter, Hash40::new("se_trail_step_right_l"));
327-
}
328-
}
329-
}
330-
331320
unsafe fn fastfall_specials(fighter: &mut L2CFighterCommon) {
332321
if !fighter.is_in_hitlag()
333322
&& !StatusModule::is_changing(fighter.module_accessor)
@@ -372,7 +361,6 @@ pub unsafe fn moveset(fighter: &mut smash::lua2cpp::L2CFighterCommon, boma: &mut
372361
side_special_walljump(boma, cat[0]);
373362
//aerial_sweep_hit_actionability(boma, frame);
374363
training_cycle(fighter, boma, frame);
375-
run_sfx(fighter, frame);
376364
fastfall_specials(fighter);
377365
}
378366

0 commit comments

Comments
 (0)