Skip to content

Commit

Permalink
ds tweaks init
Browse files Browse the repository at this point in the history
  • Loading branch information
jaccob101 committed Mar 24, 2024
1 parent 026848e commit 0b6642c
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 80 deletions.
54 changes: 30 additions & 24 deletions fighters/samusd/src/acmd/aerials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ unsafe extern "C" fn samusd_attack_air_n_game(fighter: &mut L2CAgentBase) {
FT_MOTION_RATE(fighter, 1.0);
for _ in 0..7 {
if is_excute(fighter) {
ATTACK(fighter, 0, 0, Hash40::new("top"), 1.0, 365, 48, 0, 34, 4.0, 0.0, 15.0, 4.5, None, None, None, 0.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_elec_whip"), *ATTACK_SOUND_LEVEL_M, *COLLISION_SOUND_ATTR_ELEC, *ATTACK_REGION_BODY);
ATTACK(fighter, 1, 0, Hash40::new("top"), 1.0, 365, 48, 0, 34, 4.0, 0.0, 15.0, -4.1, None, None, None, 0.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_elec_whip"), *ATTACK_SOUND_LEVEL_M, *COLLISION_SOUND_ATTR_ELEC, *ATTACK_REGION_BODY);
ATTACK(fighter, 2, 0, Hash40::new("top"), 1.0, 110, 48, 0, 34, 4.0, 0.0, 6.0, 4.5, None, None, None, 0.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_elec_whip"), *ATTACK_SOUND_LEVEL_M, *COLLISION_SOUND_ATTR_ELEC, *ATTACK_REGION_BODY);
ATTACK(fighter, 3, 0, Hash40::new("top"), 1.0, 110, 48, 0, 34, 4.0, 0.0, 6.0, -4.1, None, None, None, 0.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_elec_whip"), *ATTACK_SOUND_LEVEL_M, *COLLISION_SOUND_ATTR_ELEC, *ATTACK_REGION_BODY);
ATTACK(fighter, 0, 0, Hash40::new("top"), 1.0, 365, 48, 0, 34, 3.8, 0.0, 15.2, 4.7, None, None, None, 0.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_elec_whip"), *ATTACK_SOUND_LEVEL_M, *COLLISION_SOUND_ATTR_ELEC, *ATTACK_REGION_BODY);
ATTACK(fighter, 1, 0, Hash40::new("top"), 1.0, 365, 48, 0, 34, 3.8, 0.0, 15.2, -4.3, None, None, None, 0.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_elec_whip"), *ATTACK_SOUND_LEVEL_M, *COLLISION_SOUND_ATTR_ELEC, *ATTACK_REGION_BODY);
ATTACK(fighter, 2, 0, Hash40::new("top"), 1.0, 110, 48, 0, 34, 3.8, 0.0, 5.8, 4.7, None, None, None, 0.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_elec_whip"), *ATTACK_SOUND_LEVEL_M, *COLLISION_SOUND_ATTR_ELEC, *ATTACK_REGION_BODY);
ATTACK(fighter, 3, 0, Hash40::new("top"), 1.0, 110, 48, 0, 34, 3.8, 0.0, 5.8, -4.3, None, None, None, 0.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_elec_whip"), *ATTACK_SOUND_LEVEL_M, *COLLISION_SOUND_ATTR_ELEC, *ATTACK_REGION_BODY);
}
wait(lua_state, 2.0);
if is_excute(fighter) {
Expand Down Expand Up @@ -189,21 +189,16 @@ unsafe extern "C" fn samusd_attack_air_n_expression(fighter: &mut L2CAgentBase)
unsafe extern "C" fn samusd_attack_air_f_game(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
frame(lua_state, 1.0);
FT_MOTION_RATE_RANGE(fighter, 1.0, 5.0, 3.0);
frame(lua_state, 5.0);
FT_MOTION_RATE(fighter, 1.0);
frame(lua_state, 4.0);
if is_excute(fighter) {
WorkModule::on_flag(boma, *FIGHTER_STATUS_ATTACK_AIR_FLAG_ENABLE_LANDING);
}
frame(lua_state, 11.0);
FT_MOTION_RATE_RANGE(fighter, 11.0, 15.0, 5.0);
frame(lua_state, 8.0);
if is_excute(fighter) {
ATTACK(fighter, 0, 0, Hash40::new("armr"), 13.0, 361, 85, 0, 30, 3.5, 0.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH);
ATTACK(fighter, 1, 0, Hash40::new("armr"), 13.0, 361, 85, 0, 30, 4.5, 6.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_PUNCH);
ATTACK(fighter, 0, 0, Hash40::new("handl"), 12.0, 361, 101, 0, 20, 4.5, 0.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_cutup"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_CUTUP, *ATTACK_REGION_PUNCH);
ATTACK(fighter, 1, 0, Hash40::new("shoulderl"), 12.0, 361, 101, 0, 20, 4.0, 0.8, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_PUNCH, *ATTACK_REGION_PUNCH);
}
frame(lua_state, 15.0);
FT_MOTION_RATE(fighter, 1.0);//34 faf
frame(lua_state, 12.0);//34faf
if is_excute(fighter) {
AttackModule::clear_all(boma);
}
Expand All @@ -216,18 +211,29 @@ unsafe extern "C" fn samusd_attack_air_f_game(fighter: &mut L2CAgentBase) {
unsafe extern "C" fn samusd_attack_air_f_effect(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
frame(lua_state, 11.0);
frame(lua_state, 8.0);
if is_excute(fighter) {
EFFECT_FOLLOW(fighter, Hash40::new("sys_attack_arc_d"), Hash40::new("top"), 0, 9, 3, 15, -18 , -85, 1.15, true);
LAST_EFFECT_SET_COLOR(fighter, 0.1, 0.7, 3.0);
LAST_EFFECT_SET_RATE(fighter, 1.5);
EFFECT_FOLLOW(fighter, Hash40::new("sys_attack_arc_d"), Hash40::new("top"), 0, 11.4, 7.1, -20, -18 , -110, 1.15, true);
let color_vec = match WorkModule::get_int(boma, *FIGHTER_INSTANCE_WORK_ID_INT_COLOR) {
0 => Vector3f::new(0.1, 0.7, 3.0),//nor
1 => Vector3f::new(0.55, 0.88, 0.0004),//g
2 => Vector3f::new(1.25, 0.55, 1.5),//pur
3 => Vector3f::new(0.84, 0.7, 0.03),//r
4 => Vector3f::new(0.1, 1.0, 2.0),//y
5 => Vector3f::new(0.9, 0.03, 0.03),//w
6 => Vector3f::new(1.15, 0.65, 0.03),//blac
7 => Vector3f::new(0.78, 0.5, 2.5),//pi
_ => Vector3f::new(0.1, 0.7, 3.0)
}; //matches glow color
LAST_EFFECT_SET_COLOR(fighter, color_vec.x, color_vec.y, color_vec.z);
LAST_EFFECT_SET_RATE(fighter, 1.6);
}
}

unsafe extern "C" fn samusd_attack_air_f_sound(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
frame(lua_state, 11.0);
frame(lua_state, 7.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_samusd_swing_m"));
}
Expand All @@ -237,12 +243,12 @@ unsafe extern "C" fn samusd_attack_air_f_sound(fighter: &mut L2CAgentBase) {
unsafe extern "C" fn samusd_attack_air_f_expression(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
frame(lua_state, 9.0);
frame(lua_state, 5.0);
if is_excute(fighter) {
ControlModule::set_rumble(boma, Hash40::new("rbkind_nohitm"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
}

frame(lua_state, 11.0);
frame(lua_state, 8.0);
if is_excute(fighter) {
RUMBLE_HIT(fighter, Hash40::new("rbkind_attackm"), 0);
}
Expand All @@ -257,9 +263,9 @@ unsafe extern "C" fn samusd_attack_air_b_game(fighter: &mut L2CAgentBase) {
FT_MOTION_RATE(fighter, 1.0);
if is_excute(fighter) {
WorkModule::on_flag(boma, *FIGHTER_STATUS_ATTACK_AIR_FLAG_ENABLE_LANDING);
ATTACK(fighter, 0, 0, Hash40::new("hip"), 12.0, 38, 90, 0, 44, 5.0, 0.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_KICK);
ATTACK(fighter, 1, 0, Hash40::new("legr"), 12.0, 38, 90, 0, 44, 4.5, 3.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_KICK);
ATTACK(fighter, 2, 0, Hash40::new("kneer"), 15.0, 38, 90, 0, 44, 4.5, 6.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_KICK);
ATTACK(fighter, 0, 0, Hash40::new("hip"), 12.0, 38, 101, 0, 30, 5.0, 0.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_KICK);
ATTACK(fighter, 1, 0, Hash40::new("legr"), 12.0, 38, 101, 0, 30, 4.5, 3.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_KICK);
ATTACK(fighter, 2, 0, Hash40::new("kneer"), 15.0, 38, 101, 0, 20, 4.5, 6.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_KICK, *ATTACK_REGION_KICK);
}
frame(lua_state, 12.0);
if is_excute(fighter) {
Expand Down
34 changes: 32 additions & 2 deletions fighters/samusd/src/acmd/ground.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ unsafe extern "C" fn samusd_attack_11_game(fighter: &mut L2CAgentBase) {
let boma = fighter.boma();
frame(lua_state, 3.0);
if is_excute(fighter) {
ATTACK(fighter, 0, 0, Hash40::new("top"), 3.5, 60, 38, 0, 35, 3.5, 0.0, 9.5, 8.0, Some(0.0), Some(9.5), Some(16.0), 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA_d, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_PUNCH, *ATTACK_REGION_PUNCH);
ATTACK(fighter, 1, 0, Hash40::new("top"), 3.5, 361, 10, 0, 25, 2.5, 0.0, 3.5, 8.0, Some(0.0), Some(3.5), Some(15.5), 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_PUNCH, *ATTACK_REGION_PUNCH);
ATTACK(fighter, 0, 0, Hash40::new("top"), 3.5, 50, 38, 0, 35, 3.5, 0.0, 9.5, 5.5, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_F, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA_d, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_PUNCH, *ATTACK_REGION_PUNCH);
ATTACK(fighter, 1, 0, Hash40::new("top"), 3.5, 60, 38, 0, 35, 3.5, 0.0, 9.5, 5.5, Some(0.0), Some(9.5), Some(13.5), 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_F, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA_d, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_PUNCH, *ATTACK_REGION_PUNCH);
ATTACK(fighter, 2, 0, Hash40::new("top"), 3.5, 361, 10, 0, 25, 2.5, 0.0, 3.5, 5.5, Some(0.0), Some(3.5), Some(13.0), 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_F, false, 0, 0.0, 0, false, false, false, false, true, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_PUNCH, *ATTACK_REGION_PUNCH);
AttackModule::set_down_only(boma, 2, true);
}
wait(lua_state, 2.0);
if is_excute(fighter) {
Expand All @@ -23,6 +25,34 @@ unsafe extern "C" fn samusd_attack_11_game(fighter: &mut L2CAgentBase) {

}

unsafe extern "C" fn samusd_attack_11_effect(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
if is_excute(fighter) {
FOOT_EFFECT(fighter, Hash40::new("null"), Hash40::new("top"), 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, false);
}
frame(lua_state, 2.0);
if is_excute(fighter) {
EFFECT_FOLLOW(fighter, Hash40::new("sys_attack_line"), Hash40::new("top"), 0, 10, 0, 0, 0, 0, 0.95, true);
let color_vec = match WorkModule::get_int(boma, *FIGHTER_INSTANCE_WORK_ID_INT_COLOR) {
0 => Vector3f::new(0.1, 0.7, 3.0),//nor
1 => Vector3f::new(0.55, 0.88, 0.0004),//g
2 => Vector3f::new(1.25, 0.55, 1.5),//pur
3 => Vector3f::new(0.84, 0.7, 0.03),//r
4 => Vector3f::new(0.1, 1.0, 2.0),//y
5 => Vector3f::new(0.9, 0.03, 0.03),//w
6 => Vector3f::new(1.15, 0.65, 0.03),//blac
7 => Vector3f::new(0.78, 0.5, 2.5),//pi
_ => Vector3f::new(0.1, 0.7, 3.0)
}; //matches glow color
LAST_EFFECT_SET_COLOR(fighter, color_vec.x, color_vec.y, color_vec.z);
}
frame(lua_state, 3.0);
if is_excute(fighter) {
EFFECT(fighter, Hash40::new("sys_attack_impact"), Hash40::new("top"), -1, 10, 14.5, 0, 0, 0, 1.15, 0, 0, 0, 0, 0, 360, true);
}
}

unsafe extern "C" fn samusd_attack_12_game(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
Expand Down
Loading

0 comments on commit 0b6642c

Please sign in to comment.