Skip to content

Commit

Permalink
Merge pull request HDR-Development#2144 from HDR-Development/Mega-Man…
Browse files Browse the repository at this point in the history
…-Adjustments

Mega Man Adjustments
  • Loading branch information
WuBoytH authored Dec 21, 2023
2 parents 465851b + 6e85d23 commit e8dc9aa
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 41 deletions.
14 changes: 14 additions & 0 deletions fighters/rockman/src/acmd/aerials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ unsafe fn rockman_attack_air_b_game(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
frame(lua_state, 4.0);
FT_MOTION_RATE(fighter, 2.0 / 3.0);
if is_excute(fighter) {
WorkModule::on_flag(boma, *FIGHTER_STATUS_ATTACK_AIR_FLAG_ENABLE_LANDING);
ATTACK(fighter, 0, 0, Hash40::new("top"), 4.5, 365, 19, 0, 40, 5.0, 0.0, 9.5, -14.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_B, false, 0, 0.0, 0, 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_SWORD);
Expand All @@ -162,6 +163,7 @@ unsafe fn rockman_attack_air_b_game(fighter: &mut L2CAgentBase) {
AttackModule::clear_all(boma);
}
wait(lua_state, 1.0);
FT_MOTION_RATE(fighter, 1.0);
if is_excute(fighter) {
ATTACK(fighter, 0, 0, Hash40::new("top"), 5.0, 361, 200, 0, 20, 7.6, 0.0, 9.5, -13.0, None, None, None, 1.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, 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_L, *COLLISION_SOUND_ATTR_CUTUP, *ATTACK_REGION_SWORD);
ATTACK(fighter, 1, 0, Hash40::new("top"), 5.0, 361, 200, 0, 20, 4.5, 0.0, 9.5, -6.0, None, None, None, 1.5, 1.0, *ATTACK_SETOFF_KIND_ON, *ATTACK_LR_CHECK_POS, false, 0, 0.0, 0, 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_L, *COLLISION_SOUND_ATTR_CUTUP, *ATTACK_REGION_SWORD);
Expand All @@ -177,6 +179,16 @@ unsafe fn rockman_attack_air_b_game(fighter: &mut L2CAgentBase) {

}

#[acmd_script( agent = "rockman", script = "effect_attackairb" , category = ACMD_EFFECT , low_priority)]
unsafe fn rockman_attack_air_b_effect(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
frame(lua_state, 3.0);
if is_excute(fighter) {
EFFECT_FOLLOW_FLIP(fighter, Hash40::new("rockman_slashcraw"), Hash40::new("rockman_slashcraw"), Hash40::new("top"), 0, 10, 9, 0, 0, 0, 1, true, *EF_FLIP_YZ);
LAST_EFFECT_SET_RATE(fighter, 3.0 / 2.0);
}
}

#[acmd_script( agent = "rockman", script = "game_attackairhi" , category = ACMD_GAME , low_priority)]
unsafe fn rockman_attack_air_hi_game(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
Expand Down Expand Up @@ -242,7 +254,9 @@ pub fn install() {
rockman_attack_air_f_game,
rockman_attack_air_f_effect,
rockman_attack_air_f_expression,

rockman_attack_air_b_game,
rockman_attack_air_b_effect,

rockman_attack_air_hi_game,

Expand Down
42 changes: 38 additions & 4 deletions fighters/rockman/src/acmd/other.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,45 @@ unsafe fn rockman_hardknuckle_regular_game(fighter: &mut L2CAgentBase) {
if is_excute(fighter) {
WorkModule::on_flag(boma, *WEAPON_ROCKMAN_HARDKNUCKLE_INSTANCE_WORK_ID_FLAG_ATTACK_VECTOR_REVERSE_UD_CHECK);
}
frame(lua_state, 4.0);
frame(lua_state, 5.0);
if is_excute(fighter) {
ATTACK(fighter, 0, 0, Hash40::new("top"), 12.0, 50, 60, 0, 20, 4.5, 0.0, 0.0, 0.0, None, None, None, 1.0, 1.0, *ATTACK_SETOFF_KIND_THRU, *ATTACK_LR_CHECK_SPEED, false, 0, 0.0, 0, true, false, false, false, false, *COLLISION_SITUATION_MASK_GA, *COLLISION_CATEGORY_MASK_ALL, *COLLISION_PART_MASK_ALL, false, Hash40::new("collision_attr_normal"), *ATTACK_SOUND_LEVEL_L, *COLLISION_SOUND_ATTR_PUNCH, *ATTACK_REGION_PUNCH);
AttackModule::clear(boma, 1, false);
AttackModule::clear_all(boma);
sv_kinetic_energy!(
set_speed,
fighter,
WEAPON_KINETIC_ENERGY_RESERVE_ID_NORMAL,
0.0,
-0.5
);
sv_kinetic_energy!(
set_stable_speed,
fighter,
WEAPON_KINETIC_ENERGY_RESERVE_ID_NORMAL,
0.0,
0.0
);
sv_kinetic_energy!(
set_brake,
fighter,
WEAPON_KINETIC_ENERGY_RESERVE_ID_NORMAL,
0.0,
0.05
);
}
}

#[acmd_script( agent = "rockman_hardknuckle", script = "effect_regular" , category = ACMD_EFFECT , low_priority)]
unsafe fn rockman_hardknuckle_regular_effect(fighter: &mut L2CAgentBase) {
let lua_state = fighter.lua_state_agent;
let boma = fighter.boma();
frame(lua_state, 1.0);
if is_excute(fighter) {
EFFECT_FOLLOW_NO_STOP(fighter, Hash40::new("rockman_hardknuckle"), Hash40::new("top"), 0, 0, 0, 0, 0, 0, 1, true);
}
frame(lua_state, 6.0);
if is_excute(fighter) {
EFFECT_OFF_KIND(fighter, Hash40::new("rockman_hardknuckle"), true, true);
}

}

/*
Expand Down Expand Up @@ -181,6 +214,7 @@ pub fn install() {
dash_sound,
turn_dash_game,
rockman_rockbuster_regular_game,
rockman_hardknuckle_regular_effect,
rockman_airshooter_regular_game,
rockman_hardknuckle_regular_game,
);
Expand Down
74 changes: 37 additions & 37 deletions fighters/rockman/src/vtable_hook.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,48 +124,48 @@ pub unsafe extern "C" fn rockman_vtable_func(vtable: u64, fighter: &mut smash::a
original!()(vtable, fighter);
}

pub unsafe fn is_damage_check(module_accessor: *mut BattleObjectModuleAccessor, is_prev: bool) -> bool {
let status : i32;
if is_prev {
status = StatusModule::prev_status_kind(module_accessor, 0);
}
else {
status = StatusModule::status_kind(module_accessor);
}
if FighterStopModuleImpl::is_damage_stop(module_accessor)
|| WorkModule::is_flag(module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_CAPTURE_YOSHI)
|| WorkModule::is_flag(module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_GANON_SPECIAL_S_DAMAGE_FALL_GROUND)
|| WorkModule::is_flag(module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_GANON_SPECIAL_S_DAMAGE_FALL_AIR)
|| (*FIGHTER_STATUS_KIND_CAPTURE_PULLED..=*FIGHTER_STATUS_KIND_DAMAGE_FALL).contains(&status)
|| (*FIGHTER_STATUS_KIND_DOWN..=*FIGHTER_STATUS_KIND_LAY_DOWN).contains(&status)
|| (*FIGHTER_STATUS_KIND_DOWN_DAMAGE..=*FIGHTER_STATUS_KIND_BIND).contains(&status)
|| (*FIGHTER_STATUS_KIND_SLIP..=*FIGHTER_STATUS_KIND_SLIP_WAIT).contains(&status)
|| (*FIGHTER_STATUS_KIND_TREAD_DAMAGE..=*FIGHTER_STATUS_KIND_ICE_JUMP).contains(&status)
|| (*FIGHTER_STATUS_KIND_LINK_FINAL..=*FIGHTER_STATUS_KIND_PIT_FALL).contains(&status)
|| (*FIGHTER_STATUS_KIND_SWALLOWED..=*FIGHTER_STATUS_KIND_CAPTURE_DAMAGE_YOSHI).contains(&status)
|| (*FIGHTER_STATUS_KIND_CATCHED_REFLET..=*FIGHTER_STATUS_KIND_CAPTURE_MASTERHAND).contains(&status)
|| status == *FIGHTER_STATUS_KIND_GIMMICK_EATEN
|| (*FIGHTER_STATUS_KIND_CAPTURE_ITEM..=*FIGHTER_STATUS_KIND_CAPTURE_CLAPTRAP).contains(&status)
|| (*FIGHTER_STATUS_KIND_FINAL_VISUAL_ATTACK_OTHER..=*FIGHTER_STATUS_KIND_RIDLEY_FINAL_TARGET_END).contains(&status)
|| (*FIGHTER_STATUS_KIND_CATCHED_RIDLEY..=*FIGHTER_STATUS_KIND_STABBED_DAMAGE).contains(&status)
|| (*FIGHTER_STATUS_KIND_SWING_GAOGAEN_CATCHED..=*FIGHTER_STATUS_KIND_SWING_GAOGAEN_FAILURE).contains(&status)
|| (*FIGHTER_STATUS_KIND_SHEIK_FINAL_CAPTURE..=*FIGHTER_STATUS_KIND_CAPTURE_WAIT_OCTOPUS).contains(&status)
|| (*FIGHTER_STATUS_KIND_SIMON_FINAL_TARGET_START..=*FIGHTER_STATUS_KIND_YOSHI_FINAL_TARGET_END).contains(&status)
|| (*FIGHTER_STATUS_KIND_SUICIDE_BOMB..=*FIGHTER_STATUS_KIND_TANTAN_FINAL_TARGET_END).contains(&status)
|| (*FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_JUMP_BOARD..=*FIGHTER_STATUS_KIND_EDGE_FINAL_TARGET_END).contains(&status)
|| (*FIGHTER_STATUS_KIND_CAPTURE_TRAIL_KEYHOLE..=*FIGHTER_STATUS_KIND_TRAIL_FINAL_TARGET_END).contains(&status) {
return true;
}
false
}
// pub unsafe fn is_damage_check(module_accessor: *mut BattleObjectModuleAccessor, is_prev: bool) -> bool {
// let status : i32;
// if is_prev {
// status = StatusModule::prev_status_kind(module_accessor, 0);
// }
// else {
// status = StatusModule::status_kind(module_accessor);
// }
// if FighterStopModuleImpl::is_damage_stop(module_accessor)
// || WorkModule::is_flag(module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_CAPTURE_YOSHI)
// || WorkModule::is_flag(module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_GANON_SPECIAL_S_DAMAGE_FALL_GROUND)
// || WorkModule::is_flag(module_accessor, *FIGHTER_INSTANCE_WORK_ID_FLAG_GANON_SPECIAL_S_DAMAGE_FALL_AIR)
// || (*FIGHTER_STATUS_KIND_CAPTURE_PULLED..=*FIGHTER_STATUS_KIND_DAMAGE_FALL).contains(&status)
// || (*FIGHTER_STATUS_KIND_DOWN..=*FIGHTER_STATUS_KIND_LAY_DOWN).contains(&status)
// || (*FIGHTER_STATUS_KIND_DOWN_DAMAGE..=*FIGHTER_STATUS_KIND_BIND).contains(&status)
// || (*FIGHTER_STATUS_KIND_SLIP..=*FIGHTER_STATUS_KIND_SLIP_WAIT).contains(&status)
// || (*FIGHTER_STATUS_KIND_TREAD_DAMAGE..=*FIGHTER_STATUS_KIND_ICE_JUMP).contains(&status)
// || (*FIGHTER_STATUS_KIND_LINK_FINAL..=*FIGHTER_STATUS_KIND_PIT_FALL).contains(&status)
// || (*FIGHTER_STATUS_KIND_SWALLOWED..=*FIGHTER_STATUS_KIND_CAPTURE_DAMAGE_YOSHI).contains(&status)
// || (*FIGHTER_STATUS_KIND_CATCHED_REFLET..=*FIGHTER_STATUS_KIND_CAPTURE_MASTERHAND).contains(&status)
// || status == *FIGHTER_STATUS_KIND_GIMMICK_EATEN
// || (*FIGHTER_STATUS_KIND_CAPTURE_ITEM..=*FIGHTER_STATUS_KIND_CAPTURE_CLAPTRAP).contains(&status)
// || (*FIGHTER_STATUS_KIND_FINAL_VISUAL_ATTACK_OTHER..=*FIGHTER_STATUS_KIND_RIDLEY_FINAL_TARGET_END).contains(&status)
// || (*FIGHTER_STATUS_KIND_CATCHED_RIDLEY..=*FIGHTER_STATUS_KIND_STABBED_DAMAGE).contains(&status)
// || (*FIGHTER_STATUS_KIND_SWING_GAOGAEN_CATCHED..=*FIGHTER_STATUS_KIND_SWING_GAOGAEN_FAILURE).contains(&status)
// || (*FIGHTER_STATUS_KIND_SHEIK_FINAL_CAPTURE..=*FIGHTER_STATUS_KIND_CAPTURE_WAIT_OCTOPUS).contains(&status)
// || (*FIGHTER_STATUS_KIND_SIMON_FINAL_TARGET_START..=*FIGHTER_STATUS_KIND_YOSHI_FINAL_TARGET_END).contains(&status)
// || (*FIGHTER_STATUS_KIND_SUICIDE_BOMB..=*FIGHTER_STATUS_KIND_TANTAN_FINAL_TARGET_END).contains(&status)
// || (*FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_JUMP_BOARD..=*FIGHTER_STATUS_KIND_EDGE_FINAL_TARGET_END).contains(&status)
// || (*FIGHTER_STATUS_KIND_CAPTURE_TRAIL_KEYHOLE..=*FIGHTER_STATUS_KIND_TRAIL_FINAL_TARGET_END).contains(&status) {
// return true;
// }
// false
// }

unsafe fn rockman_valid_charging_state(module_accessor: *mut BattleObjectModuleAccessor) -> bool {
if WorkModule::is_enable_transition_term(module_accessor, *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_SPECIAL_N) {
return true;
}
if is_damage_check(module_accessor, false) {
return false;
}
// if is_damage_check(module_accessor, false) {
// return false;
// }
let status = StatusModule::status_kind(module_accessor);
![
*FIGHTER_STATUS_KIND_DEAD,
Expand Down

0 comments on commit e8dc9aa

Please sign in to comment.