mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-22 06:16:11 +00:00
* Add rustfmt CI checker Minimal checker that just runs `cargo fmt --check` on all targets. * rustfmt
32 lines
773 B
Rust
32 lines
773 B
Rust
use smash::app::{self};
|
|
|
|
use crate::common::consts::*;
|
|
use crate::common::*;
|
|
|
|
static mut STICK_DIRECTION: Direction = Direction::OUT;
|
|
|
|
pub fn roll_direction() {
|
|
unsafe {
|
|
STICK_DIRECTION = MENU.shield_tilt.get_random();
|
|
}
|
|
}
|
|
|
|
pub unsafe fn mod_get_stick_x(
|
|
module_accessor: &mut app::BattleObjectModuleAccessor,
|
|
) -> Option<f32> {
|
|
get_angle(module_accessor).map(|a| a.cos() as f32)
|
|
}
|
|
|
|
pub unsafe fn mod_get_stick_y(
|
|
module_accessor: &mut app::BattleObjectModuleAccessor,
|
|
) -> Option<f32> {
|
|
get_angle(module_accessor).map(|a| a.sin() as f32)
|
|
}
|
|
|
|
unsafe fn get_angle(module_accessor: &mut app::BattleObjectModuleAccessor) -> Option<f64> {
|
|
if !is_operation_cpu(module_accessor) {
|
|
return None;
|
|
}
|
|
|
|
STICK_DIRECTION.into_angle()
|
|
}
|