private static float SkillBuffModifier(Skill.Type type, float amount)
        {
            if (PlayerBuff.HasBuff <Productive>())
            {
                var statIncModifier = new StatIncreaseArgs(amount);
                PlayerBuff.GetBuff <Productive>()?.TakeEffect(statIncModifier);
                amount = statIncModifier.Amount;
            }

            return(amount);
        }
Exemple #2
0
        public override void Drain(float timeScale)
        {
            float multiplier  = (GameLibOfMethods.isSleeping) ? 0.5f : 1;
            float drainAmount = data.drainPerHour * timeScale * multiplier;

            if (PlayerBuff.HasBuff <Suppression>())
            {
                var statModifier = new StatDecreaseArgs(drainAmount);
                PlayerBuff.GetBuff <Suppression>()?.TakeEffect(statModifier);
                drainAmount = statModifier.Amount;
            }

            Add(drainAmount);
        }
Exemple #3
0
        public override void Use()
        {
            CurrentAction.ApplyStatsOnUse();

            if (shouldCancel && !PlayerBuff.HasBuff <DeepSleep>())
            {
                FinishUsing(true);
            }
            else if (!CurrentAction.ValidateStats())
            {
                useState = ObjectUseState.Preparation;
                GameClock.ResetSpeed();
                ExitAfterDelay(false);
            }
        }
Exemple #4
0
        public override void Interact()
        {
            var result = TrySetCurrentAction("Sleep");

            if (result)
            {
                if (PlayerBuff.HasBuff <Insomnia>())
                {
                    PlayerChatLog.Instance.AddChatMessege("I can't sleep.");
                    return;
                }

                BeginUsing();
            }
            else
            {
                result.PrintErrorMessage();
            }
        }
Exemple #5
0
    public virtual void Finish()
    {
        foreach (Skill.Type type in RequiredSkills.Keys)
        {
            Stats.AddXP(type, XPbonus);
        }
        WorkedToday = true;

        var salary = WagePerHour *
                     (float)System.TimeSpan.FromSeconds(JobManager.Instance.CurrentWorkingTime).TotalHours;

        if (PlayerBuff.HasBuff <Motivated>())
        {
            var statIncrease = new StatIncreaseArgs(salary);
            PlayerBuff.GetBuff <Motivated>()?.TakeEffect(statIncrease);
            salary = statIncrease.Amount;
        }

        Stats.AddMoney(salary);
    }
        private static float StatBuffModifier(Status.Type type, float amount)
        {
            switch (type)
            {
            case Status.Type.Mood when amount > 0 && PlayerBuff.HasBuff <Freedom>():
                var statIncModifier = new StatIncreaseArgs(amount);
                PlayerBuff.GetBuff <Freedom>()?.TakeEffect(statIncModifier);
                amount = statIncModifier.Amount;
                break;

            case Status.Type.Health when PlayerBuff.HasBuff <Suppression>():
            {
                var statDecModifier = new StatDecreaseArgs(amount);
                PlayerBuff.GetBuff <Suppression>()?.TakeEffect(statDecModifier);
                amount = statDecModifier.Amount;
                break;
            }
            }

            return(amount);
        }