mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 14:07:51 +01:00
Merge pull request #1422 from FalseIncarnate/master
[High-Priority][Fix] Food/Pill Fixes
This commit is contained in:
@@ -127,32 +127,6 @@ datum
|
||||
if (!target.reagents || src.total_volume<=0)
|
||||
return
|
||||
|
||||
/*var/datum/reagents/R = target.reagents
|
||||
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/noreact/B = new /obj/item/weapon/reagent_containers/glass/beaker/noreact //temporary holder
|
||||
|
||||
amount = min(min(amount, src.total_volume), R.maximum_volume-R.total_volume)
|
||||
var/part = amount / src.total_volume
|
||||
var/trans_data = null
|
||||
for (var/datum/reagent/current_reagent in src.reagent_list)
|
||||
if (!current_reagent)
|
||||
continue
|
||||
//if (current_reagent.id == "blood" && ishuman(target))
|
||||
// var/mob/living/carbon/human/H = target
|
||||
// H.inject_blood(my_atom, amount)
|
||||
// continue
|
||||
var/current_reagent_transfer = current_reagent.volume * part
|
||||
if(preserve_data)
|
||||
trans_data = current_reagent.data
|
||||
|
||||
B.add_reagent(current_reagent.id, (current_reagent_transfer * multiplier), trans_data, safety = 1) //safety checks on these so all chemicals are transferred
|
||||
src.remove_reagent(current_reagent.id, current_reagent_transfer, safety = 1) // to the target container before handling reactions
|
||||
|
||||
src.update_total()
|
||||
B.update_total()
|
||||
B.handle_reactions()
|
||||
src.handle_reactions()*/
|
||||
|
||||
var/obj/item/weapon/reagent_containers/glass/beaker/noreact/B = new /obj/item/weapon/reagent_containers/glass/beaker/noreact //temporary holder
|
||||
B.volume = 1000
|
||||
|
||||
@@ -163,9 +137,13 @@ datum
|
||||
|
||||
src.trans_to(B, amount)
|
||||
|
||||
spawn(100)
|
||||
spawn(-1)
|
||||
src = null // Survive through deletion of the reagent holder
|
||||
sleep(100)
|
||||
if(!target)
|
||||
return
|
||||
BR.trans_to(target, BR.total_volume)
|
||||
del(B)
|
||||
qdel(B)
|
||||
|
||||
return amount
|
||||
|
||||
|
||||
@@ -234,6 +234,7 @@ datum
|
||||
reagent_state = LIQUID
|
||||
color = "#0064C8" // rgb: 0, 100, 200
|
||||
var/cooling_temperature = 2
|
||||
process_flags = ORGANIC | SYNTHETIC
|
||||
|
||||
reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)
|
||||
if(!istype(M, /mob/living))
|
||||
@@ -3238,4 +3239,4 @@ datum
|
||||
holder.reagent_list -= src
|
||||
holder = null
|
||||
|
||||
return ..()
|
||||
return ..()
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
M << "\blue You swallow some of contents of the [src]."
|
||||
if(reagents.total_volume)
|
||||
reagents.reaction(M, INGEST)
|
||||
spawn(5)
|
||||
spawn(0)
|
||||
reagents.trans_to_ingest(M, 10)
|
||||
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
if(reagents.total_volume)
|
||||
reagents.reaction(M, INGEST)
|
||||
spawn(5)
|
||||
spawn(0)
|
||||
reagents.trans_to(M, 10)
|
||||
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
M << "\blue You swallow a gulp of [src]."
|
||||
if(reagents.total_volume)
|
||||
reagents.reaction(M, INGEST)
|
||||
spawn(5)
|
||||
spawn(0)
|
||||
reagents.trans_to_ingest(M, gulp_size)
|
||||
|
||||
playsound(M.loc,'sound/items/drink.ogg', rand(10,50), 1)
|
||||
@@ -65,7 +65,7 @@
|
||||
|
||||
if(reagents.total_volume)
|
||||
reagents.reaction(M, INGEST)
|
||||
spawn(5)
|
||||
spawn(0)
|
||||
reagents.trans_to_ingest(M, gulp_size)
|
||||
|
||||
if(isrobot(user)) //Cyborg modules that include drinks automatically refill themselves, but drain the borg's cell
|
||||
|
||||
@@ -100,7 +100,7 @@
|
||||
playsound(M.loc,'sound/items/eatfood.ogg', rand(10,50), 1)
|
||||
if(reagents.total_volume)
|
||||
reagents.reaction(M, INGEST)
|
||||
spawn(5)
|
||||
spawn(0)
|
||||
if(reagents.total_volume > bitesize)
|
||||
/*
|
||||
* I totally cannot understand what this code supposed to do.
|
||||
|
||||
@@ -21,12 +21,18 @@
|
||||
return
|
||||
attack(mob/M as mob, mob/user as mob, def_zone)
|
||||
if(M == user)
|
||||
M << "\blue You [apply_method] [src]."
|
||||
if(istype(M,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species.flags & IS_SYNTHETIC)
|
||||
H << "<span class='warning'>You have a monitor for a head, where do you think you're going to put that?</span>"
|
||||
return
|
||||
|
||||
M << "<span class='notify'>You [apply_method] [src].</span>"
|
||||
M.unEquip(src) //icon update
|
||||
if(reagents.total_volume)
|
||||
reagents.reaction(M, apply_type)
|
||||
spawn(5)
|
||||
reagents.trans_to(M, reagents.total_volume)
|
||||
spawn(0)
|
||||
reagents.trans_to_ingest(M, reagents.total_volume)
|
||||
qdel(src)
|
||||
else
|
||||
qdel(src)
|
||||
@@ -34,14 +40,19 @@
|
||||
|
||||
else if(istype(M, /mob/living/carbon/human) )
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(H.species.flags & IS_SYNTHETIC)
|
||||
user << "<span class='warning'>They have a monitor for a head, where do you think you're going to put that?</span>"
|
||||
return
|
||||
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
O.show_message("\red [user] attempts to force [M] to [apply_method] [src].", 1)
|
||||
O.show_message("<span class='warning'>[user] attempts to force [M] to [apply_method] [src].</span>", 1)
|
||||
|
||||
if(!do_mob(user, M)) return
|
||||
|
||||
user.unEquip(src) //icon update
|
||||
for(var/mob/O in viewers(world.view, user))
|
||||
O.show_message("\red [user] forces [M] to [apply_method] [src].", 1)
|
||||
O.show_message("<span class='warning'>[user] forces [M] to [apply_method] [src].</span>", 1)
|
||||
|
||||
M.attack_log += text("\[[time_stamp()]\] <font color='orange'>Has been fed [src.name] by [user.name] ([user.ckey]) Reagents: [reagentlist(src)]</font>")
|
||||
user.attack_log += text("\[[time_stamp()]\] <font color='red'>Fed [M.name] by [M.name] ([M.ckey]) Reagents: [reagentlist(src)]</font>")
|
||||
@@ -54,7 +65,7 @@
|
||||
|
||||
if(reagents.total_volume)
|
||||
reagents.reaction(M, apply_type)
|
||||
spawn(5)
|
||||
spawn(0)
|
||||
reagents.trans_to_ingest(M, reagents.total_volume)
|
||||
qdel(src)
|
||||
else
|
||||
@@ -69,7 +80,7 @@
|
||||
|
||||
if(target.is_open_container() != 0 && target.reagents)
|
||||
if(!target.reagents.total_volume)
|
||||
user << "\red [target] is empty. Cant dissolve [src]."
|
||||
user << "<span class='warning'>[target] is empty. Cant dissolve [src].</span>"
|
||||
return
|
||||
|
||||
// /vg/: Logging transfers of bad things
|
||||
@@ -83,10 +94,10 @@
|
||||
message_admins("[user.name] ([user.ckey]) added [reagents.get_reagent_ids(1)] to \a [target] with [src].[hl] (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
log_game("[user.name] ([user.ckey]) added [reagents.get_reagent_ids(1)] to \a [target] with [src].")
|
||||
|
||||
user << "\blue You dissolve [src] in [target]"
|
||||
user << "<span class='notify'>You dissolve [src] in [target].</span>"
|
||||
reagents.trans_to(target, reagents.total_volume)
|
||||
for(var/mob/O in viewers(2, user))
|
||||
O.show_message("\red [user] puts something in [target].", 1)
|
||||
O.show_message("<span class='warning'>[user] puts something in [target].</span>", 1)
|
||||
spawn(5)
|
||||
qdel(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user