Skip to content

Commit 8ef458b

Browse files
authored
Merge pull request #2137 from HDR-Development/bowser-claw
Koopa Claw Side Special
2 parents 359add8 + 3da3fe5 commit 8ef458b

File tree

8 files changed

+1147
-198
lines changed

8 files changed

+1147
-198
lines changed

dynamic/src/consts.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,12 @@ pub mod vars {
700700
pub const FIREBALL_COOLDOWN_FRAME: i32 = 0x0100;
701701
pub const FIREBALL_EFFECT_ID: i32 = 0x0101;
702702
pub const CHARGE_EFFECT_HANDLER: i32 = 0x0102;
703+
pub const SPECIAL_S_THROW_TYPE: i32 = 0x0103;
703704
}
704705
pub mod status {
705-
// flags
706+
//flags
706707
pub const PUNCH_CAN_ZOOM: i32 = 0x1101; // flag for controlling the zoom opff so it only runs once on impact
708+
pub const SPECIAL_S_ABOVE_BLASTZONE: i32 = 0x1102;
707709
}
708710
}
709711

fighters/koopa/Cargo.toml

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ utils = { package = "dynamic", path = "../../dynamic" }
1010
skyline = "0.2.1"
1111
skyline_smash = { git = "https://github.com/blu-dev/skyline-smash", features = ["weak_l2cvalue"] }
1212
smash_script = { git = "https://github.com/blu-dev/smash-script", branch = "development" }
13-
smashline = { git = "https://github.com/HDR-Development/smashline" }
13+
smashline = { git = "https://github.com/HDR-Development/smashline" }
14+
interpolation = "0.2.0"

fighters/koopa/src/acmd/specials.rs

+276
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,253 @@ unsafe extern "C" fn koopa_special_n_max_expression(fighter: &mut L2CAgentBase)
134134
}
135135
}
136136

