mirror of
https://github.com/jugeeya/UltimateTrainingModpack.git
synced 2024-11-20 08:54:15 +00:00
refactor to as_lua_int and lua bools when possible
This commit is contained in:
parent
7befc07555
commit
0a6a26b6b2
2 changed files with 21 additions and 21 deletions
|
@ -191,20 +191,20 @@ unsafe fn handle_escape_option(fighter: &mut L2CFighterCommon) {
|
|||
match MENU.mash_state {
|
||||
Mash::Spotdodge => {
|
||||
fighter.fighter_base.change_status(
|
||||
L2CValue::new_int(*FIGHTER_STATUS_KIND_ESCAPE as u64),
|
||||
L2CValue::new_bool(true),
|
||||
FIGHTER_STATUS_KIND_ESCAPE.as_lua_int(),
|
||||
LUA_TRUE,
|
||||
);
|
||||
}
|
||||
Mash::RollForward => {
|
||||
fighter.fighter_base.change_status(
|
||||
L2CValue::new_int(*FIGHTER_STATUS_KIND_ESCAPE_F as u64),
|
||||
L2CValue::new_bool(true),
|
||||
FIGHTER_STATUS_KIND_ESCAPE_F.as_lua_int(),
|
||||
LUA_TRUE,
|
||||
);
|
||||
}
|
||||
Mash::RollBack => {
|
||||
fighter.fighter_base.change_status(
|
||||
L2CValue::new_int(*FIGHTER_STATUS_KIND_ESCAPE_B as u64),
|
||||
L2CValue::new_bool(true),
|
||||
FIGHTER_STATUS_KIND_ESCAPE_B.as_lua_int(),
|
||||
LUA_TRUE,
|
||||
);
|
||||
}
|
||||
_ => (),
|
||||
|
@ -229,8 +229,8 @@ unsafe fn handle_attack_option(
|
|||
}
|
||||
|
||||
fighter.fighter_base.change_status(
|
||||
L2CValue::new_int(*FIGHTER_STATUS_KIND_CATCH as u64),
|
||||
L2CValue::new_bool(true),
|
||||
FIGHTER_STATUS_KIND_CATCH.as_lua_int(),
|
||||
LUA_TRUE,
|
||||
);
|
||||
}
|
||||
Attack::UpB => {
|
||||
|
@ -241,8 +241,8 @@ unsafe fn handle_attack_option(
|
|||
return;
|
||||
}
|
||||
fighter.fighter_base.change_status(
|
||||
L2CValue::new_int(*FIGHTER_STATUS_KIND_SPECIAL_HI as u64),
|
||||
L2CValue::new_bool(false),
|
||||
FIGHTER_STATUS_KIND_SPECIAL_HI.as_lua_int(),
|
||||
LUA_TRUE,
|
||||
);
|
||||
}
|
||||
Attack::UpSmash => {
|
||||
|
@ -253,8 +253,8 @@ unsafe fn handle_attack_option(
|
|||
return;
|
||||
}
|
||||
fighter.fighter_base.change_status(
|
||||
L2CValue::new_int(*FIGHTER_STATUS_KIND_ATTACK_HI4_START as u64),
|
||||
L2CValue::new_bool(false),
|
||||
FIGHTER_STATUS_KIND_ATTACK_HI4_START.as_lua_int(),
|
||||
LUA_TRUE,
|
||||
);
|
||||
}
|
||||
_ => (),
|
||||
|
|
|
@ -62,16 +62,16 @@ unsafe fn mod_handle_change_status(
|
|||
app::sv_math::rand(hash40("fighter"), random_statuses.len() as i32) as usize;
|
||||
if random_statuses[random_status_index] != FIGHTER_STATUS_KIND_DOWN {
|
||||
*status_kind = L2CValue::new_int(random_statuses[random_status_index] as u64);
|
||||
*unk = L2CValue::new_bool(true);
|
||||
*unk = LUA_TRUE
|
||||
}
|
||||
}
|
||||
TechOption::InPlace => {
|
||||
*status_kind = L2CValue::new_int(*FIGHTER_STATUS_KIND_PASSIVE as u64);
|
||||
*unk = L2CValue::new_bool(true);
|
||||
*status_kind = FIGHTER_STATUS_KIND_PASSIVE.as_lua_int();
|
||||
*unk = LUA_TRUE;
|
||||
}
|
||||
TechOption::Roll => {
|
||||
*status_kind = L2CValue::new_int(*FIGHTER_STATUS_KIND_PASSIVE_FB as u64);
|
||||
*unk = L2CValue::new_bool(true);
|
||||
*status_kind = FIGHTER_STATUS_KIND_PASSIVE_FB.as_lua_int();
|
||||
*unk = LUA_TRUE;
|
||||
}
|
||||
_ => (),
|
||||
}
|
||||
|
@ -83,8 +83,8 @@ unsafe fn mod_handle_change_status(
|
|||
if status_kind_int == FIGHTER_STATUS_KIND_STOP_WALL
|
||||
|| status_kind_int == FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_LR
|
||||
{
|
||||
*status_kind = L2CValue::new_int(*FIGHTER_STATUS_KIND_PASSIVE_WALL as u64);
|
||||
*unk = L2CValue::new_bool(true);
|
||||
*status_kind = FIGHTER_STATUS_KIND_PASSIVE_WALL.as_lua_int();
|
||||
*unk = LUA_TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -92,8 +92,8 @@ unsafe fn mod_handle_change_status(
|
|||
if status_kind_int == FIGHTER_STATUS_KIND_STOP_CEIL
|
||||
|| status_kind_int == FIGHTER_STATUS_KIND_DAMAGE_FLY_REFLECT_U
|
||||
{
|
||||
*status_kind = L2CValue::new_int(*FIGHTER_STATUS_KIND_PASSIVE_CEIL as u64);
|
||||
*unk = L2CValue::new_bool(true);
|
||||
*status_kind = FIGHTER_STATUS_KIND_PASSIVE_CEIL.as_lua_int();
|
||||
*unk = LUA_TRUE;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue