Files
Alexis 21b4095dfd [MDB IGNORE] [IDB IGNORE] Upstream Sync - 04/17/2026 (#5453)
Upstream 04/17/2026

fixes https://github.com/Bubberstation/Bubberstation/issues/5549

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: tgstation-ci[bot] <179393467+tgstation-ci[bot]@users.noreply.github.com>
Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com>
Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
Co-authored-by: Rhials <28870487+Rhials@users.noreply.github.com>
Co-authored-by: rageguy505 <54517726+rageguy505@users.noreply.github.com>
Co-authored-by: LemonInTheDark <58055496+LemonInTheDark@users.noreply.github.com>
Co-authored-by: John Willard <53777086+JohnFulpWillard@users.noreply.github.com>
Co-authored-by: Aliceee2ch <160794176+Aliceee2ch@users.noreply.github.com>
Co-authored-by: Time-Green <7501474+Time-Green@users.noreply.github.com>
Co-authored-by: Tsar-Salat <62388554+Tsar-Salat@users.noreply.github.com>
Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com>
Co-authored-by: Maxipat <108554989+Maxipat112@users.noreply.github.com>
Co-authored-by: SyncIt21 <110812394+SyncIt21@users.noreply.github.com>
Co-authored-by: deltanedas <39013340+deltanedas@users.noreply.github.com>
Co-authored-by: SimplyLogan <47579821+loganuk@users.noreply.github.com>
Co-authored-by: loganuk <fakeemail123@aol.com>
Co-authored-by: Leland Kemble <70413276+lelandkemble@users.noreply.github.com>
Co-authored-by: FalloutFalcon <86381784+FalloutFalcon@users.noreply.github.com>
Co-authored-by: Roxy <75404941+TealSeer@users.noreply.github.com>
Co-authored-by: Lucy <lucy@absolucy.moe>
Co-authored-by: siliconOpossum <138069572+siliconOpossum@users.noreply.github.com>
Co-authored-by: Isratosh <Isratosh@hotmail.com>
Co-authored-by: TheRyeGuyWhoWillNowDie <70169560+TheRyeGuyWhoWillNowDie@users.noreply.github.com>
Co-authored-by: Neocloudy <88008002+Neocloudy@users.noreply.github.com>
Co-authored-by: Alexander V. <volas@ya.ru>
Co-authored-by: ElGitificador <168473461+ElGitificador@users.noreply.github.com>
Co-authored-by: Twaticus <46540570+Twaticus@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com>
Co-authored-by: Cameron Lennox <killer65311@gmail.com>
Co-authored-by: Tim <timothymtorres@gmail.com>
Co-authored-by: Iamgoofball <iamgoofball@gmail.com>
Co-authored-by: Layzu666 <121319428+Layzu666@users.noreply.github.com>
Co-authored-by: Arturlang <24881678+Arturlang@users.noreply.github.com>
Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>
Co-authored-by: mrmanlikesbt <99309552+mrmanlikesbt@users.noreply.github.com>
Co-authored-by: Ben10Omintrix <138636438+Ben10Omintrix@users.noreply.github.com>
Co-authored-by: John F. Kennedy <54908920+MacaroniCritter@users.noreply.github.com>
Co-authored-by: Cursor <102828457+theselfish@users.noreply.github.com>
Co-authored-by: Josh <josh.adam.powell@gmail.com>
Co-authored-by: Josh Powell <josh.powell@softwire.com>
Co-authored-by: Yobrocharlie <Charliemiller5617@gmail.com>
Co-authored-by: Hardly3D <66234359+Hardly3D@users.noreply.github.com>
Co-authored-by: shayoki <96078776+shayoki@users.noreply.github.com>
Co-authored-by: LT3 <83487515+lessthnthree@users.noreply.github.com>
2026-05-16 00:56:00 +02:00

114 lines
4.4 KiB
Plaintext

/obj/item/stack/sheet
name = "sheet"
lefthand_file = 'icons/mob/inhands/items/sheets_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items/sheets_righthand.dmi'
icon_state = "sheet-metal_3"
abstract_type = /obj/item/stack/sheet
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
material_flags = MATERIAL_EFFECTS | MATERIAL_NO_DESCRIPTORS
table_type = /obj/structure/table/greyscale
pickup_sound = 'sound/items/handling/materials/metal_pick_up.ogg'
drop_sound = 'sound/items/handling/materials/metal_drop.ogg'
sound_vary = TRUE
usable_for_construction = TRUE
/// text string used to find typepaths used in door and wall (false and tram too) construction for door assemblies and girders respectively
var/construction_path_type = null
///If true, this is worth points in the gulag labour stacker
var/gulag_valid = FALSE
///Set to true if this is vended from a material storage
var/manufactured = FALSE
/// whether this sheet can be sniffed by the material sniffer
var/sniffable = FALSE
/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)
if(sniffable && amount >= 10 && is_station_level(z))
GLOB.sniffable_sheets |= src
/obj/item/stack/sheet/Destroy(force)
if(sniffable)
GLOB.sniffable_sheets -= src
return ..()
/obj/item/stack/sheet/examine(mob/user)
. = ..()
if (manufactured && gulag_valid)
. += span_notice("It has been embossed with a manufacturer's mark of guaranteed quality.")
var/datum/material/material = get_master_material()
if (!HAS_TRAIT(user, TRAIT_RESEARCH_SCANNER) || !material)
return
var/list/material_string = list()
for (var/prop_id in material.mat_properties)
var/datum/material_property/property = SSmaterials.properties[prop_id]
var/prop_value = material.get_property(prop_id)
if (isnull(prop_value)) // Error?
continue
var/descriptor = property?.get_descriptor(prop_value)
var/tooltip_hint = property?.get_tooltip(prop_value)
if (descriptor) // Overriden derivative property?
material_string += span_tooltip("[property]: [tooltip_hint]", descriptor)
if (length(material_string))
. += span_info("[capitalize(material.name)] is [english_list(material_string)].")
/obj/item/stack/sheet/add(_amount)
. = ..()
if(sniffable && amount >= 10 && is_station_level(z))
GLOB.sniffable_sheets |= src
/obj/item/stack/sheet/merge(obj/item/stack/sheet/target_stack, limit)
. = ..()
manufactured = manufactured && target_stack.manufactured
/obj/item/stack/sheet/copy_evidences(obj/item/stack/sheet/from)
. = ..()
manufactured = from.manufactured
/// removing from sniffable handled by the sniffer itself when it checks for targets
/**
* Facilitates sheets being smacked on the floor
*
* This is used for crafting by hitting the floor with items.
* The initial use case is glass sheets breaking in to shards when the floor is hit.
* Args:
* * target: The floor that was hit
* * user: The user that did the action
* * modifiers: The modifiers passed in from attackby
*/
/obj/item/stack/sheet/proc/on_attack_floor(turf/open/floor/target, mob/user, list/modifiers)
var/list/shards = list()
for(var/datum/material/mat in custom_materials)
if(mat.shard_type)
shards += mat.shard_type
if(!shards.len)
return FALSE
if(!use(1))
to_chat(user, is_cyborg ? span_warning("There is not enough material in the synthesizer to produce a shard!") : span_warning("Somehow, there is not enough of [src] to shatter!"))
if(!is_cyborg)
stack_trace("A stack of sheet material was attempted to be shattered into shards while having less than 1 sheets remaining.")
return FALSE
user.do_attack_animation(target, ATTACK_EFFECT_BOOP)
playsound(target, SFX_SHATTER, 70, TRUE)
var/list/shards_created = list()
for(var/shard_to_create in shards)
var/obj/item/new_shard = new shard_to_create(target)
new_shard.add_fingerprint(user)
shards_created += "[new_shard.name]"
user.visible_message(span_notice("[user] shatters the sheet of [name] on [target], leaving [english_list(shards_created)]."), \
span_notice("You shatter the sheet of [name] on [target], leaving [english_list(shards_created)]."))
return TRUE