mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 22:19:30 +01:00
Gibbing transfers reagents to meat (#42492)
* adds reagent from mob to meat * actually makes reagents transfer on gibbing * Apply suggestions from code review Co-Authored-By: Time-Green <timkoster1@hotmail.com>
This commit is contained in:
@@ -178,13 +178,17 @@
|
||||
typeofskin = /obj/item/stack/sheet/animalhide/monkey
|
||||
else if(isalien(C))
|
||||
typeofskin = /obj/item/stack/sheet/animalhide/xeno
|
||||
|
||||
var/occupant_volume
|
||||
if(occupant?.reagents)
|
||||
occupant_volume = occupant.reagents.total_volume
|
||||
for (var/i=1 to meat_produced)
|
||||
var/obj/item/reagent_containers/food/snacks/meat/slab/newmeat = new typeofmeat
|
||||
newmeat.name = "[sourcename] [newmeat.name]"
|
||||
if(istype(newmeat))
|
||||
newmeat.subjectname = sourcename
|
||||
newmeat.reagents.add_reagent ("nutriment", sourcenutriment / meat_produced) // Thehehe. Fat guys go first
|
||||
if(occupant_volume)
|
||||
occupant.reagents.trans_to(newmeat, occupant_volume / meat_produced, remove_blacklisted = TRUE)
|
||||
if(sourcejob)
|
||||
newmeat.subjectjob = sourcejob
|
||||
allmeat[i] = newmeat
|
||||
|
||||
@@ -163,7 +163,8 @@
|
||||
|
||||
return master
|
||||
|
||||
/datum/reagents/proc/trans_to(obj/target, amount=1, multiplier=1, preserve_data=1, no_react = 0, mob/transfered_by)//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
/datum/reagents/proc/trans_to(obj/target, amount = 1, multiplier = 1, preserve_data = TRUE, no_react = FALSE, mob/transfered_by, remove_blacklisted = FALSE)
|
||||
//if preserve_data=0, the reagents data will be lost. Usefull if you use data for some strange stuff and don't want it to be transferred.
|
||||
var/list/cached_reagents = reagent_list
|
||||
if(!target || !total_volume)
|
||||
return
|
||||
@@ -190,6 +191,8 @@
|
||||
var/trans_data = null
|
||||
for(var/reagent in cached_reagents)
|
||||
var/datum/reagent/T = reagent
|
||||
if(remove_blacklisted && !T.can_synth)
|
||||
continue
|
||||
var/transfer_amount = T.volume * part
|
||||
if(preserve_data)
|
||||
trans_data = copy_data(T)
|
||||
|
||||
Reference in New Issue
Block a user