[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 return
/obj/item/weapon/cell/proc/get_electrocute_damage() /obj/item/weapon/cell/proc/get_electrocute_damage()
switch (charge) //1kW = 5
/* if (9000 to INFINITY) //10kW = 24
return min(rand(90,150),rand(90,150)) //100kW = 45
if (2500 to 9000-1) //250kW = 53
return min(rand(70,145),rand(70,145)) //1MW = 66
if (1750 to 2500-1) //10MW = 88
return min(rand(35,110),rand(35,110)) //100MW = 110
if (1500 to 1750-1) //1GW = 132
return min(rand(30,100),rand(30,100)) if(charge >= 1000)
if (750 to 1500-1) var/damage = log(1.1,charge)
return min(rand(25,90),rand(25,90)) damage = damage - (log(1.1,damage)*1.5)
if (250 to 750-1) return round(damage)
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 else
return 0 return 0

View File

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