Files
VOREStation/code/modules/materials/sheets/_sheets.dm
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

109 lines
2.9 KiB
Plaintext

// Stacked resources. They use a material datum for a lot of inherited values.
// If you're adding something here, make sure to add it to fifty_spawner_mats.dm as well
/obj/item/stack/material
force = 5.0
throwforce = 5
w_class = ITEMSIZE_NORMAL
throw_speed = 3
throw_range = 3
center_of_mass_x = 0
center_of_mass_y = 0
max_amount = 50
item_icons = list(
slot_l_hand_str = 'icons/mob/items/lefthand_material.dmi',
slot_r_hand_str = 'icons/mob/items/righthand_material.dmi',
)
var/default_type = MAT_STEEL
var/datum/material/material
var/coin_type = null
var/perunit = SHEET_MATERIAL_AMOUNT
var/apply_colour //temp pending icon rewrite
drop_sound = 'sound/items/drop/axe.ogg'
pickup_sound = 'sound/items/pickup/axe.ogg'
custom_handling = TRUE
/obj/item/stack/material/Initialize(mapload)
. = ..()
randpixel_xy()
if(!default_type)
default_type = MAT_STEEL
material = get_material_by_name("[default_type]")
if(!material)
stack_trace("Material of type: [default_type] does not exist.")
return INITIALIZE_HINT_QDEL
recipes = material.get_recipes()
stacktype = material.stack_type
if(islist(material.stack_origin_tech))
origin_tech = material.stack_origin_tech.Copy()
if(apply_colour)
color = material.icon_colour
if(!material.conductive)
flags |= NOCONDUCT
matter = material.get_matter()
update_strings()
/obj/item/stack/material/Destroy()
material = null
. = ..()
/obj/item/stack/material/get_material()
return material
/obj/item/stack/material/proc/update_strings()
// Update from material datum.
singular_name = material.sheet_singular_name
if(amount>1)
name = "[material.use_name] [material.sheet_plural_name]"
desc = "A [material.sheet_collective_name] of [material.use_name] [material.sheet_plural_name]."
gender = PLURAL
else
name = "[material.use_name] [material.sheet_singular_name]"
desc = "A [material.sheet_singular_name] of [material.use_name]."
gender = NEUTER
/obj/item/stack/material/get_examine_string()
if(!uses_charge)
return "There [amount == 1 ? "is" : "are"] [amount] [material.sheet_singular_name]\s in the [material.sheet_collective_name]."
return ..()
/obj/item/stack/material/use(var/used)
. = ..()
if(QDELETED(src))
return
update_strings()
/obj/item/stack/material/transfer_to(obj/item/stack/S, var/tamount=null, var/type_verified)
var/obj/item/stack/material/M = S
if(!istype(M) || material.name != M.material.name)
return 0
var/transfer = ..(S,tamount,1)
if(!QDELETED(src))
update_strings()
if(M)
M.update_strings()
return transfer
/obj/item/stack/material/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(!material.build_windows(user, src))
tgui_interact(user)
/obj/item/stack/material/attackby(var/obj/item/W, var/mob/user)
if(istype(W,/obj/item/stack/cable_coil))
material.build_wired_product(user, W, src)
return
else if(istype(W, /obj/item/stack/rods))
material.build_rod_product(user, W, src)
return
return ..()