public HttpResponseMessage RegisterOfficerChanges(Crew.CrewOfficer officer)
        {
            string steamId            = User.Identity.Name;
            int    playerId           = PlayerDataSql.PlayerId(steamId);
            string statsEditingResult = Crew.CrewOfficer.RegisterOfficerStatsChanged(playerId, officer);

            if (string.IsNullOrEmpty(statsEditingResult))
            {
                var response = new HttpResponseMessage(HttpStatusCode.OK);
                return(response);
            }
            else
            {
                var response = new HttpResponseMessage(HttpStatusCode.BadRequest);
                response.ReasonPhrase = statsEditingResult;
                return(response);
            }
        }
Exemple #2
0
        public void CreateFromOfficer(Crew.CrewOfficer officer)
        {
            //Добавление брони - +100% за каждые 10 очков статов
            int tStat = officer.StatValue(Crew.OfficerStatType.StatType.ArmorBoost);

            ArmorPercent = GetStandartBonusForSkill(tStat);

            //Увеличение ловкости. Стат добавляет 0.1% ловкости за каждое очко
            tStat        = officer.StatValue(Crew.OfficerStatType.StatType.Dexterity);
            DexterityAdd = (float)tStat / 10;

            //Сумма всех оружейных статов - для расчета в нескольких статах
            float weaponTotal = officer.WeaponStatSum();

            FireRatePercent         = (1 + weaponTotal / 10 / 100);
            DamageAmountPercent     = (1 + weaponTotal / 5 / 100);
            CriticalChancePercent   = (1 + weaponTotal / 100);
            CriticalStrengthPercent = (1 + weaponTotal / 100);

            //Увеличение мощности разных пушек - по 100% за каждые 10 очков умения
            tStat = officer.StatValue(Crew.OfficerStatType.StatType.ExplosiveWeapons);
            ExplosiveDamagePercent = GetStandartBonusForSkill(tStat);

            tStat = officer.StatValue(Crew.OfficerStatType.StatType.KineticWeapons);
            KineticDamagePercent = GetStandartBonusForSkill(tStat);

            tStat = officer.StatValue(Crew.OfficerStatType.StatType.LaserWeapons);
            LaserDamagePercent = GetStandartBonusForSkill(tStat);

            //Что делать с реактором не решено. Пока не будет сета модулей кораблей говорить о
            //том, как будет сбалансирован этот аспект бессмысленно
            tStat          = officer.StatValue(Crew.OfficerStatType.StatType.ReactorBoost);
            ReactorPercent = (1 + (float)tStat / 100);

            //Со щитом всё просто - офицер драматически увеличивает его
            tStat              = officer.StatValue(Crew.OfficerStatType.StatType.ShieldsBoost);
            ShieldPercent      = GetStandartBonusForSkill(tStat);
            ShieldRegenPercent = ShieldPercent;

            //Ускорители - пока не понятно как быть со скоростью, так что пропускаем ускорители
            tStat = officer.StatValue(Crew.OfficerStatType.StatType.ThrustersBoost);
        }
Exemple #3
0
 //Для расчета буста, который даёт офицер
 public ParameterBonus(Crew.CrewOfficer officer)
 {
     CreateFromOfficer(officer);
 }