diff --git a/monkestation/code/modules/loafing/code/loaf.dm b/monkestation/code/modules/loafing/code/loaf.dm new file mode 100644 index 000000000000..eab60ca4053c --- /dev/null +++ b/monkestation/code/modules/loafing/code/loaf.dm @@ -0,0 +1,24 @@ +/obj/item/food/prison_loaf + name = "prison loaf" + desc = "A barely edible brick of nutrients, designed as a low-cost solution to malnourishment." + icon = 'monkestation/code/modules/loafing/icon/obj.dmi' + icon_state = "loaf0" + var/loaf_density = 0 + + +/obj/item/food/prison_loaf/proc/condense() + switch(src.loaf_density) + + if(0 to 100) + src.name = "prison loaf" + src.desc = "A barely edible brick of nutrients, designed as a low-cost solution to malnourishment." + src.icon_state = "loaf0" + src.force = 0 + src.throwforce = 0 + if(101 to 250) + src.name = "dense prison loaf" + src.desc = "This loaf is noticeably heavier than usual." + src.icon_state = "loaf0" + src.force = 3 + src.throwforce = 3 + diff --git a/monkestation/code/modules/loafing/code/loafer.dm b/monkestation/code/modules/loafing/code/loafer.dm new file mode 100644 index 000000000000..43e85bbe1226 --- /dev/null +++ b/monkestation/code/modules/loafing/code/loafer.dm @@ -0,0 +1,87 @@ +/obj/structure/disposalpipe/loafer + name = "loafing device" + desc = "A prisoner feeding device that condenses matter into an Ultra Delicious(tm) nutrition bar!" + icon = 'monkestation/code/modules/loafing/icon/obj.dmi' + icon_state = "loafer" + + +/obj/structure/disposalpipe/loafer/transfer(obj/structure/disposalholder/debris) + + //check if there's anything in there + if (debris.contents.len) + //start playing sound + playsound(src.loc, "sound", 50, 1) + src.icon_state = "loafer-on" + + //create new loaf + var/obj/item/food/prison_loaf/loaf = new /obj/item/food/prison_loaf(src) + + //add all the garbage to the loaf's contents + for (var/atom/movable/foodstuff in debris) + if(foodstuff.reagents)//the object has reagents + foodstuff.reagents.trans_to(loaf, 1000) + if(istype(foodstuff, /obj/item/food/prison_loaf))//the object is a loaf, compress somehow + var/obj/item/food/prison_loaf/loaf_to_grind = foodstuff + loaf.loaf_density += loaf_to_grind.loaf_density + loaf_to_grind = null + else if(isliving(foodstuff)) + var/mob/living/victim = foodstuff + //different mobs add different reagents + if(issilicon(victim)) + loaf.reagents.add_reagent("oil", 10) + loaf.reagents.add_reagent("iron", 10) + else + loaf.reagents.add_reagent("blood", 10) + loaf.reagents.add_reagent("urine", 10) + //then we give the loaf more power + if(ishuman(victim)) + loaf.loaf_density += 50 + else + loaf.loaf_density += 10 + if(!isdead(victim)) + victim.emote("scream") + victim.death() + if(victim.mind || victim.client) + victim.ghostize(FALSE) + else if (istype(foodstuff, /obj/item))//everything else + var/obj/item/kitchen_sink = foodstuff + var/weight = kitchen_sink.w_class + loaf.loaf_density += weight + debris.contents -= foodstuff + qdel(foodstuff) + + loaf.condense() + loaf.loc = debris.loc + src.icon_state = "loafer" + + return transfer_to_dir(debris, nextdir(debris)) + +/obj/structure/disposalpipe/loafer/deconstruct(disassembled = TRUE) + if(!(flags_1 & NODECONSTRUCT_1)) + if(disassembled) + if(stored) + stored.forceMove(loc) + transfer_fingerprints_to(stored) + stored.setDir(dir) + stored = null + else + var/turf/T = get_turf(src) + for(var/D in GLOB.cardinals) + if(D & dpdir) + var/obj/structure/disposalpipe/broken/P = new(T) + P.setDir(D) + spew_forth() + qdel(src) + +/obj/structure/disposalconstruct/loafer + name = "disposal pipe segment" + desc = "A huge pipe segment used for constructing disposal systems." + icon = 'monkestation/code/modules/loafing/icon/obj.dmi' + icon_state = "conloafer" + pipe_type = /obj/structure/disposalpipe/loafer + +/obj/structure/disposalpipe/loafer/broken + desc = "A broken piece of disposal pipe." + icon_state = "loafer_broken" + initialize_dirs = DISP_DIR_NONE + diff --git a/tgstation.dme b/tgstation.dme index 46c16219451b..c614887f7d42 100644 --- a/tgstation.dme +++ b/tgstation.dme @@ -5827,6 +5827,8 @@ #include "monkestation\code\modules\loadouts\items\toys.dm" #include "monkestation\code\modules\loadouts\items\under\donator.dm" #include "monkestation\code\modules\loadouts\items\under\under.dm" +#include "monkestation\code\modules\loafing\code\loaf.dm" +#include "monkestation\code\modules\loafing\code\loafer.dm" #include "monkestation\code\modules\maptext\maptext_image_helper.dm" #include "monkestation\code\modules\mech_comp\_interface.dm" #include "monkestation\code\modules\mech_comp\_message.dm"