mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-19 05:26:28 +00:00
* Bespoke Material Backend - Adds support for bespoke materials: - Reimplements [/datum/material/var/id] - Ports GetIdFromArguments from SSdcs - Adds a wrapper define for GetMaterialRef - Adds [MATERIAL_INIT_BESPOKE] - Adds [/datum/material/proc/Initialize] - Does not actually add any bespoke materials - [ ] TODO: Code docs - [ ] TODO: Actually adding bespoke materials * Some has_material procs and cleaning up some spaghetti - Adds a pair of has_material procs for use in checking whether a given atom has a given material * Adds meat - Adds bespoke meat variants - Does not make them accessible - Shuts up the linter * Implements bespoke meat - Makes the material container preserve bespoke materials - Makes the sheetifier accept bespoke materials - Makes the autolathe accept bespoke materials - Makes the gibber produce bespoke meats * Makes butchering produce bespoke meats This is jank and really needs to be folded into a unified butchering and gibbing system * Material documentation - Adds, fixes, and touches up some documentation * Material container insertion callback - Changes the proc used to expand the material container's material list ot a proc used to check whether a material fits into a material container - Instantiating new materials is no longer O(n) relative to the number of autolathes in existence. * Makes processing meat conserve materials - Makes bespoke meat carry over into meatballs * Makes preserving custom materials an option - Implements the ability to turn preserving custom materials _off_ for processor recipes * Fixes all bespoke materials of the same type using the same singleton - We use ids now, not just types. * Makes the fat sucker produce bespoke meats - Because consistency is good. * Fixes autolathes merging bespoke stacks into normal stacks. * Makes the callback to test materials for holdibility optional - @Floyd * GetMaterialRef -> GET_MATERIAL_REF - We capitalize macros. * Removes an extraneous callback - Makes the sheetifier use functionality I didn't notice I implemented a few commits ago. * Makes mob and species meat null compatible * Fixes the ore silo - The ore silo had really snowflake material handling that has been brought in line with the rest. - The materials should show up in the correct order. * Fixes minor lathe bugs - Fixes stack_traces caused when lathes tried to fetch materials using reagent typepaths - Fixed the selective reagent disposal topic. I have no idea how long this has been broken. * Various documentation fixes - Clarified a couple comments - Removes an extraneous ?. operator - Fixed mat floor tiles having bugged reagent temperatures * More fixes -/datum/material/meat/mob -> /datum/material/meat/mob_meat - Adds atom typecheck to material containers. * Fixes old typepaths
48 lines
1.8 KiB
Plaintext
48 lines
1.8 KiB
Plaintext
/obj/item/stack/sheet
|
|
name = "sheet"
|
|
lefthand_file = 'icons/mob/inhands/misc/sheets_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/misc/sheets_righthand.dmi'
|
|
full_w_class = WEIGHT_CLASS_NORMAL
|
|
force = 5
|
|
throwforce = 5
|
|
max_amount = 50
|
|
throw_speed = 1
|
|
throw_range = 3
|
|
attack_verb_continuous = list("bashes", "batters", "bludgeons", "thrashes", "smashes")
|
|
attack_verb_simple = list("bash", "batter", "bludgeon", "thrash", "smash")
|
|
novariants = FALSE
|
|
var/sheettype = null //this is used for girders in the creation of walls/false walls
|
|
var/point_value = 0 //turn-in value for the gulag stacker - loosely relative to its rarity.
|
|
///What type of wall does this sheet spawn
|
|
var/walltype
|
|
|
|
/obj/item/stack/sheet/Initialize(mapload, new_amount, merge = TRUE, list/mat_override=null, mat_amt=1)
|
|
. = ..()
|
|
pixel_x = rand(-4, 4)
|
|
pixel_y = rand(-4, 4)
|
|
|
|
/**
|
|
* Facilitates sheets being smacked on the floor
|
|
*
|
|
* This is used for crafting by hitting the floor with items.
|
|
* The inital use case is glass sheets breaking in to shards when the floor is hit.
|
|
* Args:
|
|
* * user: The user that did the action
|
|
* * params: paramas passed in from attackby
|
|
*/
|
|
/obj/item/stack/sheet/proc/on_attack_floor(mob/user, params)
|
|
var/list/shards = list()
|
|
for(var/datum/material/mat in custom_materials)
|
|
if(mat.shard_type)
|
|
var/obj/item/new_shard = new mat.shard_type(user.loc)
|
|
new_shard.add_fingerprint(user)
|
|
shards += "\a [new_shard.name]"
|
|
if(!shards.len)
|
|
return FALSE
|
|
user.do_attack_animation(src, ATTACK_EFFECT_BOOP)
|
|
playsound(src, "shatter", 70, TRUE)
|
|
use(1)
|
|
user.visible_message("<span class='notice'>[user] shatters the sheet of [name] on the floor, leaving [english_list(shards)].</span>", \
|
|
"<span class='notice'>You shatter the sheet of [name] on the floor, leaving [english_list(shards)].</span>")
|
|
return TRUE
|