mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2025-03-14 02:16:10 +00:00
clean up imports
This commit is contained in:
parent
548b306645
commit
329f0cd3f0
9 changed files with 17 additions and 70 deletions
|
@ -3,8 +3,8 @@ pub mod consts;
|
|||
use smash::lib::lua_const::{*};
|
||||
use crate::common::consts::*;
|
||||
use smash::app::{self};
|
||||
use smash::app::lua_bind::{self, *};
|
||||
use smash::app::{FighterManager, FighterInformation};
|
||||
use smash::app::lua_bind::*;
|
||||
// use smash::app::{FighterManager, FighterInformation};
|
||||
use smash::hash40;
|
||||
|
||||
pub static mut menu_struct : consts::TrainingModpackMenu = consts::TrainingModpackMenu{
|
||||
|
|
|
@ -4,9 +4,8 @@ use smash::app::sv_animcmd::{self};
|
|||
use smash::app::sv_system::{self};
|
||||
use smash::app::lua_bind::*;
|
||||
use smash::lib::lua_const::*;
|
||||
use smash::lib::{L2CAgent, L2CValue, L2CValueType};
|
||||
use smash::lib::{L2CAgent, L2CValue};
|
||||
use smash::phx::{Hash40, Vector3f};
|
||||
use skyline::{logging::HexDump};
|
||||
use crate::common::*;
|
||||
|
||||
/**
|
||||
|
@ -33,7 +32,7 @@ pub fn unlerp_bounded(min: f32, max: f32, val: f32) -> f32 {
|
|||
}
|
||||
|
||||
/**
|
||||
* Linearly nterpolates between two colors, with bounds checking, accounting for
|
||||
* Linearly interpolates between two colors, with bounds checking, accounting for
|
||||
* gamma. arguments:
|
||||
* - min_color (Vector3f) -- xyz maps to rgb, components are usually in the
|
||||
* range [0.0f, 1.0f] but can go beyond to account for super-bright or
|
||||
|
@ -150,45 +149,6 @@ pub unsafe fn generate_hitbox_effects(
|
|||
}
|
||||
}
|
||||
|
||||
// if (*menu).HITBOX_VIS && is_training_mode() { // generate hitbox effect(s)
|
||||
// let color_scale: f32;
|
||||
// if true { // color intensity scales with damage
|
||||
// color_scale = unlerp_bounded(1.0, 18.0, damage.get_num());
|
||||
// } else { // color intensity scales with total KB
|
||||
// // calculate the expected KB a character with 95 weight will receive
|
||||
// // at 80% pre-hit
|
||||
// let target_percent = 80.0;
|
||||
// let target_weight = 95.0;
|
||||
// let percent_component: f32;
|
||||
// if fkb.get_int() > 0 {
|
||||
// percent_component = (10.0 + fkb.get_int() as f32) * 0.1 * (1.0 + fkb.get_int() as f32 * 0.5);
|
||||
// } else {
|
||||
// percent_component = (target_percent + damage.get_num()) * 0.1 *
|
||||
// (1.0 + damage.get_num() * 0.5);
|
||||
// }
|
||||
// let weight_component: f32 = 200.0 / (target_weight + 100.0);
|
||||
// let kb: f32 = (percent_component * weight_component * 1.4 + 18.0) *
|
||||
// (kbg.get_int() as f32 * 0.01) + bkb.get_int() as f32;
|
||||
// color_scale = unlerp_bounded(50.0, 200.0, kb);
|
||||
// }
|
||||
// // non-linear scaling to magnify
|
||||
// // differences at lower values
|
||||
// let color_t: f32 = 0.8 + 0.2 * color_scale.powf(0.5);
|
||||
// let color = color_lerp(
|
||||
// Vector3f{x: 1.0, y: 1.0, z: 1.0},
|
||||
// ID_COLORS[(id.get_int() % 8) as usize],
|
||||
// color_t,
|
||||
// 2.0
|
||||
// );
|
||||
// generate_hitbox_effects(
|
||||
// sv_system::battle_object_module_accessor(lua_state),
|
||||
// bone.get_int(),
|
||||
// size.get_num(),
|
||||
// x.get_num(), y.get_num(), z.get_num(),
|
||||
// x2.try_get_num(), y2.try_get_num(), z2.try_get_num(),
|
||||
// color);
|
||||
// }
|
||||
|
||||
pub unsafe fn get_command_flag_cat(
|
||||
module_accessor: &mut app::BattleObjectModuleAccessor,
|
||||
category: i32)
|
||||
|
|
18
src/lib.rs
18
src/lib.rs
|
@ -1,30 +1,24 @@
|
|||
#![feature(proc_macro_hygiene)]
|
||||
#![allow(unused_imports)]
|
||||
#![allow(unused_variables)]
|
||||
#![allow(dead_code)]
|
||||
#![allow(non_snake_case)]
|
||||
#![allow(non_upper_case_globals)]
|
||||
#![feature(with_options)]
|
||||
#![feature(asm)]
|
||||
|
||||
mod hitbox_visualizer;
|
||||
mod training;
|
||||
mod common;
|
||||
|
||||
use smash::hash40;
|
||||
use crate::common::*;
|
||||
use crate::common::consts::*;
|
||||
|
||||
use smash::lib::lua_const::{*};
|
||||
use smash::lib::{self, L2CAgent, L2CValue};
|
||||
use smash::app::{self};
|
||||
use smash::lib::L2CValue;
|
||||
use smash::app::lua_bind::{*};
|
||||
use smash::app::sv_animcmd::{self};
|
||||
use smash::app::sv_system::{self};
|
||||
use smash::lua2cpp::L2CFighterCommon;
|
||||
use skyline::libc::{size_t, c_int, c_void, strlen, fopen, fwrite, fclose};
|
||||
use smash::Result;
|
||||
use skyline::nn;
|
||||
use skyline::patching::patch_data_from_text;
|
||||
use skyline::{from_c_str, c_str, hooks::A64HookFunction, logging::hex_dump_ptr, logging::HexDump};
|
||||
use std::fs;
|
||||
use skyline::libc::{c_void, fopen, fwrite, fclose};
|
||||
use skyline::{c_str};
|
||||
use skyline::nro::{self, NroInfo};
|
||||
|
||||
#[allow(unused_unsafe)]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use smash::{hash40, phx::Hash40};
|
||||
use smash::hash40;
|
||||
use smash::app::{self};
|
||||
use smash::app::lua_bind::*;
|
||||
use smash::lib::lua_const::*;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use smash::{hash40, phx::Hash40};
|
||||
use smash::hash40;
|
||||
use smash::app::{self};
|
||||
use smash::app::lua_bind::*;
|
||||
use smash::lib::lua_const::*;
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
use smash::{hash40, phx::Hash40, phx::Vector3f};
|
||||
use smash::{phx::Vector3f};
|
||||
use smash::app::{self};
|
||||
use smash::app::lua_bind::*;
|
||||
use smash::lib::lua_const::*;
|
||||
use crate::common::*;
|
||||
use crate::common::consts::*;
|
||||
|
||||
#[derive(PartialEq)]
|
||||
enum SaveState {
|
||||
|
@ -85,9 +84,6 @@ pub unsafe fn save_states(module_accessor: &mut app::BattleObjectModuleAccessor)
|
|||
let pos = Vector3f{x : *save_state_x, y : *save_state_y, z : 0.0};
|
||||
PostureModule::set_pos(module_accessor, &pos);
|
||||
PostureModule::set_lr(module_accessor, *save_state_lr);
|
||||
// DamageModule::add_damage(
|
||||
// module_accessor,
|
||||
// -1.0 * DamageModule::damage(module_accessor, 0), 0);
|
||||
DamageModule::heal(module_accessor, -1.0 * DamageModule::damage(module_accessor, 0), 0);
|
||||
DamageModule::add_damage(module_accessor, *save_state_percent, 0);
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
|
||||
use smash::hash40;
|
||||
use smash::app::{self};
|
||||
use smash::app::lua_bind::*;
|
||||
use smash::lib::lua_const::*;
|
||||
use crate::common::*;
|
||||
use crate::common::consts::*;
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use smash::{hash40, phx::Hash40};
|
||||
use smash::hash40;
|
||||
use smash::app::{self};
|
||||
use smash::app::lua_bind::*;
|
||||
use smash::lib::lua_const::*;
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
use smash::app::{self, sv_system, sv_animcmd, lua_bind::*, FighterManager};
|
||||
use smash::lib::{self, L2CAgent, L2CValue, lua_const::*};
|
||||
use smash::phx::{Hash40, Vector3f};
|
||||
use smash::hash40;
|
||||
use skyline::{c_str, nn::ro::LookupSymbol, logging::hex_dump_ptr};
|
||||
use smash::app::{self, sv_animcmd, lua_bind::*};
|
||||
use smash::lib::{L2CAgent, L2CValue};
|
||||
use skyline::{c_str, nn::ro::LookupSymbol};
|
||||
use crate::common::fighter_manager_addr;
|
||||
use crate::common::*;
|
||||
use crate::common::consts::*;
|
||||
|
|
Loading…
Add table
Reference in a new issue