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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
806 B
Rust
Raw Normal View History

use smash::app::{lua_bind::StatusModule, BattleObjectModuleAccessor};
use smash::lib::lua_const::*;
use crate::common::consts::OnOff;
use crate::common::*;
pub unsafe fn mod_get_stick_y(module_accessor: &mut BattleObjectModuleAccessor) -> Option<f32> {
if !is_operation_cpu(module_accessor) {
return None;
}
let fighter_status_kind = StatusModule::status_kind(module_accessor);
if MENU.crouch == OnOff::On
&& [
*FIGHTER_STATUS_KIND_WAIT,
*FIGHTER_STATUS_KIND_SQUAT,
*FIGHTER_STATUS_KIND_SQUAT_B,
*FIGHTER_STATUS_KIND_SQUAT_F,
*FIGHTER_STATUS_KIND_SQUAT_RV,
*FIGHTER_STATUS_KIND_SQUAT_WAIT,
]
.contains(&fighter_status_kind)
{
Some(-1.0)
} else {
None
}
}