Files
Bubberstation/code/game/objects/items/storage/storage.dm
Iamgoofball a3aa69701a [READY] Basically, Instant Explosions 2: The Search For More Money: Eternal: A Tail Of Two Kitties: 33 1/3 (#50594)
About The Pull Request

Extools maptick stuff is in the game. Stolen from BeeStation/BeeStation-Hornet#1119, improves performance. Requires ex-tools on the server, though.

Explosions have been refactored to do the actual exploding in a subsystem.

Credit to goon.

Here's some videos!

Why It's Good For The Game
Basically instant max-caps now.
We can now give more of a tick over to the sending of map updates

Changelog

cl Goonstation Coders, Beestation, Extools devs
refactor: Explosions have been heavily optimized.
/cl
2020-04-30 10:27:53 +12:00

51 lines
1.3 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)
for(var/atom/A in contents)
switch(severity)
if(EXPLODE_DEVASTATE)
SSexplosions.highobj += A
if(EXPLODE_HEAVY)
SSexplosions.medobj += A
if(EXPLODE_LIGHT)
SSexplosions.lowobj += A
/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()