Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Koopa Claw Side Special #2137

Merged
merged 13 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion dynamic/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,12 @@ pub mod vars {
pub const FIREBALL_COOLDOWN_FRAME: i32 = 0x0100;
pub const FIREBALL_EFFECT_ID: i32 = 0x0101;
pub const CHARGE_EFFECT_HANDLER: i32 = 0x0102;
pub const SPECIAL_S_THROW_TYPE: i32 = 0x0103;
}
pub mod status {
// flags
//flags
pub const PUNCH_CAN_ZOOM: i32 = 0x1101; // flag for controlling the zoom opff so it only runs once on impact
pub const SPECIAL_S_ABOVE_BLASTZONE: i32 = 0x1102;
}
}

Expand Down
3 changes: 2 additions & 1 deletion fighters/koopa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ utils = { package = "dynamic", path = "../../dynamic" }
skyline = "0.2.1"
skyline_smash = { git = "https://github.com/blu-dev/skyline-smash", features = ["weak_l2cvalue"] }
smash_script = { git = "https://github.com/blu-dev/smash-script", branch = "development" }
smashline = { git = "https://github.com/HDR-Development/smashline" }
smashline = { git = "https://github.com/HDR-Development/smashline" }
interpolation = "0.2.0"
276 changes: 276 additions & 0 deletions fighters/koopa/src/acmd/specials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,253 @@ unsafe extern "C" fn koopa_special_n_max_expression(fighter: &mut L2CAgentBase)
}
}

unsafe extern "C" fn koopa_special_s_squat_effect(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
EFFECT_FOLLOW(fighter, Hash40::new("sys_catch"), Hash40::new("haver"), 0, 1, 2, 0, 0, 0, 0.8, false);
}
}

unsafe extern "C" fn koopa_special_s_throwlw_game(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
ATTACK_ABS(fighter, *FIGHTER_ATTACK_ABSOLUTE_KIND_THROW, 0, 12.0, 82, 80, 0, 60, 0.0, 1.0, *ATTACK_LR_CHECK_F, 0.0, true, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_NONE, *ATTACK_REGION_THROW);
ATTACK_ABS(fighter, *FIGHTER_ATTACK_ABSOLUTE_KIND_CATCH, 0, 3.0, 361, 100, 0, 40, 0.0, 1.0, *ATTACK_LR_CHECK_F, 0.0, true, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_NONE, *ATTACK_REGION_THROW);
}
frame(fighter.lua_state_agent, 18.0);
if is_excute(fighter) {
CHECK_FINISH_CAMERA(fighter, 23, 16);
}
wait(fighter.lua_state_agent, 1.0);
if is_excute(fighter) {
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_KOOPA_STATUS_SPECIAL_S_FLAG_HIT);
}
}

unsafe extern "C" fn koopa_special_s_throwlw_effect(fighter: &mut L2CAgentBase) {
frame(fighter.lua_state_agent, 17.0);
if is_excute(fighter) {
FOOT_EFFECT(fighter, Hash40::new("sys_dash_smoke"), Hash40::new("top"), 2, 0, -6, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 0, true);
}
frame(fighter.lua_state_agent, 19.0);
if is_excute(fighter) {
EFFECT(fighter, Hash40::new("sys_smash_flash_s"), Hash40::new("throw"), 0, 0, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 0, true);
EFFECT(fighter, Hash40::new("sys_attack_impact"), Hash40::new("throw"), 0, 0, 0, 0, 0, 0, 2.2, 0, 0, 0, 0, 0, 360, true);
LAST_EFFECT_SET_RATE(fighter,0.8);
}
}

unsafe extern "C" fn koopa_special_s_throwlw_sound(fighter: &mut L2CAgentBase) {
frame(fighter.lua_state_agent, 4.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_common_throw_01"));
}
wait(fighter.lua_state_agent, 18.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_common_heavy_hit_m"));
}
}

unsafe extern "C" fn koopa_special_s_throwlw_expression(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE, *SLOPE_STATUS_LR);
}
frame(fighter.lua_state_agent, 19.0);
if is_excute(fighter) {
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_attackm"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
QUAKE(fighter, *CAMERA_QUAKE_KIND_M);
}
}

