1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-27 20:34:03 +00:00

Override ledge fix and input recording menu fixes (#542)

* GCC+tinkering

* First working pass with 8-byte structure usage.
Control scheme is effectively copied for CPU.

* CPU override, sticks not working properly

* Recording working again during record, playback issues.
Also, aerials are all nair, and jump/Dash Attack issues.

* Structure creation cleanup

* Continued testing, still aerial, jump, and dash attack issues

* Fix Dockerfile

* Rework with ControlModuleInternal and ControlModuleStored - same exact issues

* Fix playback inconsistency

* Dead code of trying to find attack air address

* It works! Fix mash.rs overrides of input playback

* Action passing groundwork; Clatter off by default for now

* All Overrides implemented, notes on Snake

* Input Submenu, dummy slots and save state/mash playback interaction

* Nana command fix, mash fix

* Initial Savestate/Ledge record (slight issues)

* Add TODO

* Lasso handled, ledge jump issue fixed, shield decay with input recording fixed, standby setup begun

* first frame playback clear, fix neutral getup

* Standy by groundwork, broken by our frame late record impl

* Prepare for structure change

* On time small structure recording, needs ledge adjustments

* Coloring fix for poessession, lockout implemented and full ledge functionality

* Cleaning and menu fix

* Fix ledge option loop and shield holding on mash

* Fix shielding issues

* turn off playback

* Enable input recording

* Resolving comments 1,2,4,5

* Resolve comments 6, 7, and 8

* External Mash Function

* No Trigger for Overrides, Clatter and Tumble Added

* LR Support, Full Hop Fix

* Starting Status WIP, Structure WIP, LedgeOption PLAYBACK renaming

* WIP Playback Mash - OoS issues - WIP Slots

* Merge branch 'main' into for-restructure prep

* more merge prep

* Return None fix

* More cleanup

* Block -> Shieldstun

* Don't crash on missing menu icons

* Add input recording tab to prevent crash

* Fix general override behavior

* Fix teching overrides

* Additional merge changes

* Nana fixes (also on master so this will be awkward)

* Additional Merge Fixes

* Remove extra tab, prevent panic on missing input recording items

* Needs proper selection of action

* Ledge overrides work without trigger, remove playback/record slot until working
This commit is contained in:
GradualSyrup 2023-07-29 15:12:32 -05:00 committed by GitHub
parent 62298ecbc1
commit 78d4b36400
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 60 additions and 35 deletions

View file

@ -3,9 +3,7 @@ use smash::lib::lua_const::*;
use crate::common::consts::*; use crate::common::consts::*;
use crate::common::*; use crate::common::*;
use crate::training::frame_counter; use crate::training::{frame_counter, mash, input_record};
use crate::training::mash;
use crate::training::input_record;
const NOT_SET: u32 = 9001; const NOT_SET: u32 = 9001;
static mut LEDGE_DELAY: u32 = NOT_SET; static mut LEDGE_DELAY: u32 = NOT_SET;
@ -59,6 +57,43 @@ fn roll_ledge_case() {
} }
} }
fn get_ledge_option() -> Option<Action> {
unsafe {
let mut override_action: Option<Action> = None;
let regular_action = if MENU.mash_triggers.contains(MashTrigger::LEDGE)
{Some(MENU.mash_state.get_random())}
else {None};
match LEDGE_CASE {
LedgeOption::NEUTRAL => {
if MENU.ledge_neutral_override != Action::empty() {
override_action = Some(MENU.ledge_neutral_override.get_random());
}
}
LedgeOption::ROLL => {
if MENU.ledge_roll_override != Action::empty() {
override_action = Some(MENU.ledge_roll_override.get_random());
}
}
LedgeOption::JUMP => {
if MENU.ledge_jump_override != Action::empty() {
override_action = Some(MENU.ledge_jump_override.get_random());
}
}
LedgeOption::ATTACK => {
if MENU.ledge_attack_override != Action::empty() {
override_action = Some(MENU.ledge_attack_override.get_random());
}
}
_ => {
override_action = None;
}
}
return override_action.or(regular_action);
}
}
pub unsafe fn force_option(module_accessor: &mut app::BattleObjectModuleAccessor) { pub unsafe fn force_option(module_accessor: &mut app::BattleObjectModuleAccessor) {
if StatusModule::situation_kind(module_accessor) != *SITUATION_KIND_CLIFF { if StatusModule::situation_kind(module_accessor) != *SITUATION_KIND_CLIFF {
// No longer on ledge, so re-roll the ledge case and reset the delay counter for next time // No longer on ledge, so re-roll the ledge case and reset the delay counter for next time
@ -124,19 +159,9 @@ pub unsafe fn force_option(module_accessor: &mut app::BattleObjectModuleAccessor
StatusModule::change_status_request_from_script(module_accessor, status, true); StatusModule::change_status_request_from_script(module_accessor, status, true);
} }
if MENU.mash_triggers.contains(MashTrigger::LEDGE) { let ledge_option: Option<Action> = get_ledge_option();
if LEDGE_CASE == LedgeOption::NEUTRAL && MENU.ledge_neutral_override != Action::empty() { if ledge_option.is_some() {
mash::external_buffer_menu_mash(MENU.ledge_neutral_override.get_random()); mash::external_buffer_menu_mash(ledge_option.unwrap());
} else if LEDGE_CASE == LedgeOption::ROLL && MENU.ledge_roll_override != Action::empty() {
mash::external_buffer_menu_mash(MENU.ledge_roll_override.get_random());
} else if LEDGE_CASE == LedgeOption::JUMP && MENU.ledge_jump_override != Action::empty() {
mash::external_buffer_menu_mash(MENU.ledge_jump_override.get_random());
} else if LEDGE_CASE == LedgeOption::ATTACK && MENU.ledge_attack_override != Action::empty()
{
mash::external_buffer_menu_mash(MENU.ledge_attack_override.get_random());
} else {
mash::external_buffer_menu_mash(MENU.mash_state.get_random());
}
} }
} }

View file

@ -73,8 +73,8 @@ pub struct TrainingModpackMenu {
pub landing_override: Action, pub landing_override: Action,
pub trump_override: Action, pub trump_override: Action,
pub save_state_playback: OnOff, pub save_state_playback: OnOff,
pub recording_slot: RecordSlot, //pub recording_slot: RecordSlot,
pub playback_slot: PlaybackSlot, //pub playback_slot: PlaybackSlot,
pub playback_mash: OnOff, pub playback_mash: OnOff,
pub record_trigger: RecordTrigger, pub record_trigger: RecordTrigger,
pub hitstun_playback: HitstunPlayback, pub hitstun_playback: HitstunPlayback,
@ -169,12 +169,12 @@ pub static DEFAULTS_MENU: TrainingModpackMenu = TrainingModpackMenu {
landing_override: Action::empty(), landing_override: Action::empty(),
trump_override: Action::empty(), trump_override: Action::empty(),
save_state_playback: OnOff::Off, save_state_playback: OnOff::Off,
recording_slot: RecordSlot::S1, //recording_slot: RecordSlot::S1,
playback_slot: PlaybackSlot::S1, //playback_slot: PlaybackSlot::S1,
playback_mash: OnOff::On, playback_mash: OnOff::On,
record_trigger: RecordTrigger::None, //Command? record_trigger: RecordTrigger::None, //Command?
hitstun_playback: HitstunPlayback::Hitstun, hitstun_playback: HitstunPlayback::Hitstun,
// TODO: alphabetize? // TODO: alphabetize
}; };
pub static mut MENU: TrainingModpackMenu = DEFAULTS_MENU; pub static mut MENU: TrainingModpackMenu = DEFAULTS_MENU;
@ -752,20 +752,20 @@ pub unsafe fn ui_menu(menu: TrainingModpackMenu) -> UiMenu<'static> {
true, true,
&(menu.save_state_playback as u32), &(menu.save_state_playback as u32),
); );
input_tab.add_submenu_with_toggles::<RecordSlot>( // input_tab.add_submenu_with_toggles::<RecordSlot>(
"Recording Slot", // "Recording Slot",
"recording_slot", // "recording_slot",
"Recording Slot: Choose which slot to record into", // "Recording Slot: Choose which slot to record into",
true, // true,
&(menu.recording_slot as u32), // &(menu.recording_slot as u32),
); // );
input_tab.add_submenu_with_toggles::<PlaybackSlot>( // TODO: This menu should really be a submenu inside Action menus, probably want to be able to customize for each action // input_tab.add_submenu_with_toggles::<PlaybackSlot>( // TODO: This menu should really be a submenu inside Action menus, probably want to be able to customize for each action
"Playback Slots", // "Playback Slots",
"playback_slot", // "playback_slot",
"Playback Slots: Choose which slots to choose between for playback when this action is triggered", // "Playback Slots: Choose which slots to choose between for playback when this action is triggered",
false, // false,
&(menu.playback_slot.bits() as u32), // &(menu.playback_slot.bits() as u32),
); // );
input_tab.add_submenu_with_toggles::<OnOff>( input_tab.add_submenu_with_toggles::<OnOff>(
"Mash Ends Playback", "Mash Ends Playback",
"playback_mash", "playback_mash",