[MIRROR] Replaces the RnG of electric shocks with a more sane calculation (#7466)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: BlackMajor <henrydyer6@hotmail.com>
This commit is contained in:
CHOMPStation2
2023-12-24 05:31:07 -07:00
committed by GitHub
parent 37382803a2
commit e93a179596
2 changed files with 28 additions and 40 deletions

View File

@@ -233,30 +233,17 @@
return
/obj/item/weapon/cell/proc/get_electrocute_damage()
switch (charge)
/* if (9000 to INFINITY)
return min(rand(90,150),rand(90,150))
if (2500 to 9000-1)
return min(rand(70,145),rand(70,145))
if (1750 to 2500-1)
return min(rand(35,110),rand(35,110))
if (1500 to 1750-1)
return min(rand(30,100),rand(30,100))
if (750 to 1500-1)
return min(rand(25,90),rand(25,90))
if (250 to 750-1)
return min(rand(20,80),rand(20,80))
if (100 to 250-1)
return min(rand(20,65),rand(20,65))*/
if (1000000 to INFINITY)
return min(rand(50,160),rand(50,160))
if (200000 to 1000000-1)
return min(rand(25,80),rand(25,80))
if (100000 to 200000-1)//Ave powernet
return min(rand(20,60),rand(20,60))
if (50000 to 100000-1)
return min(rand(15,40),rand(15,40))
if (1000 to 50000-1)
return min(rand(10,20),rand(10,20))
else
return 0
//1kW = 5
//10kW = 24
//100kW = 45
//250kW = 53
//1MW = 66
//10MW = 88
//100MW = 110
//1GW = 132
if(charge >= 1000)
var/damage = log(1.1,charge)
damage = damage - (log(1.1,damage)*1.5)
return round(damage)
else
return 0

View File

@@ -159,19 +159,20 @@
return between(0, (load / avail) * 100, 100)
/datum/powernet/proc/get_electrocute_damage()
switch(avail)
if (1000000 to INFINITY)
return min(rand(50,160),rand(50,160))
if (200000 to 1000000)
return min(rand(25,80),rand(25,80))
if (100000 to 200000)//Ave powernet
return min(rand(20,60),rand(20,60))
if (50000 to 100000)
return min(rand(15,40),rand(15,40))
if (1000 to 50000)
return min(rand(10,20),rand(10,20))
else
return 0
//1kW = 5
//10kW = 24
//100kW = 45
//250kW = 53
//1MW = 66
//10MW = 88
//100MW = 110
//1GW = 132
if(avail >= 1000)
var/damage = log(1.1,avail)
damage = damage - (log(1.1,damage)*1.5)
return round(damage)
else
return 0
////////////////////////////////////////////////
// Misc.