unsafe extern "C" fn koopa_special_s_throwf_game(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
ATTACK_ABS(fighter, *FIGHTER_ATTACK_ABSOLUTE_KIND_THROW, 0, 12.0, 50, 66, 0, 60, 0.0, 1.0, *ATTACK_LR_CHECK_F, 0.0, true, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_NONE, *ATTACK_REGION_THROW);
ATTACK_ABS(fighter, *FIGHTER_ATTACK_ABSOLUTE_KIND_CATCH, 0, 3.0, 361, 100, 0, 40, 0.0, 1.0, *ATTACK_LR_CHECK_F, 0.0, true, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_NONE, *ATTACK_REGION_THROW);
}
frame(fighter.lua_state_agent, 18.0);
if is_excute(fighter) {
CHECK_FINISH_CAMERA(fighter, 23, 16);
}
wait(fighter.lua_state_agent, 1.0);
if is_excute(fighter) {
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_KOOPA_STATUS_SPECIAL_S_FLAG_HIT);
}
}

unsafe extern "C" fn koopa_special_s_throwf_effect(fighter: &mut L2CAgentBase) {
frame(fighter.lua_state_agent, 17.0);
if is_excute(fighter) {
if StatusModule::situation_kind(fighter.module_accessor) == *SITUATION_KIND_GROUND {
FOOT_EFFECT(fighter, Hash40::new("sys_dash_smoke"), Hash40::new("top"), 2, 0, -6, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 0, true);
}
}
frame(fighter.lua_state_agent, 19.0);
if is_excute(fighter) {
EFFECT(fighter, Hash40::new("sys_smash_flash_s"), Hash40::new("throw"), 0, 0, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 0, true);
}
}

unsafe extern "C" fn koopa_special_s_throwf_sound(fighter: &mut L2CAgentBase) {
frame(fighter.lua_state_agent, 4.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_common_throw_01"));
}
wait(fighter.lua_state_agent, 15.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_common_throw_02"));
}
}

unsafe extern "C" fn koopa_special_s_throwf_expression(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE, *SLOPE_STATUS_LR);
}
frame(fighter.lua_state_agent, 19.0);
if is_excute(fighter) {
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_attackm"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
QUAKE(fighter, *CAMERA_QUAKE_KIND_S);
}
}

unsafe extern "C" fn koopa_special_s_throwb_game(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
ATTACK_ABS(fighter, *FIGHTER_ATTACK_ABSOLUTE_KIND_THROW, 0, 12.0, 45, 66, 0, 60, 0.0, 1.0, *ATTACK_LR_CHECK_F, 0.0, true, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_NONE, *ATTACK_REGION_THROW);
ATTACK_ABS(fighter, *FIGHTER_ATTACK_ABSOLUTE_KIND_CATCH, 0, 3.0, 361, 100, 0, 40, 0.0, 1.0, *ATTACK_LR_CHECK_F, 0.0, true, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_NONE, *ATTACK_REGION_THROW);
}
frame(fighter.lua_state_agent, 18.0);
if is_excute(fighter) {
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_REVERSE_LR_FINISH_CAMERA_THROW_ORBIT);
CHECK_FINISH_CAMERA(fighter, 20, 15);
}
frame(fighter.lua_state_agent, 19.0);
if is_excute(fighter) {
REVERSE_LR(fighter);
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_KOOPA_STATUS_SPECIAL_S_FLAG_HIT);
}
}

unsafe extern "C" fn koopa_special_s_throwb_effect(fighter: &mut L2CAgentBase) {
frame(fighter.lua_state_agent, 19.0);
if is_excute(fighter) {
EFFECT(fighter, Hash40::new("sys_smash_flash_s"), Hash40::new("throw"), 0, 0, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 0, true);
}
frame(fighter.lua_state_agent, 22.0);
if is_excute(fighter) {
if StatusModule::situation_kind(fighter.module_accessor) == *SITUATION_KIND_GROUND {
FOOT_EFFECT(fighter, Hash40::new("sys_dash_smoke"), Hash40::new("top"), 3, 0, 3, 0, 180, 0, 1.5, 0, 0, 0, 0, 0, 0, true);
}
}
}

