Skip to content

Commit e802372

Browse files
committed
footstep sfx
1 parent 80096f1 commit e802372

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

fighters/trail/src/acmd/other.rs

+13
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,19 @@ unsafe fn escape_air_slide_game(fighter: &mut L2CAgentBase) {
204204
unsafe fn run_sound(fighter: &mut L2CAgentBase) {
205205
let lua_state = fighter.lua_state_agent;
206206
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+
}
207220
}
208221

209222
pub fn install() {

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)