public void StartExplorer(int stage)
        {
            var stageData  = _explorer.GetStage(stage);
            var staticData = _explorer.Stages[stage];

            //UpdateExplorerSlots();
            foreach (var temp in _units.State.LastTeam)
            {
                var data = _units.GetUnit(temp.Key).data;
                data.ExplorerPosition = temp.Value;
                data.Reserve          = false;
            }

            if (_units.ExplorerUnits.Length == 0)
            {
                throw new Exception("The number of selected units in exploration should be: 0 < count < 3");
            }
            if (!stageData.IsUnlock)
            {
                throw new Exception($"Stage is locked. stage_id = {stage}");
            }
            if (stageData.DailyNumber <= 0)
            {
                throw new Exception($"Ended up trying for today. stage_id = {stage}.");
            }
            if (!staticData.NoExit)
            {
                stageData.DailyNumber--;
            }
            _scorers.Spend(staticData.Price, _formula);
            _explorerLogic.StartExplorer(stage);
            LogicLog.SetExplorer(stage, LogExplorerType.Start);
        }
Exemplo n.º 2
0
        public void StageAutowin(int selectedStageId, int tryCount)
        {
            var stage     = _explorer.Stages[selectedStageId];
            var stageData = _explorer.GetStage(stage.Id);

            for (var i = 0; i < tryCount; i++)
            {
                _explorer.SetCurrentStage(selectedStageId);
                Impact.ExecuteImpact(stage.ImpactAutowin);
                Scorers.Spend(stage.Price, Formula);
                _explorer.ClearCurrentStage();
                LogicLog.SetExplorer(selectedStageId, LogExplorerType.AutoWin);
            }

            stageData.DailyNumber = Mathf.Clamp(stageData.DailyNumber - tryCount, 0, int.MaxValue);
        }
Exemplo n.º 3
0
        public void Drop(int gachaId, GachaCountType count)
        {
            var(gachaItem, prices, countDrop) = _resources.GetGacha(gachaId, count, _condition);
            for (var i = 0; i < countDrop; i++)
            {
                _impactLogic.ExecuteImpact(gachaItem.Impact);
            }
            var gachaPrice = prices.Prices ?? new Dictionary <int, IPrice>();

            foreach (var price in gachaPrice.Values)
            {
                _scorers.Spend(price, _formuls);
            }
            _impactLogic.ExecuteImpact(prices.Impact);
            LogicLog.Gacha(gachaId, countDrop);
            UpdateDropItems();
        }