From 716562c88c61f2e98b26946242a3660624d6676d Mon Sep 17 00:00:00 2001 From: GradualSyrup <68757075+GradualSyrup@users.noreply.github.com> Date: Fri, 29 Mar 2024 17:36:47 -0500 Subject: [PATCH] Save Levin Aerial Usage (#678) --- src/training/charge.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/training/charge.rs b/src/training/charge.rs index 55dee83..bcb6b62 100644 --- a/src/training/charge.rs +++ b/src/training/charge.rs @@ -26,6 +26,7 @@ pub struct RobinCharges { pub purple_book: i32, pub levin_charge: i32, pub levin_recharge: i32, + pub has_levin: bool, } #[derive(Serialize, Deserialize, Default, Copy, Clone, Debug)] @@ -324,6 +325,10 @@ pub unsafe fn get_charge( module_accessor, *FIGHTER_REFLET_INSTANCE_WORK_ID_INT_THUNDER_SWORD_REVIVAL_COUNT, ); + let has_levin = WorkModule::is_flag( + module_accessor, + *FIGHTER_REFLET_INSTANCE_WORK_ID_FLAG_THUNDER_SWORD_ON, + ); let robin_charges = RobinCharges { thunder_kind, yellow_book, @@ -332,6 +337,7 @@ pub unsafe fn get_charge( purple_book, levin_charge, levin_recharge, + has_levin, }; charge_state.set_robin(robin_charges) } @@ -968,6 +974,11 @@ pub unsafe fn handle_charge( robin_charges.levin_recharge, *FIGHTER_REFLET_INSTANCE_WORK_ID_INT_THUNDER_SWORD_REVIVAL_COUNT, ); + WorkModule::set_flag( + module_accessor, + robin_charges.has_levin, + *FIGHTER_REFLET_INSTANCE_WORK_ID_FLAG_THUNDER_SWORD_ON, + ); }); } // Incineroar Revenge