137+
unsafe extern "C" fn koopa_special_s_squat_effect(fighter: &mut L2CAgentBase) {
138+
if is_excute(fighter) {
139+
EFFECT_FOLLOW(fighter, Hash40::new("sys_catch"), Hash40::new("haver"), 0, 1, 2, 0, 0, 0, 0.8, false);
140+
}
141+
}
142+
143+
unsafe extern "C" fn koopa_special_s_throwlw_game(fighter: &mut L2CAgentBase) {
144+
if is_excute(fighter) {
145+
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);
146+
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);
147+
}
148+
frame(fighter.lua_state_agent, 18.0);
149+
if is_excute(fighter) {
150+
CHECK_FINISH_CAMERA(fighter, 23, 16);
151+
}
152+
wait(fighter.lua_state_agent, 1.0);
153+
if is_excute(fighter) {
154+
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_KOOPA_STATUS_SPECIAL_S_FLAG_HIT);
155+
}
156+
}
157+
158+
unsafe extern "C" fn koopa_special_s_throwlw_effect(fighter: &mut L2CAgentBase) {
159+
frame(fighter.lua_state_agent, 17.0);
160+
if is_excute(fighter) {
161+
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);
162+
}
163+
frame(fighter.lua_state_agent, 19.0);
164+
if is_excute(fighter) {
165+
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);
166+
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);
167+
LAST_EFFECT_SET_RATE(fighter,0.8);
168+
}
169+
}
170+
171+
unsafe extern "C" fn koopa_special_s_throwlw_sound(fighter: &mut L2CAgentBase) {
172+
frame(fighter.lua_state_agent, 4.0);
173+
if is_excute(fighter) {
174+
PLAY_SE(fighter, Hash40::new("se_common_throw_01"));
175+
}
176+
wait(fighter.lua_state_agent, 18.0);
177+
if is_excute(fighter) {
178+
PLAY_SE(fighter, Hash40::new("se_common_heavy_hit_m"));
179+
}
180+
}
181+
182+
unsafe extern "C" fn koopa_special_s_throwlw_expression(fighter: &mut L2CAgentBase) {
183+
if is_excute(fighter) {
184+
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE, *SLOPE_STATUS_LR);
185+
}
186+
frame(fighter.lua_state_agent, 19.0);
187+
if is_excute(fighter) {
188+
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_attackm"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
189+
QUAKE(fighter, *CAMERA_QUAKE_KIND_M);
190+
}
191+
}
192+
193+
unsafe extern "C" fn koopa_special_s_throwf_game(fighter: &mut L2CAgentBase) {
194+
if is_excute(fighter) {
195+
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);
196+
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);
197+
}
198+
frame(fighter.lua_state_agent, 18.0);
199+
if is_excute(fighter) {
200+
CHECK_FINISH_CAMERA(fighter, 23, 16);
201+
}
202+
wait(fighter.lua_state_agent, 1.0);
203+
if is_excute(fighter) {
204+
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_KOOPA_STATUS_SPECIAL_S_FLAG_HIT);
205+
}
206+
}
207+
208+
unsafe extern "C" fn koopa_special_s_throwf_effect(fighter: &mut L2CAgentBase) {
209+
frame(fighter.lua_state_agent, 17.0);
210+
if is_excute(fighter) {
211+
if StatusModule::situation_kind(fighter.module_accessor) == *SITUATION_KIND_GROUND {
212+
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);
213+
}
214+
}
215+
frame(fighter.lua_state_agent, 19.0);
216+
if is_excute(fighter) {
217+
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);
218+
}
219+
}
220+
221+
unsafe extern "C" fn koopa_special_s_throwf_sound(fighter: &mut L2CAgentBase) {
222+
frame(fighter.lua_state_agent, 4.0);
223+
if is_excute(fighter) {
224+
PLAY_SE(fighter, Hash40::new("se_common_throw_01"));
225+
}
226+
wait(fighter.lua_state_agent, 15.0);
227+
if is_excute(fighter) {
228+
PLAY_SE(fighter, Hash40::new("se_common_throw_02"));
229+
}
230+
}
231+
232+
unsafe extern "C" fn koopa_special_s_throwf_expression(fighter: &mut L2CAgentBase) {
233+
if is_excute(fighter) {
234+
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE, *SLOPE_STATUS_LR);
235+
}
236+
frame(fighter.lua_state_agent, 19.0);
237+
if is_excute(fighter) {
238+
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_attackm"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
239+
QUAKE(fighter, *CAMERA_QUAKE_KIND_S);
240+
}
241+
}
242+
243+
unsafe extern "C" fn koopa_special_s_throwb_game(fighter: &mut L2CAgentBase) {
244+
if is_excute(fighter) {
245+
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);
246+
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);
247+
}
248+
frame(fighter.lua_state_agent, 18.0);
249+
if is_excute(fighter) {
250+
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_REVERSE_LR_FINISH_CAMERA_THROW_ORBIT);
251+
CHECK_FINISH_CAMERA(fighter, 20, 15);
252+
}
253+
frame(fighter.lua_state_agent, 19.0);
254+
if is_excute(fighter) {
255+
REVERSE_LR(fighter);
256+
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_KOOPA_STATUS_SPECIAL_S_FLAG_HIT);
257+
}
258+
}
259+
260+
unsafe extern "C" fn koopa_special_s_throwb_effect(fighter: &mut L2CAgentBase) {
261+
frame(fighter.lua_state_agent, 19.0);
262+
if is_excute(fighter) {
263+
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);
264+
}
265+
frame(fighter.lua_state_agent, 22.0);
266+
if is_excute(fighter) {
267+
if StatusModule::situation_kind(fighter.module_accessor) == *SITUATION_KIND_GROUND {
268+
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);
269+
}
270+
}
271+
}
272+
273+
unsafe extern "C" fn koopa_special_s_throwb_sound(fighter: &mut L2CAgentBase) {
274+
frame(fighter.lua_state_agent, 4.0);
275+
if is_excute(fighter) {
276+
PLAY_SE(fighter, Hash40::new("se_common_throw_01"));
277+
}
278+
wait(fighter.lua_state_agent, 15.0);
279+
if is_excute(fighter) {
280+
PLAY_SE(fighter, Hash40::new("se_common_throw_02"));
281+
}
282+
}
283+
284+
unsafe extern "C" fn koopa_special_s_throwb_expression(fighter: &mut L2CAgentBase) {
285+
if is_excute(fighter) {
286+
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE, *SLOPE_STATUS_LR);
287+
}
288+
frame(fighter.lua_state_agent, 19.0);
289+
if is_excute(fighter) {
290+
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_attackm"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
291+
QUAKE(fighter, *CAMERA_QUAKE_KIND_S);
292+
}
293+
}
294+
295+
unsafe extern "C" fn koopa_special_s_jump_effect(fighter: &mut L2CAgentBase) {
296+
frame(fighter.lua_state_agent, 7.0);
297+
if is_excute(fighter) {
298+
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);
299+
}
300+
frame(fighter.lua_state_agent, 17.0);
301+
if is_excute(fighter) {
302+
EFFECT_FOLLOW(fighter, Hash40::new("koopa_drop_air"), Hash40::new("top"), 0, 9, 0, 0, 0, 0, 0.8, true);
303+
}
304+
}
305+
306+
unsafe extern "C" fn koopa_special_s_jump_sound(fighter: &mut L2CAgentBase) {
307+
frame(fighter.lua_state_agent, 1.0);
308+
if is_excute(fighter) {
309+
PLAY_SE(fighter, Hash40::new("se_koopa_special_s03"));
310+
}
311+
frame(fighter.lua_state_agent, 35.0);
312+
if is_excute(fighter) {
313+
PLAY_SE(fighter, Hash40::new("se_koopa_special_s04"));
314+
}
315+
}
316+
317+
unsafe extern "C" fn koopa_special_s_fall_effect(fighter: &mut L2CAgentBase) {
318+
if is_excute(fighter) {
319+
EFFECT_FOLLOW(fighter, Hash40::new("koopa_drop_air"), Hash40::new("top"), 0, 9, 0, 0, 0, 0, 0.8, true);
320+
}
321+
}
322+
323+
unsafe extern "C" fn koopa_special_s_landing_game(fighter: &mut L2CAgentBase) {
324+
if is_excute(fighter) {
325+
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);
326+
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);
327+
}
328+
frame(fighter.lua_state_agent, 1.0);
329+
if is_excute(fighter) {
330+
//CHECK_FINISH_CAMERA(fighter, 3, 9);
331+
//lua_bind::FighterCutInManager::set_throw_finish_zoom_rate(singletons::FighterCutInManager(), 1.3);
332+
//lua_bind::FighterCutInManager::set_throw_finish_offset(singletons::FighterCutInManager(), Vector3f{x: 0.0, y: -9.0, z: 0.0});
333+
}
334+
frame(fighter.lua_state_agent, 2.0);
335+
if is_excute(fighter) {
336+
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_KOOPA_STATUS_SPECIAL_S_FLAG_HIT);
337+
}
338+
frame(fighter.lua_state_agent, 10.0);
339+
FT_MOTION_RATE_RANGE(fighter,10.0,14.0,8.0);
340+
frame(fighter.lua_state_agent, 14.0);
341+
FT_MOTION_RATE_RANGE(fighter,14.0,26.0,16.0);
342+
frame(fighter.lua_state_agent, 26.0);
343+
FT_MOTION_RATE(fighter,1.0)
344+
}
345+
346+
unsafe extern "C" fn koopa_special_s_landing_effect(fighter: &mut L2CAgentBase) {
347+
if is_excute(fighter) {
348+
EFFECT(fighter, Hash40::new("sys_crown"), Hash40::new("top"), 0, 0, 0, 0, 0, 0, 1.25, 0, 0, 0, 0, 0, 0, false);
349+
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);
350+
}
351+
}
352+
353+
unsafe extern "C" fn koopa_special_s_landing_sound(fighter: &mut L2CAgentBase) {
354+
if is_excute(fighter) {
355+
STOP_SE(fighter, Hash40::new("se_koopa_special_s04"));
356+
PLAY_STATUS(fighter, Hash40::new("se_koopa_special_s05"));
357+
}
358+
frame(fighter.lua_state_agent, 17.0);
359+
if is_excute(fighter) {
360+
PLAY_STEP_FLIPPABLE(fighter, Hash40::new("se_koopa_step_left_m"), Hash40::new("se_koopa_step_right_m"));
361+
}
362+
frame(fighter.lua_state_agent, 26.0);
363+
if is_excute(fighter) {
364+
PLAY_STEP_FLIPPABLE(fighter, Hash40::new("se_koopa_step_right_m"), Hash40::new("se_koopa_step_left_m"));
365+
}
366+
}
367+
368+
unsafe extern "C" fn koopa_special_s_landing_expression(fighter: &mut L2CAgentBase) {
369+
if is_excute(fighter) {
370+
ItemModule::set_have_item_visibility(fighter.module_accessor, false, 0);
371+
QUAKE(fighter, *CAMERA_QUAKE_KIND_L);
372+
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_erase"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
373+
}
374+
frame(fighter.lua_state_agent, 3.0);
375+
if is_excute(fighter) {
376+
ControlModule::set_rumble(fighter.module_accessor, Hash40::new("rbkind_explosionm"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
377+
}
378+
frame(fighter.lua_state_agent, 23.0);
379+
if is_excute(fighter) {
380+
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE_INTP, *SLOPE_STATUS_LR, 6);
381+
}
382+
}
383+
137384
unsafe extern "C" fn koopa_special_hi_game(fighter: &mut L2CAgentBase) {
138385
let lua_state = fighter.lua_state_agent;
139386
let boma = fighter.boma();
@@ -336,6 +583,35 @@ pub fn install() {
336583
.acmd("sound_specialairnmax", koopa_special_n_max_sound)
337584
.acmd("expression_specialnmax", koopa_special_n_max_expression)
338585
.acmd("expression_specialairnmax", koopa_special_n_max_expression)
586+
.acmd("effect_specialssquat", koopa_special_s_squat_effect)
587+
.acmd("effect_specialairssquat", koopa_special_s_squat_effect)
588+
.acmd("game_specialsthrowlw", koopa_special_s_throwlw_game)
589+
.acmd("effect_specialsthrowlw", koopa_special_s_throwlw_effect)
590+
.acmd("sound_specialsthrowlw", koopa_special_s_throwlw_sound)
591+
.acmd("expression_specialsthrowlw", koopa_special_s_throwlw_expression)
592+
.acmd("game_specialsthrowf", koopa_special_s_throwf_game)
593+
.acmd("game_specialairsthrowf", koopa_special_s_throwf_game)
594+
.acmd("effect_specialsthrowf", koopa_special_s_throwf_effect)
595+
.acmd("effect_specialairsthrowf", koopa_special_s_throwf_effect)
596+
.acmd("sound_specialsthrowf", koopa_special_s_throwf_sound)
597+
.acmd("sound_specialairsthrowf", koopa_special_s_throwf_sound)
598+
.acmd("expression_specialsthrowf", koopa_special_s_throwf_expression)
599+
.acmd("expression_specialairsthrowf", koopa_special_s_throwf_expression)
600+
.acmd("game_specialsthrowb", koopa_special_s_throwb_game)
601+
.acmd("game_specialairsthrowb", koopa_special_s_throwb_game)
602+
.acmd("effect_specialsthrowb", koopa_special_s_throwb_effect)
603+
.acmd("effect_specialairsthrowb", koopa_special_s_throwb_effect)
604+
.acmd("sound_specialsthrowb", koopa_special_s_throwb_sound)
605+
.acmd("sound_specialairsthrowb", koopa_special_s_throwb_sound)
606+
.acmd("expression_specialsthrowb", koopa_special_s_throwb_expression)
607+
.acmd("expression_specialairsthrowb", koopa_special_s_throwb_expression)
608+
.acmd("effect_specialsjump", koopa_special_s_jump_effect)
609+
.acmd("sound_specialsjump", koopa_special_s_jump_sound)
610+
.acmd("effect_specialsfall", koopa_special_s_fall_effect)
611+
.acmd("game_specialslanding", koopa_special_s_landing_game)
612+
.acmd("effect_specialslanding", koopa_special_s_landing_effect)
613+
.acmd("sound_specialslanding", koopa_special_s_landing_sound)
614+
.acmd("expression_specialslanding", koopa_special_s_landing_expression)
339615
.acmd("game_specialhi", koopa_special_hi_game)
340616
.acmd("expression_specialhi", koopa_special_hi_expression)
341617
.acmd("game_specialairhi", koopa_special_air_hi_game)

0 commit comments

Comments
 (0)