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

Format Rust code using rustfmt

This commit is contained in:
github-actions[bot] 2021-12-26 18:11:18 +00:00 committed by GitHub
parent 6f6ce58a88
commit ac81ef810f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 16 deletions

View file

@ -10,10 +10,10 @@ pub mod combo;
pub mod directional_influence; pub mod directional_influence;
pub mod frame_counter; pub mod frame_counter;
pub mod ledge; pub mod ledge;
pub mod throw;
pub mod sdi; pub mod sdi;
pub mod shield; pub mod shield;
pub mod tech; pub mod tech;
pub mod throw;
mod air_dodge_direction; mod air_dodge_direction;
mod attack_angle; mod attack_angle;
@ -86,7 +86,7 @@ pub unsafe fn handle_get_command_flag_cat(
flag |= mash::get_command_flag_cat(module_accessor, category); flag |= mash::get_command_flag_cat(module_accessor, category);
// Get throw directions // Get throw directions
flag |= throw::get_command_flag_throw_direction(module_accessor); flag |= throw::get_command_flag_throw_direction(module_accessor);
once_per_frame_per_fighter(module_accessor, category); once_per_frame_per_fighter(module_accessor, category);
flag flag

View file

@ -1,10 +1,10 @@
use crate::common::*; use crate::common::*;
use crate::training::frame_counter; use crate::training::frame_counter;
use crate::training::ledge; use crate::training::ledge;
use crate::training::throw;
use crate::training::mash; use crate::training::mash;
use crate::training::sdi; use crate::training::sdi;
use crate::training::shield_tilt; use crate::training::shield_tilt;
use crate::training::throw;
use smash::app::{self, lua_bind::*}; use smash::app::{self, lua_bind::*};
use smash::lib::lua_const::*; use smash::lib::lua_const::*;

View file

@ -56,7 +56,7 @@ fn roll_throw_delay() {
return; return;
} }
THROW_DELAY = MENU.throw_delay.get_random().into_meddelay(); THROW_DELAY = MENU.throw_delay.get_random().into_meddelay();
} }
} }
@ -67,7 +67,7 @@ fn roll_pummel_delay() {
return; return;
} }
PUMMEL_DELAY = MENU.pummel_delay.get_random().into_meddelay(); PUMMEL_DELAY = MENU.pummel_delay.get_random().into_meddelay();
} }
} }
@ -83,16 +83,15 @@ fn roll_throw_case() {
} }
pub unsafe fn get_command_flag_throw_direction( pub unsafe fn get_command_flag_throw_direction(
module_accessor: &mut app::BattleObjectModuleAccessor module_accessor: &mut app::BattleObjectModuleAccessor,
) -> i32 { ) -> i32 {
if !is_operation_cpu(module_accessor) { if !is_operation_cpu(module_accessor) {
return 0; return 0;
} }
if StatusModule::status_kind(module_accessor) as i32 != *FIGHTER_STATUS_KIND_CATCH_WAIT if StatusModule::status_kind(module_accessor) as i32 != *FIGHTER_STATUS_KIND_CATCH_WAIT
&& StatusModule::status_kind(module_accessor) as i32 != *FIGHTER_STATUS_KIND_CATCH_PULL && StatusModule::status_kind(module_accessor) as i32 != *FIGHTER_STATUS_KIND_CATCH_PULL
&& StatusModule::status_kind(module_accessor) as i32 != *FIGHTER_STATUS_KIND_CATCH_ATTACK && StatusModule::status_kind(module_accessor) as i32 != *FIGHTER_STATUS_KIND_CATCH_ATTACK
{ {
// No longer holding character, so re-roll the throw case and reset the delay counter for next time // No longer holding character, so re-roll the throw case and reset the delay counter for next time
reset_throw_case(); reset_throw_case();
@ -101,8 +100,9 @@ pub unsafe fn get_command_flag_throw_direction(
reset_pummel_delay(); reset_pummel_delay();
return 0; return 0;
} }
if !WorkModule::is_enable_transition_term( // If you can't throw right now, don't bother if !WorkModule::is_enable_transition_term(
// If you can't throw right now, don't bother
module_accessor, module_accessor,
*FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_THROW_HI, *FIGHTER_STATUS_TRANSITION_TERM_ID_CONT_THROW_HI,
) { ) {
@ -130,10 +130,10 @@ pub unsafe fn get_command_flag_throw_direction(
if MENU.pummel_delay == MedDelay::empty() { if MENU.pummel_delay == MedDelay::empty() {
return 0; return 0;
} }
// (this conditional would need to be changed to speed up pummelling) // (this conditional would need to be changed to speed up pummelling)
if StatusModule::status_kind(module_accessor) as i32 == *FIGHTER_STATUS_KIND_CATCH_WAIT { if StatusModule::status_kind(module_accessor) as i32 == *FIGHTER_STATUS_KIND_CATCH_WAIT {
let status = *FIGHTER_STATUS_KIND_CATCH_ATTACK;//.unwrap_or(0); let status = *FIGHTER_STATUS_KIND_CATCH_ATTACK; //.unwrap_or(0);
StatusModule::change_status_request_from_script(module_accessor, status, true); StatusModule::change_status_request_from_script(module_accessor, status, true);
} }
@ -149,6 +149,6 @@ pub unsafe fn get_command_flag_throw_direction(
mash::buffer_menu_mash(); mash::buffer_menu_mash();
return cmd; return cmd;
} }
return 0; return 0;
} }