コード例 #1
0
        //uzywa przedmiot
        public void TryUseItem()
        {
            ItemDataAddon it = FPPGameModuleManager.Instance.TheInventory.ActiveItem;

            if (it != null && GameManager.Instance.IsModuleLoaded("Herbology"))
            {
                MedicalItemDataAddon medicalItem = HerbologyModuleManager.Instance.FindMedicalItem(it.Type);
                if (medicalItem != null)
                {
                    CharactersModuleManager.Instance.ThePlayer.InternalPatient.AddTreatmentItem(medicalItem);
                    SilentDestroyItem(it.Type);
                }
            }
        }
コード例 #2
0
        public void AddTreatmentItem(MedicalItemDataAddon newItem)
        {
            newItem.ResetDuration();
            //first use of item is now, it may last longer if has duration > 1
            List <Harm> wplywPrzedmiotu = newItem.GetGeneralChange();

            foreach (Harm change in wplywPrzedmiotu)
            {
                _character.SetSkillValue(change.ResName, _character.getSkillValue(change.ResName) + 1f * change.Value);
            }
            newItem.UseDose();
            if (newItem.DurationRemained >= 1)
            {
                _treatmentItems.Add(newItem);
            }
        }