Пример #1
0
        private void RefreshMedicalCooldown()
        {
            // assign twice in order to reset the animated countdown
            this.MedicalCooldownDuration = 0;

            var medicalCooldownEffect =
                this.statusEffects.FirstOrDefault(se => se.ProtoGameObject is StatusEffectMedicalCooldown);

            if (medicalCooldownEffect is null)
            {
                return;
            }

            var intensity = StatusEffectMedicalCooldown.GetPublicState(medicalCooldownEffect).Intensity;

            this.MedicalCooldownDuration = intensity * StatusEffectMedicalCooldown.MaxDuration;
        }
Пример #2
0
        private bool SharedHasActiveCooldown(IItem item, ICharacter character)
        {
            if (this.CooldownDuration <= 0)
            {
                // this item is not subject to the medical cooldown
                return(false);
            }

            if (!character.SharedHasPerk(StatName.PerkCannotUseMedicalItems))
            {
                return(false);
            }

            Logger.Info("Cannot use a medicine - under a medical cooldown: " + item, character);

            if (IsClient)
            {
                StatusEffectMedicalCooldown.ClientShowCooldownNotification();
            }

            return(true);
        }