1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-30 22:00:16 +00:00

Add Neutral Mashing Toggle (#84)

* Add Mash Toggle

Added toggle to set the cpu to also mash in neutral

* Add Utility Functions

is_grounded
is_airborne

* Fix Neutral Mashing Aerials

Added jump flag

* Update README.md

* Changed Button Combination

Changed mash Toggle to Attack + Dpad Up/Down

* use Tesla overlay for mash in neutral

* add menu commit for neutral mash

* Update README.md

Co-authored-by: jugeeya <jugeeya@live.com>
This commit is contained in:
sidschingis 2020-06-13 07:45:25 +02:00 committed by GitHub
parent e67c69ed63
commit 32f7fb0808
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 39 additions and 11 deletions

@ -1 +1 @@
Subproject commit 036171692ee4c704d6794f7c263509c316f48a9c Subproject commit ebe52ded3762dc3a45aa07652cbacbc410145ead

View file

@ -1,6 +1,12 @@
use smash::lib::lua_const::*; use smash::lib::lua_const::*;
// Side Taunt /// Hitbox Visualization
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum HitboxVisualization {
Off = 0,
On = 1,
}
// DI // DI
/* /*
@ -203,9 +209,17 @@ impl From<i32> for Defensive {
} }
} }
/// Mash in neutral
#[repr(i32)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum MashInNeutral {
Off = 0,
On = 1,
}
#[repr(C)] #[repr(C)]
pub struct TrainingModpackMenu { pub struct TrainingModpackMenu {
pub hitbox_vis: bool, pub hitbox_vis: HitboxVisualization,
pub di_state: DirectionalInfluence, pub di_state: DirectionalInfluence,
pub mash_attack_state: Attack, pub mash_attack_state: Attack,
pub ledge_state: LedgeOption, pub ledge_state: LedgeOption,
@ -213,5 +227,6 @@ pub struct TrainingModpackMenu {
pub mash_state: Mash, pub mash_state: Mash,
pub shield_state: Shield, pub shield_state: Shield,
pub defensive_state: Defensive, pub defensive_state: Defensive,
pub oos_offset: u8, pub oos_offset: i32,
pub mash_in_neutral: MashInNeutral
} }

View file

@ -6,7 +6,7 @@ use smash::hash40;
use smash::lib::lua_const::*; use smash::lib::lua_const::*;
pub static mut MENU_STRUCT: consts::TrainingModpackMenu = consts::TrainingModpackMenu { pub static mut MENU_STRUCT: consts::TrainingModpackMenu = consts::TrainingModpackMenu {
hitbox_vis: true, hitbox_vis: HitboxVisualization::On,
di_state: DirectionalInfluence::None, di_state: DirectionalInfluence::None,
mash_attack_state: Attack::Nair, mash_attack_state: Attack::Nair,
ledge_state: LedgeOption::Random, ledge_state: LedgeOption::Random,
@ -15,6 +15,7 @@ pub static mut MENU_STRUCT: consts::TrainingModpackMenu = consts::TrainingModpac
shield_state: Shield::None, shield_state: Shield::None,
defensive_state: Defensive::Random, defensive_state: Defensive::Random,
oos_offset: 0, oos_offset: 0,
mash_in_neutral: MashInNeutral::Off,
}; };
pub static MENU: &'static mut consts::TrainingModpackMenu = unsafe { &mut MENU_STRUCT }; pub static MENU: &'static mut consts::TrainingModpackMenu = unsafe { &mut MENU_STRUCT };
@ -52,6 +53,16 @@ pub unsafe fn is_operation_cpu(module_accessor: &mut app::BattleObjectModuleAcce
FighterInformation::is_operation_cpu(fighter_information) FighterInformation::is_operation_cpu(fighter_information)
} }
pub unsafe fn is_grounded(module_accessor: &mut app::BattleObjectModuleAccessor) ->bool{
let situation_kind = StatusModule::situation_kind(module_accessor) as i32;
situation_kind == SITUATION_KIND_GROUND
}
pub unsafe fn is_airborne(module_accessor: &mut app::BattleObjectModuleAccessor) ->bool{
let situation_kind = StatusModule::situation_kind(module_accessor) as i32;
situation_kind == SITUATION_KIND_AIR
}
pub unsafe fn is_idle(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool { pub unsafe fn is_idle(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
let status_kind = StatusModule::status_kind(module_accessor); let status_kind = StatusModule::status_kind(module_accessor);
status_kind == FIGHTER_STATUS_KIND_WAIT status_kind == FIGHTER_STATUS_KIND_WAIT

View file

@ -170,7 +170,7 @@ pub unsafe fn get_command_flag_cat(
// Resume Effect AnimCMD incase we don't display hitboxes // Resume Effect AnimCMD incase we don't display hitboxes
MotionAnimcmdModule::set_sleep_effect(module_accessor, false); MotionAnimcmdModule::set_sleep_effect(module_accessor, false);
if !MENU.hitbox_vis { if MENU.hitbox_vis == HitboxVisualization::Off {
return; return;
} }
@ -248,7 +248,7 @@ unsafe fn mod_handle_attack(lua_state: u64) {
} }
// Hitbox Visualization // Hitbox Visualization
if MENU.hitbox_vis { if MENU.hitbox_vis == HitboxVisualization::On {
// get all necessary grabbox params // get all necessary grabbox params
let id = l2c_agent.pop_lua_stack(1); // int let id = l2c_agent.pop_lua_stack(1); // int
let joint = l2c_agent.pop_lua_stack(3); // hash40 let joint = l2c_agent.pop_lua_stack(3); // hash40
@ -291,7 +291,7 @@ unsafe fn mod_handle_catch(lua_state: u64) {
return; return;
} }
if !MENU.hitbox_vis { if MENU.hitbox_vis == HitboxVisualization::Off {
return; return;
} }

View file

@ -34,6 +34,7 @@ pub unsafe fn get_command_flag_cat(
category: i32, category: i32,
flag: &mut i32, flag: &mut i32,
) { ) {
// Only do once per frame
if category != FIGHTER_PAD_COMMAND_CATEGORY1 { if category != FIGHTER_PAD_COMMAND_CATEGORY1 {
return; return;
} }
@ -55,6 +56,7 @@ pub unsafe fn get_command_flag_cat(
|| is_in_landing(module_accessor) || is_in_landing(module_accessor)
|| is_in_shieldstun(module_accessor) || is_in_shieldstun(module_accessor)
|| is_in_footstool(module_accessor) || is_in_footstool(module_accessor)
|| MENU.mash_in_neutral == MashInNeutral::On
|| StatusModule::status_kind(module_accessor) == FIGHTER_STATUS_KIND_CLIFF_ROBBED) || StatusModule::status_kind(module_accessor) == FIGHTER_STATUS_KIND_CLIFF_ROBBED)
{ {
return; return;
@ -84,8 +86,8 @@ pub unsafe fn get_command_flag_cat(
match MENU.mash_attack_state { match MENU.mash_attack_state {
Nair | Fair | Bair | UpAir | Dair => { Nair | Fair | Bair | UpAir | Dair => {
*flag |= *FIGHTER_PAD_CMD_CAT1_FLAG_ATTACK_N; *flag |= *FIGHTER_PAD_CMD_CAT1_FLAG_ATTACK_N;
// If we are performing the attack OOS we also need to jump // If we are grounded we also need to jump
if is_in_shieldstun(module_accessor) { if is_grounded(module_accessor) {
*flag |= *FIGHTER_PAD_CMD_CAT1_FLAG_JUMP_BUTTON; *flag |= *FIGHTER_PAD_CMD_CAT1_FLAG_JUMP_BUTTON;
} }
} }

View file

@ -9,7 +9,7 @@ use smash::lib::L2CValue;
use smash::lua2cpp::L2CFighterCommon; use smash::lua2cpp::L2CFighterCommon;
// How many hits to hold shield until picking an Out Of Shield option // How many hits to hold shield until picking an Out Of Shield option
static mut MULTI_HIT_OFFSET: u8 = MENU.oos_offset; static mut MULTI_HIT_OFFSET: i32 = MENU.oos_offset;
// Used to only decrease once per shieldstun change // Used to only decrease once per shieldstun change
static mut WAS_IN_SHIELDSTUN: bool = false; static mut WAS_IN_SHIELDSTUN: bool = false;