Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
polygoblyn committed Sep 18, 2023
1 parent 0a38a34 commit 8a7fd10
Show file tree
Hide file tree
Showing 3 changed files with 113 additions and 0 deletions.
24 changes: 24 additions & 0 deletions monkestation/code/modules/loafing/code/loaf.dm
Original file line number Diff line number Diff line change
@@ -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

87 changes: 87 additions & 0 deletions monkestation/code/modules/loafing/code/loafer.dm
Original file line number Diff line number Diff line change
@@ -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

2 changes: 2 additions & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 8a7fd10

Please sign in to comment.