public void UseItem() { // キャラクターのアイテム数を減らす ((AllyStatus)baseStatus).SetItemNum(currentItem, ((AllyStatus)baseStatus).GetItemNum(currentItem) - 1); if (currentItem.GetItemType() == Item.Type.HPRecovery) { // 回復力 var recoveryPoint = currentItem.GetAmount(); targetCharacterBattleScript.SetHp(targetCharacterBattleScript.GetHp() + recoveryPoint); battleStatusScript.UpdateStatus(targetBaseStatus, BattleStatus.Status.HP, targetCharacterBattleScript.GetHp()); battleManager.ShowMessage(currentTarget.name + "のHPを" + recoveryPoint + "回復した。"); } else if (currentItem.GetItemType() == Item.Type.MPRecovery) { // 回復力 var recoveryPoint = currentItem.GetAmount(); targetCharacterBattleScript.SetMp(targetCharacterBattleScript.GetMp() + recoveryPoint); battleStatusScript.UpdateStatus(targetBaseStatus, BattleStatus.Status.MP, targetCharacterBattleScript.GetMp()); battleManager.ShowMessage(currentTarget.name + "のMPを" + recoveryPoint + "回復した。"); } else if (currentItem.GetItemType() == Item.Type.ParalyzeRecovery) { targetBaseStatus.SetParalyze(false); battleManager.ShowMessage(currentTarget.name + "の麻痺を消した。"); } else if (currentItem.GetItemType() == Item.Type.PoisonRecovery) { targetBaseStatus.SetPoisonState(false); battleManager.ShowMessage(currentTarget.name + "の毒を消した。"); } else if (currentItem.GetItemType() == Item.Type.SilentRecovery) { targetBaseStatus.SetSilence(false); battleManager.ShowMessage(currentTarget.name + "の沈黙を消した。"); } // アイテム数が0になったらItemDictionaryからそのアイテムを削除 if (((AllyStatus)baseStatus).GetItemNum(currentItem) == 0) { ((AllyStatus)baseStatus).GetItemDictionary().Remove(currentItem); } }