Skip to content

Commit

Permalink
Brawler crate
Browse files Browse the repository at this point in the history
  • Loading branch information
BEANSS0328 committed Mar 23, 2024
1 parent a8b59ef commit 88ff353
Show file tree
Hide file tree
Showing 11 changed files with 980 additions and 994 deletions.
182 changes: 90 additions & 92 deletions fighters/miifighter/src/acmd/aerials.rs

Large diffs are not rendered by default.

96 changes: 47 additions & 49 deletions fighters/miifighter/src/acmd/ground.rs

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions fighters/miifighter/src/acmd/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ mod specials;
mod throws;
mod ground;

pub fn install() {
aerials::install();
tilts::install();
other::install();
smashes::install();
specials::install();
throws::install();
ground::install();
pub fn install(agent: &mut Agent) {
aerials::install(agent);
tilts::install(agent);
other::install(agent);
smashes::install(agent);
specials::install(agent);
throws::install(agent);
ground::install(agent);
}
156 changes: 77 additions & 79 deletions fighters/miifighter/src/acmd/other.rs
Original file line number Diff line number Diff line change
@@ -1,195 +1,193 @@

use super::*;

unsafe extern "C" fn damageflyhi_sound(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn sound_damageflyhi(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 1.0);
if is_excute(fighter) {
if !StopModule::is_stop(fighter.module_accessor) {
if is_excute(agent) {
if !StopModule::is_stop(agent.module_accessor) {
let play_vc = if DamageModule::reaction(boma, 0) < 100.0 {
app::sv_math::rand(hash40("fighter"), 3)
} else {
0
};
if play_vc == 0 {PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
}
}
frame(lua_state, 1.1);
if is_excute(fighter) {
if is_excute(agent) {
let play_vc = if DamageModule::reaction(boma, 0) < 100.0 {
app::sv_math::rand(hash40("fighter"), 3)
} else {
0
};
if play_vc == 0 {PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
}
}

unsafe extern "C" fn damageflylw_sound(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn sound_damageflylw(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 1.0);
if is_excute(fighter) {
if !StopModule::is_stop(fighter.module_accessor) {
if is_excute(agent) {
if !StopModule::is_stop(agent.module_accessor) {
let play_vc = if DamageModule::reaction(boma, 0) < 100.0 {
app::sv_math::rand(hash40("fighter"), 3)
} else {
0
};
if play_vc == 0 {PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
}
}
frame(lua_state, 1.1);
if is_excute(fighter) {
if is_excute(agent) {
let play_vc = if DamageModule::reaction(boma, 0) < 100.0 {
app::sv_math::rand(hash40("fighter"), 3)
} else {
0
};
if play_vc == 0 {PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
}
}

unsafe extern "C" fn damageflyn_sound(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn sound_damageflyn(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 1.0);
if is_excute(fighter) {
if !StopModule::is_stop(fighter.module_accessor) {
if is_excute(agent) {
if !StopModule::is_stop(agent.module_accessor) {
let play_vc = if DamageModule::reaction(boma, 0) < 100.0 {
app::sv_math::rand(hash40("fighter"), 3)
} else {
0
};
if play_vc == 0 {PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
}
}
frame(lua_state, 1.1);
if is_excute(fighter) {
if is_excute(agent) {
let play_vc = if DamageModule::reaction(boma, 0) < 100.0 {
app::sv_math::rand(hash40("fighter"), 3)
} else {
0
};
if play_vc == 0 {PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
}
}

unsafe extern "C" fn damageflyroll_sound(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn sound_damageflyroll(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 1.0);
if is_excute(fighter) {
if !StopModule::is_stop(fighter.module_accessor) {
PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));
if is_excute(agent) {
if !StopModule::is_stop(agent.module_accessor) {
PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));
}
}
frame(lua_state, 1.1);
if is_excute(fighter) {
PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));
if is_excute(agent) {
PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));
}
}

unsafe extern "C" fn damageflytop_sound(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn sound_damageflytop(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 1.0);
if is_excute(fighter) {
if !StopModule::is_stop(fighter.module_accessor) {
if is_excute(agent) {
if !StopModule::is_stop(agent.module_accessor) {
let play_vc = if DamageModule::reaction(boma, 0) < 100.0 {
app::sv_math::rand(hash40("fighter"), 3)
} else {
0
};
if play_vc == 0 {PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
}
}
frame(lua_state, 1.1);
if is_excute(fighter) {
if is_excute(agent) {
let play_vc = if DamageModule::reaction(boma, 0) < 100.0 {
app::sv_math::rand(hash40("fighter"), 3)
} else {
0
};
if play_vc == 0 {PLAY_FLY_VOICE(fighter, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_miifighter_rnd_futtobi01"), Hash40::new("seq_miifighter_rnd_futtobi02"));}
}
}

unsafe extern "C" fn dash_game(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn game_dash(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 12.0);
if is_excute(fighter) {
if is_excute(agent) {
WorkModule::enable_transition_term(boma, *FIGHTER_STATUS_TRANSITION_TERM_ID_DASH_TO_RUN);
}

}

unsafe extern "C" fn dash_sound(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn sound_dash(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 4.0);
if is_excute(fighter) {
let dash_sfx_handle = SoundModule::play_se(fighter.module_accessor, Hash40::new("se_miifighter_dash_start"), true, false, false, false, app::enSEType(0));
if is_excute(agent) {
let dash_sfx_handle = SoundModule::play_se(agent.module_accessor, Hash40::new("se_miifighter_dash_start"), true, false, false, false, app::enSEType(0));
SoundModule::set_se_vol(boma, dash_sfx_handle as i32, 0.5, 0);
}
}

unsafe extern "C" fn turn_dash_game(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn game_turndash(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 3.0);
if is_excute(fighter) {
if is_excute(agent) {
WorkModule::on_flag(boma, *FIGHTER_STATUS_DASH_FLAG_TURN_DASH);
}
frame(lua_state, 12.0);
if is_excute(fighter) {
if is_excute(agent) {
WorkModule::enable_transition_term(boma, *FIGHTER_STATUS_TRANSITION_TERM_ID_DASH_TO_RUN);
}

}

unsafe extern "C" fn escape_air_game(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn game_escapeair(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
let escape_air_cancel_frame = WorkModule::get_param_float(boma, hash40("param_motion"), hash40("escape_air_cancel_frame"));

frame(lua_state, 29.0);
if is_excute(fighter) {
if is_excute(agent) {
KineticModule::change_kinetic(boma, *FIGHTER_KINETIC_TYPE_FALL);
}
frame(lua_state, escape_air_cancel_frame);
if is_excute(fighter) {
notify_event_msc_cmd!(fighter, Hash40::new_raw(0x2127e37c07), *GROUND_CLIFF_CHECK_KIND_ALWAYS_BOTH_SIDES);
if is_excute(agent) {
notify_event_msc_cmd!(agent, Hash40::new_raw(0x2127e37c07), *GROUND_CLIFF_CHECK_KIND_ALWAYS_BOTH_SIDES);
}
}

unsafe extern "C" fn escape_air_slide_game(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
unsafe extern "C" fn game_escapeairslide(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();

frame(lua_state, 29.0);
if is_excute(fighter) {
if is_excute(agent) {
WorkModule::on_flag(boma, *FIGHTER_STATUS_ESCAPE_AIR_FLAG_SLIDE_ENABLE_CONTROL);
}
frame(lua_state, 39.0);
if is_excute(fighter) {
notify_event_msc_cmd!(fighter, Hash40::new_raw(0x2127e37c07), *GROUND_CLIFF_CHECK_KIND_ALWAYS_BOTH_SIDES);
if is_excute(agent) {
notify_event_msc_cmd!(agent, Hash40::new_raw(0x2127e37c07), *GROUND_CLIFF_CHECK_KIND_ALWAYS_BOTH_SIDES);
}
}

pub fn install() {
smashline::Agent::new("miifighter")
.acmd("sound_damageflyhi", damageflyhi_sound)
.acmd("sound_damageflylw", damageflylw_sound)
.acmd("sound_damageflyn", damageflyn_sound)
.acmd("sound_damageflyroll", damageflyroll_sound)
.acmd("sound_damageflytop", damageflytop_sound)
.acmd("game_dash", dash_game)
.acmd("sound_dash", dash_sound)
.acmd("game_turndash", turn_dash_game)
.acmd("game_escapeair", escape_air_game)
.acmd("game_escapeairslide", escape_air_slide_game)
.install();
pub fn install(agent: &mut Agent) {
agent.acmd("sound_damageflyhi", sound_damageflyhi);
agent.acmd("sound_damageflylw", sound_damageflylw);
agent.acmd("sound_damageflyn", sound_damageflyn);
agent.acmd("sound_damageflyroll", sound_damageflyroll);
agent.acmd("sound_damageflytop", sound_damageflytop);
agent.acmd("game_dash", game_dash);
agent.acmd("sound_dash", sound_dash);
agent.acmd("game_turndash", game_turndash);
agent.acmd("game_escapeair", game_escapeair);
agent.acmd("game_escapeairslide", game_escapeairslide);
}
20 changes: 9 additions & 11 deletions fighters/miifighter/src/acmd/smashes.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use super::*;

unsafe extern "C" fn miifighter_attack_hi4_game(agent: &mut L2CAgentBase) {
unsafe extern "C" fn game_attackhi4(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 4.0);
Expand All @@ -26,7 +26,7 @@ unsafe extern "C" fn miifighter_attack_hi4_game(agent: &mut L2CAgentBase) {
}
}

unsafe extern "C" fn miifighter_attack_s4_game(agent: &mut L2CAgentBase) {
unsafe extern "C" fn game_attacks4(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 6.0);
Expand All @@ -49,7 +49,7 @@ unsafe extern "C" fn miifighter_attack_s4_game(agent: &mut L2CAgentBase) {
}
}

unsafe extern "C" fn miifighter_attack_lw4_game(agent: &mut L2CAgentBase) {
unsafe extern "C" fn game_attacklw4(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
frame(lua_state, 3.0);
Expand All @@ -69,12 +69,10 @@ unsafe extern "C" fn miifighter_attack_lw4_game(agent: &mut L2CAgentBase) {
}
}

pub fn install() {
smashline::Agent::new("miifighter")
.acmd("game_attackhi4", miifighter_attack_hi4_game)
.acmd("game_attacks4", miifighter_attack_s4_game)
.acmd("game_attacks4hi", miifighter_attack_s4_game)
.acmd("game_attacks4lw", miifighter_attack_s4_game)
.acmd("game_attacklw4", miifighter_attack_lw4_game)
.install();
pub fn install(agent: &mut Agent) {;
agent.acmd("game_attackhi4", game_attackhi4);
agent.acmd("game_attacks4", game_attacks4);
agent.acmd("game_attacks4hi", game_attacks4);
agent.acmd("game_attacks4lw", game_attacks4);
agent.acmd("game_attacklw4", game_attacklw4);
}
Loading

0 comments on commit 88ff353

Please sign in to comment.