private void OnActionChosen_Use() { if (CurrentItem.CanBeUsedFromBag()) { if (CurrentItem is GeneralItem generalCurrentItem && !generalCurrentItem.GetRequireTargetPokemon()) { // General items that don't require a pokemon target to be used // Items are handled for individual cases as functionalities are too unique to generalise // Switch statement for different possible items that are being used switch (generalCurrentItem.id) { case GeneralItem.repelId: case GeneralItem.superRepelId: case GeneralItem.maxRepelId: OnActionChosen_Use_Repel(generalCurrentItem); break; default: Debug.LogError("Unhandled general no-target-pokemon item id - " + generalCurrentItem.id); break; } PlayerData.singleton.inventory.RemoveItem(CurrentItem, 1); textBoxController.Show(); textBoxController.SetTextInstant($"{CurrentItem.itemName} was used"); textBoxController.SetHideDelay(1.5F); ChangeToSectionSelection(false); } else { // Default case pokemonSelectionMode = PokemonSelectionMode.Use; ChangeToPokemonSelection(); } }