Files
VOREStation/code/game/objects/structures/bedsheet_bin.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

264 lines
5.7 KiB
Plaintext

/*
CONTAINS:
BEDSHEETS
LINEN BINS
*/
/obj/item/bedsheet
name = "bedsheet"
desc = "A surprisingly soft linen bedsheet."
icon = 'icons/obj/items.dmi'
icon_state = "sheet"
slot_flags = SLOT_BACK
plane = MOB_PLANE
layer = BELOW_MOB_LAYER
throwforce = 1
throw_speed = 1
throw_range = 2
w_class = ITEMSIZE_SMALL
drop_sound = 'sound/items/drop/clothing.ogg'
pickup_sound = 'sound/items/pickup/clothing.ogg'
///var used for attack_self chain
var/special_handling = FALSE
/obj/item/bedsheet/Initialize(mapload)
. = ..()
AddElement(/datum/element/rotatable/onlyflip)
/obj/item/bedsheet/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
if(special_handling)
return FALSE
user.drop_item()
if(layer == initial(layer))
layer = ABOVE_MOB_LAYER
else
reset_plane_and_layer()
add_fingerprint(user)
return
/obj/item/bedsheet/attackby(obj/item/I, mob/user)
if(is_sharp(I))
user.visible_message(span_infoplain(span_bold("\The [user]") + " begins cutting up [src] with [I]."), span_notice("You begin cutting up [src] with [I]."))
if(do_after(user, 5 SECONDS, target = src))
to_chat(user, span_notice("You cut [src] into pieces!"))
for(var/i in 1 to rand(2,5))
new /obj/item/reagent_containers/glass/rag(drop_location())
qdel(src)
return
..()
/obj/item/bedsheet/ghosts_can_use_rotate_verbs()
return CONFIG_GET(flag/ghost_interaction)
/obj/item/bedsheet/blue
icon_state = "sheetblue"
/obj/item/bedsheet/green
icon_state = "sheetgreen"
/obj/item/bedsheet/orange
icon_state = "sheetorange"
/obj/item/bedsheet/purple
icon_state = "sheetpurple"
/obj/item/bedsheet/rainbow
icon_state = "sheetrainbow"
/obj/item/bedsheet/red
icon_state = "sheetred"
/obj/item/bedsheet/yellow
icon_state = "sheetyellow"
/obj/item/bedsheet/mime
icon_state = "sheetmime"
/obj/item/bedsheet/clown
icon_state = "sheetclown"
item_state = "sheetrainbow"
/obj/item/bedsheet/captain
icon_state = "sheetcaptain"
/obj/item/bedsheet/rd
icon_state = "sheetrd"
/obj/item/bedsheet/medical
icon_state = "sheetmedical"
/obj/item/bedsheet/hos
icon_state = "sheethos"
/obj/item/bedsheet/hop
icon_state = "sheethop"
/obj/item/bedsheet/ce
icon_state = "sheetce"
/obj/item/bedsheet/brown
icon_state = "sheetbrown"
/obj/item/bedsheet/ian
icon_state = "sheetian"
/obj/item/bedsheet/double
icon_state = "doublesheet"
item_state = "sheet"
/obj/item/bedsheet/bluedouble
icon_state = "doublesheetblue"
item_state = "sheetblue"
/obj/item/bedsheet/greendouble
icon_state = "doublesheetgreen"
item_state = "sheetgreen"
/obj/item/bedsheet/orangedouble
icon_state = "doublesheetorange"
item_state = "sheetorange"
/obj/item/bedsheet/purpledouble
icon_state = "doublesheetpurple"
item_state = "sheetpurple"
/obj/item/bedsheet/rainbowdouble //all the way across the sky.
icon_state = "doublesheetrainbow"
item_state = "sheetrainbow"
/obj/item/bedsheet/reddouble
icon_state = "doublesheetred"
item_state = "sheetred"
/obj/item/bedsheet/yellowdouble
icon_state = "doublesheetyellow"
item_state = "sheetyellow"
/obj/item/bedsheet/mimedouble
icon_state = "doublesheetmime"
item_state = "sheetmime"
/obj/item/bedsheet/clowndouble
icon_state = "doublesheetclown"
item_state = "sheetrainbow"
/obj/item/bedsheet/captaindouble
icon_state = "doublesheetcaptain"
item_state = "sheetcaptain"
/obj/item/bedsheet/rddouble
icon_state = "doublesheetrd"
item_state = "sheetrd"
/obj/item/bedsheet/hosdouble
icon_state = "doublesheethos"
item_state = "sheethos"
/obj/item/bedsheet/hopdouble
icon_state = "doublesheethop"
item_state = "sheethop"
/obj/item/bedsheet/cedouble
icon_state = "doublesheetce"
item_state = "sheetce"
/obj/item/bedsheet/browndouble
icon_state = "doublesheetbrown"
item_state = "sheetbrown"
/obj/item/bedsheet/iandouble
icon_state = "doublesheetian"
item_state = "sheetian"
/obj/structure/bedsheetbin
name = "linen bin"
desc = "A linen bin. It looks rather cosy."
icon = 'icons/obj/structures.dmi'
icon_state = "linenbin-full"
anchored = TRUE
var/amount = 20
var/list/sheets = list()
var/obj/item/hidden = null
/obj/structure/bedsheetbin/examine(mob/user)
. = ..()
if(amount < 1)
. += "There are no bed sheets in the bin."
else if(amount == 1)
. += "There is one bed sheet in the bin."
else
. += "There are [amount] bed sheets in the bin."
/obj/structure/bedsheetbin/update_icon()
if(amount == 0)
icon_state = "linenbin-empty"
else if(amount <= (amount / 2))
icon_state = "linenbin-half"
else
icon_state = "linenbin-full"
/obj/structure/bedsheetbin/attackby(obj/item/I as obj, mob/user as mob)
if(istype(I, /obj/item/bedsheet))
user.drop_item()
I.loc = src
sheets.Add(I)
amount++
to_chat(user, span_notice("You put [I] in [src]."))
else if(amount && !hidden && I.w_class < ITEMSIZE_LARGE) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
user.drop_item()
I.loc = src
hidden = I
to_chat(user, span_notice("You hide [I] among the sheets."))
/obj/structure/bedsheetbin/attack_hand(mob/user as mob)
if(amount >= 1)
amount--
var/obj/item/bedsheet/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
else
B = new /obj/item/bedsheet(loc)
B.loc = user.loc
user.put_in_hands(B)
to_chat(user, span_notice("You take [B] out of [src]."))
if(hidden)
hidden.loc = user.loc
to_chat(user, span_notice("[hidden] falls out of [B]!"))
hidden = null
add_fingerprint(user)
/obj/structure/bedsheetbin/attack_tk(mob/user as mob)
if(amount >= 1)
amount--
var/obj/item/bedsheet/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
else
B = new /obj/item/bedsheet(loc)
B.loc = loc
to_chat(user, span_notice("You telekinetically remove [B] from [src]."))
update_icon()
if(hidden)
hidden.loc = loc
hidden = null
add_fingerprint(user)