Skip to content

Commit

Permalink
we done?
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed Sep 26, 2023
1 parent bf661c8 commit 12742cf
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
20 changes: 10 additions & 10 deletions code/modules/food_and_drinks/food/ration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
/obj/item/reagent_containers/food/snacks/ration/microwave_act(obj/machinery/microwave/Heater)
if (cookable == FALSE)
..()
else if (cooked == TRUE)
..()
else
name = "warm [initial(name)]"
bonus_reagents = list(/datum/reagent/consumable/nutriment = 2, /datum/reagent/consumable/nutriment/vitamin = 2)
Expand Down Expand Up @@ -88,24 +90,23 @@

/obj/item/reagent_containers/food/snacks/ration/attack(mob/living/M, mob/user, def_zone)
if (!is_drainable())
to_chat(user, "<span class='warning'>The [src] is sealed shut!</span>")
to_chat(user, "<span class='warning'>[src] is sealed shut!</span>")
return 0
else
to_chat(user, "<span class='warning'>The [src] cant be eaten like that!</span>")
to_chat(user, "<span class='warning'>[src] cant be eaten like that!</span>")
return 0

/obj/item/reagent_containers/food/snacks/ration/condiment/afterattack(obj/target, mob/user , proximity)
. = ..()
if(!is_drainable())
to_chat(user, "<span class='warning'>The [src] is sealed shut!</span>")
to_chat(user, "<span class='warning'>[src] is sealed shut!</span>")
return
if(!proximity)
return
//You can tear the bag open above food to put the condiments on it, obviously.
if(istype(target, /obj/item/reagent_containers/food/snacks))
if(target.reagents.total_volume >= target.reagents.maximum_volume)
to_chat(user, "<span class='warning'>You tear open [src], but [target] is stacked so high that it just drips off!</span>" )
qdel(src)
to_chat(user, "<span class='warning'>[target] is too full!</span>" )
return
else
to_chat(user, "<span class='notice'>You tear open [src] above [target] and the condiments drip onto it.</span>")
Expand All @@ -122,23 +123,22 @@

/obj/item/reagent_containers/food/snacks/ration/attack(mob/living/M, mob/user, def_zone)
if (!is_drainable())
to_chat(user, "<span class='warning'>The [src] is sealed shut!</span>")
to_chat(user, "<span class='warning'>[src] is sealed shut!</span>")
return 0
else
to_chat(user, "<span class='warning'>The [src] cant be eaten like that!</span>")
to_chat(user, "<span class='warning'>[src] cant be eaten like that!</span>")
return 0

/obj/item/reagent_containers/food/snacks/ration/pack/afterattack(obj/target, mob/user , proximity)
. = ..()
if(!is_drainable())
to_chat(user, "<span class='warning'>The [src] is sealed shut!</span>")
to_chat(user, "<span class='warning'>[src] is sealed shut!</span>")
return
if(!proximity)
return
if(istype(target, /obj/item/reagent_containers))
if(target.reagents.total_volume >= target.reagents.maximum_volume)
to_chat(user, "<span class='warning'>You pour the [src] in, but [target] is too full!</span>" )
qdel(src)
to_chat(user, "<span class='warning'>[target] is too full!</span>" )
return
else
to_chat(user, "<span class='notice'>You pour the [src] into [target] and shake.</span>")
Expand Down
9 changes: 4 additions & 5 deletions code/modules/food_and_drinks/kitchen_machinery/microwave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -383,24 +383,23 @@
RegisterSignal(tocook, COMSIG_PARENT_QDELETING, PROC_REF(clear_cooking))
target.add_overlay(ration_overlay)
addtimer(CALLBACK(src, .proc/cook), 100)
visible_message("<span class='notice'>\the [target] rapidly begins cooking...</span>")
target.visible_message("<span class='notice'>\The [target] rapidly begins cooking...</span>")
playsound(src, 'sound/items/cig_light.ogg', 50, 1)
moveToNullspace()

/obj/item/ration_heater/proc/clear_cooking(datum/source)
SIGNAL_HANDLER
UnregisterSignal(tocook, COMSIG_PARENT_QDELETING)
tocook.cut_overlay(ration_overlay)
tocook = null

/obj/item/ration_heater/proc/cook()
var/cookturf = get_turf(tocook)
tocook.visible_message("<span class='notice'>\the [src] lets out a final hiss...</span>")
tocook.visible_message("<span class='notice'>\The [src] lets out a final hiss...</span>")
playsound(tocook, 'sound/items/cig_snuff.ogg', 50, 1)
if(istype(tocook, /obj/item/reagent_containers/food) || istype(tocook, /obj/item/grown))
tocook.visible_message("<span class='notice'>\the [tocook] is done warming up!</span>")
tocook.microwave_act()
tocook.visible_message("<span class='notice'>\The [tocook] is done warming up!</span>")
clear_cooking()
tocook.microwave_act()
if(uses == 0)
qdel()
else
Expand Down

0 comments on commit 12742cf

Please sign in to comment.