mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-01 04:21:42 +00:00
* Some explosions code cleanup (#57493) Clears out two deprecated explosions systems (explosion ids and explosion levels) Refactors a bunch of contents_explosions procs to be maybe slightly faster. Cleans up a bunch of ex_act code. Slightly cleaner code A few less unused vars on /atom and /turf * Some explosions code cleanup Co-authored-by: TemporalOroboros <TemporalOroboros@gmail.com>
57 lines
1.5 KiB
Plaintext
57 lines
1.5 KiB
Plaintext
/obj/item/storage
|
|
name = "storage"
|
|
icon = 'icons/obj/storage.dmi'
|
|
w_class = WEIGHT_CLASS_NORMAL
|
|
var/rummage_if_nodrop = TRUE
|
|
var/component_type = /datum/component/storage/concrete
|
|
|
|
/obj/item/storage/get_dumping_location(obj/item/storage/source,mob/user)
|
|
return src
|
|
|
|
/obj/item/storage/Initialize()
|
|
. = ..()
|
|
PopulateContents()
|
|
|
|
/obj/item/storage/ComponentInitialize()
|
|
AddComponent(component_type)
|
|
|
|
/obj/item/storage/AllowDrop()
|
|
return FALSE
|
|
|
|
/obj/item/storage/contents_explosion(severity, target)
|
|
switch(severity)
|
|
if(EXPLODE_DEVASTATE)
|
|
SSexplosions.high_mov_atom += contents
|
|
if(EXPLODE_HEAVY)
|
|
SSexplosions.med_mov_atom += contents
|
|
if(EXPLODE_LIGHT)
|
|
SSexplosions.low_mov_atom += contents
|
|
|
|
/obj/item/storage/canStrip(mob/who)
|
|
. = ..()
|
|
if(!. && rummage_if_nodrop)
|
|
return TRUE
|
|
|
|
/obj/item/storage/doStrip(mob/who)
|
|
if(HAS_TRAIT(src, TRAIT_NODROP) && rummage_if_nodrop)
|
|
var/datum/component/storage/CP = GetComponent(/datum/component/storage)
|
|
CP.do_quick_empty()
|
|
return TRUE
|
|
return ..()
|
|
|
|
/obj/item/storage/contents_explosion(severity, target)
|
|
//Cyberboss says: "USE THIS TO FILL IT, NOT INITIALIZE OR NEW"
|
|
|
|
/obj/item/storage/proc/PopulateContents()
|
|
|
|
/obj/item/storage/proc/emptyStorage()
|
|
var/datum/component/storage/ST = GetComponent(/datum/component/storage)
|
|
ST.do_quick_empty()
|
|
|
|
/obj/item/storage/Destroy()
|
|
for(var/obj/important_thing in contents)
|
|
if(!(important_thing.resistance_flags & INDESTRUCTIBLE))
|
|
continue
|
|
important_thing.forceMove(drop_location())
|
|
return ..()
|