mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 20:48:56 +01:00
Fixes newfood reagent transfer and food trash' to_chat (#55150)
Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
This commit is contained in:
@@ -324,6 +324,22 @@
|
||||
src.handle_reactions()
|
||||
return amount
|
||||
|
||||
///Multiplies the reagents inside this holder by a specific amount
|
||||
/datum/reagents/proc/multiply_reagents(multiplier=1)
|
||||
var/list/cached_reagents = reagent_list
|
||||
if(!total_volume)
|
||||
return
|
||||
var/change = (multiplier - 1) //Get the % change
|
||||
for(var/reagent in cached_reagents)
|
||||
var/datum/reagent/T = reagent
|
||||
if(change > 0)
|
||||
add_reagent(T.type, T.volume * change)
|
||||
else
|
||||
remove_reagent(T.type, abs(T.volume * change)) //absolute value to prevent a double negative situation (removing -50% would be adding 50%)
|
||||
|
||||
update_total()
|
||||
handle_reactions()
|
||||
|
||||
/// Transfer a specific reagent id to the target object
|
||||
/datum/reagents/proc/trans_id_to(obj/target, reagent, amount=1, preserve_data=1)//Not sure why this proc didn't exist before. It does now! /N
|
||||
var/list/cached_reagents = reagent_list
|
||||
|
||||
Reference in New Issue
Block a user