public void StartExplorer(int stageId) { var stageData = _explorer.GetStage(stageId); _explorer.SetCurrentStage(stageId); _explorer.State.PlayerBuffs.Clear(); foreach (var id in stageData.ObjectAvailibility.Select(x => x.Key).ToList()) { var staticData = _explorer.Static.Objects[id]; if (staticData.Revert) { stageData.ObjectAvailibility.Remove(id); } } _scorersLogic.ClearTemporaryScorers(); var maxStamina = 0; foreach (var unitId in _units.ExplorerUnits) { var(data, def) = _units.GetUnit(unitId); maxStamina += _units.CalculateMaxStamina(unitId); foreach (var perk in data.PerkStars) { var charges = _units.CalculatePerkCharges(unitId, perk.Key); data.PerkCharges[perk.Key] = charges; } //_context.SetContextFormula(unitId); //data.CurrentHp = (float)_units.CalculateMaxHp(data, _formula).Value; } foreach (var data in _units.State.Units) { if (data.Stars > 0) { _context.SetContextFormula(data.Id); data.CurrentHp = (float)_units.CalculateMaxHp(data, _formula).Value; } } _context.SetContextFormula(null); stageData.Values[_scorers.StaminaId] = maxStamina; }
public Int32 CalculatePerkCharges(System.Int32 unitId, System.Int32 perkId) { return(_accessor.CalculatePerkCharges(unitId, perkId)); }