mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Refactored code to use the reagent check_and_add proc
This commit is contained in:
@@ -736,7 +736,8 @@ Congratulations! You are now trained for invasive xenobiology research!"}
|
||||
icon_state = "bed"
|
||||
no_icon_updates = 1 //no icon updates for this; it's static.
|
||||
injected_reagents = list("corazone","spaceacillin")
|
||||
injected_target_amount = 31 //the patient needs at least 30u of spaceacillin to prevent necrotization.
|
||||
reagent_target_amount = 31 //the patient needs at least 30u of spaceacillin to prevent necrotization.
|
||||
inject_amount = 10
|
||||
|
||||
/obj/structure/closet/abductor
|
||||
name = "alien locker"
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
buckle_lying = 90
|
||||
var/no_icon_updates = 0 //set this to 1 if you don't want the icons ever changing
|
||||
var/list/injected_reagents = list()
|
||||
var/injected_target_amount = 1
|
||||
var/reagent_target_amount = 1
|
||||
var/inject_amount = 1
|
||||
|
||||
/obj/machinery/optable/New()
|
||||
..()
|
||||
@@ -107,10 +108,9 @@
|
||||
check_victim()
|
||||
if(LAZYLEN(injected_reagents))
|
||||
for(var/mob/living/carbon/C in get_turf(src))
|
||||
var/datum/reagents/R = C.reagents
|
||||
for(var/chemical in injected_reagents)
|
||||
var/current_amount = C.reagents.get_reagent_amount(chemical)
|
||||
if(current_amount < injected_target_amount)
|
||||
C.reagents.add_reagent(chemical, injected_target_amount - current_amount)
|
||||
R.check_and_add(chemical,reagent_target_amount,inject_amount)
|
||||
|
||||
/obj/machinery/optable/proc/take_victim(mob/living/carbon/C, mob/living/carbon/user as mob)
|
||||
if(C == user)
|
||||
|
||||
Reference in New Issue
Block a user