Patch rework (#13062)

* Patch Rework Part 1

* applicator

* fixes

* fixes

* temperature settings

* single application patches

* additional

* new line fix

* fox  is a derp sometimes
This commit is contained in:
Fox McCloud
2020-05-02 20:07:43 -04:00
committed by GitHub
parent 4118b4c8f9
commit faecf7cbfa
26 changed files with 297 additions and 118 deletions
+9 -2
View File
@@ -9,12 +9,18 @@
qdel(item)
QDEL_LIST(internal_organs)
QDEL_LIST(stomach_contents)
QDEL_LIST(processing_patches)
var/mob/living/simple_animal/borer/B = has_brain_worms()
if(B)
B.leave_host()
qdel(B)
return ..()
/mob/living/carbon/handle_atom_del(atom/A)
if(A in processing_patches)
processing_patches -= A
return ..()
/mob/living/carbon/blob_act(obj/structure/blob/B)
if(stat == DEAD)
return
@@ -1073,8 +1079,9 @@ so that different stomachs can handle things in different ways VB*/
if(can_taste_container)
taste(toEat.reagents)
var/fraction = min(this_bite/toEat.reagents.total_volume, 1)
toEat.reagents.reaction(src, toEat.apply_type, fraction)
toEat.reagents.trans_to(src, this_bite*toEat.transfer_efficiency)
if(fraction)
toEat.reagents.reaction(src, toEat.apply_type, fraction)
toEat.reagents.trans_to(src, this_bite*toEat.transfer_efficiency)
/mob/living/carbon/get_access()
. = ..()
@@ -2,6 +2,7 @@
gender = MALE
pressure_resistance = 15
var/list/stomach_contents = list()
var/list/processing_patches = list()
var/list/internal_organs = list()
var/list/internal_organs_slot = list() //Same as above, but stores "slot ID" - "organ" pairs for easy access.
var/antibodies = 0
+20
View File
@@ -13,6 +13,7 @@
for(var/obj/item/organ/internal/O in internal_organs)
O.on_life()
handle_patches()
handle_changeling()
handle_wetness(times_fired)
@@ -438,3 +439,22 @@
overlay_fullscreen("brute", /obj/screen/fullscreen/brute, severity)
else
clear_fullscreen("brute")
/mob/living/carbon/proc/handle_patches()
if(LAZYLEN(processing_patches))
var/multiple_patch_multiplier = processing_patches.len > 1 ? (processing_patches.len * 1.5) : 1
var/applied_amount = 0.35 * multiple_patch_multiplier
for(var/patch in processing_patches)
var/obj/item/reagent_containers/food/pill/patch/P = patch
if(P.reagents && P.reagents.total_volume)
var/fractional_applied_amount = applied_amount / P.reagents.total_volume
P.reagents.reaction(src, REAGENT_TOUCH, fractional_applied_amount, P.needs_to_apply_reagents)
P.needs_to_apply_reagents = FALSE
P.reagents.trans_to(src, applied_amount * 0.5)
P.reagents.remove_any(applied_amount * 0.5)
else
if(!P.reagents || P.reagents.total_volume <= 0)
processing_patches -= P
qdel(P)
+2
View File
@@ -406,6 +406,8 @@
QDEL_LIST(C.reagents.addiction_list)
C.reagents.addiction_threshold_accumulated.Cut()
QDEL_LIST(C.processing_patches)
// rejuvenate: Called by `revive` to get the mob into a revivable state
// the admin "rejuvenate" command calls `revive`, not this proc.
/mob/living/proc/rejuvenate()