unsafe extern "C" fn koopa_special_s_throwb_sound(fighter: &mut L2CAgentBase) {
frame(fighter.lua_state_agent, 4.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_common_throw_01"));
}
wait(fighter.lua_state_agent, 15.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_common_throw_02"));
}
}

unsafe extern "C" fn koopa_special_s_throwb_expression(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE, *SLOPE_STATUS_LR);
}
frame(fighter.lua_state_agent, 19.0);
if is_excute(fighter) {
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_attackm"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
QUAKE(fighter, *CAMERA_QUAKE_KIND_S);
}
}

unsafe extern "C" fn koopa_special_s_jump_effect(fighter: &mut L2CAgentBase) {
frame(fighter.lua_state_agent, 7.0);
if is_excute(fighter) {
EFFECT(fighter, Hash40::new("sys_v_smoke_a"), Hash40::new("top"), 0, -1.0, 0, 0, 0, 0, 0.8, 0, 0, 0, 0, 0, 0, false);
}
frame(fighter.lua_state_agent, 17.0);
if is_excute(fighter) {
EFFECT_FOLLOW(fighter, Hash40::new("koopa_drop_air"), Hash40::new("top"), 0, 9, 0, 0, 0, 0, 0.8, true);
}
}

unsafe extern "C" fn koopa_special_s_jump_sound(fighter: &mut L2CAgentBase) {
frame(fighter.lua_state_agent, 1.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_koopa_special_s03"));
}
frame(fighter.lua_state_agent, 35.0);
if is_excute(fighter) {
PLAY_SE(fighter, Hash40::new("se_koopa_special_s04"));
}
}

unsafe extern "C" fn koopa_special_s_fall_effect(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
EFFECT_FOLLOW(fighter, Hash40::new("koopa_drop_air"), Hash40::new("top"), 0, 9, 0, 0, 0, 0, 0.8, true);
}
}

unsafe extern "C" fn koopa_special_s_landing_game(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
ATTACK_ABS(fighter, *FIGHTER_ATTACK_ABSOLUTE_KIND_THROW, 0, 18.0, 60, 60, 0, 80, 0.0, 1.0, *ATTACK_LR_CHECK_F, 0.0, true, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_NONE, *ATTACK_REGION_BODY);
ATTACK_ABS(fighter, *FIGHTER_ATTACK_ABSOLUTE_KIND_CATCH, 0, 5.0, 70, 30, 0, 60, 0.0, 1.0, *ATTACK_LR_CHECK_F, 0.0, true, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_S, *COLLISION_SOUND_ATTR_NONE, *ATTACK_REGION_BODY);
}
frame(fighter.lua_state_agent, 1.0);
if is_excute(fighter) {
//CHECK_FINISH_CAMERA(fighter, 3, 9);
//lua_bind::FighterCutInManager::set_throw_finish_zoom_rate(singletons::FighterCutInManager(), 1.3);
//lua_bind::FighterCutInManager::set_throw_finish_offset(singletons::FighterCutInManager(), Vector3f{x: 0.0, y: -9.0, z: 0.0});
}
frame(fighter.lua_state_agent, 2.0);
if is_excute(fighter) {
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_KOOPA_STATUS_SPECIAL_S_FLAG_HIT);
}
frame(fighter.lua_state_agent, 10.0);
FT_MOTION_RATE_RANGE(fighter,10.0,14.0,8.0);
frame(fighter.lua_state_agent, 14.0);
FT_MOTION_RATE_RANGE(fighter,14.0,26.0,16.0);
frame(fighter.lua_state_agent, 26.0);
FT_MOTION_RATE(fighter,1.0)
}

unsafe extern "C" fn koopa_special_s_landing_effect(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
EFFECT(fighter, Hash40::new("sys_crown"), Hash40::new("top"), 0, 0, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 0, 0, false);
LANDING_EFFECT(fighter, Hash40::new("sys_v_smoke_b"), Hash40::new("top"), 0, 0, 0, 0, 0, 0, 1.5, 0, 0, 0, 0, 0, 0, false);
}
}

