Slightly refactors storage item insertion (#24429)

* everything is on fire

* silent trait check

* how did it even become CRLF

* minor formatting

* fix icon updating and adds silent insertion to global trait list

* adds the new parameter to documentation - whoops!

* pain

* contra review

* contra review again, reduces amount of checks for user in the loops

---------

Co-authored-by: cybercapitalism <98280110+cybercapitalism@users.noreply.github.com>
This commit is contained in:
chuga-git
2024-03-24 13:41:07 -05:00
committed by GitHub
parent 25848b6988
commit 19c0b70171
18 changed files with 84 additions and 67 deletions
+2 -2
View File
@@ -80,13 +80,13 @@
var/obj/item/I = new item_to_summon(src)
if(H.back && isstorage(H.back))
var/obj/item/storage/S = H.back
S.handle_item_insertion(I, TRUE) //We don't check if it can be inserted because it's magic, GET IN THERE!
S.handle_item_insertion(I, H, TRUE) //We don't check if it can be inserted because it's magic, GET IN THERE!
H.visible_message("<span class='chaosgood'>[H]'s [S.name] glows bright!</span>", "<span class='chaosverygood'>\A [I] suddenly appears in your glowing [S.name]!</span>")
return
if(H.back && ismodcontrol(H.back))
var/obj/item/mod/control/C = H.back
if(C.bag)
C.handle_item_insertion(I, TRUE)
C.handle_item_insertion(I, H, TRUE)
H.visible_message("<span class='chaosgood'>[H]'s [C] glows bright!</span>", "<span class='chaosverygood'>\A [I] suddenly appears in your glowing [C.name]!</span>")
return
I.forceMove(get_turf(H))
@@ -125,6 +125,10 @@
empty_state = "crossbow_empty"
can_holster = TRUE
/obj/item/gun/energy/kinetic_accelerator/crossbow/Initialize(mapload)
. = ..()
ADD_TRAIT(src, TRAIT_SILENT_INSERTION, ROUNDSTART_TRAIT)
/obj/item/gun/energy/kinetic_accelerator/crossbow/large
name = "energy crossbow"
desc = "A reverse engineered weapon using syndicate technology."