Exemplo n.º 1
0
        public void CompleteAchievement(int achievementId)
        {
            var achievement = _accessor.Static.Achievements[achievementId];
            var value       = _scorersLogic.GetScorer(achievement.ScorerId, 0);
            var maxValue    = _formula.Calculate(achievement.Value);

            if (value < maxValue)
            {
                throw new Exception($"error update achievement. value = {value} maxValue = {maxValue}");
            }
            _impacts.ExecuteImpact(achievement.Impact);
            foreach (var temp in achievement.Items)
            {
                _dropLogic.Drop(temp.Value);
            }
            _accessor.State.Achievements[achievementId].Complete = true;
            LogicLog.CompleteAchievement(achievementId);
        }