public bool actor_deployed(int actor_id) { bool result = false; int temp_actor_id = Unit_Window.actor_id; Unit_Window.actor_id = actor_id; if (!Units_To_UnDeploy.Contains(Unit_Window.index)) { if (Units_To_Deploy.Contains(Unit_Window.index) || Unit_Deployed_Flags[Unit_Window.index]) { result = true; } } Unit_Window.actor_id = temp_actor_id; return(result); }
public bool switch_unit(int index) { bool result = false; var unit_window = (Unit_Window as Window_Prep_PickUnits_Unit); if (Unit_Deployed_Flags[index]) { // If forced, buzz if (Global.game_map.forced_deployment.Contains(actor_id)) { Global.game_system.play_se(System_Sounds.Buzzer); } // If pre-deployed, buzz else if (!Global.game_map.deployment_points.Contains(Global.game_map.units[ Global.game_map.get_unit_id_from_actor(actor_id)].loc)) { Global.game_system.play_se(System_Sounds.Buzzer); } else { // If Unit was deployed and has been removed, add them back to the team if (Units_To_UnDeploy.Contains(index)) { // If too many units, buzz if (unit_count_maxed) { Global.game_system.play_se(System_Sounds.Buzzer); } else { Global.game_system.play_se(System_Sounds.Confirm); Units_Deployed++; Units_To_UnDeploy.Remove(index); unit_window.refresh_unit(true); result = true; } } // Else undeploy unit else { Global.game_system.play_se(System_Sounds.Cancel); Units_Deployed--; Units_To_UnDeploy.Add(index); unit_window.refresh_unit(false); result = true; } } } else { // If Unit wasn't deployed and and wants to be, add them to the team if (!Units_To_Deploy.Contains(index)) { // If too many units, buzz if (unit_count_maxed) { Global.game_system.play_se(System_Sounds.Buzzer); } else { Global.game_system.play_se(System_Sounds.Confirm); Units_Deployed++; Units_To_Deploy.Add(index); unit_window.refresh_unit(true); result = true; } } // Else undeploy unit else { Global.game_system.play_se(System_Sounds.Cancel); Units_Deployed--; Units_To_Deploy.Remove(index); unit_window.refresh_unit(false); result = true; } } unit_window.unit_count = Units_Deployed; return(result); }