Organ processing performance (#13534)

* Organ Processing Performance

* more optimization

* indentation error

* More OOP

* compensation buff
This commit is contained in:
Fox McCloud
2020-06-07 14:29:52 -06:00
committed by GitHub
parent 34ebfd07d5
commit f4a0790514
3 changed files with 49 additions and 68 deletions
@@ -173,6 +173,29 @@
metabolization_rate = 0.2
taste_description = "antibiotics"
/datum/reagent/medicine/spaceacillin/on_mob_life(mob/living/M)
var/list/organs_list = list()
if(iscarbon(M))
var/mob/living/carbon/C = M
organs_list += C.internal_organs
if(ishuman(M))
var/mob/living/carbon/human/H = M
organs_list += H.bodyparts
for(var/X in organs_list)
var/obj/item/organ/O = X
if(O.germ_level < INFECTION_LEVEL_ONE)
O.germ_level = 0 //cure instantly
else if(O.germ_level < INFECTION_LEVEL_TWO)
O.germ_level = max(M.germ_level - 25, 0) //at germ_level == 500, this should cure the infection in 34 seconds
else
O.germ_level = max(M.germ_level - 10, 0) // at germ_level == 1000, this will cure the infection in 1 minutes, 14 seconds
organs_list.Cut()
M.germ_level = max(M.germ_level - 20, 0) // Reduces the mobs germ level, too
return ..()
/datum/reagent/medicine/silver_sulfadiazine
name = "Silver Sulfadiazine"
id = "silver_sulfadiazine"