Skip to content

Commit

Permalink
Diddy Crate
Browse files Browse the repository at this point in the history
  • Loading branch information
BEANSS0328 committed Mar 23, 2024
1 parent ebcc132 commit e046253
Show file tree
Hide file tree
Showing 15 changed files with 530 additions and 558 deletions.
196 changes: 97 additions & 99 deletions fighters/diddy/src/acmd/aerials.rs

Large diffs are not rendered by default.

135 changes: 66 additions & 69 deletions fighters/diddy/src/acmd/ground.rs

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions fighters/diddy/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 tilts;

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);
}
160 changes: 79 additions & 81 deletions fighters/diddy/src/acmd/other.rs
Original file line number Diff line number Diff line change
@@ -1,183 +1,183 @@

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_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_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_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_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_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_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_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_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_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_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_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_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_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));
if is_excute(agent) {
if !StopModule::is_stop(agent.module_accessor) {
PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));
}
}
frame(lua_state, 1.1);
if is_excute(fighter) {
PLAY_FLY_VOICE(fighter, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));
if is_excute(agent) {
PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_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_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_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_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));}
if play_vc == 0 {PLAY_FLY_VOICE(agent, Hash40::new("seq_diddy_rnd_futtobi01"), Hash40::new("seq_diddy_rnd_futtobi02"));}
}
}

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_diddy_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_diddy_dash_start"), true, false, false, false, app::enSEType(0));
SoundModule::set_se_vol(boma, dash_sfx_handle as i32, 0.5, 0);
}
wait(lua_state, 8.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_diddy_step_right_ll"));
if is_excute(agent) {
PLAY_SE(agent, Hash40::new("se_diddy_step_right_ll"));
}
wait(lua_state, 4.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_diddy_step_left_ll"));
if is_excute(agent) {
PLAY_SE(agent, Hash40::new("se_diddy_step_left_ll"));
}
}

unsafe extern "C" fn diddy_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, 11.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);
}
}

unsafe extern "C" fn game_appealhi(agent: &mut L2CAgentBase) {
unsafe extern "C" fn game_appealhil(agent: &mut L2CAgentBase) {
let lua_state = agent.lua_state_agent;
let boma = agent.boma();
if is_excute(agent) {
Expand All @@ -194,18 +194,16 @@ unsafe extern "C" fn game_appealhi(agent: &mut L2CAgentBase) {
}
}

pub fn install() {
smashline::Agent::new("diddy")
.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("sound_dash", dash_sound)
.acmd("game_turndash", diddy_turn_dash_game)
.acmd("game_escapeair", escape_air_game)
.acmd("game_escapeairslide", escape_air_slide_game)
.acmd("game_appealhil", game_appealhi)
.acmd("game_appealhir", game_appealhi)
.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("sound_dash", sound_dash);
agent.acmd("game_turndash", game_turndash);
agent.acmd("game_escapeair", game_escapeair);
agent.acmd("game_escapeairslide", game_escapeairslide);
agent.acmd("game_appealhil", game_appealhil);
agent.acmd("game_appealhir", game_appealhil);
}
Loading

0 comments on commit e046253

Please sign in to comment.