public string GetReqST(Configrations configration, double fullWeight) { string st = ""; switch (configration) { case Configrations.Beamer: case Configrations.Pistol: st = Math.Round((Math.Sqrt(fullWeight) * 3.3), 1).ToString(); break; case Configrations.Rifle: case Configrations.SMG: st = Math.Round((Math.Sqrt(fullWeight) * 2.4), 1).ToString(); st += "t"; //поставить меч break; case Configrations.Shotgun: case Configrations.Staf: case Configrations.HeavyWeapon: st = Math.Round((Math.Sqrt(fullWeight) * 2.2), 1).ToString(); st += "M"; break; } return(st); }
public async Task <IActionResult> Edit(Configrations configrations) { if (ModelState.IsValid) { try { _context.Update(configrations); if (!configrations.UseRecurringJob.GetValueOrDefault()) { _context.Database.ExecuteSqlCommand("DELETE FROM [Hangfire].[Hash];DELETE FROM [Hangfire].[JOB];DELETE FROM [Hangfire].[Set]"); } await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { throw; } return(RedirectToAction("Index", "Home")); } return(View(configrations)); }
public int GetBulk(double fullWeight, Configrations configration) { double sb = 0; switch (configration) { case Configrations.Beamer: sb = 1; break; case Configrations.Pistol: sb = 1.25; break; case Configrations.SMG: case Configrations.Rifle: case Configrations.Shotgun: case Configrations.Staf: case Configrations.HeavyWeapon: sb = 1.5; break; } return(-(int)Math.Round(fullWeight * sb, 0)); }
public int GetAcc(Configrations configration, Beams beam) { double ca = 0, ab = 0; switch (configration) { case Configrations.Beamer: ca = 0.5; break; case Configrations.Staf: ca = 0.75; break; case Configrations.Pistol: ca = 1; break; case Configrations.SMG: ca = 1.5; break; case Configrations.Rifle: ca = 2; break; case Configrations.HeavyWeapon: ca = 3; break; } switch (beam) { case Beams.SonicStunner: ab = 3; break; case Beams.SonicScreamer: ab = 3; break; case Beams.Electrolaser: ab = 4; break; case Beams.Plasma: ab = 4; break; case Beams.PlasmaFlamer: //custom round down ab = 3; break; case Beams.SoundDisruptors: //custom round down ab = 3; break; case Beams.PlasmaLance: //custom ab = 2.5; break; default: ab = 6; break; } return((int)Math.Round(ca * ab)); }