Example #1
0
        private bool TryConsumeMoney(ResetConfiguration configuration)
        {
            var calculatedRequiredZen = configuration.RequiredMoney;

            if (configuration.MultiplyRequiredMoneyByResetCount)
            {
                calculatedRequiredZen *= this.GetResetCount() + 1;
            }

            if (!this.player.TryRemoveMoney(calculatedRequiredZen))
            {
                this.ShowMessage($"You don't have enough money for reset, required zen is {calculatedRequiredZen}");
                return(false);
            }

            return(true);
        }
Example #2
0
        private void UpdateStats(ResetConfiguration configuration)
        {
            var calculatedPointsPerReset = configuration.PointsPerReset;

            if (configuration.MultiplyPointsByResetCount)
            {
                calculatedPointsPerReset *= this.GetResetCount();
            }

            if (configuration.ResetStats)
            {
                this.player.SelectedCharacter.CharacterClass.StatAttributes
                .Where(s => s.IncreasableByPlayer)
                .ForEach(s => this.player.Attributes[s.Attribute] = s.BaseValue);
            }

            this.player.SelectedCharacter.LevelUpPoints = calculatedPointsPerReset;
        }