1
0
Fork 0
mirror of https://github.com/jugeeya/UltimateTrainingModpack.git synced 2024-11-20 08:54:15 +00:00

Mash Fixes (#140)

* Fix Shield Toggle

Fixed air dodging when shield is buffered

* Update Mash Reset

Fixed followups not being cleared on reset (training mode/ save state/ tech)

Fixed resetting when landing after a mash toggle

* Version +

* Use Existing Constant

* Adjust Versioning
This commit is contained in:
sidschingis 2020-08-18 00:05:40 +02:00 committed by GitHub
parent 1835be9cfb
commit 53c361686f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 16 deletions

View file

@ -38,7 +38,7 @@ include $(DEVKITPRO)/libnx/switch_rules
# NACP building is skipped as well. # NACP building is skipped as well.
#--------------------------------------------------------------------------------- #---------------------------------------------------------------------------------
APP_TITLE := Training Modpack APP_TITLE := Training Modpack
APP_VERSION := 2.6beta APP_VERSION := 2.4.1beta
TARGET := ovlTrainingModpack TARGET := ovlTrainingModpack
BUILD := build BUILD := build

View file

@ -3,8 +3,8 @@ use crate::common::*;
use crate::training::character_specific; use crate::training::character_specific;
use crate::training::fast_fall; use crate::training::fast_fall;
use crate::training::full_hop; use crate::training::full_hop;
use crate::training::shield;
use crate::training::sdi; use crate::training::sdi;
use crate::training::shield;
use smash::app::{self, lua_bind::*}; use smash::app::{self, lua_bind::*};
use smash::lib::lua_const::*; use smash::lib::lua_const::*;
@ -52,7 +52,7 @@ pub fn get_current_buffer() -> Action {
} }
} }
pub fn reset() { fn reset() {
unsafe { unsafe {
QUEUE.pop(); QUEUE.pop();
} }
@ -60,6 +60,14 @@ pub fn reset() {
shield::suspend_shield(get_current_buffer()); shield::suspend_shield(get_current_buffer());
} }
pub fn full_reset(){
unsafe{
while QUEUE.len() > 0 {
reset();
}
}
}
pub fn set_aerial(attack: Action) { pub fn set_aerial(attack: Action) {
if !shield::is_aerial(attack) { if !shield::is_aerial(attack) {
return; return;
@ -113,7 +121,7 @@ unsafe fn check_buffer(module_accessor: &mut app::BattleObjectModuleAccessor) {
and to reset when using the training mode reset and to reset when using the training mode reset
*/ */
if should_reset(module_accessor) { if should_reset(module_accessor) {
reset(); full_reset();
} }
return; return;
@ -137,16 +145,8 @@ fn should_reset(module_accessor: &mut app::BattleObjectModuleAccessor) -> bool {
prev_status = StatusModule::prev_status_kind(module_accessor, 0); prev_status = StatusModule::prev_status_kind(module_accessor, 0);
} }
// Don't reset after teching // Only reset on training mode reset
if prev_status == *FIGHTER_STATUS_KIND_DOWN { if prev_status != *FIGHTER_STATUS_KIND_NONE {
return false;
}
if prev_status == *FIGHTER_STATUS_KIND_PASSIVE {
return false;
}
if prev_status == *FIGHTER_STATUS_KIND_PASSIVE_FB {
return false; return false;
} }
@ -233,6 +233,9 @@ unsafe fn perform_action(module_accessor: &mut app::BattleObjectModuleAccessor)
); );
} }
Action::SHIELD => { Action::SHIELD => {
if !is_grounded(module_accessor) {
return 0;
}
/* /*
Doesn't actually cause the shield, but will clear the buffer once shield is possible. Doesn't actually cause the shield, but will clear the buffer once shield is possible.
Shield hold is performed through shield::should_hold_shield and request_shield Shield hold is performed through shield::should_hold_shield and request_shield
@ -454,7 +457,7 @@ fn try_change_status(
} }
pub unsafe fn perform_defensive_option() { pub unsafe fn perform_defensive_option() {
reset(); full_reset();
let action = match MENU.defensive_state.get_random() { let action = match MENU.defensive_state.get_random() {
Defensive::ROLL_F => Action::ROLL_F, Defensive::ROLL_F => Action::ROLL_F,

View file

@ -95,7 +95,7 @@ pub unsafe fn save_states(module_accessor: &mut app::BattleObjectModuleAccessor,
SAVE_STATE_PLAYER.state = KillPlayer; SAVE_STATE_PLAYER.state = KillPlayer;
SAVE_STATE_CPU.state = KillPlayer; SAVE_STATE_CPU.state = KillPlayer;
} }
mash::reset(); mash::full_reset();
return; return;
} }