Skip to content

Commit

Permalink
Merge pull request #4661 from MistakeNot4892/port/nuggets
Browse files Browse the repository at this point in the history
Ported chicken nuggets from Polaris.
  • Loading branch information
out-of-phaze authored Jan 3, 2025
2 parents 7e1d545 + 07fabaa commit a670b1e
Show file tree
Hide file tree
Showing 9 changed files with 95 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/datums/supplypacks/galley.dm
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@
containername = "pizza crate"
supply_method = /decl/supply_method/randomized

/decl/hierarchy/supply_pack/galley/nuggets
name = "Emergency - Nugget crate"
contains = list(/obj/item/box/nuggets = 2)
containertype = /obj/structure/closet/crate/freezer
containername = "nugget crate"

/decl/hierarchy/supply_pack/galley/rations
num_contained = 6
name = "Emergency - MREs"
Expand Down
63 changes: 63 additions & 0 deletions code/game/objects/items/weapons/storage/nuggets.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/datum/storage/box/nuggets
can_hold = list(/obj/item/food/nugget)
var/expected_nugget_count = 10

/datum/storage/box/nuggets/New()
max_storage_space = /obj/item/food/nugget::w_class * expected_nugget_count
..()

/datum/storage/box/nuggets/twenty
expected_nugget_count = 20

/datum/storage/box/nuggets/forty
expected_nugget_count = 40

/obj/item/box/nuggets
name = "10-piece nuggets box"
icon = 'icons/obj/items/storage/nugget_box.dmi'
icon_state = "nuggetbox_ten"
desc = "A share pack of golden chicken nuggets in various fun shapes. Rumours of the rare and deadly 'fifth nugget shape' remain unsubstantiated."
storage = /datum/storage/box/nuggets
center_of_mass = @'{"x":16,"y":9}'

/obj/item/box/nuggets/Initialize(ml, material_key)
. = ..()
update_icon()

/obj/item/box/nuggets/WillContain()
. = list()
if(istype(storage, /datum/storage/box/nuggets))
var/datum/storage/box/nuggets/nugget_box = storage
for(var/i = 1 to nugget_box.expected_nugget_count)
. += /obj/item/food/nugget

/obj/item/box/nuggets/on_update_icon()
var/datum/storage/box/nuggets/nugget_box = storage
if(length(contents) == 0 || !istype(nugget_box))
icon_state = "[initial(icon_state)]_empty"
else if(length(contents) >= nugget_box.expected_nugget_count)
icon_state = "[initial(icon_state)]_full"
else
icon_state = initial(icon_state)

// Subtypes below.
/obj/item/box/nuggets/twenty
name = "20-piece nuggets box"
icon_state = "nuggetbox_twenty"
storage = /datum/storage/box/nuggets/twenty

/obj/item/box/nuggets/twenty/WillContain()
. = list()
for(var/i = 1 to 20)
. += /obj/item/food/nugget

/obj/item/box/nuggets/twenty/empty/WillContain()
return

/obj/item/box/nuggets/forty
name = "40-piece nuggets box"
icon_state = "nuggetbox_forty"
storage = /datum/storage/box/nuggets/forty

/obj/item/box/nuggets/forty/empty/WillContain()
return
24 changes: 24 additions & 0 deletions code/modules/food/nuggets.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/obj/item/food/nugget
name = "chicken nugget"
icon = 'icons/obj/food/nuggets/nugget.dmi'
icon_state = ICON_STATE_WORLD
nutriment_desc = "mild battered chicken"
nutriment_amt = 6
nutriment_type = /decl/material/solid/organic/meat/chicken
material = /decl/material/solid/organic/meat/chicken
bitesize = 3
var/shape = null
var/static/list/nugget_icons = list(
"lump" = 'icons/obj/food/nuggets/nugget.dmi',
"star" = 'icons/obj/food/nuggets/nugget_star.dmi',
"lizard" = 'icons/obj/food/nuggets/nugget_lizard.dmi',
"corgi" = 'icons/obj/food/nuggets/nugget_corgi.dmi'
)

/obj/item/food/nugget/Initialize()
. = ..()
if(isnull(shape))
shape = pick(nugget_icons)
set_icon(nugget_icons[shape])
desc = "A chicken nugget vaguely shaped like a [shape]."
add_allergen_flags(ALLERGEN_GLUTEN) // flour
Binary file added icons/obj/food/nuggets/nugget.dmi
Binary file not shown.
Binary file added icons/obj/food/nuggets/nugget_corgi.dmi
Binary file not shown.
Binary file added icons/obj/food/nuggets/nugget_lizard.dmi
Binary file not shown.
Binary file added icons/obj/food/nuggets/nugget_star.dmi
Binary file not shown.
Binary file added icons/obj/items/storage/nugget_box.dmi
Binary file not shown.
2 changes: 2 additions & 0 deletions nebula.dme
Original file line number Diff line number Diff line change
Expand Up @@ -1366,6 +1366,7 @@
#include "code\game\objects\items\weapons\storage\med_pouch.dm"
#include "code\game\objects\items\weapons\storage\misc.dm"
#include "code\game\objects\items\weapons\storage\mre.dm"
#include "code\game\objects\items\weapons\storage\nuggets.dm"
#include "code\game\objects\items\weapons\storage\parachute.dm"
#include "code\game\objects\items\weapons\storage\picnic_basket.dm"
#include "code\game\objects\items\weapons\storage\secure.dm"
Expand Down Expand Up @@ -2436,6 +2437,7 @@
#include "code\modules\fluids\fluid_flood.dm"
#include "code\modules\fluids\fluid_mapped.dm"
#include "code\modules\food\assembled.dm"
#include "code\modules\food\nuggets.dm"
#include "code\modules\food\cooking\_recipe.dm"
#include "code\modules\food\cooking\cooking_vessels\_cooking_vessel.dm"
#include "code\modules\food\cooking\cooking_vessels\baking_dish.dm"
Expand Down

0 comments on commit a670b1e

Please sign in to comment.