Skip to content

Commit 13888e4

Browse files
authored
Merge pull request #2299 from robertyur/Belmont-changes
Richter Rework
2 parents a283489 + a5e0d5a commit 13888e4

File tree

24 files changed

+3153
-479
lines changed

24 files changed

+3153
-479
lines changed

dynamic/src/consts.rs

+8
Original file line numberDiff line numberDiff line change
@@ -975,6 +975,14 @@ pub mod vars {
975975
}
976976
}
977977

978+
pub mod richter {
979+
pub mod instance {
980+
// flags
981+
pub const UP_SPECIAL_FREEFALL: i32 = 0x0100;
982+
pub const SPECIAL_N_LAND_CANCEL: i32 = 0x0101;
983+
}
984+
}
985+
978986
pub mod rockman {
979987
pub mod instance {
980988
// flags

fighters/common/src/function_hooks/change_status.rs

+6
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,12 @@ unsafe fn change_status_request_from_script_hook(boma: &mut BattleObjectModuleAc
136136
&& !VarModule::is_flag(boma.object(), vars::reflet::instance::UP_SPECIAL_FREEFALL) {
137137
next_status = *FIGHTER_STATUS_KIND_FALL;
138138
}
139+
else if boma.kind() == *FIGHTER_KIND_RICHTER
140+
&& StatusModule::status_kind(boma) == *FIGHTER_STATUS_KIND_SPECIAL_HI
141+
&& next_status == *FIGHTER_STATUS_KIND_FALL_SPECIAL
142+
&& !VarModule::is_flag(boma.object(), vars::richter::instance::UP_SPECIAL_FREEFALL) {
143+
next_status = *FIGHTER_STATUS_KIND_FALL;
144+
}
139145
else if boma.kind() == *FIGHTER_KIND_MEWTWO
140146
&& StatusModule::status_kind(boma) == *FIGHTER_MEWTWO_STATUS_KIND_SPECIAL_HI_3
141147
&& next_status == *FIGHTER_STATUS_KIND_FALL_SPECIAL

fighters/common/src/opff/gentleman.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ unsafe fn gentleman(boma: &mut BattleObjectModuleAccessor, status_kind: i32, fig
1414
let mut jab_finisher_start = 1.0; // Start of window for rapid jab finisher transition, determined by character
1515
let mut jab_finisher_end = 1.0; // End of window for rapid jab finisher transition, determined by character
1616

17-
if [*FIGHTER_KIND_KIRBY, *FIGHTER_KIND_FOX, *FIGHTER_KIND_SHEIK, *FIGHTER_KIND_FALCO, *FIGHTER_KIND_MURABITO, *FIGHTER_KIND_KOOPAJR, *FIGHTER_KIND_SIMON, *FIGHTER_KIND_RICHTER, *FIGHTER_KIND_MIIFIGHTER].contains(&fighter_kind) {
17+
if [*FIGHTER_KIND_KIRBY, *FIGHTER_KIND_FOX, *FIGHTER_KIND_SHEIK, *FIGHTER_KIND_FALCO, *FIGHTER_KIND_MURABITO, *FIGHTER_KIND_KOOPAJR, *FIGHTER_KIND_SIMON, *FIGHTER_KIND_MIIFIGHTER].contains(&fighter_kind) {
1818
jab_finisher_start = 6.0;
1919
jab_finisher_end = 14.0;
2020
} else if fighter_kind == *FIGHTER_KIND_ZELDA {
@@ -48,7 +48,7 @@ unsafe fn gentleman(boma: &mut BattleObjectModuleAccessor, status_kind: i32, fig
4848
}
4949
}
5050
}
51-
} else if [*FIGHTER_KIND_KIRBY, *FIGHTER_KIND_FOX, *FIGHTER_KIND_SHEIK, *FIGHTER_KIND_FALCO, *FIGHTER_KIND_KOOPAJR, *FIGHTER_KIND_SIMON, *FIGHTER_KIND_RICHTER, *FIGHTER_KIND_MIIFIGHTER, *FIGHTER_KIND_DEDEDE, *FIGHTER_KIND_PFUSHIGISOU, *FIGHTER_KIND_MURABITO].contains(&fighter_kind) {
51+
} else if [*FIGHTER_KIND_KIRBY, *FIGHTER_KIND_FOX, *FIGHTER_KIND_SHEIK, *FIGHTER_KIND_FALCO, *FIGHTER_KIND_KOOPAJR, *FIGHTER_KIND_SIMON, *FIGHTER_KIND_MIIFIGHTER, *FIGHTER_KIND_DEDEDE, *FIGHTER_KIND_PFUSHIGISOU, *FIGHTER_KIND_MURABITO].contains(&fighter_kind) {
5252
if MotionModule::motion_kind(boma) == hash40("attack_12") {
5353
if MotionModule::frame(boma) > jab_finisher_start && MotionModule::frame(boma) < jab_finisher_end {
5454
if boma.is_pad_flag(PadFlag::SpecialTrigger) {

fighters/kirby/src/acmd/copyspecials.rs

+94
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,94 @@ unsafe extern "C" fn palutena_special_n_expression(agent: &mut L2CAgentBase) {
13281328
}
13291329
}
13301330

1331+
unsafe extern "C" fn richter_special_n_effect(agent: &mut L2CAgentBase) {
1332+
let lua_state = agent.lua_state_agent;
1333+
let boma = agent.boma();
1334+
frame(lua_state, 1.0);
1335+
if is_excute(agent) {
1336+
EFFECT_FOLLOW(agent, Hash40::new("richter_bottle_appear"), Hash40::new("haver"), 0, 0, 0, 0, 0, 0, 0.4, true);
1337+
}
1338+
frame(lua_state, 10.0);
1339+
if is_excute(agent) {
1340+
LANDING_EFFECT(agent, Hash40::new("sys_action_smoke_h"), Hash40::new("top"), 5, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, false);
1341+
}
1342+
frame(lua_state, 14.0);
1343+
if is_excute(agent) {
1344+
EFFECT(agent, Hash40::new("sys_sp_flash"), Hash40::new("haver"), 0, 0, 0, 0, 0, 0, 0.4, 0, 0, 0, 0, 0, 0, false);
1345+
LAST_EFFECT_SET_COLOR(agent, 1.0, 1.0, 0.5);
1346+
LAST_EFFECT_SET_RATE(agent, 0.6);
1347+
}
1348+
frame(lua_state, 21.0);
1349+
if is_excute(agent) {
1350+
EFFECT_OFF_KIND(agent, Hash40::new("sys_sp_flash"), false, true);
1351+
}
1352+
}
1353+
1354+
unsafe extern "C" fn richter_special_n_sound(agent: &mut L2CAgentBase) {
1355+
let lua_state = agent.lua_state_agent;
1356+
let boma = agent.boma();
1357+
frame(lua_state, 13.0);
1358+
if is_excute(agent) {
1359+
PLAY_SE(agent, Hash40::new("se_richter_special_l01"));
1360+
PLAY_SE(agent, Hash40::new("vc_kirby_copy_richter_01"));
1361+
}
1362+
}
1363+
1364+
unsafe extern "C" fn richter_special_n_expression(agent: &mut L2CAgentBase) {
1365+
let lua_state = agent.lua_state_agent;
1366+
let boma = agent.boma();
1367+
if is_excute(agent) {
1368+
ItemModule::set_have_item_visibility(boma, false, 0);
1369+
slope!(agent, *MA_MSC_CMD_SLOPE_SLOPE, *SLOPE_STATUS_LR);
1370+
}
1371+
frame(lua_state, 14.0);
1372+
if is_excute(agent) {
1373+
ControlModule::set_rumble(boma, Hash40::new("rbkind_lightthrow4item"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
1374+
}
1375+
}
1376+
1377+
unsafe extern "C" fn richter_special_air_n_effect(agent: &mut L2CAgentBase) {
1378+
let lua_state = agent.lua_state_agent;
1379+
let boma = agent.boma();
1380+
frame(lua_state, 1.0);
1381+
if is_excute(agent) {
1382+
EFFECT_FOLLOW(agent, Hash40::new("richter_bottle_appear"), Hash40::new("haver"), 0, 0, 0, 0, 0, 0, 0.4, true);
1383+
}
1384+
frame(lua_state, 14.0);
1385+
if is_excute(agent) {
1386+
EFFECT(agent, Hash40::new("sys_sp_flash"), Hash40::new("haver"), 0, 0, 0, 0, 0, 0, 0.4, 0, 0, 0, 0, 0, 0, false);
1387+
LAST_EFFECT_SET_COLOR(agent, 1.0, 1.0, 0.5);
1388+
LAST_EFFECT_SET_RATE(agent, 0.6);
1389+
}
1390+
frame(lua_state, 21.0);
1391+
if is_excute(agent) {
1392+
EFFECT_OFF_KIND(agent, Hash40::new("sys_sp_flash"), false, true);
1393+
}
1394+
}
1395+
1396+
unsafe extern "C" fn richter_special_air_n_sound(agent: &mut L2CAgentBase) {
1397+
let lua_state = agent.lua_state_agent;
1398+
let boma = agent.boma();
1399+
frame(lua_state, 13.0);
1400+
if is_excute(agent) {
1401+
PLAY_SE(agent, Hash40::new("se_richter_special_l01"));
1402+
PLAY_SE(agent, Hash40::new("vc_kirby_copy_richter_01"));
1403+
}
1404+
}
1405+
1406+
unsafe extern "C" fn richter_special_air_n_expression(agent: &mut L2CAgentBase) {
1407+
let lua_state = agent.lua_state_agent;
1408+
let boma = agent.boma();
1409+
if is_excute(agent) {
1410+
ItemModule::set_have_item_visibility(boma, false, 0);
1411+
slope!(agent, *MA_MSC_CMD_SLOPE_SLOPE, *SLOPE_STATUS_LR);
1412+
}
1413+
frame(lua_state, 14.0);
1414+
if is_excute(agent) {
1415+
ControlModule::set_rumble(boma, Hash40::new("rbkind_lightthrow4item"), 0, false, *BATTLE_OBJECT_ID_INVALID as u32);
1416+
}
1417+
}
1418+
13311419
unsafe extern "C" fn ridley_special_n_explode_game(fighter: &mut L2CAgentBase) {
13321420
let lua_state = fighter.lua_state_agent;
13331421
let boma = fighter.boma();
@@ -1774,6 +1862,12 @@ pub fn install() {
17741862
"expression_palutenaspecialairn",
17751863
palutena_special_n_expression,
17761864
)
1865+
.acmd("effect_richterspecialn", richter_special_n_effect)
1866+
.acmd("sound_richterspecialn", richter_special_n_sound)
1867+
.acmd("expression_richterspecialn", richter_special_n_expression)
1868+
.acmd("effect_richterspecialairn", richter_special_air_n_effect)
1869+
.acmd("sound_richterspecialairn", richter_special_air_n_sound)
1870+
.acmd("expression_richterspecialairn", richter_special_air_n_expression)
17771871
.acmd("game_ridleyspecialnexplode", ridley_special_n_explode_game)
17781872
.acmd(
17791873
"effect_ridleyspecialnexplode",

fighters/kirby/src/opff.rs

+14
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,17 @@ unsafe fn axe_drift(boma: &mut BattleObjectModuleAccessor, status_kind: i32, sit
704704
}
705705
}
706706

707+
// Richter's Knife Drift
708+
unsafe fn knife_drift(boma: &mut BattleObjectModuleAccessor, status_kind: i32, situation_kind: i32, cat2: i32, stick_y: f32) {
709+
if status_kind == *FIGHTER_KIRBY_STATUS_KIND_RICHTER_SPECIAL_N {
710+
if situation_kind == *SITUATION_KIND_AIR {
711+
if KineticModule::get_kinetic_type(boma) != *FIGHTER_KINETIC_TYPE_FALL {
712+
KineticModule::change_kinetic(boma, *FIGHTER_KINETIC_TYPE_FALL);
713+
}
714+
}
715+
}
716+
}
717+
707718
// Toon Link's Bow Drift
708719
unsafe fn heros_bow_drift(boma: &mut BattleObjectModuleAccessor, status_kind: i32, situation_kind: i32, cat2: i32, stick_y: f32) {
709720
if status_kind == *FIGHTER_KIRBY_STATUS_KIND_TOONLINK_SPECIAL_N {
@@ -1245,6 +1256,9 @@ pub unsafe fn moveset(fighter: &mut L2CFighterCommon, boma: &mut BattleObjectMod
12451256
// Simon's Axe Drift
12461257
axe_drift(boma, status_kind, situation_kind, cat[1], stick_y);
12471258

1259+
// Richter's Knife Drift
1260+
knife_drift(boma, status_kind, situation_kind, cat[1], stick_y);
1261+
12481262
// Toon Link's Bow Drift
12491263
heros_bow_drift(boma, status_kind, situation_kind, cat[1], stick_y);
12501264

0 commit comments

Comments
 (0)