Skip to content

Commit

Permalink
Linen Plant Bags! - Adds a primitive reskin of the plant bag, makes i…
Browse files Browse the repository at this point in the history
…t the default when crafted by Icewalkers (#1156)

* Adds a primitive reskin of the plant bag, makes it the default when icewalkers craft plant bags

* Ashwalkers get it too

Co-authored-by: Bloop <[email protected]>

---------

Co-authored-by: Bloop <[email protected]>
  • Loading branch information
2 people authored and StealsThePRs committed Mar 7, 2024
1 parent f80121f commit 36303f5
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 0 deletions.
69 changes: 69 additions & 0 deletions modular_nova/modules/primitive_cooking_additions/code/plant_bag.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
#define RESKIN_LINEN "Linen"

/obj/item/storage/bag/plants
uses_advanced_reskins = TRUE
unique_reskin = list(
"Original" = list(
RESKIN_ICON = 'icons/obj/service/hydroponics/equipment.dmi',
RESKIN_ICON_STATE = "plantbag",
RESKIN_WORN_ICON = 'icons/mob/clothing/belt.dmi',
RESKIN_WORN_ICON_STATE = "plantbag",
),
RESKIN_LINEN = list(
RESKIN_ICON = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag.dmi',
RESKIN_ICON_STATE = "plantbag_primitive",
RESKIN_WORN_ICON = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag_worn.dmi',
RESKIN_WORN_ICON_STATE = "plantbag_primitive",
),
)


// This is so the linen reskin shows properly in the suit storage.
/obj/item/storage/bag/plants/build_worn_icon(default_layer, default_icon_file, isinhands, female_uniform, override_state, override_file, use_height_offset, mutant_styles)
if(default_layer == SUIT_STORE_LAYER && current_skin == RESKIN_LINEN)
override_file = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag_worn_mirror.dmi'

return ..()


/// Simple helper to reskin this item into its primitive variant.
/obj/item/storage/bag/plants/proc/make_primitive()
current_skin = RESKIN_LINEN

icon = unique_reskin[current_skin][RESKIN_ICON]
icon_state = unique_reskin[current_skin][RESKIN_ICON_STATE]
worn_icon = unique_reskin[current_skin][RESKIN_WORN_ICON]
worn_icon_state = unique_reskin[current_skin][RESKIN_WORN_ICON_STATE]

update_appearance()


/// A helper for the primitive variant, for mappers.
/obj/item/storage/bag/plants/primitive
current_skin = RESKIN_LINEN // Just so it displays properly when in suit storage
uses_advanced_reskins = FALSE
unique_reskin = null
icon = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag.dmi'
icon_state = "plantbag_primitive"
worn_icon = 'modular_nova/modules/primitive_cooking_additions/icons/plant_bag_worn.dmi'
worn_icon_state = "plantbag_primitive"


/obj/item/stack/sheet/cloth/on_item_crafted(mob/builder, atom/created)
if(!istype(created, /obj/item/storage/bag/plants))
return

if(!isprimitivedemihuman(builder) && !isashwalker(builder))
return

var/obj/item/storage/bag/plants/bag = created

bag.make_primitive()


/obj/item/storage/bag/plants/portaseeder
uses_advanced_reskins = FALSE
unique_reskin = null


#undef RESKIN_LINEN
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions tgstation.dme
Original file line number Diff line number Diff line change
Expand Up @@ -7937,6 +7937,7 @@
#include "modular_nova\modules\primitive_cooking_additions\code\cookware.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\cutting_board.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\millstone.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\plant_bag.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\stone_griddle.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\stone_oven.dm"
#include "modular_nova\modules\primitive_cooking_additions\code\stone_stove.dm"
Expand Down

0 comments on commit 36303f5

Please sign in to comment.