equation

0

Please login or register to vote for this query.

(click on this box to dismiss)

Stack Overflow Meta en español

Preguntas y respuestas sobre el sitio para programadores y profesionales de la informática

DECLARE @troopstrength INT = 75600
DECLARE @troopbonushealth REAL = 238.5 +25+25-- + 2+3+1
DECLARE @troopbonusstrength REAL = 257.5 + 25
DECLARE @troopbonusstrength2 INT = 592
DECLARE @troopnumber INT = 79


/*
-- elf 24
DECLARE @enemy1strength INT = 2600
DECLARE @enemy1number INT   = 6000
DECLARE @enemy2strength INT = 28
DECLARE @enemy2number INT   = 240000
*/

-- inferno 23
DECLARE @enemy1strength INT = 3100
DECLARE @enemy1number INT   = 4100
DECLARE @enemy2strength INT = 50
DECLARE @enemy2number INT   = 110000

/*
-- elf 23
DECLARE @enemy1strength INT = 2600
DECLARE @enemy1number INT   = 3800
DECLARE @enemy2strength INT = 100
DECLARE @enemy2number INT   = 42000
*/
--undead 23
--DECLARE @enemy1strength INT = 1100
--DECLARE @enemy1number INT   = 8100
--DECLARE @enemy2strength INT = 28
--DECLARE @enemy2number INT   = 140000

SELECT 
--*,
--damage * @troopnumber totaldamage,
--iif(damage * @troopnumber > m1health, 0, cast(m1health- damage * @troopnumber as int)+1)*3/ health monster1kill, 
cast(@enemy1strength * @enemy1number * 3 / damage as int)+1 neededtokill,
cast(@enemy1strength * @enemy1number / health as int) kills1,
cast(@enemy2strength * @enemy2number / health as int) kills2,
cast((@enemy1strength * @enemy1number + @enemy2strength * @enemy2number)/ health as int) maxkills
FROM
(SELECT 
  damage   = @troopstrength * (@troopbonusstrength + @troopbonusstrength2 + 100)/100,
  m1health = @enemy1strength * @enemy1number * 3 ,
  m2health = @enemy2strength * @enemy2number * 3 ,
  health   = (@troopbonushealth + 100)/100*@troopstrength*3 
)x

Enter Parameters

Options:
Switch to main site
loading Hold tight while we fetch your results