Skip to content

Commit 9ce0767

Browse files
authored
Merge pull request #2154 from HDR-Development/small-fixes
Various Fixes
2 parents 0ad9880 + 0fc82e7 commit 9ce0767

File tree

14 files changed

+81
-34
lines changed

14 files changed

+81
-34
lines changed

dynamic/src/consts.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ pub mod vars {
521521
pub mod eflame {
522522
pub mod instance {
523523
// flags
524-
pub const DISABLE_SPECIAL_HI: i32 = 0x0100;
524+
pub const DISABLE_SPECIAL_HI: i32 = 0x0104;
525525
}
526526
}
527527

dynamic/src/ext.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1187,7 +1187,7 @@ impl BomaExt for BattleObjectModuleAccessor {
11871187
crate::consts::vars::common::instance::HITFALL_BUFFER,
11881188
);
11891189

1190-
if self.is_cat_flag(Cat2::FallJump) && 0 < buffer && buffer <= 5 {
1190+
if self.is_cat_flag(Cat2::FallJump) && self.stick_y() < 0.0 && 0 < buffer && buffer <= 5 {
11911191
WorkModule::on_flag(self, *FIGHTER_STATUS_WORK_ID_FLAG_RESERVE_DIVE);
11921192
}
11931193
}

fighters/buddy/src/status.rs

+12-11
Original file line numberDiff line numberDiff line change
@@ -62,24 +62,25 @@ pub unsafe fn buddy_special_s_pre(fighter: &mut L2CFighterCommon) -> L2CValue{
6262

6363
#[status_script(agent = "buddy", status = FIGHTER_STATUS_KIND_SPECIAL_S, condition = LUA_SCRIPT_STATUS_FUNC_STATUS_MAIN)]
6464
unsafe fn buddy_special_s_main(fighter: &mut L2CFighterCommon) -> L2CValue {
65+
let feathers_g = WorkModule::get_int(fighter.module_accessor,*FIGHTER_BUDDY_INSTANCE_WORK_ID_INT_SPECIAL_S_REMAIN);
6566
//Bypass if transitioning into Air Fail
66-
if (VarModule::get_float(fighter.battle_object, vars::buddy::instance::FEATHERS_RED_COOLDOWN)>0.0)
67-
&& fighter.is_situation(*SITUATION_KIND_AIR)
68-
{
69-
return 1.into();
67+
if fighter.is_situation(*SITUATION_KIND_AIR) {
68+
if VarModule::get_float(fighter.battle_object, vars::buddy::instance::FEATHERS_RED_COOLDOWN) > 0.0 {
69+
return 1.into();
70+
}
7071
}
7172
else {
7273
fighter.sub_set_special_start_common_kinetic_setting(hash40("param_special_s").into());
73-
let feathers_g = WorkModule::get_int(fighter.module_accessor,*FIGHTER_BUDDY_INSTANCE_WORK_ID_INT_SPECIAL_S_REMAIN);
74-
if feathers_g < 0 && fighter.is_situation(*SITUATION_KIND_GROUND) {
74+
if feathers_g <= 0 {
7575
WorkModule::on_flag(fighter.module_accessor, *FIGHTER_BUDDY_STATUS_SPECIAL_S_FLAG_FAIL);
76+
fighter.change_status(FIGHTER_BUDDY_STATUS_KIND_SPECIAL_S_FAIL.into(), false.into());
7677
}
77-
fighter.sub_change_motion_by_situation(Hash40::new("special_s").into(), Hash40::new("special_air_s").into(), false.into());
78-
fighter.sub_set_ground_correct_by_situation(false.into());
79-
WorkModule::off_flag(fighter.module_accessor, *FIGHTER_BUDDY_STATUS_SPECIAL_S_FLAG_SUPER_ARMOR);
80-
WorkModule::off_flag(fighter.module_accessor, *FIGHTER_BUDDY_STATUS_SPECIAL_S_FLAG_SUPER_ARMOR_EQUIP);
81-
fighter.sub_shift_status_main(L2CValue::Ptr(buddy_special_s_main_loop as *const () as _))
8278
}
79+
fighter.sub_change_motion_by_situation(Hash40::new("special_s").into(), Hash40::new("special_air_s").into(), false.into());
80+
fighter.sub_set_ground_correct_by_situation(false.into());
81+
WorkModule::off_flag(fighter.module_accessor, *FIGHTER_BUDDY_STATUS_SPECIAL_S_FLAG_SUPER_ARMOR);
82+
WorkModule::off_flag(fighter.module_accessor, *FIGHTER_BUDDY_STATUS_SPECIAL_S_FLAG_SUPER_ARMOR_EQUIP);
83+
fighter.sub_shift_status_main(L2CValue::Ptr(buddy_special_s_main_loop as *const () as _))
8384

8485
}
8586

fighters/krool/src/acmd/specials.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -309,8 +309,11 @@ unsafe fn krool_backpack_start_effect(fighter: &mut L2CAgentBase) {
309309
unsafe fn krool_backpack_fly_game(fighter: &mut L2CAgentBase) {
310310
let lua_state = fighter.lua_state_agent;
311311
let boma = fighter.boma();
312+
let owner_boma = &mut *sv_battle_object::module_accessor((WorkModule::get_int(boma, *WEAPON_INSTANCE_WORK_ID_INT_LINK_OWNER)) as u32);
313+
let krool = utils::util::get_battle_object_from_accessor(owner_boma);
314+
let damage = 3.0 + (VarModule::get_int(krool, vars::krool::instance::SPECIAL_HI_FUEL) as f32 * 0.158).clamp(0.0, 6.0);
312315
if is_excute(fighter) {
313-
ATTACK(fighter, 0, 0, Hash40::new("wingl1"), 3.0, 80, 30, 0, 90, 4.5, 2.0, 0.0, 0.0, Some(-2.0), Some(0.0), Some(0.0), 1.0, 1.2, *ATTACK_SETOFF_KIND_OFF, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 15, 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_S, *COLLISION_SOUND_ATTR_CUTUP, *ATTACK_REGION_OBJECT);
316+
ATTACK(fighter, 0, 0, Hash40::new("wingl1"), damage, 80, 30, 0, 90, 4.5, 2.0, 0.0, 0.0, Some(-2.0), Some(0.0), Some(0.0), 1.0, 1.2, *ATTACK_SETOFF_KIND_OFF, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 15, 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_S, *COLLISION_SOUND_ATTR_CUTUP, *ATTACK_REGION_OBJECT);
314317
}
315318
}
316319

fighters/krool/src/status/special_hi.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -266,10 +266,10 @@ unsafe extern "C" fn special_hi_set_physics(fighter: &mut L2CFighterCommon) {
266266
let fly_charge_min_spd_y = ParamModule::get_float(fighter.battle_object, ParamType::Agent, "param_special_hi.fly_charge_min_spd_y");
267267
let fly_charge_y_mul = ParamModule::get_float(fighter.battle_object, ParamType::Agent, "param_special_hi.fly_charge_y_mul");
268268

269-
// accounts for 50 max charge frames
269+
// accounts for 50 max charge frames (this ended up being 38 in practice, oops)
270270
let calc_charge_x = (fly_charge_min_spd_x + (charge_frames * fly_charge_x_mul)) * PostureModule::lr(fighter.module_accessor);
271271
let calc_charge_y = fly_charge_min_spd_y + (charge_frames * fly_charge_y_mul);
272-
// max x: 0.7, max y: 3.0
272+
// max x: 0.97, max y: 3.0
273273

274274
KineticUtility::clear_unable_energy(*FIGHTER_KINETIC_ENERGY_ID_MOTION, fighter.module_accessor);
275275
sv_kinetic_energy!(reset_energy, fighter, ENERGY_GRAVITY_RESET_TYPE_GRAVITY, 0.0, 0.0, 0.0, 0.0, 0.0);

fighters/littlemac/src/opff.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ unsafe fn tech_roll_help(boma: &mut BattleObjectModuleAccessor, motion_kind: u64
3636
}
3737

3838
unsafe fn nspecial_cancels(fighter: &mut smash::lua2cpp::L2CFighterCommon, boma: &mut BattleObjectModuleAccessor, status_kind: i32, situation_kind: i32, cat1: i32, frame: f32) {
39-
if status_kind == *FIGHTER_LITTLEMAC_STATUS_KIND_SPECIAL_N_START {
39+
if status_kind == *FIGHTER_LITTLEMAC_STATUS_KIND_SPECIAL_N_START
40+
&& frame >= 8.0 {
4041
if fighter.is_situation(*SITUATION_KIND_GROUND) {
4142
if fighter.is_cat_flag(Cat2::StickEscape) {
4243
VarModule::set_int(fighter.battle_object, vars::littlemac::status::SPECIAL_N_CANCEL_TYPE, vars::littlemac::SPECIAL_N_CANCEL_TYPE_ESCAPE);

fighters/miifighter/src/acmd/specials.rs

+7-5
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,8 @@ unsafe fn miifighter_special_lw3_throw_game(fighter: &mut L2CAgentBase) {
10631063
if is_excute(fighter) {
10641064
AttackModule::clear_all(boma);
10651065
FT_CATCH_STOP(fighter, 5, 1);
1066-
CHECK_FINISH_CAMERA(fighter, 14, 0);
1067-
lua_bind::FighterCutInManager::set_throw_finish_zoom_rate(singletons::FighterCutInManager(), 1.3);
1066+
//CHECK_FINISH_CAMERA(fighter, 14, 0);
1067+
//lua_bind::FighterCutInManager::set_throw_finish_zoom_rate(singletons::FighterCutInManager(), 1.3);
10681068
}
10691069
frame(lua_state, 14.0);
10701070
FT_MOTION_RATE(fighter, 0.5);
@@ -1073,7 +1073,9 @@ unsafe fn miifighter_special_lw3_throw_game(fighter: &mut L2CAgentBase) {
10731073
let target_group = WorkModule::get_int64(boma, *FIGHTER_STATUS_THROW_WORK_INT_TARGET_HIT_GROUP);
10741074
let target_no = WorkModule::get_int64(boma, *FIGHTER_STATUS_THROW_WORK_INT_TARGET_HIT_NO);
10751075
let opponent_boma = fighter.get_grabbed_opponent_boma();
1076-
VarModule::on_flag(opponent_boma.object(), vars::common::instance::IS_KNOCKDOWN_THROW);
1076+
if opponent_boma.is_fighter() {
1077+
VarModule::on_flag(opponent_boma.object(), vars::common::instance::IS_KNOCKDOWN_THROW);
1078+
}
10771079
ATK_HIT_ABS(fighter, *FIGHTER_ATTACK_ABSOLUTE_KIND_THROW, Hash40::new("throw"), target, target_group, target_no);
10781080
WHOLE_HIT(fighter, *HIT_STATUS_NORMAL);
10791081
}
@@ -1102,8 +1104,8 @@ unsafe fn miifighter_special_air_lw3_throw_game(fighter: &mut L2CAgentBase) {
11021104
if is_excute(fighter) {
11031105
AttackModule::clear_all(boma);
11041106
FT_CATCH_STOP(fighter, 5, 1);
1105-
CHECK_FINISH_CAMERA(fighter, 14, 0);
1106-
lua_bind::FighterCutInManager::set_throw_finish_zoom_rate(singletons::FighterCutInManager(), 1.3);
1107+
//CHECK_FINISH_CAMERA(fighter, 14, 0);
1108+
//lua_bind::FighterCutInManager::set_throw_finish_zoom_rate(singletons::FighterCutInManager(), 1.3);
11071109
}
11081110
frame(lua_state, 13.0);
11091111
if is_excute(fighter) {

fighters/richter/src/opff.rs

+22-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,25 @@ utils::import_noreturn!(common::opff::fighter_common_opff);
33
use super::*;
44
use globals::*;
55

6+
// allow fair and bair to transition into their angled variants when the stick is angled up/down
7+
unsafe fn whip_angling(fighter: &mut L2CFighterCommon, boma: &mut BattleObjectModuleAccessor, frame: f32, stick_y: f32) {
8+
if fighter.is_motion_one_of(&[Hash40::new("attack_air_f"), Hash40::new("attack_air_f_hi"), Hash40::new("attack_air_f_lw")])
9+
&& (11.0..12.0).contains(&frame) {
10+
if stick_y > 0.5 { // stick is held up
11+
MotionModule::change_motion_inherit_frame(boma, Hash40::new("attack_air_f_hi"), -1.0, 1.0, 0.0, false, false);
12+
} else if stick_y < -0.5 { // stick is held down
13+
MotionModule::change_motion_inherit_frame(boma, Hash40::new("attack_air_f_lw"), -1.0, 1.0, 0.0, false, false);
14+
}
15+
}
16+
else if fighter.is_motion_one_of(&[Hash40::new("attack_air_b"), Hash40::new("attack_air_b_hi"), Hash40::new("attack_air_b_lw")])
17+
&& (11.0..12.0).contains(&frame) {
18+
if stick_y > 0.5 { // stick is held up
19+
MotionModule::change_motion_inherit_frame(boma, Hash40::new("attack_air_b_hi"), -1.0, 1.0, 0.0, false, false);
20+
} else if stick_y < -0.5 { // stick is held down
21+
MotionModule::change_motion_inherit_frame(boma, Hash40::new("attack_air_b_lw"), -1.0, 1.0, 0.0, false, false);
22+
}
23+
}
24+
}
625

726
unsafe fn fastfall_specials(fighter: &mut L2CFighterCommon) {
827
if !fighter.is_in_hitlag()
@@ -36,7 +55,8 @@ unsafe fn fastfall_specials(fighter: &mut L2CFighterCommon) {
3655
}
3756
}
3857

39-
pub unsafe fn moveset(fighter: &mut L2CFighterCommon) {
58+
pub unsafe fn moveset(fighter: &mut L2CFighterCommon, boma: &mut BattleObjectModuleAccessor, id: usize, cat: [i32 ; 4], status_kind: i32, situation_kind: i32, motion_kind: u64, stick_x: f32, stick_y: f32, facing: f32, frame: f32) {
59+
whip_angling(fighter, boma, frame, stick_y);
4060
fastfall_specials(fighter);
4161
}
4262

@@ -50,6 +70,6 @@ pub fn richter_frame_wrapper(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
5070

5171
pub unsafe fn richter_frame(fighter: &mut smash::lua2cpp::L2CFighterCommon) {
5272
if let Some(info) = FrameInfo::update_and_get(fighter) {
53-
moveset(fighter);
73+
moveset(fighter, &mut *info.boma, info.id, info.cat, info.status_kind, info.situation_kind, info.motion_kind.hash, info.stick_x, info.stick_y, info.facing, info.frame);
5474
}
5575
}

fighters/richter/src/status/attacks3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ unsafe extern "C" fn attack_s3_main_loop(fighter: &mut L2CFighterCommon) -> L2CV
3131

3232
// <HDR>
3333
if StatusModule::is_changing(fighter.module_accessor)
34-
&& [*FIGHTER_STATUS_KIND_SQUAT_WAIT, *FIGHTER_STATUS_KIND_SQUAT_RV].contains(&fighter.global_table[PREV_STATUS_KIND].get_i32()) {
34+
&& fighter.stick_y() <= -0.5 {
3535
WorkModule::unable_transition_term_group_ex(fighter.module_accessor, *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_SQUAT);
3636
MotionModule::change_motion(fighter.module_accessor, Hash40::new("attack_squat_s3"), 0.0, 1.0, false, 0.0, false, false);
3737
}

fighters/simon/src/opff.rs

+21
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,26 @@ unsafe fn cross_land_cancel(fighter: &mut L2CFighterCommon, boma: &mut BattleObj
4949
}
5050
}
5151

52+
// allow fair and bair to transition into their angled variants when the stick is angled up/down
53+
unsafe fn whip_angling(fighter: &mut L2CFighterCommon, boma: &mut BattleObjectModuleAccessor, frame: f32, stick_y: f32) {
54+
if fighter.is_motion_one_of(&[Hash40::new("attack_air_f"), Hash40::new("attack_air_f_hi"), Hash40::new("attack_air_f_lw")])
55+
&& (11.0..12.0).contains(&frame) {
56+
if stick_y > 0.5 { // stick is held up
57+
MotionModule::change_motion_inherit_frame(boma, Hash40::new("attack_air_f_hi"), -1.0, 1.0, 0.0, false, false);
58+
} else if stick_y < -0.5 { // stick is held down
59+
MotionModule::change_motion_inherit_frame(boma, Hash40::new("attack_air_f_lw"), -1.0, 1.0, 0.0, false, false);
60+
}
61+
}
62+
else if fighter.is_motion_one_of(&[Hash40::new("attack_air_b"), Hash40::new("attack_air_b_hi"), Hash40::new("attack_air_b_lw")])
63+
&& (11.0..12.0).contains(&frame) {
64+
if stick_y > 0.5 { // stick is held up
65+
MotionModule::change_motion_inherit_frame(boma, Hash40::new("attack_air_b_hi"), -1.0, 1.0, 0.0, false, false);
66+
} else if stick_y < -0.5 { // stick is held down
67+
MotionModule::change_motion_inherit_frame(boma, Hash40::new("attack_air_b_lw"), -1.0, 1.0, 0.0, false, false);
68+
}
69+
}
70+
}
71+
5272
unsafe fn fastfall_specials(fighter: &mut L2CFighterCommon) {
5373
if !fighter.is_in_hitlag()
5474
&& !StatusModule::is_changing(fighter.module_accessor)
@@ -82,6 +102,7 @@ pub unsafe fn moveset(fighter: &mut L2CFighterCommon, boma: &mut BattleObjectMod
82102
holy_water_ac(fighter, boma, id, status_kind, situation_kind, cat[0], frame);
83103
axe_drift(boma, status_kind, situation_kind, cat[1], stick_y);
84104
cross_land_cancel(fighter, boma, cat[2], stick_y);
105+
whip_angling(fighter, boma, frame, stick_y);
85106
fastfall_specials(fighter);
86107
}
87108

fighters/simon/src/status/attacks3.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ unsafe extern "C" fn attack_s3_main_loop(fighter: &mut L2CFighterCommon) -> L2CV
3131

3232
// <HDR>
3333
if StatusModule::is_changing(fighter.module_accessor)
34-
&& [*FIGHTER_STATUS_KIND_SQUAT_WAIT, *FIGHTER_STATUS_KIND_SQUAT_RV].contains(&fighter.global_table[PREV_STATUS_KIND].get_i32()) {
34+
&& fighter.stick_y() <= -0.5 {
3535
WorkModule::unable_transition_term_group_ex(fighter.module_accessor, *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_SQUAT);
3636
MotionModule::change_motion(fighter.module_accessor, Hash40::new("attack_squat_s3"), 0.0, 1.0, false, 0.0, false, false);
3737
}

fighters/zelda/src/opff.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@ unsafe fn teleport_tech(fighter: &mut smash::lua2cpp::L2CFighterCommon, boma: &m
77
if boma.is_status(*FIGHTER_ZELDA_STATUS_KIND_SPECIAL_HI_2) {
88
if compare_mask(ControlModule::get_pad_flag(boma), *FIGHTER_PAD_FLAG_SPECIAL_TRIGGER) {
99
VarModule::on_flag(fighter.battle_object, vars::common::instance::IS_HEAVY_ATTACK);
10-
ControlModule::reset_trigger(boma);
11-
ControlModule::clear_command_one(boma, *FIGHTER_PAD_COMMAND_CATEGORY1, *FIGHTER_PAD_CMD_CAT1_FLAG_SPECIAL_ANY);
12-
boma.change_status_req(*FIGHTER_ZELDA_STATUS_KIND_SPECIAL_HI_3, true);
10+
fighter.change_status(FIGHTER_ZELDA_STATUS_KIND_SPECIAL_HI_3.into(), true.into());
11+
return;
1312
}
1413
}
1514

romfs/source/fighter/krool/param/hdr.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
<float hash="start_limit_spd_x">1.3</float>
1919
<float hash="start_stable_spd_y">0.1</float>
2020
<float hash="fly_charge_min_spd_x">0.4</float>
21-
<float hash="fly_charge_x_mul">0.007</float>
21+
<float hash="fly_charge_x_mul">0.014</float>
2222
<float hash="fly_limit_spd_x">1.0</float>
2323
<float hash="fly_charge_min_spd_y">2.5</float>
24-
<float hash="fly_charge_y_mul">0.01</float>
24+
<float hash="fly_charge_y_mul">0.0132</float>
2525
<float hash="fly_lean_min_spd_x">0.3</float>
2626
<float hash="fly_lean_min_acl_x">0.01</float>
27-
<float hash="fly_lean_charge_x_mul">0.007</float>
27+
<float hash="fly_lean_charge_x_mul">0.014</float>
2828
<float hash="fly_lean_spd_y">0.0025</float>
2929
<float hash="fly_no_lean_spd_y">0.055</float>
3030
<float hash="fly_lean_f_spd_y">0.08</float>

romfs/source/fighter/krool/param/vl.prcxml

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<float hash="p2_x">-16</float>
77
</struct>
88
<struct index="1">
9-
<float hash="p1_y">25</float>
9+
<float hash="p1_y">28</float>
1010
<float hash="p2_x">-16</float>
1111
</struct>
1212
</list>
@@ -68,7 +68,7 @@
6868
<float hash="special_hi_fall_max_spd_x">1.0</float>
6969
<float hash="special_hi_fall_acl_y">0.07</float>
7070
<float hash="special_hi_fall_max_spd_y">2.3</float>
71-
<int hash="special_hi_landing_frame">28</int>
71+
<int hash="special_hi_landing_frame">26</int>
7272
</struct>
7373
<hash40 index="1">dummy</hash40>
7474
<hash40 index="2">dummy</hash40>

0 commit comments

Comments
 (0)