Skip to content

Commit 6ed9d33

Browse files
authored
Merge branch 'HDR-Development:dev' into PMRoyProject
2 parents b421f34 + f503797 commit 6ed9d33

File tree

24 files changed

+224
-158
lines changed

24 files changed

+224
-158
lines changed

dynamic/src/consts.rs

+1
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,7 @@ pub mod vars {
910910
pub mod instance {
911911
// flags
912912
pub const SPECIAL_HI_CANCEL_ESCAPE_AIR: i32 = 0x0100;
913+
pub const SPECIAL_S_PIKMIN_DETONATE_IS_DETACH_FOR_DETONATE: i32 = 0x0101;
913914
}
914915
pub mod status {
915916
// flags

fighters/common/src/function_hooks/attack.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ unsafe fn get_damage_frame_mul(ctx: &mut skyline::hooks::InlineCtx) {
6363
}
6464
}
6565

66-
#[skyline::hook(offset = 0x406bd4, inline)]
66+
#[skyline::hook(offset = 0x406bf4, inline)]
6767
unsafe fn get_hitstop_frame_add(ctx: &mut skyline::hooks::InlineCtx) {
6868
match utils::game_modes::get_custom_mode() {
6969
Some(modes) => {

fighters/common/src/function_hooks/fighterspecializer/jack.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use super::*;
33
#[skyline::from_offset(0xb2f820)]
44
extern "C" fn jack_customizer(module_accessor: *mut BattleObjectModuleAccessor, customize_to: u32);
55

6-
#[skyline::hook(offset = 0xb30934, inline)]
6+
#[skyline::hook(offset = 0xb30954, inline)]
77
unsafe fn check_doyle_summon_dispatch_hook(ctx: &mut skyline::hooks::InlineCtx) {
88
let module_accessor = *ctx.registers[21].x.as_ref() as *mut BattleObjectModuleAccessor;
99
WorkModule::off_flag(module_accessor, *FIGHTER_JACK_INSTANCE_WORK_ID_FLAG_DOYLE_EXIST);

fighters/common/src/function_hooks/get_param.rs

+19-22
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,27 @@ pub fn install() {
1616
//skyline::nro::add_hook(item_nro_hook);
1717
}
1818

19-
static INT_OFFSET: usize = 0x4e5380; // 12.0.0
20-
static FLOAT_OFFSET: usize = 0x4e53C0; // 12.0.0
2119

20+
// #[skyline::hook(offset=0x720540)]
21+
// unsafe fn get_offset(arg0: u64, arg1: u64) {
22+
// static mut ONCE: bool = true;
23+
// if ONCE {
24+
// ONCE = false;
25+
// //debug::dump_trace();
26+
// }
27+
// original!()(arg0, arg1);
28+
// }
2229

23-
#[skyline::hook(offset=0x720540)]
24-
unsafe fn get_offset(arg0: u64, arg1: u64) {
25-
static mut ONCE: bool = true;
26-
if ONCE {
27-
ONCE = false;
28-
//debug::dump_trace();
29-
}
30-
original!()(arg0, arg1);
31-
}
32-
33-
#[skyline::hook(offset=0x1f8810c, inline)]
34-
unsafe fn get_inline_offset(ctx: &InlineCtx) {
35-
static mut ONCE: bool = true;
36-
if ONCE {
37-
ONCE = false;
38-
println!("{:#x}", ctx.registers[3].x.as_ref() - getRegionAddress(Region::Text) as u64);
39-
}
40-
}
30+
// #[skyline::hook(offset=0x1f8810c, inline)]
31+
// unsafe fn get_inline_offset(ctx: &InlineCtx) {
32+
// static mut ONCE: bool = true;
33+
// if ONCE {
34+
// ONCE = false;
35+
// println!("{:#x}", ctx.registers[3].x.as_ref() - getRegionAddress(Region::Text) as u64);
36+
// }
37+
// }
4138

42-
#[skyline::hook(offset=INT_OFFSET)]
39+
#[skyline::hook(offset=0x4E53A0)]
4340
pub unsafe fn get_param_int_hook(x0: u64, x1: u64, x2 :u64) -> i32 {
4441
let mut boma = *((x0 as *mut u64).offset(1)) as *mut BattleObjectModuleAccessor;
4542
let boma_reference = &mut *boma;
@@ -122,7 +119,7 @@ pub unsafe fn get_param_int_hook(x0: u64, x1: u64, x2 :u64) -> i32 {
122119
original!()(x0, x1, x2)
123120
}
124121

125-
#[skyline::hook(offset=FLOAT_OFFSET)]
122+
#[skyline::hook(offset=0x4E53E0)]
126123
pub unsafe fn get_param_float_hook(x0 /*boma*/: u64, x1 /*param_type*/: u64, x2 /*param_hash*/: u64) -> f32 {
127124
let mut boma = *((x0 as *mut u64).offset(1)) as *mut BattleObjectModuleAccessor;
128125
let boma_reference = &mut *boma;

fighters/common/src/function_hooks/hitstun.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#[skyline::hook(offset=0x6a70e0)]
2+
#[skyline::hook(offset=0x6a7100)] // unadjusted for 13.0.2?
33
pub fn stub_kill_screen() {}
44

55
pub fn install() {

fighters/common/src/function_hooks/shotos.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ pub fn install() {
66
disable_negative_edge,
77
// enable_terry_inputs_for_shotos
88
);
9-
skyline::patching::Patch::in_text(0x10d45a4).data(0x14000014u32); // enables terry's command inputs for shotos
9+
skyline::patching::Patch::in_text(0x10D45C4).data(0x14000014u32); // enables terry's command inputs for shotos
1010
}
1111

1212
// disables negative edge check for both shotos

fighters/common/src/function_hooks/stage_hazards.rs

+20-17
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ extern "C" {
1010

1111
#[skyline::hook(offset = 0x30F6DE0)]
1212
unsafe fn stub(arg: u64) {
13-
if get_stage_id() == 0x8f && get_current_stage_alt() == 0 {
13+
// if get_stage_id() == 0x8f && get_current_stage_alt() == 0 {
1414
return;
15-
} else {
16-
call_original!(arg);
17-
}
15+
// } else {
16+
// call_original!(arg);
17+
// }
1818
}
1919

2020
#[skyline::hook(offset = 0x5209c0)]
@@ -23,9 +23,10 @@ unsafe fn area_manager_process(manager: *const u64) {
2323
let end = *manager.add(2);
2424
while start != end {
2525
let current = *(start as *const u64);
26-
if *(current as *mut u8).add(0x20) == 0x1b
27-
&& (get_stage_id() == 0x8f && get_current_stage_alt() == 0)
28-
{
26+
// if *(current as *mut u8).add(0x20) == 0x1b
27+
// && (get_stage_id() == 0x8f && get_current_stage_alt() == 0)
28+
// {
29+
if *(current as *mut u8).add(0x20) == 0x1b && get_stage_id() == 0x8f {
2930
*(current as *mut bool).add(0x21) = false;
3031
*((current + 0x40) as *mut f32) = 0.0;
3132
*((current + 0x40) as *mut f32).add(1) = 0.0;
@@ -57,9 +58,10 @@ static HAZARDLESS_STAGE_IDS: &[u32] = &[
5758
#[skyline::hook(offset = 0x178ab60, inline)]
5859
unsafe fn init_stage(ctx: &mut skyline::hooks::InlineCtx) {
5960
let stage_id = *ctx.registers[1].w.as_ref();
60-
let is_alt_haz_off = ([0x59].contains(&stage_id) && get_current_stage_alt() == 0)
61-
|| (stage_id == 0x68 && get_current_stage_alt() == 0);
62-
if HAZARDLESS_STAGE_IDS.contains(&stage_id) || is_alt_haz_off {
61+
// let is_alt_haz_off = ([0x59].contains(&stage_id) && get_current_stage_alt() == 0)
62+
// || (stage_id == 0x68 && get_current_stage_alt() == 0);
63+
// if HAZARDLESS_STAGE_IDS.contains(&stage_id) || is_alt_haz_off {
64+
if HAZARDLESS_STAGE_IDS.contains(&stage_id) || stage_id == 0x68 || stage_id == 0x59 {
6365
*ctx.registers[3].w.as_mut() = 0;
6466
}
6567
}
@@ -76,9 +78,10 @@ unsafe fn handle_movement_grav_update(ctx: &mut skyline::hooks::InlineCtx) {
7678
unsafe fn fix_hazards_for_online(ctx: &skyline::hooks::InlineCtx) {
7779
let ptr = *ctx.registers[1].x.as_ref();
7880
let stage_id = *(ptr as *const u16) as u32;
79-
let is_alt_haz_off = ([0x59].contains(&stage_id) && get_current_stage_alt() == 0)
80-
|| (stage_id == 0x68 && get_current_stage_alt() == 0);
81-
if HAZARDLESS_STAGE_IDS.contains(&stage_id) || is_alt_haz_off {
81+
// let is_alt_haz_off = ([0x59].contains(&stage_id) && get_current_stage_alt() == 0)
82+
// || (stage_id == 0x68 && get_current_stage_alt() == 0);
83+
// if HAZARDLESS_STAGE_IDS.contains(&stage_id) || is_alt_haz_off {
84+
if HAZARDLESS_STAGE_IDS.contains(&stage_id) || stage_id == 0x68 || stage_id == 0x59 {
8285
*(ptr as *mut bool).add(0x10) = false;
8386
}
8487
}
@@ -97,11 +100,11 @@ unsafe fn lylat_no_rot(ctx: &mut skyline::hooks::InlineCtx) {
97100
// 0x4 - default haz off space
98101
#[skyline::hook(offset = 0x297D68C, inline)]
99102
unsafe fn lylat_set_form_hazards_off(ctx: &mut skyline::hooks::InlineCtx) {
100-
if get_current_stage_alt() == 0 {
101-
*ctx.registers[8].x.as_mut() = 0x2;
102-
} else {
103+
// if get_current_stage_alt() == 0 {
104+
// *ctx.registers[8].x.as_mut() = 0x2;
105+
// } else {
103106
*ctx.registers[8].x.as_mut() = 0x4;
104-
}
107+
// }
105108
}
106109

107110
pub fn install() {

fighters/common/src/general_statuses/shield/misc.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,13 @@ pub unsafe fn sub_guard_cont(fighter: &mut L2CFighterCommon) -> L2CValue {
425425
return true.into();
426426
}
427427

428+
// check parry
429+
if fighter.is_parry_input() {
430+
fighter.change_status(FIGHTER_STATUS_KIND_GUARD_OFF.into(), true.into());
431+
VarModule::on_flag(fighter.object(), vars::common::instance::IS_PARRY_FOR_GUARD_OFF);
432+
return true.into();
433+
}
434+
428435
// check jump
429436
if
430437
fighter.sub_check_button_jump().get_bool() ||
@@ -452,13 +459,6 @@ pub unsafe fn sub_guard_cont(fighter: &mut L2CFighterCommon) -> L2CValue {
452459
return true.into();
453460
}
454461

455-
// check parry
456-
if fighter.is_parry_input() {
457-
fighter.change_status(FIGHTER_STATUS_KIND_GUARD_OFF.into(), true.into());
458-
VarModule::on_flag(fighter.object(), vars::common::instance::IS_PARRY_FOR_GUARD_OFF);
459-
return true.into();
460-
}
461-
462462
return false.into();
463463
}
464464

fighters/duckhunt/src/acmd/other.rs

+40-1
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,42 @@ unsafe fn escape_air_slide_game(fighter: &mut L2CAgentBase) {
363363
}
364364
}
365365

366+
#[acmd_script( agent = "duckhunt", scripts = ["effect_appealsl", "effect_appealsr"], category = ACMD_EFFECT , low_priority)]
367+
unsafe fn effect_appeals(fighter: &mut L2CAgentBase) {
368+
let lua_state = fighter.lua_state_agent;
369+
let boma = fighter.boma();
370+
}
371+
372+
#[acmd_script( agent = "duckhunt", scripts = ["sound_appealsl", "sound_appealsr"], category = ACMD_SOUND , low_priority)]
373+
unsafe fn sound_appeals(fighter: &mut L2CAgentBase) {
374+
let lua_state = fighter.lua_state_agent;
375+
let boma = fighter.boma();
376+
frame(lua_state, 1.0);
377+
if is_excute(fighter) {
378+
let handle = SoundModule::play_se(boma, Hash40::new("se_duckhunt_appeal_s01"), true, false, false, false, app::enSEType(0));
379+
SoundModule::set_se_vol(boma, handle as i32, 3.0, 0);
380+
}
381+
}
382+
383+
#[acmd_script( agent = "duckhunt", scripts = ["expression_appealsl", "expression_appealsr"], category = ACMD_EXPRESSION , low_priority)]
384+
unsafe fn expression_appeals(fighter: &mut L2CAgentBase) {
385+
let lua_state = fighter.lua_state_agent;
386+
let boma = fighter.boma();
387+
if is_excute(fighter) {
388+
ItemModule::set_have_item_visibility(boma, false, 0);
389+
VisibilityModule::set_int64(boma, hash40("body") as i64, hash40("body_normal") as i64);
390+
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE_INTP, *SLOPE_STATUS_TOP, 10);
391+
}
392+
frame(lua_state, 10.0);
393+
if is_excute(fighter) {
394+
ControlModule::set_rumble(boma, Hash40::new("rbkind_superleaf"), 72, true, *BATTLE_OBJECT_ID_INVALID as u32);
395+
}
396+
frame(lua_state, 88.0);
397+
if is_excute(fighter) {
398+
slope!(fighter, *MA_MSC_CMD_SLOPE_SLOPE_INTP, *SLOPE_STATUS_LR, 10);
399+
}
400+
}
401+
366402
pub fn install() {
367403
install_acmd_scripts!(
368404
escape_air_game,
@@ -382,7 +418,10 @@ pub fn install() {
382418
damageflylw_sound,
383419
damageflyn_sound,
384420
damageflyroll_sound,
385-
damageflytop_sound
421+
damageflytop_sound,
422+
effect_appeals,
423+
sound_appeals,
424+
expression_appeals
386425
);
387426
}
388427

fighters/duckhunt/src/acmd/tilts.rs

-5
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ unsafe fn duckhunt_attack_squat_s3_sound(agent: &mut L2CAgentBase) {
181181
let boma = agent.boma();
182182
frame(lua_state, 1.0);
183183
if is_excute(agent) {
184-
PLAY_SE(agent, Hash40::new("se_duckhunt_appeal_s01"));
185184
PLAY_SE(agent, Hash40::new("se_duckhunt_appeal_s02"));
186185
}
187186
frame(lua_state, 4.0);
@@ -216,10 +215,6 @@ unsafe fn duckhunt_attack_squat_s3_expression(agent: &mut L2CAgentBase) {
216215
if is_excute(agent) {
217216
RUMBLE_HIT(agent, Hash40::new("rbkind_attackm"), 0);
218217
}
219-
frame(lua_state, 22.0);
220-
if is_excute(agent) {
221-
VisibilityModule::set_int64(boma, hash40("body") as i64, hash40("body_normal") as i64);
222-
}
223218
}
224219

225220
pub fn install() {

fighters/lucario/src/status/special_hi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ unsafe extern "C" fn lucario_special_hi_metered_cancel(fighter: &mut L2CFighterC
246246
WorkModule::enable_transition_term(fighter.module_accessor, *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_ATTACK_AIR);
247247
if fighter.sub_transition_group_check_air_attack().get_bool() {
248248
KineticModule::mul_speed(fighter.module_accessor, &Vector3f{x: 0.5, y: 0.5, z: 0.5}, *FIGHTER_KINETIC_ENERGY_ID_STOP);
249-
MeterModule::drain_direct(fighter.object(), MeterModule::meter_per_level(fighter.object()) * 2.0);
249+
MeterModule::drain_direct(fighter.battle_object, MeterModule::meter_per_level(fighter.battle_object));
250250
let frames = 120.max(VarModule::get_int(fighter.object(), vars::lucario::instance::METER_PAUSE_REGEN_FRAME));
251251
VarModule::set_int(fighter.object(), vars::lucario::instance::METER_PAUSE_REGEN_FRAME, frames);
252252
VarModule::on_flag(fighter.object(), vars::lucario::instance::IS_USPECIAL_ATTACK_CANCEL);

fighters/lucas/src/acmd/aerials.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -327,13 +327,13 @@ unsafe fn lucas_attack_air_hi_effect(fighter: &mut L2CAgentBase) {
327327
let boma = fighter.boma();
328328
frame(lua_state, 6.0);
329329
if is_excute(fighter) {
330-
EFFECT_FOLLOW_FLIP(fighter, Hash40::new("sys_attack_arc_d"), Hash40::new("sys_attack_arc_d"), Hash40::new("top"), 1.3, 8.8, 0, -55, -128, -62, 0.8, true, *EF_FLIP_YZ);
331-
LAST_EFFECT_SET_RATE(fighter, 2.0);
330+
EFFECT_FOLLOW_FLIP(fighter, Hash40::new("sys_attack_arc_d"), Hash40::new("sys_attack_arc_d"), Hash40::new("top"), 1.3, 7.8, -2.0, -55, -128, -62, 0.8, true, *EF_FLIP_YZ);
331+
LAST_EFFECT_SET_RATE(fighter, 2.4);
332332
LAST_EFFECT_SET_COLOR(fighter, 1.0, 0.8, 0.1);
333333
}
334334
frame(lua_state, 7.0);
335335
if is_excute(fighter) {
336-
EFFECT_ALPHA(fighter, Hash40::new("sys_attack_impact"), Hash40::new("top"), 1.05, 14.5, 0, 0, 0, 0, 1.31, 0, 0, 0, 0, 0, 0, true, 0.7);
336+
EFFECT_ALPHA(fighter, Hash40::new("sys_attack_impact"), Hash40::new("top"), 1.05, 14.5, 2.0, 0, 0, 0, 1.31, 0, 0, 0, 0, 0, 0, true, 0.7);
337337
}
338338
}
339339

fighters/lucas/src/acmd/smashes.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,13 @@ unsafe fn lucas_attack_s4_s_game(fighter: &mut L2CAgentBase) {
6262
AttackModule::clear_all(boma);
6363
}
6464
frame(lua_state, 20.0);
65+
if is_excute(fighter) {
66+
WorkModule::on_flag(boma, *FIGHTER_LUCAS_STATUS_ATTACK_S4_FLAG_REFLECT_END);
67+
}
68+
frame(lua_state, 25.0);
6569
if is_excute(fighter) {
6670
VarModule::off_flag(fighter.object(), vars::lucas::instance::ATTACK_S4_ANGLE_DOWN);
6771
VarModule::off_flag(fighter.object(), vars::lucas::instance::ATTACK_S4_ANGLE_UP);
68-
WorkModule::on_flag(boma, *FIGHTER_LUCAS_STATUS_ATTACK_S4_FLAG_REFLECT_END);
6972
}
7073
}
7174
else {
@@ -116,10 +119,13 @@ unsafe fn lucas_attack_s4_s_game(fighter: &mut L2CAgentBase) {
116119
AttackModule::clear_all(boma);
117120
}
118121
frame(lua_state, 20.0);
122+
if is_excute(fighter) {
123+
WorkModule::on_flag(boma, *FIGHTER_LUCAS_STATUS_ATTACK_S4_FLAG_REFLECT_END);
124+
}
125+
frame(lua_state, 25.0);
119126
if is_excute(fighter) {
120127
VarModule::off_flag(fighter.object(), vars::lucas::instance::ATTACK_S4_ANGLE_DOWN);
121128
VarModule::off_flag(fighter.object(), vars::lucas::instance::ATTACK_S4_ANGLE_UP);
122-
WorkModule::on_flag(boma, *FIGHTER_LUCAS_STATUS_ATTACK_S4_FLAG_REFLECT_END);
123129
}
124130
}
125131
}

fighters/lucas/src/opff.rs

+8-6
Original file line numberDiff line numberDiff line change
@@ -348,15 +348,17 @@ unsafe fn smash_s_angle_handler(fighter: &mut L2CFighterCommon, frame: f32) {
348348
if fighter.is_status_one_of(&[*FIGHTER_STATUS_KIND_ATTACK_S4, *FIGHTER_STATUS_KIND_ATTACK_S4_START]) {
349349
// Up Tilted Side Smash
350350
if VarModule::is_flag(fighter.object(), vars::lucas::instance::ATTACK_S4_ANGLE_UP) {
351-
joint_rotator(fighter, frame, Hash40::new("waist"), Vector3f{x: 0.0, y:-30.0, z:0.0}, 11.0, 15.0, 17.0, 25.0);
352-
joint_rotator(fighter, frame, Hash40::new("bust"), Vector3f{x: 0.0, y:-20.0, z:0.0}, 11.0, 15.0, 17.0, 25.0);
351+
joint_rotator(fighter, frame, Hash40::new("waist"), Vector3f{x: 0.0, y:-10.0, z:0.0}, 13.0, 15.0, 16.0, 25.0);
352+
joint_rotator(fighter, frame, Hash40::new("bust"), Vector3f{x: 0.0, y:-10.0, z:0.0}, 13.0, 15.0, 16.0, 25.0);
353+
joint_rotator(fighter, frame, Hash40::new("handl"), Vector3f{x: 0.0, y:-20.0, z:0.0}, 11.0, 15.0, 16.0, 25.0);
354+
joint_rotator(fighter, frame, Hash40::new("handr"), Vector3f{x: 0.0, y:-20.0, z:0.0}, 11.0, 15.0, 16.0, 25.0);
353355
}
354356
// Down Tilted Side Smash
355357
else if VarModule::is_flag(fighter.object(), vars::lucas::instance::ATTACK_S4_ANGLE_DOWN) {
356-
joint_rotator(fighter, frame, Hash40::new("waist"), Vector3f{x: 0.0, y:10.0, z:0.0}, 11.0, 15.0, 17.0, 25.0);
357-
joint_rotator(fighter, frame, Hash40::new("bust"), Vector3f{x: 0.0, y:10.0, z:0.0}, 11.0, 15.0, 17.0, 25.0);
358-
joint_rotator(fighter, frame, Hash40::new("handl"), Vector3f{x: 0.0, y:20.0, z:0.0}, 11.0, 15.0, 17.0, 25.0);
359-
joint_rotator(fighter, frame, Hash40::new("handr"), Vector3f{x: 0.0, y:20.0, z:0.0}, 11.0, 15.0, 17.0, 25.0);
358+
joint_rotator(fighter, frame, Hash40::new("waist"), Vector3f{x: 0.0, y:10.0, z:0.0}, 13.0, 15.0, 16.0, 25.0);
359+
joint_rotator(fighter, frame, Hash40::new("bust"), Vector3f{x: 0.0, y:10.0, z:0.0}, 13.0, 15.0, 16.0, 25.0);
360+
joint_rotator(fighter, frame, Hash40::new("handl"), Vector3f{x: 0.0, y:20.0, z:0.0}, 11.0, 15.0, 16.0, 25.0);
361+
joint_rotator(fighter, frame, Hash40::new("handr"), Vector3f{x: 0.0, y:20.0, z:0.0}, 11.0, 15.0, 16.0, 25.0);
360362
}
361363
}
362364
}

0 commit comments

Comments
 (0)