unsafe extern "C" fn koopa_special_s_landing_sound(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
STOP_SE(fighter, Hash40::new("se_koopa_special_s04"));
PLAY_STATUS(fighter, Hash40::new("se_koopa_special_s05"));
}
frame(fighter.lua_state_agent, 17.0);
if is_excute(fighter) {
PLAY_STEP_FLIPPABLE(fighter, Hash40::new("se_koopa_step_left_m"), Hash40::new("se_koopa_step_right_m"));
}
frame(fighter.lua_state_agent, 26.0);
if is_excute(fighter) {
PLAY_STEP_FLIPPABLE(fighter, Hash40::new("se_koopa_step_right_m"), Hash40::new("se_koopa_step_left_m"));
}
}

unsafe extern "C" fn koopa_special_s_landing_expression(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
ItemModule::set_have_item_visibility(fighter.module_accessor, false, 0);
QUAKE(fighter, *CAMERA_QUAKE_KIND_L);
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_erase"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
}
frame(fighter.lua_state_agent, 3.0);
if is_excute(fighter) {
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_explosionm"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
}
frame(fighter.lua_state_agent, 23.0);
if is_excute(fighter) {
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE_INTP, *SLOPE_STATUS_LR, 6);
}
}

unsafe extern "C" fn koopa_special_hi_game(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
Expand Down Expand Up @@ -336,6 +583,35 @@ pub fn install() {
.acmd("sound_specialairnmax", koopa_special_n_max_sound)
.acmd("expression_specialnmax", koopa_special_n_max_expression)
.acmd("expression_specialairnmax", koopa_special_n_max_expression)
.acmd("effect_specialssquat", koopa_special_s_squat_effect)
.acmd("effect_specialairssquat", koopa_special_s_squat_effect)
.acmd("game_specialsthrowlw", koopa_special_s_throwlw_game)
.acmd("effect_specialsthrowlw", koopa_special_s_throwlw_effect)
.acmd("sound_specialsthrowlw", koopa_special_s_throwlw_sound)
.acmd("expression_specialsthrowlw", koopa_special_s_throwlw_expression)
.acmd("game_specialsthrowf", koopa_special_s_throwf_game)
.acmd("game_specialairsthrowf", koopa_special_s_throwf_game)
.acmd("effect_specialsthrowf", koopa_special_s_throwf_effect)
.acmd("effect_specialairsthrowf", koopa_special_s_throwf_effect)
.acmd("sound_specialsthrowf", koopa_special_s_throwf_sound)
.acmd("sound_specialairsthrowf", koopa_special_s_throwf_sound)
.acmd("expression_specialsthrowf", koopa_special_s_throwf_expression)
.acmd("expression_specialairsthrowf", koopa_special_s_throwf_expression)
.acmd("game_specialsthrowb", koopa_special_s_throwb_game)
.acmd("game_specialairsthrowb", koopa_special_s_throwb_game)
.acmd("effect_specialsthrowb", koopa_special_s_throwb_effect)
.acmd("effect_specialairsthrowb", koopa_special_s_throwb_effect)
.acmd("sound_specialsthrowb", koopa_special_s_throwb_sound)
.acmd("sound_specialairsthrowb", koopa_special_s_throwb_sound)
.acmd("expression_specialsthrowb", koopa_special_s_throwb_expression)
.acmd("expression_specialairsthrowb", koopa_special_s_throwb_expression)
.acmd("effect_specialsjump", koopa_special_s_jump_effect)
.acmd("sound_specialsjump", koopa_special_s_jump_sound)
.acmd("effect_specialsfall", koopa_special_s_fall_effect)
.acmd("game_specialslanding", koopa_special_s_landing_game)
.acmd("effect_specialslanding", koopa_special_s_landing_effect)
.acmd("sound_specialslanding", koopa_special_s_landing_sound)
.acmd("expression_specialslanding", koopa_special_s_landing_expression)
.acmd("game_specialhi", koopa_special_hi_game)
.acmd("expression_specialhi", koopa_special_hi_expression)
.acmd("game_specialairhi", koopa_special_air_hi_game)
Expand Down
Loading
Loading