Merge pull request #9983 from Ghommie/Ghommie-cit408

refactoring altclick interaction to allow parent calls without forcing the turf contents stat menu open.
This commit is contained in:
Lin
2019-12-10 23:52:31 +00:00
committed by Archie
parent 7ed460e9fe
commit b0779fe2d7
96 changed files with 10279 additions and 10117 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -974,10 +974,12 @@
to_chat(user, "<span class='notice'>You [suction ? "enable" : "disable"] the board's suction function.</span>")
/obj/item/circuitboard/machine/dish_drive/AltClick(mob/living/user)
. = ..()
if(!user.Adjacent(src))
return
transmit = !transmit
to_chat(user, "<span class='notice'>You [transmit ? "enable" : "disable"] the board's automatic disposal transmission.</span>")
return TRUE
/obj/item/circuitboard/machine/stacking_unit_console
name = "Stacking Machine Console (Machine Board)"

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,91 @@
//NOT YET IMPLEMENTED -- Archie
/obj/item/desynchronizer
name = "desynchronizer"
desc = "An experimental device that can temporarily desynchronize the user from spacetime, effectively making them disappear while it's active."
icon = 'icons/obj/device.dmi'
icon_state = "desynchronizer"
item_state = "electronic"
w_class = WEIGHT_CLASS_SMALL
item_flags = NOBLUDGEON
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
materials = list(MAT_METAL = 250, MAT_GLASS = 500)
var/max_duration = 3000
var/duration = 300
var/last_use = 0
var/next_use = 0
var/obj/effect/abstract/sync_holder/sync_holder
/obj/item/desynchronizer/attack_self(mob/living/user)
if(world.time < next_use)
to_chat(user, "<span class='warning'>[src] is still recharging.</span>")
return
if(!sync_holder)
desync(user)
else
resync()
/obj/item/desynchronizer/examine(mob/user)
. = ..()
if(world.time < next_use)
. += "<span class='warning'>Time left to recharge: [DisplayTimeText(next_use - world.time)]</span>"
. += "<span class='notice'>Alt-click to customize the duration. Current duration: [DisplayTimeText(duration)].</span>"
. += "<span class='notice'>Can be used again to interrupt the effect early. The recharge time is the same as the time spent in desync.</span>"
/obj/item/desynchronizer/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
var/new_duration = input(user, "Set the duration (5-300):", "Desynchronizer", duration / 10) as null|num
if(new_duration)
new_duration = new_duration SECONDS
new_duration = CLAMP(new_duration, 50, max_duration)
duration = new_duration
to_chat(user, "<span class='notice'>You set the duration to [DisplayTimeText(duration)].</span>")
return TRUE
/obj/item/desynchronizer/proc/desync(mob/living/user)
if(sync_holder)
return
sync_holder = new(drop_location())
new /obj/effect/temp_visual/desynchronizer(drop_location())
to_chat(user, "<span class='notice'>You activate [src], desynchronizing yourself from the present. You can still see your surroundings, but you feel eerily dissociated from reality.</span>")
user.forceMove(sync_holder)
SEND_SIGNAL(user, COMSIG_MOVABLE_SECLUDED_LOCATION)
for(var/thing in user)
var/atom/movable/AM = thing
SEND_SIGNAL(AM, COMSIG_MOVABLE_SECLUDED_LOCATION)
last_use = world.time
icon_state = "desynchronizer-on"
addtimer(CALLBACK(src, .proc/resync), duration)
/obj/item/desynchronizer/proc/resync()
new /obj/effect/temp_visual/desynchronizer(sync_holder.drop_location())
QDEL_NULL(sync_holder)
icon_state = initial(icon_state)
next_use = world.time + (world.time - last_use) // Could be 2*world.time-last_use but that would just be confusing
/obj/item/desynchronizer/Destroy()
resync()
return ..()
/obj/effect/abstract/sync_holder
name = "desyncronized pocket"
desc = "A pocket in spacetime, keeping the user a fraction of a second in the future."
icon = null
icon_state = null
alpha = 0
invisibility = INVISIBILITY_ABSTRACT
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
anchored = TRUE
resistance_flags = INDESTRUCTIBLE
/obj/effect/abstract/sync_holder/Destroy()
for(var/I in contents)
var/atom/movable/AM = I
AM.forceMove(drop_location())
return ..()
/obj/effect/abstract/sync_holder/AllowDrop()
return TRUE //no dropping spaghetti out of your spacetime pocket

View File

@@ -184,14 +184,16 @@
return ..()
/obj/item/geiger_counter/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE))
return ..()
return
if(!scanning)
to_chat(usr, "<span class='warning'>[src] must be on to reset its radiation level!</span>")
return 0
return TRUE
radiation_count = 0
to_chat(usr, "<span class='notice'>You flush [src]'s radiation counts, resetting it to normal.</span>")
update_icon()
return TRUE
/obj/item/geiger_counter/emag_act(mob/user)
if(obj_flags & EMAGGED)

View File

@@ -1,224 +1,226 @@
GLOBAL_LIST_EMPTY(GPS_list)
/obj/item/gps
name = "global positioning system"
desc = "Helping lost spacemen find their way through the planets since 2016."
icon = 'icons/obj/telescience.dmi'
icon_state = "gps-c"
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
obj_flags = UNIQUE_RENAME
var/gpstag = "COM0"
var/emped = FALSE
var/tracking = TRUE
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
/obj/item/gps/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
/obj/item/gps/Initialize()
. = ..()
GLOB.GPS_list += src
name = "global positioning system ([gpstag])"
add_overlay("working")
/obj/item/gps/Destroy()
GLOB.GPS_list -= src
return ..()
/obj/item/gps/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
emped = TRUE
cut_overlay("working")
add_overlay("emp")
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
SStgui.close_uis(src) //Close the UI control if it is open.
/obj/item/gps/proc/reboot()
emped = FALSE
cut_overlay("emp")
add_overlay("working")
/obj/item/gps/AltClick(mob/user)
if(!user.canUseTopic(src, BE_CLOSE))
return
toggletracking(user)
/obj/item/gps/proc/toggletracking(mob/user)
if(!user.canUseTopic(src, BE_CLOSE))
return //user not valid to use gps
if(emped)
to_chat(user, "It's busted!")
return
if(tracking)
cut_overlay("working")
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
tracking = FALSE
else
add_overlay("working")
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
tracking = TRUE
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
if(emped)
to_chat(user, "[src] fizzles weakly.")
return
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
var/gps_window_height = 300 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
ui = new(user, src, ui_key, "gps", "Global Positioning System", 600, gps_window_height, master_ui, state) //width, height
ui.open()
ui.set_autoupdate(state = updating)
/obj/item/gps/ui_data(mob/user)
var/list/data = list()
data["power"] = tracking
data["tag"] = gpstag
data["updating"] = updating
data["globalmode"] = global_mode
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
return data
var/turf/curr = get_turf(src)
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
var/list/signals = list()
data["signals"] = list()
for(var/gps in GLOB.GPS_list)
var/obj/item/gps/G = gps
if(G.emped || !G.tracking || G == src)
continue
var/turf/pos = get_turf(G)
if(!global_mode && pos.z != curr.z)
continue
var/list/signal = list()
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
signal["area"] = get_area_name(G, TRUE)
signal["coord"] = "[pos.x], [pos.y], [pos.z]"
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
var/direction = uppertext(dir2text(get_dir(curr, pos))) //Direction text (East, etc). Not as precise, but still helpful.
if(!direction)
direction = "CENTER"
signal["degrees"] = "N/A"
signal["direction"] = direction
signals += list(signal) //Add this signal to the list of signals
data["signals"] = signals
return data
/obj/item/gps/ui_act(action, params)
if(..())
return
switch(action)
if("rename")
var/a = input("Please enter desired tag.", name, gpstag) as text
a = copytext(sanitize(a), 1, 20)
gpstag = a
. = TRUE
name = "global positioning system ([gpstag])"
if("power")
toggletracking(usr)
. = TRUE
if("updating")
updating = !updating
. = TRUE
if("globalmode")
global_mode = !global_mode
. = TRUE
/obj/item/gps/science
icon_state = "gps-s"
gpstag = "SCI0"
/obj/item/gps/engineering
icon_state = "gps-e"
gpstag = "ENG0"
/obj/item/gps/mining
icon_state = "gps-m"
gpstag = "MINE0"
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
/obj/item/gps/cyborg
icon_state = "gps-b"
gpstag = "BORG0"
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
/obj/item/gps/cyborg/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
/obj/item/gps/internal
icon_state = null
item_flags = ABSTRACT
gpstag = "Eerie Signal"
desc = "Report to a coder immediately."
invisibility = INVISIBILITY_MAXIMUM
var/obj/item/implant/gps/implant
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
. = ..()
implant = _implant
/obj/item/gps/internal/Destroy()
if(implant?.imp_in)
qdel(implant)
else
return ..()
/obj/item/gps/internal/mining
icon_state = "gps-m"
gpstag = "MINER"
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
/obj/item/gps/internal/base
gpstag = "NT_AUX"
desc = "A homing signal from Kinaris's mining base."
/obj/item/gps/visible_debug
name = "visible GPS"
gpstag = "ADMIN"
desc = "This admin-spawn GPS unit leaves the coordinates visible \
on any turf that it passes over, for debugging. Especially useful \
for marking the area around the transition edges."
var/list/turf/tagged
/obj/item/gps/visible_debug/Initialize()
. = ..()
tagged = list()
START_PROCESSING(SSfastprocess, src)
/obj/item/gps/visible_debug/process()
var/turf/T = get_turf(src)
if(T)
// I assume it's faster to color,tag and OR the turf in, rather
// then checking if its there
T.color = RANDOM_COLOUR
T.maptext = "[T.x],[T.y],[T.z]"
tagged |= T
/obj/item/gps/visible_debug/proc/clear()
while(tagged.len)
var/turf/T = pop(tagged)
T.color = initial(T.color)
T.maptext = initial(T.maptext)
/obj/item/gps/visible_debug/Destroy()
if(tagged)
clear()
tagged = null
STOP_PROCESSING(SSfastprocess, src)
. = ..()
GLOBAL_LIST_EMPTY(GPS_list)
/obj/item/gps
name = "global positioning system"
desc = "Helping lost spacemen find their way through the planets since 2016."
icon = 'icons/obj/telescience.dmi'
icon_state = "gps-c"
w_class = WEIGHT_CLASS_SMALL
slot_flags = ITEM_SLOT_BELT
obj_flags = UNIQUE_RENAME
var/gpstag = "COM0"
var/emped = FALSE
var/tracking = TRUE
var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
/obj/item/gps/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to switch it [tracking ? "off":"on"].</span>"
/obj/item/gps/Initialize()
. = ..()
GLOB.GPS_list += src
name = "global positioning system ([gpstag])"
add_overlay("working")
/obj/item/gps/Destroy()
GLOB.GPS_list -= src
return ..()
/obj/item/gps/emp_act(severity)
. = ..()
if (. & EMP_PROTECT_SELF)
return
emped = TRUE
cut_overlay("working")
add_overlay("emp")
addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
SStgui.close_uis(src) //Close the UI control if it is open.
/obj/item/gps/proc/reboot()
emped = FALSE
cut_overlay("emp")
add_overlay("working")
/obj/item/gps/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, BE_CLOSE))
return
toggletracking(user)
return TRUE
/obj/item/gps/proc/toggletracking(mob/user)
if(!user.canUseTopic(src, BE_CLOSE))
return //user not valid to use gps
if(emped)
to_chat(user, "It's busted!")
return
if(tracking)
cut_overlay("working")
to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
tracking = FALSE
else
add_overlay("working")
to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
tracking = TRUE
/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
if(emped)
to_chat(user, "[src] fizzles weakly.")
return
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
var/gps_window_height = 300 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
ui = new(user, src, ui_key, "gps", "Global Positioning System", 600, gps_window_height, master_ui, state) //width, height
ui.open()
ui.set_autoupdate(state = updating)
/obj/item/gps/ui_data(mob/user)
var/list/data = list()
data["power"] = tracking
data["tag"] = gpstag
data["updating"] = updating
data["globalmode"] = global_mode
if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
return data
var/turf/curr = get_turf(src)
data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
var/list/signals = list()
data["signals"] = list()
for(var/gps in GLOB.GPS_list)
var/obj/item/gps/G = gps
if(G.emped || !G.tracking || G == src)
continue
var/turf/pos = get_turf(G)
if(!global_mode && pos.z != curr.z)
continue
var/list/signal = list()
signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
signal["area"] = get_area_name(G, TRUE)
signal["coord"] = "[pos.x], [pos.y], [pos.z]"
if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
var/direction = uppertext(dir2text(get_dir(curr, pos))) //Direction text (East, etc). Not as precise, but still helpful.
if(!direction)
direction = "CENTER"
signal["degrees"] = "N/A"
signal["direction"] = direction
signals += list(signal) //Add this signal to the list of signals
data["signals"] = signals
return data
/obj/item/gps/ui_act(action, params)
if(..())
return
switch(action)
if("rename")
var/a = input("Please enter desired tag.", name, gpstag) as text
a = copytext(sanitize(a), 1, 20)
gpstag = a
. = TRUE
name = "global positioning system ([gpstag])"
if("power")
toggletracking(usr)
. = TRUE
if("updating")
updating = !updating
. = TRUE
if("globalmode")
global_mode = !global_mode
. = TRUE
/obj/item/gps/science
icon_state = "gps-s"
gpstag = "SCI0"
/obj/item/gps/engineering
icon_state = "gps-e"
gpstag = "ENG0"
/obj/item/gps/mining
icon_state = "gps-m"
gpstag = "MINE0"
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
/obj/item/gps/cyborg
icon_state = "gps-b"
gpstag = "BORG0"
desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
/obj/item/gps/cyborg/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
/obj/item/gps/internal
icon_state = null
item_flags = ABSTRACT
gpstag = "Eerie Signal"
desc = "Report to a coder immediately."
invisibility = INVISIBILITY_MAXIMUM
var/obj/item/implant/gps/implant
/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
. = ..()
implant = _implant
/obj/item/gps/internal/Destroy()
if(implant?.imp_in)
qdel(implant)
else
return ..()
/obj/item/gps/internal/mining
icon_state = "gps-m"
gpstag = "MINER"
desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
/obj/item/gps/internal/base
gpstag = "NT_AUX"
desc = "A homing signal from Kinaris's mining base."
/obj/item/gps/visible_debug
name = "visible GPS"
gpstag = "ADMIN"
desc = "This admin-spawn GPS unit leaves the coordinates visible \
on any turf that it passes over, for debugging. Especially useful \
for marking the area around the transition edges."
var/list/turf/tagged
/obj/item/gps/visible_debug/Initialize()
. = ..()
tagged = list()
START_PROCESSING(SSfastprocess, src)
/obj/item/gps/visible_debug/process()
var/turf/T = get_turf(src)
if(T)
// I assume it's faster to color,tag and OR the turf in, rather
// then checking if its there
T.color = RANDOM_COLOUR
T.maptext = "[T.x],[T.y],[T.z]"
tagged |= T
/obj/item/gps/visible_debug/proc/clear()
while(tagged.len)
var/turf/T = pop(tagged)
T.color = initial(T.color)
T.maptext = initial(T.maptext)
/obj/item/gps/visible_debug/Destroy()
if(tagged)
clear()
tagged = null
STOP_PROCESSING(SSfastprocess, src)
. = ..()

View File

@@ -18,12 +18,14 @@
. += "<span class='notice'>Insert [src] into an active quantum pad to link it.</span>"
/obj/item/quantum_keycard/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
to_chat(user, "<span class='notice'>You start pressing [src]'s unlink button...</span>")
if(do_after(user, 40, target = src))
to_chat(user, "<span class='notice'>The keycard beeps twice and disconnects the quantum link.</span>")
qpad = null
return TRUE
/obj/item/quantum_keycard/update_icon()
if(qpad)

View File

@@ -1,333 +1,335 @@
// Used for translating channels to tokens on examination
GLOBAL_LIST_INIT(channel_tokens, list(
RADIO_CHANNEL_COMMON = RADIO_KEY_COMMON,
RADIO_CHANNEL_SCIENCE = RADIO_TOKEN_SCIENCE,
RADIO_CHANNEL_COMMAND = RADIO_TOKEN_COMMAND,
RADIO_CHANNEL_MEDICAL = RADIO_TOKEN_MEDICAL,
RADIO_CHANNEL_ENGINEERING = RADIO_TOKEN_ENGINEERING,
RADIO_CHANNEL_SECURITY = RADIO_TOKEN_SECURITY,
RADIO_CHANNEL_CENTCOM = RADIO_TOKEN_CENTCOM,
RADIO_CHANNEL_SYNDICATE = RADIO_TOKEN_SYNDICATE,
RADIO_CHANNEL_SUPPLY = RADIO_TOKEN_SUPPLY,
RADIO_CHANNEL_SERVICE = RADIO_TOKEN_SERVICE,
MODE_BINARY = MODE_TOKEN_BINARY,
RADIO_CHANNEL_AI_PRIVATE = RADIO_TOKEN_AI_PRIVATE
))
/obj/item/radio/headset
name = "radio headset"
desc = "An updated, modular intercom that fits over the head. Takes encryption keys."
icon_state = "headset"
item_state = "headset"
materials = list(MAT_METAL=75)
subspace_transmission = TRUE
canhear_range = 0 // can't hear headsets from very far away
slot_flags = ITEM_SLOT_EARS
var/obj/item/encryptionkey/keyslot2 = null
dog_fashion = null
/obj/item/radio/headset/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins putting \the [src]'s antenna up [user.p_their()] nose! It looks like [user.p_theyre()] trying to give [user.p_them()]self cancer!</span>")
return TOXLOSS
/obj/item/radio/headset/examine(mob/user)
. = ..()
if(item_flags & IN_INVENTORY && loc == user)
// construction of frequency description
var/list/avail_chans = list("Use [RADIO_KEY_COMMON] for the currently tuned frequency")
if(translate_binary)
avail_chans += "use [MODE_TOKEN_BINARY] for [MODE_BINARY]"
if(length(channels))
for(var/i in 1 to length(channels))
if(i == 1)
avail_chans += "use [MODE_TOKEN_DEPARTMENT] or [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
else
avail_chans += "use [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
. += "<span class='notice'>A small screen on the headset displays the following available frequencies:\n[english_list(avail_chans)]."
if(command)
. += "<span class='info'>Alt-click to toggle the high-volume mode.</span>"
else
. += "<span class='notice'>A small screen on the headset flashes, it's too small to read without holding or wearing the headset.</span>"
/obj/item/radio/headset/Initialize()
. = ..()
recalculateChannels()
/obj/item/radio/headset/Destroy()
QDEL_NULL(keyslot2)
return ..()
/obj/item/radio/headset/talk_into(mob/living/M, message, channel, list/spans,datum/language/language)
if (!listening)
return ITALICS | REDUCE_RANGE
return ..()
/obj/item/radio/headset/can_receive(freq, level, AIuser)
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
if(H.ears == src)
return ..(freq, level)
else if(AIuser)
return ..(freq, level)
return FALSE
/obj/item/radio/headset/syndicate //disguised to look like a normal headset for stealth ops
/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
name = "syndicate headset"
desc = "A syndicate headset that can be used to hear all radio frequencies. Protects ears from flashbangs."
icon_state = "syndie_headset"
item_state = "syndie_headset"
/obj/item/radio/headset/syndicate/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/syndicate/alt/leader
name = "team leader headset"
command = TRUE
/obj/item/radio/headset/syndicate/Initialize()
. = ..()
make_syndie()
/obj/item/radio/headset/binary
/obj/item/radio/headset/binary/Initialize()
. = ..()
qdel(keyslot)
keyslot = new /obj/item/encryptionkey/binary
recalculateChannels()
/obj/item/radio/headset/headset_sec
name = "security radio headset"
desc = "This is used by your elite security force."
icon_state = "sec_headset"
keyslot = new /obj/item/encryptionkey/headset_sec
/obj/item/radio/headset/headset_sec/alt
name = "security bowman headset"
desc = "This is used by your elite security force. Protects ears from flashbangs."
icon_state = "sec_headset_alt"
item_state = "sec_headset_alt"
/obj/item/radio/headset/headset_sec/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/headset_eng
name = "engineering radio headset"
desc = "When the engineers wish to chat like girls."
icon_state = "eng_headset"
keyslot = new /obj/item/encryptionkey/headset_eng
/obj/item/radio/headset/headset_rob
name = "robotics radio headset"
desc = "Made specifically for the roboticists, who cannot decide between departments."
icon_state = "rob_headset"
keyslot = new /obj/item/encryptionkey/headset_rob
/obj/item/radio/headset/headset_med
name = "medical radio headset"
desc = "A headset for the trained staff of the medbay."
icon_state = "med_headset"
keyslot = new /obj/item/encryptionkey/headset_med
/obj/item/radio/headset/headset_sci
name = "science radio headset"
desc = "A sciency headset. Like usual."
icon_state = "sci_headset"
keyslot = new /obj/item/encryptionkey/headset_sci
/obj/item/radio/headset/headset_medsci
name = "medical research radio headset"
desc = "A headset that is a result of the mating between medical and science."
icon_state = "medsci_headset"
keyslot = new /obj/item/encryptionkey/headset_medsci
/obj/item/radio/headset/headset_com
name = "command radio headset"
desc = "A headset with a commanding channel.\nTo access the command channel, use :c."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/headset_com
/obj/item/radio/headset/heads
command = TRUE
/obj/item/radio/headset/heads/captain
name = "\proper the captain's headset"
desc = "The headset of the king."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/captain
/obj/item/radio/headset/heads/captain/alt
name = "\proper the captain's bowman headset"
desc = "The headset of the boss. Protects ears from flashbangs."
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
/obj/item/radio/headset/heads/captain/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/heads/rd
name = "\proper the research director's headset"
desc = "Headset of the fellow who keeps society marching towards technological singularity."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/rd
/obj/item/radio/headset/heads/hos
name = "\proper the head of security's headset"
desc = "The headset of the man in charge of keeping order and protecting the station."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/hos
/obj/item/radio/headset/heads/hos/alt
name = "\proper the head of security's bowman headset"
desc = "The headset of the man in charge of keeping order and protecting the station. Protects ears from flashbangs."
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
/obj/item/radio/headset/heads/hos/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/heads/ce
name = "\proper the chief engineer's headset"
desc = "The headset of the guy in charge of keeping the station powered and undamaged."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/ce
/obj/item/radio/headset/heads/cmo
name = "\proper the chief medical officer's headset"
desc = "The headset of the highly trained medical chief."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/cmo
/obj/item/radio/headset/heads/hop
name = "\proper the head of personnel's headset"
desc = "The headset of the guy who will one day be captain."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/hop
/obj/item/radio/headset/headset_cargo
name = "supply radio headset"
desc = "A headset used by the QM and his slaves."
icon_state = "cargo_headset"
keyslot = new /obj/item/encryptionkey/headset_cargo
/obj/item/radio/headset/headset_cargo/mining
name = "mining radio headset"
desc = "Headset used by shaft miners."
icon_state = "mine_headset"
keyslot = new /obj/item/encryptionkey/headset_mining
/obj/item/radio/headset/headset_srv
name = "service radio headset"
desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean."
icon_state = "srv_headset"
keyslot = new /obj/item/encryptionkey/headset_service
/obj/item/radio/headset/headset_cent
name = "\improper CentCom headset"
desc = "A headset used by the upper echelons of Kinaris."
icon_state = "cent_headset"
keyslot = new /obj/item/encryptionkey/headset_com
keyslot2 = new /obj/item/encryptionkey/headset_cent
/obj/item/radio/headset/headset_cent/empty
keyslot = null
keyslot2 = null
/obj/item/radio/headset/headset_cent/commander
keyslot = new /obj/item/encryptionkey/heads/captain
/obj/item/radio/headset/headset_cent/alt
name = "\improper CentCom bowman headset"
desc = "A headset especially for emergency response personnel. Protects ears from flashbangs."
icon_state = "cent_headset_alt"
item_state = "cent_headset_alt"
keyslot = null
/obj/item/radio/headset/headset_cent/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/ai
name = "\proper Integrated Subspace Transceiver "
keyslot2 = new /obj/item/encryptionkey/ai
command = TRUE
/obj/item/radio/headset/ai/can_receive(freq, level)
return ..(freq, level, TRUE)
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
user.set_machine(src)
if(istype(W, /obj/item/screwdriver))
if(keyslot || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
var/turf/T = user.drop_location()
if(T)
if(keyslot)
keyslot.forceMove(T)
keyslot = null
if(keyslot2)
keyslot2.forceMove(T)
keyslot2 = null
recalculateChannels()
to_chat(user, "<span class='notice'>You pop out the encryption keys in the headset.</span>")
else
to_chat(user, "<span class='warning'>This headset doesn't have any unique encryption keys! How useless...</span>")
else if(istype(W, /obj/item/encryptionkey))
if(keyslot && keyslot2)
to_chat(user, "<span class='warning'>The headset can't hold another key!</span>")
return
if(!keyslot)
if(!user.transferItemToLoc(W, src))
return
keyslot = W
else
if(!user.transferItemToLoc(W, src))
return
keyslot2 = W
recalculateChannels()
else
return ..()
/obj/item/radio/headset/recalculateChannels()
..()
if(keyslot2)
for(var/ch_name in keyslot2.channels)
if(!(ch_name in src.channels))
channels[ch_name] = keyslot2.channels[ch_name]
if(keyslot2.translate_binary)
translate_binary = TRUE
if(keyslot2.syndie)
syndie = TRUE
if (keyslot2.independent)
independent = TRUE
for(var/ch_name in channels)
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
/obj/item/radio/headset/AltClick(mob/living/user)
if(!istype(user) || !Adjacent(user) || user.incapacitated())
return
if (command)
use_command = !use_command
to_chat(user, "<span class='notice'>You toggle high-volume mode [use_command ? "on" : "off"].</span>")
// Used for translating channels to tokens on examination
GLOBAL_LIST_INIT(channel_tokens, list(
RADIO_CHANNEL_COMMON = RADIO_KEY_COMMON,
RADIO_CHANNEL_SCIENCE = RADIO_TOKEN_SCIENCE,
RADIO_CHANNEL_COMMAND = RADIO_TOKEN_COMMAND,
RADIO_CHANNEL_MEDICAL = RADIO_TOKEN_MEDICAL,
RADIO_CHANNEL_ENGINEERING = RADIO_TOKEN_ENGINEERING,
RADIO_CHANNEL_SECURITY = RADIO_TOKEN_SECURITY,
RADIO_CHANNEL_CENTCOM = RADIO_TOKEN_CENTCOM,
RADIO_CHANNEL_SYNDICATE = RADIO_TOKEN_SYNDICATE,
RADIO_CHANNEL_SUPPLY = RADIO_TOKEN_SUPPLY,
RADIO_CHANNEL_SERVICE = RADIO_TOKEN_SERVICE,
MODE_BINARY = MODE_TOKEN_BINARY,
RADIO_CHANNEL_AI_PRIVATE = RADIO_TOKEN_AI_PRIVATE
))
/obj/item/radio/headset
name = "radio headset"
desc = "An updated, modular intercom that fits over the head. Takes encryption keys."
icon_state = "headset"
item_state = "headset"
materials = list(MAT_METAL=75)
subspace_transmission = TRUE
canhear_range = 0 // can't hear headsets from very far away
slot_flags = ITEM_SLOT_EARS
var/obj/item/encryptionkey/keyslot2 = null
dog_fashion = null
/obj/item/radio/headset/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins putting \the [src]'s antenna up [user.p_their()] nose! It looks like [user.p_theyre()] trying to give [user.p_them()]self cancer!</span>")
return TOXLOSS
/obj/item/radio/headset/examine(mob/user)
. = ..()
if(item_flags & IN_INVENTORY && loc == user)
// construction of frequency description
var/list/avail_chans = list("Use [RADIO_KEY_COMMON] for the currently tuned frequency")
if(translate_binary)
avail_chans += "use [MODE_TOKEN_BINARY] for [MODE_BINARY]"
if(length(channels))
for(var/i in 1 to length(channels))
if(i == 1)
avail_chans += "use [MODE_TOKEN_DEPARTMENT] or [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
else
avail_chans += "use [GLOB.channel_tokens[channels[i]]] for [lowertext(channels[i])]"
. += "<span class='notice'>A small screen on the headset displays the following available frequencies:\n[english_list(avail_chans)]."
if(command)
. += "<span class='info'>Alt-click to toggle the high-volume mode.</span>"
else
. += "<span class='notice'>A small screen on the headset flashes, it's too small to read without holding or wearing the headset.</span>"
/obj/item/radio/headset/Initialize()
. = ..()
recalculateChannels()
/obj/item/radio/headset/Destroy()
QDEL_NULL(keyslot2)
return ..()
/obj/item/radio/headset/talk_into(mob/living/M, message, channel, list/spans,datum/language/language)
if (!listening)
return ITALICS | REDUCE_RANGE
return ..()
/obj/item/radio/headset/can_receive(freq, level, AIuser)
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
if(H.ears == src)
return ..(freq, level)
else if(AIuser)
return ..(freq, level)
return FALSE
/obj/item/radio/headset/syndicate //disguised to look like a normal headset for stealth ops
/obj/item/radio/headset/syndicate/alt //undisguised bowman with flash protection
name = "syndicate headset"
desc = "A syndicate headset that can be used to hear all radio frequencies. Protects ears from flashbangs."
icon_state = "syndie_headset"
item_state = "syndie_headset"
/obj/item/radio/headset/syndicate/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/syndicate/alt/leader
name = "team leader headset"
command = TRUE
/obj/item/radio/headset/syndicate/Initialize()
. = ..()
make_syndie()
/obj/item/radio/headset/binary
/obj/item/radio/headset/binary/Initialize()
. = ..()
qdel(keyslot)
keyslot = new /obj/item/encryptionkey/binary
recalculateChannels()
/obj/item/radio/headset/headset_sec
name = "security radio headset"
desc = "This is used by your elite security force."
icon_state = "sec_headset"
keyslot = new /obj/item/encryptionkey/headset_sec
/obj/item/radio/headset/headset_sec/alt
name = "security bowman headset"
desc = "This is used by your elite security force. Protects ears from flashbangs."
icon_state = "sec_headset_alt"
item_state = "sec_headset_alt"
/obj/item/radio/headset/headset_sec/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/headset_eng
name = "engineering radio headset"
desc = "When the engineers wish to chat like girls."
icon_state = "eng_headset"
keyslot = new /obj/item/encryptionkey/headset_eng
/obj/item/radio/headset/headset_rob
name = "robotics radio headset"
desc = "Made specifically for the roboticists, who cannot decide between departments."
icon_state = "rob_headset"
keyslot = new /obj/item/encryptionkey/headset_rob
/obj/item/radio/headset/headset_med
name = "medical radio headset"
desc = "A headset for the trained staff of the medbay."
icon_state = "med_headset"
keyslot = new /obj/item/encryptionkey/headset_med
/obj/item/radio/headset/headset_sci
name = "science radio headset"
desc = "A sciency headset. Like usual."
icon_state = "sci_headset"
keyslot = new /obj/item/encryptionkey/headset_sci
/obj/item/radio/headset/headset_medsci
name = "medical research radio headset"
desc = "A headset that is a result of the mating between medical and science."
icon_state = "medsci_headset"
keyslot = new /obj/item/encryptionkey/headset_medsci
/obj/item/radio/headset/headset_com
name = "command radio headset"
desc = "A headset with a commanding channel.\nTo access the command channel, use :c."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/headset_com
/obj/item/radio/headset/heads
command = TRUE
/obj/item/radio/headset/heads/captain
name = "\proper the captain's headset"
desc = "The headset of the king."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/captain
/obj/item/radio/headset/heads/captain/alt
name = "\proper the captain's bowman headset"
desc = "The headset of the boss. Protects ears from flashbangs."
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
/obj/item/radio/headset/heads/captain/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/heads/rd
name = "\proper the research director's headset"
desc = "Headset of the fellow who keeps society marching towards technological singularity."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/rd
/obj/item/radio/headset/heads/hos
name = "\proper the head of security's headset"
desc = "The headset of the man in charge of keeping order and protecting the station."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/hos
/obj/item/radio/headset/heads/hos/alt
name = "\proper the head of security's bowman headset"
desc = "The headset of the man in charge of keeping order and protecting the station. Protects ears from flashbangs."
icon_state = "com_headset_alt"
item_state = "com_headset_alt"
/obj/item/radio/headset/heads/hos/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/heads/ce
name = "\proper the chief engineer's headset"
desc = "The headset of the guy in charge of keeping the station powered and undamaged."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/ce
/obj/item/radio/headset/heads/cmo
name = "\proper the chief medical officer's headset"
desc = "The headset of the highly trained medical chief."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/cmo
/obj/item/radio/headset/heads/hop
name = "\proper the head of personnel's headset"
desc = "The headset of the guy who will one day be captain."
icon_state = "com_headset"
keyslot = new /obj/item/encryptionkey/heads/hop
/obj/item/radio/headset/headset_cargo
name = "supply radio headset"
desc = "A headset used by the QM and his slaves."
icon_state = "cargo_headset"
keyslot = new /obj/item/encryptionkey/headset_cargo
/obj/item/radio/headset/headset_cargo/mining
name = "mining radio headset"
desc = "Headset used by shaft miners."
icon_state = "mine_headset"
keyslot = new /obj/item/encryptionkey/headset_mining
/obj/item/radio/headset/headset_srv
name = "service radio headset"
desc = "Headset used by the service staff, tasked with keeping the station full, happy and clean."
icon_state = "srv_headset"
keyslot = new /obj/item/encryptionkey/headset_service
/obj/item/radio/headset/headset_cent
name = "\improper CentCom headset"
desc = "A headset used by the upper echelons of Kinaris."
icon_state = "cent_headset"
keyslot = new /obj/item/encryptionkey/headset_com
keyslot2 = new /obj/item/encryptionkey/headset_cent
/obj/item/radio/headset/headset_cent/empty
keyslot = null
keyslot2 = null
/obj/item/radio/headset/headset_cent/commander
keyslot = new /obj/item/encryptionkey/heads/captain
/obj/item/radio/headset/headset_cent/alt
name = "\improper CentCom bowman headset"
desc = "A headset especially for emergency response personnel. Protects ears from flashbangs."
icon_state = "cent_headset_alt"
item_state = "cent_headset_alt"
keyslot = null
/obj/item/radio/headset/headset_cent/alt/ComponentInitialize()
. = ..()
AddComponent(/datum/component/wearertargeting/earprotection, list(SLOT_EARS))
/obj/item/radio/headset/ai
name = "\proper Integrated Subspace Transceiver "
keyslot2 = new /obj/item/encryptionkey/ai
command = TRUE
/obj/item/radio/headset/ai/can_receive(freq, level)
return ..(freq, level, TRUE)
/obj/item/radio/headset/attackby(obj/item/W, mob/user, params)
user.set_machine(src)
if(istype(W, /obj/item/screwdriver))
if(keyslot || keyslot2)
for(var/ch_name in channels)
SSradio.remove_object(src, GLOB.radiochannels[ch_name])
secure_radio_connections[ch_name] = null
var/turf/T = user.drop_location()
if(T)
if(keyslot)
keyslot.forceMove(T)
keyslot = null
if(keyslot2)
keyslot2.forceMove(T)
keyslot2 = null
recalculateChannels()
to_chat(user, "<span class='notice'>You pop out the encryption keys in the headset.</span>")
else
to_chat(user, "<span class='warning'>This headset doesn't have any unique encryption keys! How useless...</span>")
else if(istype(W, /obj/item/encryptionkey))
if(keyslot && keyslot2)
to_chat(user, "<span class='warning'>The headset can't hold another key!</span>")
return
if(!keyslot)
if(!user.transferItemToLoc(W, src))
return
keyslot = W
else
if(!user.transferItemToLoc(W, src))
return
keyslot2 = W
recalculateChannels()
else
return ..()
/obj/item/radio/headset/recalculateChannels()
..()
if(keyslot2)
for(var/ch_name in keyslot2.channels)
if(!(ch_name in src.channels))
channels[ch_name] = keyslot2.channels[ch_name]
if(keyslot2.translate_binary)
translate_binary = TRUE
if(keyslot2.syndie)
syndie = TRUE
if (keyslot2.independent)
independent = TRUE
for(var/ch_name in channels)
secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
/obj/item/radio/headset/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !Adjacent(user) || user.incapacitated())
return
if (command)
use_command = !use_command
to_chat(user, "<span class='notice'>You toggle high-volume mode [use_command ? "on" : "off"].</span>")
return TRUE

View File

@@ -595,10 +595,10 @@ GENE SCANNER
to_chat(user, "<span class='info'>Temperature: [round(environment.temperature-T0C, 0.01)] &deg;C ([round(environment.temperature, 0.01)] K)</span>")
/obj/item/analyzer/AltClick(mob/user) //Barometer output for measuring when the next storm happens
..()
. = ..()
if(user.canUseTopic(src))
. = TRUE
if(cooldown)
to_chat(user, "<span class='warning'>[src]'s barometer function is preparing itself.</span>")
return

View File

@@ -138,11 +138,13 @@
toggle_igniter(user)
/obj/item/flamethrower/AltClick(mob/user)
. = ..()
if(ptank && isliving(user) && user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
user.put_in_hands(ptank)
ptank = null
to_chat(user, "<span class='notice'>You remove the plasma tank from [src]!</span>")
update_icon()
return TRUE
/obj/item/flamethrower/examine(mob/user)
. = ..()

View File

@@ -70,6 +70,7 @@
update_icon()
/obj/item/pet_carrier/AltClick(mob/living/user)
. = ..()
if(open || !user.canUseTopic(src, BE_CLOSE))
return
locked = !locked
@@ -79,6 +80,7 @@
else
playsound(user, 'sound/machines/boltsup.ogg', 30, TRUE)
update_icon()
return TRUE
/obj/item/pet_carrier/attack(mob/living/target, mob/living/user)
if(user.a_intent == INTENT_HARM)

View File

@@ -350,6 +350,7 @@
. = ..()
/obj/item/stack/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
if(is_cyborg)
@@ -363,10 +364,11 @@
max = get_amount()
stackmaterial = min(max, stackmaterial)
if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
return TRUE
else
change_stack(user, stackmaterial)
to_chat(user, "<span class='notice'>You take [stackmaterial] sheets out of the stack</span>")
return TRUE
/obj/item/stack/proc/change_stack(mob/user, amount)
if(!use(amount, TRUE, FALSE))

View File

@@ -842,23 +842,13 @@ obj/item/storage/belt/slut/ComponentInitialize()
STR.rustle_sound = FALSE
STR.max_w_class = WEIGHT_CLASS_BULKY
STR.can_hold = typecacheof(fitting_swords)
STR.quickdraw = TRUE
/obj/item/storage/belt/sabre/examine(mob/user)
. = ..()
if(length(contents))
. += "<span class='notice'>Alt-click it to quickly draw the blade.</span>"
/obj/item/storage/belt/sabre/AltClick(mob/user)
if(!iscarbon(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
if(length(contents))
var/obj/item/I = contents[1]
user.visible_message("[user] takes [I] out of [src].", "<span class='notice'>You take [I] out of [src].</span>")
user.put_in_hands(I)
update_icon()
else
to_chat(user, "[src] is empty.")
/obj/item/storage/belt/sabre/update_icon()
. = ..()
if(isliving(loc))

View File

@@ -1,389 +1,390 @@
/*
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
* .. Sorry for the shitty path name, I couldnt think of a better one.
*
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
* TODO: Cigarette boxes should be ported to this standard
*
* Contains:
* Donut Box
* Egg Box
* Candle Box
* Cigarette Box
* Cigar Case
* Heart Shaped Box w/ Chocolates
* Ring Box
*/
/obj/item/storage/fancy
icon = 'icons/obj/food/containers.dmi'
icon_state = "donutbox6"
name = "donut box"
desc = "Mmm. Donuts."
resistance_flags = FLAMMABLE
var/icon_type = "donut"
var/spawn_type = null
var/fancy_open = FALSE
/obj/item/storage/fancy/PopulateContents()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
for(var/i = 1 to STR.max_items)
new spawn_type(src)
/obj/item/storage/fancy/update_icon()
if(fancy_open)
icon_state = "[icon_type]box[contents.len]"
else
icon_state = "[icon_type]box"
/obj/item/storage/fancy/examine(mob/user)
. = ..()
if(fancy_open)
if(length(contents) == 1)
. += "There is one [icon_type] left."
else
. += "There are [contents.len <= 0 ? "no" : "[contents.len]"] [icon_type]s left."
/obj/item/storage/fancy/attack_self(mob/user)
fancy_open = !fancy_open
update_icon()
. = ..()
/obj/item/storage/fancy/Exited()
. = ..()
fancy_open = TRUE
update_icon()
/obj/item/storage/fancy/Entered()
. = ..()
fancy_open = TRUE
update_icon()
/*
* Donut Box
*/
/obj/item/storage/fancy/donut_box
icon = 'icons/obj/food/containers.dmi'
icon_state = "donutbox6"
icon_type = "donut"
name = "donut box"
spawn_type = /obj/item/reagent_containers/food/snacks/donut
fancy_open = TRUE
/obj/item/storage/fancy/donut_box/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 6
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/donut))
/*
* Egg Box
*/
/obj/item/storage/fancy/egg_box
icon = 'icons/obj/food/containers.dmi'
item_state = "eggbox"
icon_state = "eggbox"
icon_type = "egg"
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
name = "egg box"
desc = "A carton for containing eggs."
spawn_type = /obj/item/reagent_containers/food/snacks/egg
/obj/item/storage/fancy/egg_box/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 12
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/egg))
/*
* Candle Box
*/
/obj/item/storage/fancy/candle_box
name = "candle pack"
desc = "A pack of red candles."
icon = 'icons/obj/candle.dmi'
icon_state = "candlebox5"
icon_type = "candle"
item_state = "candlebox5"
throwforce = 2
slot_flags = ITEM_SLOT_BELT
spawn_type = /obj/item/candle
fancy_open = TRUE
/obj/item/storage/fancy/candle_box/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 5
/obj/item/storage/fancy/candle_box/attack_self(mob_user)
return
////////////
//CIG PACK//
////////////
/obj/item/storage/fancy/cigarettes
name = "\improper Space Cigarettes packet"
desc = "The most popular brand of cigarettes, sponsors of the Space Olympics."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig"
item_state = "cigpacket"
w_class = WEIGHT_CLASS_TINY
throwforce = 0
slot_flags = ITEM_SLOT_BELT
icon_type = "cigarette"
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
/obj/item/storage/fancy/cigarettes/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 6
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette, /obj/item/lighter))
/obj/item/storage/fancy/cigarettes/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to extract contents.</span>"
/obj/item/storage/fancy/cigarettes/AltClick(mob/living/carbon/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
var/obj/item/clothing/mask/cigarette/W = locate(/obj/item/clothing/mask/cigarette) in contents
if(W && contents.len > 0)
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, user)
user.put_in_hands(W)
contents -= W
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
/obj/item/storage/fancy/cigarettes/update_icon()
if(fancy_open || !contents.len)
cut_overlays()
if(!contents.len)
icon_state = "[initial(icon_state)]_empty"
else
icon_state = initial(icon_state)
add_overlay("[icon_state]_open")
var/cig_position = 1
for(var/C in contents)
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
if(istype(C, /obj/item/lighter/greyscale))
inserted_overlay.icon_state = "lighter_in"
else if(istype(C, /obj/item/lighter))
inserted_overlay.icon_state = "zippo_in"
else
inserted_overlay.icon_state = "cigarette"
inserted_overlay.icon_state = "[inserted_overlay.icon_state]_[cig_position]"
add_overlay(inserted_overlay)
cig_position++
else
cut_overlays()
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!ismob(M))
return
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
if(cig)
if(M == user && contents.len > 0 && !user.wear_mask)
var/obj/item/clothing/mask/cigarette/W = cig
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, M)
M.equip_to_slot_if_possible(W, SLOT_WEAR_MASK)
contents -= W
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
else
..()
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
/obj/item/storage/fancy/cigarettes/dromedaryco
name = "\improper DromedaryCo packet"
desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\""
icon_state = "dromedary"
spawn_type = /obj/item/clothing/mask/cigarette/dromedary
/obj/item/storage/fancy/cigarettes/smokekins
name = "\improper smokekins packet"
desc = "Let the Radiance fill your lungs"
icon_state = "smokekins"
spawn_type = /obj/item/clothing/mask/cigarette/smokekins
/obj/item/storage/fancy/cigarettes/cigpack_uplift
name = "\improper Uplift Smooth packet"
desc = "Your favorite brand, now menthol flavored."
icon_state = "uplift"
spawn_type = /obj/item/clothing/mask/cigarette/uplift
/obj/item/storage/fancy/cigarettes/cigpack_robust
name = "\improper Robust packet"
desc = "Smoked by the robust."
icon_state = "robust"
spawn_type = /obj/item/clothing/mask/cigarette/robust
/obj/item/storage/fancy/cigarettes/cigpack_robustgold
name = "\improper Robust Gold packet"
desc = "Smoked by the truly robust."
icon_state = "robustg"
spawn_type = /obj/item/clothing/mask/cigarette/robustgold
/obj/item/storage/fancy/cigarettes/cigpack_carp
name = "\improper Carp Classic packet"
desc = "Since 2313."
icon_state = "carp"
spawn_type = /obj/item/clothing/mask/cigarette/carp
/obj/item/storage/fancy/cigarettes/cigpack_syndicate
name = "cigarette packet"
desc = "An obscure brand of cigarettes."
icon_state = "syndie"
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
/obj/item/storage/fancy/cigarettes/cigpack_midori
name = "\improper Midori Tabako packet"
desc = "You can't understand the runes, but the packet smells funny."
icon_state = "midori"
spawn_type = /obj/item/clothing/mask/cigarette/rollie/nicotine
/obj/item/storage/fancy/cigarettes/cigpack_shadyjims
name = "\improper Shady Jim's Super Slims packet"
desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!"
icon_state = "shadyjim"
spawn_type = /obj/item/clothing/mask/cigarette/shadyjims
/obj/item/storage/fancy/cigarettes/cigpack_xeno
name = "\improper Xeno Filtered packet"
desc = "Loaded with 100% pure slime. And also nicotine."
icon_state = "slime"
spawn_type = /obj/item/clothing/mask/cigarette/xeno
/obj/item/storage/fancy/cigarettes/cigpack_cannabis
name = "\improper Freak Brothers' Special packet"
desc = "A label on the packaging reads, \"Endorsed by Phineas, Freddy and Franklin.\""
icon_state = "midori"
spawn_type = /obj/item/clothing/mask/cigarette/rollie/cannabis
/obj/item/storage/fancy/cigarettes/cigpack_mindbreaker
name = "\improper Leary's Delight packet"
desc = "Banned in over 36 galaxies."
icon_state = "shadyjim"
spawn_type = /obj/item/clothing/mask/cigarette/rollie/mindbreaker
/obj/item/storage/fancy/rollingpapers
name = "rolling paper pack"
desc = "A pack of Kinaris brand rolling papers."
w_class = WEIGHT_CLASS_TINY
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig_paper_pack"
icon_type = "rolling paper"
spawn_type = /obj/item/rollingpaper
/obj/item/storage/fancy/rollingpapers/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 10
STR.can_hold = typecacheof(list(/obj/item/rollingpaper))
/obj/item/storage/fancy/rollingpapers/update_icon()
cut_overlays()
if(!contents.len)
add_overlay("[icon_state]_empty")
/////////////
//CIGAR BOX//
/////////////
/obj/item/storage/fancy/cigarettes/cigars
name = "\improper premium cigar case"
desc = "A case of premium cigars. Very expensive."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cigarcase"
w_class = WEIGHT_CLASS_NORMAL
icon_type = "premium cigar"
spawn_type = /obj/item/clothing/mask/cigarette/cigar
/obj/item/storage/fancy/cigarettes/cigars/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 5
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette/cigar))
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
cut_overlays()
if(fancy_open)
icon_state = "[initial(icon_state)]_open"
var/cigar_position = 1 //generate sprites for cigars in the box
for(var/obj/item/clothing/mask/cigarette/cigar/smokes in contents)
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, "[smokes.icon_off]_[cigar_position]")
add_overlay(cigar_overlay)
cigar_position++
else
icon_state = "[initial(icon_state)]"
/obj/item/storage/fancy/cigarettes/cigars/cohiba
name = "\improper Cohiba Robusto cigar case"
desc = "A case of imported Cohiba cigars, renowned for their strong flavor."
icon_state = "cohibacase"
spawn_type = /obj/item/clothing/mask/cigarette/cigar/cohiba
/obj/item/storage/fancy/cigarettes/cigars/havana
name = "\improper premium Havanian cigar case"
desc = "A case of classy Havanian cigars."
icon_state = "cohibacase"
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
/*
* Heart Shaped Box w/ Chocolates
*/
/obj/item/storage/fancy/heart_box
name = "heart-shaped box"
desc = "A heart-shaped box for holding tiny chocolates."
icon = 'icons/obj/food/containers.dmi'
item_state = "chocolatebox"
icon_state = "chocolatebox"
icon_type = "chocolate"
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
spawn_type = /obj/item/reagent_containers/food/snacks/tinychocolate
/obj/item/storage/fancy/heart_box/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 8
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/tinychocolate))
/*
* Ring Box
*/
/obj/item/storage/fancy/ringbox
name = "ring box"
desc = "A tiny box covered in soft red felt made for holding rings."
icon = 'icons/obj/ring.dmi'
icon_state = "gold ringbox"
icon_type = "gold ring"
w_class = WEIGHT_CLASS_TINY
spawn_type = /obj/item/clothing/gloves/ring
/obj/item/storage/fancy/ringbox/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 1
STR.can_hold = typecacheof(list(/obj/item/clothing/gloves/ring))
/obj/item/storage/fancy/ringbox/diamond
icon_state = "diamond ringbox"
icon_type = "diamond ring"
spawn_type = /obj/item/clothing/gloves/ring/diamond
/obj/item/storage/fancy/ringbox/silver
icon_state = "silver ringbox"
icon_type = "silver ring"
spawn_type = /obj/item/clothing/gloves/ring/silver
/*
* The 'fancy' path is for objects like donut boxes that show how many items are in the storage item on the sprite itself
* .. Sorry for the shitty path name, I couldnt think of a better one.
*
* WARNING: var/icon_type is used for both examine text and sprite name. Please look at the procs below and adjust your sprite names accordingly
* TODO: Cigarette boxes should be ported to this standard
*
* Contains:
* Donut Box
* Egg Box
* Candle Box
* Cigarette Box
* Cigar Case
* Heart Shaped Box w/ Chocolates
* Ring Box
*/
/obj/item/storage/fancy
icon = 'icons/obj/food/containers.dmi'
icon_state = "donutbox6"
name = "donut box"
desc = "Mmm. Donuts."
resistance_flags = FLAMMABLE
var/icon_type = "donut"
var/spawn_type = null
var/fancy_open = FALSE
/obj/item/storage/fancy/PopulateContents()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
for(var/i = 1 to STR.max_items)
new spawn_type(src)
/obj/item/storage/fancy/update_icon()
if(fancy_open)
icon_state = "[icon_type]box[contents.len]"
else
icon_state = "[icon_type]box"
/obj/item/storage/fancy/examine(mob/user)
. = ..()
if(fancy_open)
if(length(contents) == 1)
. += "There is one [icon_type] left."
else
. += "There are [contents.len <= 0 ? "no" : "[contents.len]"] [icon_type]s left."
/obj/item/storage/fancy/attack_self(mob/user)
fancy_open = !fancy_open
update_icon()
. = ..()
/obj/item/storage/fancy/Exited()
. = ..()
fancy_open = TRUE
update_icon()
/obj/item/storage/fancy/Entered()
. = ..()
fancy_open = TRUE
update_icon()
/*
* Donut Box
*/
/obj/item/storage/fancy/donut_box
icon = 'icons/obj/food/containers.dmi'
icon_state = "donutbox6"
icon_type = "donut"
name = "donut box"
spawn_type = /obj/item/reagent_containers/food/snacks/donut
fancy_open = TRUE
/obj/item/storage/fancy/donut_box/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 6
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/donut))
/*
* Egg Box
*/
/obj/item/storage/fancy/egg_box
icon = 'icons/obj/food/containers.dmi'
item_state = "eggbox"
icon_state = "eggbox"
icon_type = "egg"
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
name = "egg box"
desc = "A carton for containing eggs."
spawn_type = /obj/item/reagent_containers/food/snacks/egg
/obj/item/storage/fancy/egg_box/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 12
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/egg))
/*
* Candle Box
*/
/obj/item/storage/fancy/candle_box
name = "candle pack"
desc = "A pack of red candles."
icon = 'icons/obj/candle.dmi'
icon_state = "candlebox5"
icon_type = "candle"
item_state = "candlebox5"
throwforce = 2
slot_flags = ITEM_SLOT_BELT
spawn_type = /obj/item/candle
fancy_open = TRUE
/obj/item/storage/fancy/candle_box/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 5
/obj/item/storage/fancy/candle_box/attack_self(mob_user)
return
////////////
//CIG PACK//
////////////
/obj/item/storage/fancy/cigarettes
name = "\improper Space Cigarettes packet"
desc = "The most popular brand of cigarettes, sponsors of the Space Olympics."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig"
item_state = "cigpacket"
w_class = WEIGHT_CLASS_TINY
throwforce = 0
slot_flags = ITEM_SLOT_BELT
icon_type = "cigarette"
spawn_type = /obj/item/clothing/mask/cigarette/space_cigarette
/obj/item/storage/fancy/cigarettes/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 6
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette, /obj/item/lighter))
/obj/item/storage/fancy/cigarettes/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to extract contents.</span>"
/obj/item/storage/fancy/cigarettes/AltClick(mob/living/carbon/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
var/obj/item/clothing/mask/cigarette/W = locate(/obj/item/clothing/mask/cigarette) in contents
if(W && contents.len > 0)
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, user)
user.put_in_hands(W)
contents -= W
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
return TRUE
/obj/item/storage/fancy/cigarettes/update_icon()
if(fancy_open || !contents.len)
cut_overlays()
if(!contents.len)
icon_state = "[initial(icon_state)]_empty"
else
icon_state = initial(icon_state)
add_overlay("[icon_state]_open")
var/cig_position = 1
for(var/C in contents)
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
if(istype(C, /obj/item/lighter/greyscale))
inserted_overlay.icon_state = "lighter_in"
else if(istype(C, /obj/item/lighter))
inserted_overlay.icon_state = "zippo_in"
else
inserted_overlay.icon_state = "cigarette"
inserted_overlay.icon_state = "[inserted_overlay.icon_state]_[cig_position]"
add_overlay(inserted_overlay)
cig_position++
else
cut_overlays()
/obj/item/storage/fancy/cigarettes/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!ismob(M))
return
var/obj/item/clothing/mask/cigarette/cig = locate(/obj/item/clothing/mask/cigarette) in contents
if(cig)
if(M == user && contents.len > 0 && !user.wear_mask)
var/obj/item/clothing/mask/cigarette/W = cig
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, M)
M.equip_to_slot_if_possible(W, SLOT_WEAR_MASK)
contents -= W
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
else
..()
else
to_chat(user, "<span class='notice'>There are no [icon_type]s left in the pack.</span>")
/obj/item/storage/fancy/cigarettes/dromedaryco
name = "\improper DromedaryCo packet"
desc = "A packet of six imported DromedaryCo cancer sticks. A label on the packaging reads, \"Wouldn't a slow death make a change?\""
icon_state = "dromedary"
spawn_type = /obj/item/clothing/mask/cigarette/dromedary
/obj/item/storage/fancy/cigarettes/smokekins
name = "\improper smokekins packet"
desc = "Let the Radiance fill your lungs"
icon_state = "smokekins"
spawn_type = /obj/item/clothing/mask/cigarette/smokekins
/obj/item/storage/fancy/cigarettes/cigpack_uplift
name = "\improper Uplift Smooth packet"
desc = "Your favorite brand, now menthol flavored."
icon_state = "uplift"
spawn_type = /obj/item/clothing/mask/cigarette/uplift
/obj/item/storage/fancy/cigarettes/cigpack_robust
name = "\improper Robust packet"
desc = "Smoked by the robust."
icon_state = "robust"
spawn_type = /obj/item/clothing/mask/cigarette/robust
/obj/item/storage/fancy/cigarettes/cigpack_robustgold
name = "\improper Robust Gold packet"
desc = "Smoked by the truly robust."
icon_state = "robustg"
spawn_type = /obj/item/clothing/mask/cigarette/robustgold
/obj/item/storage/fancy/cigarettes/cigpack_carp
name = "\improper Carp Classic packet"
desc = "Since 2313."
icon_state = "carp"
spawn_type = /obj/item/clothing/mask/cigarette/carp
/obj/item/storage/fancy/cigarettes/cigpack_syndicate
name = "cigarette packet"
desc = "An obscure brand of cigarettes."
icon_state = "syndie"
spawn_type = /obj/item/clothing/mask/cigarette/syndicate
/obj/item/storage/fancy/cigarettes/cigpack_midori
name = "\improper Midori Tabako packet"
desc = "You can't understand the runes, but the packet smells funny."
icon_state = "midori"
spawn_type = /obj/item/clothing/mask/cigarette/rollie/nicotine
/obj/item/storage/fancy/cigarettes/cigpack_shadyjims
name = "\improper Shady Jim's Super Slims packet"
desc = "Is your weight slowing you down? Having trouble running away from gravitational singularities? Can't stop stuffing your mouth? Smoke Shady Jim's Super Slims and watch all that fat burn away. Guaranteed results!"
icon_state = "shadyjim"
spawn_type = /obj/item/clothing/mask/cigarette/shadyjims
/obj/item/storage/fancy/cigarettes/cigpack_xeno
name = "\improper Xeno Filtered packet"
desc = "Loaded with 100% pure slime. And also nicotine."
icon_state = "slime"
spawn_type = /obj/item/clothing/mask/cigarette/xeno
/obj/item/storage/fancy/cigarettes/cigpack_cannabis
name = "\improper Freak Brothers' Special packet"
desc = "A label on the packaging reads, \"Endorsed by Phineas, Freddy and Franklin.\""
icon_state = "midori"
spawn_type = /obj/item/clothing/mask/cigarette/rollie/cannabis
/obj/item/storage/fancy/cigarettes/cigpack_mindbreaker
name = "\improper Leary's Delight packet"
desc = "Banned in over 36 galaxies."
icon_state = "shadyjim"
spawn_type = /obj/item/clothing/mask/cigarette/rollie/mindbreaker
/obj/item/storage/fancy/rollingpapers
name = "rolling paper pack"
desc = "A pack of Kinaris brand rolling papers."
w_class = WEIGHT_CLASS_TINY
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cig_paper_pack"
icon_type = "rolling paper"
spawn_type = /obj/item/rollingpaper
/obj/item/storage/fancy/rollingpapers/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 10
STR.can_hold = typecacheof(list(/obj/item/rollingpaper))
/obj/item/storage/fancy/rollingpapers/update_icon()
cut_overlays()
if(!contents.len)
add_overlay("[icon_state]_empty")
/////////////
//CIGAR BOX//
/////////////
/obj/item/storage/fancy/cigarettes/cigars
name = "\improper premium cigar case"
desc = "A case of premium cigars. Very expensive."
icon = 'icons/obj/cigarettes.dmi'
icon_state = "cigarcase"
w_class = WEIGHT_CLASS_NORMAL
icon_type = "premium cigar"
spawn_type = /obj/item/clothing/mask/cigarette/cigar
/obj/item/storage/fancy/cigarettes/cigars/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 5
STR.can_hold = typecacheof(list(/obj/item/clothing/mask/cigarette/cigar))
/obj/item/storage/fancy/cigarettes/cigars/update_icon()
cut_overlays()
if(fancy_open)
icon_state = "[initial(icon_state)]_open"
var/cigar_position = 1 //generate sprites for cigars in the box
for(var/obj/item/clothing/mask/cigarette/cigar/smokes in contents)
var/mutable_appearance/cigar_overlay = mutable_appearance(icon, "[smokes.icon_off]_[cigar_position]")
add_overlay(cigar_overlay)
cigar_position++
else
icon_state = "[initial(icon_state)]"
/obj/item/storage/fancy/cigarettes/cigars/cohiba
name = "\improper Cohiba Robusto cigar case"
desc = "A case of imported Cohiba cigars, renowned for their strong flavor."
icon_state = "cohibacase"
spawn_type = /obj/item/clothing/mask/cigarette/cigar/cohiba
/obj/item/storage/fancy/cigarettes/cigars/havana
name = "\improper premium Havanian cigar case"
desc = "A case of classy Havanian cigars."
icon_state = "cohibacase"
spawn_type = /obj/item/clothing/mask/cigarette/cigar/havana
/*
* Heart Shaped Box w/ Chocolates
*/
/obj/item/storage/fancy/heart_box
name = "heart-shaped box"
desc = "A heart-shaped box for holding tiny chocolates."
icon = 'icons/obj/food/containers.dmi'
item_state = "chocolatebox"
icon_state = "chocolatebox"
icon_type = "chocolate"
lefthand_file = 'icons/mob/inhands/misc/food_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/food_righthand.dmi'
spawn_type = /obj/item/reagent_containers/food/snacks/tinychocolate
/obj/item/storage/fancy/heart_box/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 8
STR.can_hold = typecacheof(list(/obj/item/reagent_containers/food/snacks/tinychocolate))
/*
* Ring Box
*/
/obj/item/storage/fancy/ringbox
name = "ring box"
desc = "A tiny box covered in soft red felt made for holding rings."
icon = 'icons/obj/ring.dmi'
icon_state = "gold ringbox"
icon_type = "gold ring"
w_class = WEIGHT_CLASS_TINY
spawn_type = /obj/item/clothing/gloves/ring
/obj/item/storage/fancy/ringbox/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_items = 1
STR.can_hold = typecacheof(list(/obj/item/clothing/gloves/ring))
/obj/item/storage/fancy/ringbox/diamond
icon_state = "diamond ringbox"
icon_type = "diamond ring"
spawn_type = /obj/item/clothing/gloves/ring/diamond
/obj/item/storage/fancy/ringbox/silver
icon_state = "silver ringbox"
icon_type = "silver ring"
spawn_type = /obj/item/clothing/gloves/ring/silver

View File

@@ -1,198 +1,199 @@
/obj/item/storage/lockbox
name = "lockbox"
desc = "A locked box."
icon_state = "lockbox+l"
item_state = "syringe_kit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
req_access = list(ACCESS_ARMORY)
var/broken = FALSE
var/open = FALSE
var/icon_locked = "lockbox+l"
var/icon_closed = "lockbox"
var/icon_broken = "lockbox+b"
/obj/item/storage/lockbox/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 14
STR.max_items = 4
STR.locked = TRUE
/obj/item/storage/lockbox/attackby(obj/item/W, mob/user, params)
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(W.GetID())
if(broken)
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
return
if(allowed(user))
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, !locked)
locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(locked)
icon_state = icon_locked
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_HIDE_ALL)
return
else
icon_state = icon_closed
to_chat(user, "<span class='danger'>You unlock the [src.name]!</span>")
return
else
to_chat(user, "<span class='danger'>Access Denied.</span>")
return
if(!locked)
return ..()
else
to_chat(user, "<span class='danger'>It's locked!</span>")
/obj/item/storage/lockbox/emag_act(mob/user)
if(!broken)
broken = TRUE
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, FALSE)
desc += "It appears to be broken."
icon_state = src.icon_broken
if(user)
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
return
/obj/item/storage/lockbox/Entered()
. = ..()
open = TRUE
update_icon()
/obj/item/storage/lockbox/Exited()
. = ..()
open = TRUE
update_icon()
/obj/item/storage/lockbox/loyalty
name = "lockbox of mindshield implants"
req_access = list(ACCESS_SECURITY)
/obj/item/storage/lockbox/loyalty/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/implantcase/mindshield(src)
new /obj/item/implanter/mindshield(src)
/obj/item/storage/lockbox/clusterbang
name = "lockbox of clusterbangs"
desc = "You have a bad feeling about opening this."
req_access = list(ACCESS_SECURITY)
/obj/item/storage/lockbox/clusterbang/PopulateContents()
new /obj/item/grenade/clusterbuster(src)
/obj/item/storage/lockbox/medal
name = "medal box"
desc = "A locked box used to store medals of honor."
icon_state = "medalbox+l"
item_state = "syringe_kit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_NORMAL
req_access = list(ACCESS_CAPTAIN)
icon_locked = "medalbox+l"
icon_closed = "medalbox"
icon_broken = "medalbox+b"
/obj/item/storage/lockbox/medal/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_SMALL
STR.max_items = 10
STR.max_combined_w_class = 20
STR.can_hold = typecacheof(list(/obj/item/clothing/accessory/medal))
/obj/item/storage/lockbox/medal/examine(mob/user)
. = ..()
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(!locked)
. += "<span class='notice'>Alt-click to [open ? "close":"open"] it.</span>"
/obj/item/storage/lockbox/medal/AltClick(mob/user)
if(user.canUseTopic(src, BE_CLOSE))
if(!SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
open = (open ? FALSE : TRUE)
update_icon()
..()
/obj/item/storage/lockbox/medal/PopulateContents()
new /obj/item/clothing/accessory/medal/gold/captain(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/security(src)
new /obj/item/clothing/accessory/medal/bronze_heart(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/conduct(src)
/obj/item/storage/lockbox/medal/update_icon()
cut_overlays()
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(locked)
icon_state = "medalbox+l"
open = FALSE
else
icon_state = "medalbox"
if(open)
icon_state += "open"
if(broken)
icon_state += "+b"
if(contents && open)
for (var/i in 1 to contents.len)
var/obj/item/clothing/accessory/medal/M = contents[i]
var/mutable_appearance/medalicon = mutable_appearance(initial(icon), M.medaltype)
if(i > 1 && i <= 5)
medalicon.pixel_x += ((i-1)*3)
else if(i > 5)
medalicon.pixel_y -= 7
medalicon.pixel_x -= 2
medalicon.pixel_x += ((i-6)*3)
add_overlay(medalicon)
/obj/item/storage/lockbox/medal/sec
name = "security medal box"
desc = "A locked box used to store medals to be given to members of the security department."
req_access = list(ACCESS_HOS)
/obj/item/storage/lockbox/medal/sec/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/silver/security(src)
/obj/item/storage/lockbox/medal/cargo
name = "cargo award box"
desc = "A locked box used to store awards to be given to members of the cargo department."
req_access = list(ACCESS_QM)
/obj/item/storage/lockbox/medal/cargo/PopulateContents()
new /obj/item/clothing/accessory/medal/ribbon/cargo(src)
/obj/item/storage/lockbox/medal/sci
name = "science medal box"
desc = "A locked box used to store medals to be given to members of the science department."
req_access = list(ACCESS_RD)
/obj/item/storage/lockbox/medal/sci/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
/obj/item/storage/lockbox/medal/engineering
name = "engineering medal box"
desc = "A locked box used to store medals to be given to the members of the engineering department."
req_access = list(ACCESS_CE)
/obj/item/storage/lockbox/medal/engineering/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/engineer(src)
/obj/item/storage/lockbox/medal/medical
name = "medical medal box"
desc = "A locked box used to store medals to be given to the members of the medical department."
req_access = list(ACCESS_CMO)
/obj/item/storage/lockbox/medal/medical/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/ribbon/medical_doctor(src)
/obj/item/storage/lockbox
name = "lockbox"
desc = "A locked box."
icon_state = "lockbox+l"
item_state = "syringe_kit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_BULKY
req_access = list(ACCESS_ARMORY)
var/broken = FALSE
var/open = FALSE
var/icon_locked = "lockbox+l"
var/icon_closed = "lockbox"
var/icon_broken = "lockbox+b"
/obj/item/storage/lockbox/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_NORMAL
STR.max_combined_w_class = 14
STR.max_items = 4
STR.locked = TRUE
/obj/item/storage/lockbox/attackby(obj/item/W, mob/user, params)
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(W.GetID())
if(broken)
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
return
if(allowed(user))
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, !locked)
locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(locked)
icon_state = icon_locked
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_HIDE_ALL)
return
else
icon_state = icon_closed
to_chat(user, "<span class='danger'>You unlock the [src.name]!</span>")
return
else
to_chat(user, "<span class='danger'>Access Denied.</span>")
return
if(!locked)
return ..()
else
to_chat(user, "<span class='danger'>It's locked!</span>")
/obj/item/storage/lockbox/emag_act(mob/user)
if(!broken)
broken = TRUE
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, FALSE)
desc += "It appears to be broken."
icon_state = src.icon_broken
if(user)
visible_message("<span class='warning'>\The [src] has been broken by [user] with an electromagnetic card!</span>")
return
/obj/item/storage/lockbox/Entered()
. = ..()
open = TRUE
update_icon()
/obj/item/storage/lockbox/Exited()
. = ..()
open = TRUE
update_icon()
/obj/item/storage/lockbox/loyalty
name = "lockbox of mindshield implants"
req_access = list(ACCESS_SECURITY)
/obj/item/storage/lockbox/loyalty/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/implantcase/mindshield(src)
new /obj/item/implanter/mindshield(src)
/obj/item/storage/lockbox/clusterbang
name = "lockbox of clusterbangs"
desc = "You have a bad feeling about opening this."
req_access = list(ACCESS_SECURITY)
/obj/item/storage/lockbox/clusterbang/PopulateContents()
new /obj/item/grenade/clusterbuster(src)
/obj/item/storage/lockbox/medal
name = "medal box"
desc = "A locked box used to store medals of honor."
icon_state = "medalbox+l"
item_state = "syringe_kit"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
w_class = WEIGHT_CLASS_NORMAL
req_access = list(ACCESS_CAPTAIN)
icon_locked = "medalbox+l"
icon_closed = "medalbox"
icon_broken = "medalbox+b"
/obj/item/storage/lockbox/medal/ComponentInitialize()
. = ..()
var/datum/component/storage/STR = GetComponent(/datum/component/storage)
STR.max_w_class = WEIGHT_CLASS_SMALL
STR.max_items = 10
STR.max_combined_w_class = 20
STR.can_hold = typecacheof(list(/obj/item/clothing/accessory/medal))
/obj/item/storage/lockbox/medal/examine(mob/user)
. = ..()
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(!locked)
. += "<span class='notice'>Alt-click to [open ? "close":"open"] it.</span>"
/obj/item/storage/lockbox/medal/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, BE_CLOSE))
if(!SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
open = (open ? FALSE : TRUE)
update_icon()
return TRUE
/obj/item/storage/lockbox/medal/PopulateContents()
new /obj/item/clothing/accessory/medal/gold/captain(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/valor(src)
new /obj/item/clothing/accessory/medal/silver/security(src)
new /obj/item/clothing/accessory/medal/bronze_heart(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/conduct(src)
/obj/item/storage/lockbox/medal/update_icon()
cut_overlays()
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(locked)
icon_state = "medalbox+l"
open = FALSE
else
icon_state = "medalbox"
if(open)
icon_state += "open"
if(broken)
icon_state += "+b"
if(contents && open)
for (var/i in 1 to contents.len)
var/obj/item/clothing/accessory/medal/M = contents[i]
var/mutable_appearance/medalicon = mutable_appearance(initial(icon), M.medaltype)
if(i > 1 && i <= 5)
medalicon.pixel_x += ((i-1)*3)
else if(i > 5)
medalicon.pixel_y -= 7
medalicon.pixel_x -= 2
medalicon.pixel_x += ((i-6)*3)
add_overlay(medalicon)
/obj/item/storage/lockbox/medal/sec
name = "security medal box"
desc = "A locked box used to store medals to be given to members of the security department."
req_access = list(ACCESS_HOS)
/obj/item/storage/lockbox/medal/sec/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/silver/security(src)
/obj/item/storage/lockbox/medal/cargo
name = "cargo award box"
desc = "A locked box used to store awards to be given to members of the cargo department."
req_access = list(ACCESS_QM)
/obj/item/storage/lockbox/medal/cargo/PopulateContents()
new /obj/item/clothing/accessory/medal/ribbon/cargo(src)
/obj/item/storage/lockbox/medal/sci
name = "science medal box"
desc = "A locked box used to store medals to be given to members of the science department."
req_access = list(ACCESS_RD)
/obj/item/storage/lockbox/medal/sci/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/plasma/nobel_science(src)
/obj/item/storage/lockbox/medal/engineering
name = "engineering medal box"
desc = "A locked box used to store medals to be given to the members of the engineering department."
req_access = list(ACCESS_CE)
/obj/item/storage/lockbox/medal/engineering/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/engineer(src)
/obj/item/storage/lockbox/medal/medical
name = "medical medal box"
desc = "A locked box used to store medals to be given to the members of the medical department."
req_access = list(ACCESS_CMO)
/obj/item/storage/lockbox/medal/medical/PopulateContents()
for(var/i in 1 to 3)
new /obj/item/clothing/accessory/medal/ribbon/medical_doctor(src)

View File

@@ -546,6 +546,7 @@
qdel(src)
/obj/item/twohanded/spear/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, BE_CLOSE))
..()
if(!explosive)
@@ -554,6 +555,7 @@
var/input = stripped_input(user,"What do you want your war cry to be? You will shout it when you hit someone in melee.", ,"", 50)
if(input)
src.war_cry = input
return TRUE
/obj/item/twohanded/spear/CheckParts(list/parts_list)
var/obj/item/twohanded/spear/S = locate() in parts_list

View File

@@ -1,252 +1,253 @@
/obj
var/crit_fail = FALSE
animate_movement = 2
speech_span = SPAN_ROBOT
var/obj_flags = CAN_BE_HIT
var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT.
var/damtype = BRUTE
var/force = 0
var/datum/armor/armor
var/obj_integrity //defaults to max_integrity
var/max_integrity = 500
var/integrity_failure = 0 //0 if we have no special broken behavior
var/resistance_flags = NONE // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF
var/acid_level = 0 //how much acid is on that obj
var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
var/current_skin //the item reskin
var/list/unique_reskin //List of options to reskin.
var/always_reskinnable = FALSE
// Access levels, used in modules\jobs\access.dm
var/list/req_access
var/req_access_txt = "0"
var/list/req_one_access
var/req_one_access_txt = "0"
var/renamedByPlayer = FALSE //set when a player uses a pen on a renamable object
/obj/vv_edit_var(vname, vval)
switch(vname)
if("anchored")
setAnchored(vval)
return TRUE
if("obj_flags")
if ((obj_flags & DANGEROUS_POSSESSION) && !(vval & DANGEROUS_POSSESSION))
return FALSE
if("control_object")
var/obj/O = vval
if(istype(O) && (O.obj_flags & DANGEROUS_POSSESSION))
return FALSE
return ..()
/obj/Initialize()
. = ..()
if (islist(armor))
armor = getArmor(arglist(armor))
else if (!armor)
armor = getArmor()
else if (!istype(armor, /datum/armor))
stack_trace("Invalid type [armor.type] found in .armor during /obj Initialize()")
if(obj_integrity == null)
obj_integrity = max_integrity
if (set_obj_flags)
var/flagslist = splittext(set_obj_flags,";")
var/list/string_to_objflag = GLOB.bitfields["obj_flags"]
for (var/flag in flagslist)
if (findtext(flag,"!",1,2))
flag = copytext(flag,1-(length(flag))) // Get all but the initial !
obj_flags &= ~string_to_objflag[flag]
else
obj_flags |= string_to_objflag[flag]
if((obj_flags & ON_BLUEPRINTS) && isturf(loc))
var/turf/T = loc
T.add_blueprints_preround(src)
/obj/Destroy(force=FALSE)
if(!ismachinery(src))
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
SStgui.close_uis(src)
. = ..()
/obj/proc/setAnchored(anchorvalue)
SEND_SIGNAL(src, COMSIG_OBJ_SETANCHORED, anchorvalue)
anchored = anchorvalue
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force, messy_throw = TRUE)
. = ..()
if(obj_flags & FROZEN)
visible_message("<span class='danger'>[src] shatters into a million pieces!</span>")
qdel(src)
/obj/assume_air(datum/gas_mixture/giver)
if(loc)
return loc.assume_air(giver)
else
return null
/obj/remove_air(amount)
if(loc)
return loc.remove_air(amount)
else
return null
/obj/return_air()
if(loc)
return loc.return_air()
else
return null
/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request)
//Return: (NONSTANDARD)
// null if object handles breathing logic for lifeform
// datum/air_group to tell lifeform to process using that breath return
//DEFAULT: Take air from turf to give to have mob process
if(breath_request>0)
var/datum/gas_mixture/environment = return_air()
var/breath_percentage = BREATH_VOLUME / environment.return_volume()
return remove_air(environment.total_moles() * breath_percentage)
else
return null
/obj/proc/updateUsrDialog()
if((obj_flags & IN_USE) && !(obj_flags & USES_TGUI))
var/is_in_use = FALSE
var/list/nearby = viewers(1, src)
for(var/mob/M in nearby)
if ((M.client && M.machine == src))
is_in_use = TRUE
ui_interact(M)
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr))
if (!(usr in nearby))
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
is_in_use = TRUE
ui_interact(usr)
// check for TK users
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
if(!(usr in nearby))
if(usr.client && usr.machine==src)
if(H.dna.check_mutation(TK))
is_in_use = TRUE
ui_interact(usr)
if (is_in_use)
obj_flags |= IN_USE
else
obj_flags &= ~IN_USE
/obj/proc/updateDialog(update_viewers = TRUE,update_ais = TRUE)
// Check that people are actually using the machine. If not, don't update anymore.
if(obj_flags & IN_USE)
var/is_in_use = FALSE
if(update_viewers)
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
is_in_use = TRUE
src.interact(M)
var/ai_in_use = FALSE
if(update_ais)
ai_in_use = AutoUpdateAI(src)
if(update_viewers && update_ais) //State change is sure only if we check both
if(!ai_in_use && !is_in_use)
obj_flags &= ~IN_USE
/obj/attack_ghost(mob/user)
. = ..()
if(.)
return
ui_interact(user)
/obj/proc/container_resist(mob/living/user)
return
/obj/proc/update_icon()
return
/mob/proc/unset_machine()
if(machine)
machine.on_unset_machine(src)
machine = null
//called when the user unsets the machine.
/atom/movable/proc/on_unset_machine(mob/user)
return
/mob/proc/set_machine(obj/O)
if(src.machine)
unset_machine()
src.machine = O
if(istype(O))
O.obj_flags |= IN_USE
/obj/item/proc/updateSelfDialog()
var/mob/M = src.loc
if(istype(M) && M.client && M.machine == src)
src.attack_self(M)
/obj/proc/hide(h)
return
/obj/singularity_pull(S, current_size)
..()
if(!anchored || current_size >= STAGE_FIVE)
step_towards(src,S)
/obj/get_dumping_location(datum/component/storage/source,mob/user)
return get_turf(src)
/obj/proc/CanAStarPass()
. = !density
/obj/proc/check_uplink_validity()
return 1
/obj/proc/intercept_user_move(dir, mob, newLoc, oldLoc)
return
/obj/vv_get_dropdown()
. = ..()
.["Delete all of type"] = "?_src_=vars;[HrefToken()];delall=[REF(src)]"
.["Osay"] = "?_src_=vars;[HrefToken()];osay[REF(src)]"
.["Modify armor values"] = "?_src_=vars;[HrefToken()];modarmor=[REF(src)]"
/obj/examine(mob/user)
. = ..()
if(obj_flags & UNIQUE_RENAME)
. += "<span class='notice'>Use a pen on it to rename it or change its description.</span>"
if(unique_reskin && (!current_skin || always_reskinnable))
. += "<span class='notice'>Alt-click it to reskin it.</span>"
/obj/AltClick(mob/user)
. = ..()
if(unique_reskin && (!current_skin || always_reskinnable) && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
reskin_obj(user)
/obj/proc/reskin_obj(mob/M)
if(!LAZYLEN(unique_reskin))
return
var/dat = "<b>Reskin options for [name]:</b>\n"
for(var/V in unique_reskin)
var/output = icon2html(src, M, unique_reskin[V])
dat += "[V]: <span class='reallybig'>[output]</span>\n"
to_chat(M, dat)
var/choice = input(M, always_reskinnable ? "Choose the a reskin for [src]" : "Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin
if(QDELETED(src) || !choice || (current_skin && !always_reskinnable) || M.incapacitated() || !in_range(M,src) || !unique_reskin[choice] || unique_reskin[choice] == current_skin)
return
current_skin = choice
icon_state = unique_reskin[choice]
to_chat(M, "[src] is now skinned as '[choice]'.")
/obj
var/crit_fail = FALSE
animate_movement = 2
speech_span = SPAN_ROBOT
var/obj_flags = CAN_BE_HIT
var/set_obj_flags // ONLY FOR MAPPING: Sets flags from a string list, handled in Initialize. Usage: set_obj_flags = "EMAGGED;!CAN_BE_HIT" to set EMAGGED and clear CAN_BE_HIT.
var/damtype = BRUTE
var/force = 0
var/datum/armor/armor
var/obj_integrity //defaults to max_integrity
var/max_integrity = 500
var/integrity_failure = 0 //0 if we have no special broken behavior
var/resistance_flags = NONE // INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ON_FIRE | UNACIDABLE | ACID_PROOF
var/acid_level = 0 //how much acid is on that obj
var/persistence_replacement //have something WAY too amazing to live to the next round? Set a new path here. Overuse of this var will make me upset.
var/current_skin //the item reskin
var/list/unique_reskin //List of options to reskin.
var/always_reskinnable = FALSE
// Access levels, used in modules\jobs\access.dm
var/list/req_access
var/req_access_txt = "0"
var/list/req_one_access
var/req_one_access_txt = "0"
var/renamedByPlayer = FALSE //set when a player uses a pen on a renamable object
/obj/vv_edit_var(vname, vval)
switch(vname)
if("anchored")
setAnchored(vval)
return TRUE
if("obj_flags")
if ((obj_flags & DANGEROUS_POSSESSION) && !(vval & DANGEROUS_POSSESSION))
return FALSE
if("control_object")
var/obj/O = vval
if(istype(O) && (O.obj_flags & DANGEROUS_POSSESSION))
return FALSE
return ..()
/obj/Initialize()
. = ..()
if (islist(armor))
armor = getArmor(arglist(armor))
else if (!armor)
armor = getArmor()
else if (!istype(armor, /datum/armor))
stack_trace("Invalid type [armor.type] found in .armor during /obj Initialize()")
if(obj_integrity == null)
obj_integrity = max_integrity
if (set_obj_flags)
var/flagslist = splittext(set_obj_flags,";")
var/list/string_to_objflag = GLOB.bitfields["obj_flags"]
for (var/flag in flagslist)
if (findtext(flag,"!",1,2))
flag = copytext(flag,1-(length(flag))) // Get all but the initial !
obj_flags &= ~string_to_objflag[flag]
else
obj_flags |= string_to_objflag[flag]
if((obj_flags & ON_BLUEPRINTS) && isturf(loc))
var/turf/T = loc
T.add_blueprints_preround(src)
/obj/Destroy(force=FALSE)
if(!ismachinery(src))
STOP_PROCESSING(SSobj, src) // TODO: Have a processing bitflag to reduce on unnecessary loops through the processing lists
SStgui.close_uis(src)
. = ..()
/obj/proc/setAnchored(anchorvalue)
SEND_SIGNAL(src, COMSIG_OBJ_SETANCHORED, anchorvalue)
anchored = anchorvalue
/obj/throw_at(atom/target, range, speed, mob/thrower, spin=1, diagonals_first = 0, datum/callback/callback, force, messy_throw = TRUE)
. = ..()
if(obj_flags & FROZEN)
visible_message("<span class='danger'>[src] shatters into a million pieces!</span>")
qdel(src)
/obj/assume_air(datum/gas_mixture/giver)
if(loc)
return loc.assume_air(giver)
else
return null
/obj/remove_air(amount)
if(loc)
return loc.remove_air(amount)
else
return null
/obj/return_air()
if(loc)
return loc.return_air()
else
return null
/obj/proc/handle_internal_lifeform(mob/lifeform_inside_me, breath_request)
//Return: (NONSTANDARD)
// null if object handles breathing logic for lifeform
// datum/air_group to tell lifeform to process using that breath return
//DEFAULT: Take air from turf to give to have mob process
if(breath_request>0)
var/datum/gas_mixture/environment = return_air()
var/breath_percentage = BREATH_VOLUME / environment.return_volume()
return remove_air(environment.total_moles() * breath_percentage)
else
return null
/obj/proc/updateUsrDialog()
if((obj_flags & IN_USE) && !(obj_flags & USES_TGUI))
var/is_in_use = FALSE
var/list/nearby = viewers(1, src)
for(var/mob/M in nearby)
if ((M.client && M.machine == src))
is_in_use = TRUE
ui_interact(M)
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr))
if (!(usr in nearby))
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
is_in_use = TRUE
ui_interact(usr)
// check for TK users
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
if(!(usr in nearby))
if(usr.client && usr.machine==src)
if(H.dna.check_mutation(TK))
is_in_use = TRUE
ui_interact(usr)
if (is_in_use)
obj_flags |= IN_USE
else
obj_flags &= ~IN_USE
/obj/proc/updateDialog(update_viewers = TRUE,update_ais = TRUE)
// Check that people are actually using the machine. If not, don't update anymore.
if(obj_flags & IN_USE)
var/is_in_use = FALSE
if(update_viewers)
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
is_in_use = TRUE
src.interact(M)
var/ai_in_use = FALSE
if(update_ais)
ai_in_use = AutoUpdateAI(src)
if(update_viewers && update_ais) //State change is sure only if we check both
if(!ai_in_use && !is_in_use)
obj_flags &= ~IN_USE
/obj/attack_ghost(mob/user)
. = ..()
if(.)
return
ui_interact(user)
/obj/proc/container_resist(mob/living/user)
return
/obj/proc/update_icon()
return
/mob/proc/unset_machine()
if(machine)
machine.on_unset_machine(src)
machine = null
//called when the user unsets the machine.
/atom/movable/proc/on_unset_machine(mob/user)
return
/mob/proc/set_machine(obj/O)
if(src.machine)
unset_machine()
src.machine = O
if(istype(O))
O.obj_flags |= IN_USE
/obj/item/proc/updateSelfDialog()
var/mob/M = src.loc
if(istype(M) && M.client && M.machine == src)
src.attack_self(M)
/obj/proc/hide(h)
return
/obj/singularity_pull(S, current_size)
..()
if(!anchored || current_size >= STAGE_FIVE)
step_towards(src,S)
/obj/get_dumping_location(datum/component/storage/source,mob/user)
return get_turf(src)
/obj/proc/CanAStarPass()
. = !density
/obj/proc/check_uplink_validity()
return 1
/obj/proc/intercept_user_move(dir, mob, newLoc, oldLoc)
return
/obj/vv_get_dropdown()
. = ..()
.["Delete all of type"] = "?_src_=vars;[HrefToken()];delall=[REF(src)]"
.["Osay"] = "?_src_=vars;[HrefToken()];osay[REF(src)]"
.["Modify armor values"] = "?_src_=vars;[HrefToken()];modarmor=[REF(src)]"
/obj/examine(mob/user)
. = ..()
if(obj_flags & UNIQUE_RENAME)
. += "<span class='notice'>Use a pen on it to rename it or change its description.</span>"
if(unique_reskin && (!current_skin || always_reskinnable))
. += "<span class='notice'>Alt-click it to reskin it.</span>"
/obj/AltClick(mob/user)
. = ..()
if(unique_reskin && (!current_skin || always_reskinnable) && user.canUseTopic(src, BE_CLOSE, NO_DEXTERY))
reskin_obj(user)
return TRUE
/obj/proc/reskin_obj(mob/M)
if(!LAZYLEN(unique_reskin))
return
var/dat = "<b>Reskin options for [name]:</b>\n"
for(var/V in unique_reskin)
var/output = icon2html(src, M, unique_reskin[V])
dat += "[V]: <span class='reallybig'>[output]</span>\n"
to_chat(M, dat)
var/choice = input(M, always_reskinnable ? "Choose the a reskin for [src]" : "Warning, you can only reskin [src] once!","Reskin Object") as null|anything in unique_reskin
if(QDELETED(src) || !choice || (current_skin && !always_reskinnable) || M.incapacitated() || !in_range(M,src) || !unique_reskin[choice] || unique_reskin[choice] == current_skin)
return
current_skin = choice
icon_state = unique_reskin[choice]
to_chat(M, "[src] is now skinned as '[choice]'.")

View File

@@ -449,6 +449,9 @@
item_chair = null
var/turns = 0
/obj/structure/chair/brass/ComponentInitialize()
return //it spins with the power of ratvar, not components.
/obj/structure/chair/brass/Destroy()
STOP_PROCESSING(SSfastprocess, src)
. = ..()
@@ -464,6 +467,7 @@
return
/obj/structure/chair/brass/AltClick(mob/living/user)
. = ..()
turns = 0
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
@@ -475,6 +479,7 @@
user.visible_message("<span class='notice'>[user] stops [src]'s uncontrollable spinning.</span>", \
"<span class='notice'>You grab [src] and stop its wild spinning.</span>")
STOP_PROCESSING(SSfastprocess, src)
return TRUE
/obj/structure/chair/bronze
name = "brass chair"

File diff suppressed because it is too large Load Diff

View File

@@ -1,154 +1,156 @@
/obj/structure/extinguisher_cabinet
name = "extinguisher cabinet"
desc = "A small wall mounted cabinet designed to hold a fire extinguisher."
icon = 'icons/obj/wallmounts.dmi'
icon_state = "extinguisher_closed"
anchored = TRUE
density = FALSE
max_integrity = 200
integrity_failure = 50
var/obj/item/extinguisher/stored_extinguisher
var/opened = FALSE
/obj/structure/extinguisher_cabinet/Initialize(mapload, ndir, building)
. = ..()
if(building)
setDir(ndir)
pixel_x = (dir & 3)? 0 : (dir == 4 ? -27 : 27)
pixel_y = (dir & 3)? (dir ==1 ? -30 : 30) : 0
opened = TRUE
icon_state = "extinguisher_empty"
else
stored_extinguisher = new /obj/item/extinguisher(src)
/obj/structure/extinguisher_cabinet/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to [opened ? "close":"open"] it.</span>"
/obj/structure/extinguisher_cabinet/Destroy()
if(stored_extinguisher)
qdel(stored_extinguisher)
stored_extinguisher = null
return ..()
/obj/structure/extinguisher_cabinet/contents_explosion(severity, target)
if(stored_extinguisher)
stored_extinguisher.ex_act(severity, target)
/obj/structure/extinguisher_cabinet/handle_atom_del(atom/A)
if(A == stored_extinguisher)
stored_extinguisher = null
update_icon()
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench) && !stored_extinguisher)
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You unsecure [name].</span>")
deconstruct(TRUE)
return
if(iscyborg(user) || isalien(user))
return
if(istype(I, /obj/item/extinguisher))
if(!stored_extinguisher && opened)
if(!user.transferItemToLoc(I, src))
return
stored_extinguisher = I
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
update_icon()
return TRUE
else
toggle_cabinet(user)
else if(user.a_intent != INTENT_HARM)
toggle_cabinet(user)
else
return ..()
/obj/structure/extinguisher_cabinet/attack_hand(mob/user)
. = ..()
if(.)
return
if(iscyborg(user) || isalien(user))
return
if(stored_extinguisher)
user.put_in_hands(stored_extinguisher)
to_chat(user, "<span class='notice'>You take [stored_extinguisher] from [src].</span>")
stored_extinguisher = null
if(!opened)
opened = 1
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
update_icon()
else
toggle_cabinet(user)
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
if(stored_extinguisher)
stored_extinguisher.forceMove(loc)
to_chat(user, "<span class='notice'>You telekinetically remove [stored_extinguisher] from [src].</span>")
stored_extinguisher = null
opened = 1
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
update_icon()
else
toggle_cabinet(user)
/obj/structure/extinguisher_cabinet/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/extinguisher_cabinet/AltClick(mob/living/user)
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
toggle_cabinet(user)
/obj/structure/extinguisher_cabinet/proc/toggle_cabinet(mob/user)
if(opened && broken)
to_chat(user, "<span class='warning'>[src] is broken open.</span>")
else
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/update_icon()
if(!opened)
icon_state = "extinguisher_closed"
return
if(stored_extinguisher)
if(istype(stored_extinguisher, /obj/item/extinguisher/mini))
icon_state = "extinguisher_mini"
else
icon_state = "extinguisher_full"
else
icon_state = "extinguisher_empty"
/obj/structure/extinguisher_cabinet/obj_break(damage_flag)
if(!broken && !(flags_1 & NODECONSTRUCT_1))
broken = 1
opened = 1
if(stored_extinguisher)
stored_extinguisher.forceMove(loc)
stored_extinguisher = null
update_icon()
/obj/structure/extinguisher_cabinet/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(disassembled)
new /obj/item/wallframe/extinguisher_cabinet(loc)
else
new /obj/item/stack/sheet/metal (loc, 2)
if(stored_extinguisher)
stored_extinguisher.forceMove(loc)
stored_extinguisher = null
qdel(src)
/obj/item/wallframe/extinguisher_cabinet
name = "extinguisher cabinet frame"
desc = "Used for building wall-mounted extinguisher cabinets."
icon_state = "extinguisher"
result_path = /obj/structure/extinguisher_cabinet
/obj/structure/extinguisher_cabinet
name = "extinguisher cabinet"
desc = "A small wall mounted cabinet designed to hold a fire extinguisher."
icon = 'icons/obj/wallmounts.dmi'
icon_state = "extinguisher_closed"
anchored = TRUE
density = FALSE
max_integrity = 200
integrity_failure = 50
var/obj/item/extinguisher/stored_extinguisher
var/opened = FALSE
/obj/structure/extinguisher_cabinet/Initialize(mapload, ndir, building)
. = ..()
if(building)
setDir(ndir)
pixel_x = (dir & 3)? 0 : (dir == 4 ? -27 : 27)
pixel_y = (dir & 3)? (dir ==1 ? -30 : 30) : 0
opened = TRUE
icon_state = "extinguisher_empty"
else
stored_extinguisher = new /obj/item/extinguisher(src)
/obj/structure/extinguisher_cabinet/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to [opened ? "close":"open"] it.</span>"
/obj/structure/extinguisher_cabinet/Destroy()
if(stored_extinguisher)
qdel(stored_extinguisher)
stored_extinguisher = null
return ..()
/obj/structure/extinguisher_cabinet/contents_explosion(severity, target)
if(stored_extinguisher)
stored_extinguisher.ex_act(severity, target)
/obj/structure/extinguisher_cabinet/handle_atom_del(atom/A)
if(A == stored_extinguisher)
stored_extinguisher = null
update_icon()
/obj/structure/extinguisher_cabinet/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench) && !stored_extinguisher)
to_chat(user, "<span class='notice'>You start unsecuring [name]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 60))
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You unsecure [name].</span>")
deconstruct(TRUE)
return
if(iscyborg(user) || isalien(user))
return
if(istype(I, /obj/item/extinguisher))
if(!stored_extinguisher && opened)
if(!user.transferItemToLoc(I, src))
return
stored_extinguisher = I
to_chat(user, "<span class='notice'>You place [I] in [src].</span>")
update_icon()
return TRUE
else
toggle_cabinet(user)
else if(user.a_intent != INTENT_HARM)
toggle_cabinet(user)
else
return ..()
/obj/structure/extinguisher_cabinet/attack_hand(mob/user)
. = ..()
if(.)
return
if(iscyborg(user) || isalien(user))
return
if(stored_extinguisher)
user.put_in_hands(stored_extinguisher)
to_chat(user, "<span class='notice'>You take [stored_extinguisher] from [src].</span>")
stored_extinguisher = null
if(!opened)
opened = 1
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
update_icon()
else
toggle_cabinet(user)
/obj/structure/extinguisher_cabinet/attack_tk(mob/user)
if(stored_extinguisher)
stored_extinguisher.forceMove(loc)
to_chat(user, "<span class='notice'>You telekinetically remove [stored_extinguisher] from [src].</span>")
stored_extinguisher = null
opened = 1
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
update_icon()
else
toggle_cabinet(user)
/obj/structure/extinguisher_cabinet/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/extinguisher_cabinet/AltClick(mob/living/user)
. = ..()
if(!istype(user) || !user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
toggle_cabinet(user)
return TRUE
/obj/structure/extinguisher_cabinet/proc/toggle_cabinet(mob/user)
if(opened && broken)
to_chat(user, "<span class='warning'>[src] is broken open.</span>")
else
playsound(loc, 'sound/machines/click.ogg', 15, 1, -3)
opened = !opened
update_icon()
/obj/structure/extinguisher_cabinet/update_icon()
if(!opened)
icon_state = "extinguisher_closed"
return
if(stored_extinguisher)
if(istype(stored_extinguisher, /obj/item/extinguisher/mini))
icon_state = "extinguisher_mini"
else
icon_state = "extinguisher_full"
else
icon_state = "extinguisher_empty"
/obj/structure/extinguisher_cabinet/obj_break(damage_flag)
if(!broken && !(flags_1 & NODECONSTRUCT_1))
broken = 1
opened = 1
if(stored_extinguisher)
stored_extinguisher.forceMove(loc)
stored_extinguisher = null
update_icon()
/obj/structure/extinguisher_cabinet/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(disassembled)
new /obj/item/wallframe/extinguisher_cabinet(loc)
else
new /obj/item/stack/sheet/metal (loc, 2)
if(stored_extinguisher)
stored_extinguisher.forceMove(loc)
stored_extinguisher = null
qdel(src)
/obj/item/wallframe/extinguisher_cabinet
name = "extinguisher cabinet frame"
desc = "Used for building wall-mounted extinguisher cabinets."
icon_state = "extinguisher"
result_path = /obj/structure/extinguisher_cabinet

View File

@@ -1,444 +1,445 @@
/* Morgue stuff
* Contains:
* Morgue
* Morgue tray
* Crematorium
* Creamatorium
* Crematorium tray
* Crematorium button
*/
/*
* Bodycontainer
* Parent class for morgue and crematorium
* For overriding only
*/
GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants and other ghosties.
/obj/structure/bodycontainer
icon = 'icons/obj/stationobjs.dmi'
icon_state = "morgue1"
density = TRUE
anchored = TRUE
max_integrity = 400
var/obj/structure/tray/connected = null
var/locked = FALSE
dir = SOUTH
var/message_cooldown
var/breakout_time = 600
var/obj/item/radio/radio = null
var/hasradio = FALSE
/obj/structure/bodycontainer/Initialize()
. = ..()
GLOB.bodycontainers += src
recursive_organ_check(src)
/obj/structure/bodycontainer/Destroy()
GLOB.bodycontainers -= src
open()
if(connected)
qdel(connected)
connected = null
return ..()
/obj/structure/bodycontainer/on_log(login)
..()
update_icon()
/obj/structure/bodycontainer/update_icon()
return
/obj/structure/bodycontainer/relaymove(mob/user)
if(user.stat || !isturf(loc))
return
if(locked)
if(message_cooldown <= world.time)
message_cooldown = world.time + 50
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
return
open()
/obj/structure/bodycontainer/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/bodycontainer/attack_hand(mob/user)
. = ..()
if(.)
return
if(locked)
to_chat(user, "<span class='danger'>It's locked.</span>")
return
if(!connected)
to_chat(user, "That doesn't appear to have a tray.")
return
if(connected.loc == src)
open()
else
close()
add_fingerprint(user)
/obj/structure/bodycontainer/attack_robot(mob/user)
if(!user.Adjacent(src))
return
return attack_hand(user)
/obj/structure/bodycontainer/attackby(obj/P, mob/user, params)
add_fingerprint(user)
if(istype(P, /obj/item/pen))
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
return
var/t = stripped_input(user, "What would you like the label to be?", text("[]", name), null)
if (user.get_active_held_item() != P)
return
if(!user.canUseTopic(src, BE_CLOSE))
return
if (t)
name = text("[]- '[]'", initial(name), t)
else
name = initial(name)
else
return ..()
/obj/structure/bodycontainer/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/metal (loc, 5)
recursive_organ_check(src)
qdel(src)
/obj/structure/bodycontainer/container_resist(mob/living/user)
if(!locked)
open()
return
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message(null, \
"<span class='notice'>You lean on the back of [src] and start pushing the tray open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a metallic creaking from [src].</span>")
if(do_after(user,(breakout_time), target = src))
if(!user || user.stat != CONSCIOUS || user.loc != src )
return
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
"<span class='notice'>You successfully break out of [src]!</span>")
open()
/obj/structure/bodycontainer/proc/open()
recursive_organ_check(src)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
playsound(src, 'sound/effects/roll.ogg', 5, 1)
var/turf/T = get_step(src, dir)
connected.setDir(dir)
for(var/atom/movable/AM in src)
if(AM != radio)
AM.forceMove(T)
update_icon()
/obj/structure/bodycontainer/proc/close()
playsound(src, 'sound/effects/roll.ogg', 5, 1)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
for(var/atom/movable/AM in connected.loc)
if(!AM.anchored || AM == connected)
AM.forceMove(src)
recursive_organ_check(src)
update_icon()
/obj/structure/bodycontainer/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)
/*
* Morgue
*/
/obj/structure/bodycontainer/morgue
name = "morgue"
desc = "Used to keep bodies in until someone fetches them. Now includes a high-tech alert system."
icon_state = "morgue1"
dir = EAST
var/beeper = TRUE
var/beep_cooldown = 50
var/next_beep = 0
//Hyperstation edit
var/radio_key = /obj/item/encryptionkey/headset_med
var/medical_channel = "Medical"
var/inuse = FALSE
hasradio = TRUE
/obj/structure/bodycontainer/morgue/Initialize()
. = ..()
radio = new(src)
radio.anchored = TRUE
radio.keyslot = new radio_key
radio.listening = 0
radio.recalculateChannels()
/obj/structure/bodycontainer/morgue/Destroy()
QDEL_NULL(radio)
GLOB.bodycontainers -= src
open()
if(connected)
qdel(connected)
connected = null
return ..()
/*
/obj/structure/bodycontainer/morgue/proc/open2()
recursive_organ_check(src)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
playsound(src, 'sound/effects/roll.ogg', 5, 1)
var/turf/T = get_step(src, dir)
connected.setDir(dir)
for(var/atom/movable/AM in src)
if(AM != radio)
AM.forceMove(T)
update_icon()
*/
//end of edit
/obj/structure/bodycontainer/morgue/New()
connected = new/obj/structure/tray/m_tray(src)
connected.connected = src
..()
/obj/structure/bodycontainer/morgue/examine(mob/user)
. = ..()
. += "<span class='notice'>The speaker is [beeper ? "enabled" : "disabled"]. Alt-click to toggle it.</span>"
/obj/structure/bodycontainer/morgue/AltClick(mob/user)
..()
if(!user.canUseTopic(src, !issilicon(user)))
return
beeper = !beeper
to_chat(user, "<span class='notice'>You turn the speaker function [beeper ? "on" : "off"].</span>")
/obj/structure/bodycontainer/morgue/update_icon()
if (!connected || connected.loc != src) // Open or tray is gone.
icon_state = "morgue0"
else
if(contents.len == 2) // Empty. Was length 1 because of the tray, is now length 2 because it includes a radio.
icon_state = "morgue1"
else
icon_state = "morgue2" // Dead, brainded mob.
var/list/compiled = recursive_mob_check(src, 0, 0) // Search for mobs in all contents.
if(!length(compiled)) // No mobs?
icon_state = "morgue3"
return
for(var/mob/living/M in compiled)
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
if(mob_occupant.client && !mob_occupant.suiciding && !(HAS_TRAIT(mob_occupant, TRAIT_NOCLONE)) && !mob_occupant.hellbound)
icon_state = "morgue4" // Cloneable
if(mob_occupant.stat == DEAD && beeper)
if(world.time > next_beep)
playsound(src, 'sound/weapons/smg_empty_alarm.ogg', 50, 0) //Clone them you blind fucks
next_beep = world.time + beep_cooldown
break
/obj/item/paper/guides/jobs/medical/morgue
name = "morgue memo"
info = "<font size='2'>Since this station's medbay never seems to fail to be staffed by the mindless monkeys meant for genetics experiments, I'm leaving a reminder here for anyone handling the pile of cadavers the quacks are sure to leave.</font><BR><BR><font size='4'><font color=red>Red lights mean there's a plain ol' dead body inside.</font><BR><BR><font color=orange>Yellow lights mean there's non-body objects inside.</font><BR><font size='2'>Probably stuff pried off a corpse someone grabbed, or if you're lucky it's stashed booze.</font><BR><BR><font color=green>Green lights mean the morgue system detects the body may be able to be cloned.</font></font><BR><font size='2'>I don't know how that works, but keep it away from the kitchen and go yell at the geneticists.</font><BR><BR>- CentCom medical inspector"
/*
* Crematorium
*/
GLOBAL_LIST_EMPTY(crematoriums)
/obj/structure/bodycontainer/crematorium
name = "crematorium"
desc = "A human incinerator. Works well on barbecue nights."
icon_state = "crema1"
dir = SOUTH
var/id = 1
/obj/structure/bodycontainer/crematorium/attack_robot(mob/user) //Borgs can't use crematoriums without help
to_chat(user, "<span class='warning'>[src] is locked against you.</span>")
return
/obj/structure/bodycontainer/crematorium/Destroy()
GLOB.crematoriums.Remove(src)
return ..()
/obj/structure/bodycontainer/crematorium/New()
connected = new/obj/structure/tray/c_tray(src)
connected.connected = src
GLOB.crematoriums.Add(src)
..()
/obj/structure/bodycontainer/crematorium/update_icon()
if(!connected || connected.loc != src)
icon_state = "crema0"
else
if(src.contents.len > 1)
src.icon_state = "crema2"
else
src.icon_state = "crema1"
if(locked)
src.icon_state = "crema_active"
return
/obj/structure/bodycontainer/crematorium/proc/cremate(mob/user)
if(locked)
return //don't let you cremate something twice or w/e
// Make sure we don't delete the actual morgue and its tray
var/list/conts = GetAllContents() - src - connected
if(!conts.len)
audible_message("<span class='italics'>You hear a hollow crackle.</span>")
return
else
audible_message("<span class='italics'>You hear a roar as the crematorium activates.</span>")
locked = TRUE
update_icon()
for(var/mob/living/M in conts)
if (M.stat != DEAD)
M.emote("scream")
if(user)
log_combat(user, M, "cremated")
else
M.log_message("was cremated", LOG_ATTACK)
M.death(1)
if(M) //some animals get automatically deleted on death.
M.ghostize()
qdel(M)
for(var/obj/O in conts) //conts defined above, ignores crematorium and tray
qdel(O)
if(!locate(/obj/effect/decal/cleanable/ash) in get_step(src, dir))//prevent pile-up
new/obj/effect/decal/cleanable/ash/crematorium(src)
sleep(30)
if(!QDELETED(src))
locked = FALSE
update_icon()
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) //you horrible people
/obj/structure/bodycontainer/crematorium/creamatorium
name = "creamatorium"
desc = "A human incinerator. Works well during ice cream socials."
/obj/structure/bodycontainer/crematorium/creamatorium/cremate(mob/user)
var/list/icecreams = new()
for(var/mob/living/i_scream in GetAllContents())
var/obj/item/reagent_containers/food/snacks/icecream/IC = new()
IC.set_cone_type("waffle")
IC.add_mob_flavor(i_scream)
icecreams += IC
. = ..()
for(var/obj/IC in icecreams)
IC.forceMove(src)
/*
* Generic Tray
* Parent class for morguetray and crematoriumtray
* For overriding only
*/
/obj/structure/tray
icon = 'icons/obj/stationobjs.dmi'
density = TRUE
layer = BELOW_OBJ_LAYER
var/obj/structure/bodycontainer/connected = null
anchored = TRUE
pass_flags = LETPASSTHROW
max_integrity = 350
/obj/structure/tray/Destroy()
if(connected)
connected.connected = null
connected.update_icon()
connected = null
return ..()
/obj/structure/tray/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/metal (loc, 2)
qdel(src)
/obj/structure/tray/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/tray/attack_hand(mob/user)
. = ..()
if(.)
return
if (src.connected)
connected.close()
add_fingerprint(user)
else
to_chat(user, "<span class='warning'>That's not connected to anything!</span>")
/obj/structure/tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user)
if(!ismovableatom(O) || O.anchored || !Adjacent(user) || !user.Adjacent(O) || O.loc == user)
return
if(!ismob(O))
if(!istype(O, /obj/structure/closet/body_bag))
return
else
var/mob/M = O
if(M.buckled)
return
if(!ismob(user) || user.lying || user.incapacitated())
return
O.forceMove(src.loc)
if (user != O)
visible_message("<span class='warning'>[user] stuffs [O] into [src].</span>")
return
/*
* Crematorium tray
*/
/obj/structure/tray/c_tray
name = "crematorium tray"
desc = "Apply body before burning."
icon_state = "cremat"
/*
* Morgue tray
*/
/obj/structure/tray/m_tray
name = "morgue tray"
desc = "Apply corpse before closing."
icon_state = "morguet"
/obj/structure/tray/m_tray/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && (mover.pass_flags & PASSTABLE))
return 1
if(locate(/obj/structure/table) in get_turf(mover))
return 1
else
return 0
/obj/structure/tray/m_tray/CanAStarPass(ID, dir, caller)
. = !density
if(ismovableatom(caller))
var/atom/movable/mover = caller
. = . || (mover.pass_flags & PASSTABLE)
//Hyperstation edit starts here
/obj/structure/bodycontainer/morgue/attack_ghost(mob/user)
. = ..()
if(!beeper || inuse)
return
var/list/compiled = recursive_mob_check(src, 0, 0) // Search for mobs in all contents.
if(!length(compiled)) // No mobs?
return
for(var/mob/living/M in compiled)
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
if(!mob_occupant.suiciding && !mob_occupant.hellbound)
if(mob_occupant.stat == DEAD && mob_occupant.mind.key == user.client.key)
inuse = TRUE
visible_message("One of the morgue coffins currently holds a soul that is eager to have its body revived.")
radio.talk_into(src, "One of the morgue coffins currently holds a soul that is eager to have its body revived.", medical_channel)
playsound(loc, 'sound/machines/ping.ogg', 50)
addtimer(CALLBACK(src, .proc/liftcooldown), 500)
/obj/structure/bodycontainer/morgue/proc/liftcooldown()
inuse = FALSE
//Hyperstation edit ends here
/* Morgue stuff
* Contains:
* Morgue
* Morgue tray
* Crematorium
* Creamatorium
* Crematorium tray
* Crematorium button
*/
/*
* Bodycontainer
* Parent class for morgue and crematorium
* For overriding only
*/
GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants and other ghosties.
/obj/structure/bodycontainer
icon = 'icons/obj/stationobjs.dmi'
icon_state = "morgue1"
density = TRUE
anchored = TRUE
max_integrity = 400
var/obj/structure/tray/connected = null
var/locked = FALSE
dir = SOUTH
var/message_cooldown
var/breakout_time = 600
var/obj/item/radio/radio = null
var/hasradio = FALSE
/obj/structure/bodycontainer/Initialize()
. = ..()
GLOB.bodycontainers += src
recursive_organ_check(src)
/obj/structure/bodycontainer/Destroy()
GLOB.bodycontainers -= src
open()
if(connected)
qdel(connected)
connected = null
return ..()
/obj/structure/bodycontainer/on_log(login)
..()
update_icon()
/obj/structure/bodycontainer/update_icon()
return
/obj/structure/bodycontainer/relaymove(mob/user)
if(user.stat || !isturf(loc))
return
if(locked)
if(message_cooldown <= world.time)
message_cooldown = world.time + 50
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
return
open()
/obj/structure/bodycontainer/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/bodycontainer/attack_hand(mob/user)
. = ..()
if(.)
return
if(locked)
to_chat(user, "<span class='danger'>It's locked.</span>")
return
if(!connected)
to_chat(user, "That doesn't appear to have a tray.")
return
if(connected.loc == src)
open()
else
close()
add_fingerprint(user)
/obj/structure/bodycontainer/attack_robot(mob/user)
if(!user.Adjacent(src))
return
return attack_hand(user)
/obj/structure/bodycontainer/attackby(obj/P, mob/user, params)
add_fingerprint(user)
if(istype(P, /obj/item/pen))
if(!user.is_literate())
to_chat(user, "<span class='notice'>You scribble illegibly on the side of [src]!</span>")
return
var/t = stripped_input(user, "What would you like the label to be?", text("[]", name), null)
if (user.get_active_held_item() != P)
return
if(!user.canUseTopic(src, BE_CLOSE))
return
if (t)
name = text("[]- '[]'", initial(name), t)
else
name = initial(name)
else
return ..()
/obj/structure/bodycontainer/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/metal (loc, 5)
recursive_organ_check(src)
qdel(src)
/obj/structure/bodycontainer/container_resist(mob/living/user)
if(!locked)
open()
return
user.changeNext_move(CLICK_CD_BREAKOUT)
user.last_special = world.time + CLICK_CD_BREAKOUT
user.visible_message(null, \
"<span class='notice'>You lean on the back of [src] and start pushing the tray open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
"<span class='italics'>You hear a metallic creaking from [src].</span>")
if(do_after(user,(breakout_time), target = src))
if(!user || user.stat != CONSCIOUS || user.loc != src )
return
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
"<span class='notice'>You successfully break out of [src]!</span>")
open()
/obj/structure/bodycontainer/proc/open()
recursive_organ_check(src)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
playsound(src, 'sound/effects/roll.ogg', 5, 1)
var/turf/T = get_step(src, dir)
connected.setDir(dir)
for(var/atom/movable/AM in src)
if(AM != radio)
AM.forceMove(T)
update_icon()
/obj/structure/bodycontainer/proc/close()
playsound(src, 'sound/effects/roll.ogg', 5, 1)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
for(var/atom/movable/AM in connected.loc)
if(!AM.anchored || AM == connected)
AM.forceMove(src)
recursive_organ_check(src)
update_icon()
/obj/structure/bodycontainer/get_remote_view_fullscreens(mob/user)
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 2)
/*
* Morgue
*/
/obj/structure/bodycontainer/morgue
name = "morgue"
desc = "Used to keep bodies in until someone fetches them. Now includes a high-tech alert system."
icon_state = "morgue1"
dir = EAST
var/beeper = TRUE
var/beep_cooldown = 50
var/next_beep = 0
//Hyperstation edit
var/radio_key = /obj/item/encryptionkey/headset_med
var/medical_channel = "Medical"
var/inuse = FALSE
hasradio = TRUE
/obj/structure/bodycontainer/morgue/Initialize()
. = ..()
radio = new(src)
radio.anchored = TRUE
radio.keyslot = new radio_key
radio.listening = 0
radio.recalculateChannels()
/obj/structure/bodycontainer/morgue/Destroy()
QDEL_NULL(radio)
GLOB.bodycontainers -= src
open()
if(connected)
qdel(connected)
connected = null
return ..()
/*
/obj/structure/bodycontainer/morgue/proc/open2()
recursive_organ_check(src)
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
playsound(src, 'sound/effects/roll.ogg', 5, 1)
var/turf/T = get_step(src, dir)
connected.setDir(dir)
for(var/atom/movable/AM in src)
if(AM != radio)
AM.forceMove(T)
update_icon()
*/
//end of edit
/obj/structure/bodycontainer/morgue/New()
connected = new/obj/structure/tray/m_tray(src)
connected.connected = src
..()
/obj/structure/bodycontainer/morgue/examine(mob/user)
. = ..()
. += "<span class='notice'>The speaker is [beeper ? "enabled" : "disabled"]. Alt-click to toggle it.</span>"
/obj/structure/bodycontainer/morgue/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !issilicon(user)))
return
beeper = !beeper
to_chat(user, "<span class='notice'>You turn the speaker function [beeper ? "on" : "off"].</span>")
return TRUE
/obj/structure/bodycontainer/morgue/update_icon()
if (!connected || connected.loc != src) // Open or tray is gone.
icon_state = "morgue0"
else
if(contents.len == 2) // Empty. Was length 1 because of the tray, is now length 2 because it includes a radio.
icon_state = "morgue1"
else
icon_state = "morgue2" // Dead, brainded mob.
var/list/compiled = recursive_mob_check(src, 0, 0) // Search for mobs in all contents.
if(!length(compiled)) // No mobs?
icon_state = "morgue3"
return
for(var/mob/living/M in compiled)
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
if(mob_occupant.client && !mob_occupant.suiciding && !(HAS_TRAIT(mob_occupant, TRAIT_NOCLONE)) && !mob_occupant.hellbound)
icon_state = "morgue4" // Cloneable
if(mob_occupant.stat == DEAD && beeper)
if(world.time > next_beep)
playsound(src, 'sound/weapons/smg_empty_alarm.ogg', 50, 0) //Clone them you blind fucks
next_beep = world.time + beep_cooldown
break
/obj/item/paper/guides/jobs/medical/morgue
name = "morgue memo"
info = "<font size='2'>Since this station's medbay never seems to fail to be staffed by the mindless monkeys meant for genetics experiments, I'm leaving a reminder here for anyone handling the pile of cadavers the quacks are sure to leave.</font><BR><BR><font size='4'><font color=red>Red lights mean there's a plain ol' dead body inside.</font><BR><BR><font color=orange>Yellow lights mean there's non-body objects inside.</font><BR><font size='2'>Probably stuff pried off a corpse someone grabbed, or if you're lucky it's stashed booze.</font><BR><BR><font color=green>Green lights mean the morgue system detects the body may be able to be cloned.</font></font><BR><font size='2'>I don't know how that works, but keep it away from the kitchen and go yell at the geneticists.</font><BR><BR>- CentCom medical inspector"
/*
* Crematorium
*/
GLOBAL_LIST_EMPTY(crematoriums)
/obj/structure/bodycontainer/crematorium
name = "crematorium"
desc = "A human incinerator. Works well on barbecue nights."
icon_state = "crema1"
dir = SOUTH
var/id = 1
/obj/structure/bodycontainer/crematorium/attack_robot(mob/user) //Borgs can't use crematoriums without help
to_chat(user, "<span class='warning'>[src] is locked against you.</span>")
return
/obj/structure/bodycontainer/crematorium/Destroy()
GLOB.crematoriums.Remove(src)
return ..()
/obj/structure/bodycontainer/crematorium/New()
connected = new/obj/structure/tray/c_tray(src)
connected.connected = src
GLOB.crematoriums.Add(src)
..()
/obj/structure/bodycontainer/crematorium/update_icon()
if(!connected || connected.loc != src)
icon_state = "crema0"
else
if(src.contents.len > 1)
src.icon_state = "crema2"
else
src.icon_state = "crema1"
if(locked)
src.icon_state = "crema_active"
return
/obj/structure/bodycontainer/crematorium/proc/cremate(mob/user)
if(locked)
return //don't let you cremate something twice or w/e
// Make sure we don't delete the actual morgue and its tray
var/list/conts = GetAllContents() - src - connected
if(!conts.len)
audible_message("<span class='italics'>You hear a hollow crackle.</span>")
return
else
audible_message("<span class='italics'>You hear a roar as the crematorium activates.</span>")
locked = TRUE
update_icon()
for(var/mob/living/M in conts)
if (M.stat != DEAD)
M.emote("scream")
if(user)
log_combat(user, M, "cremated")
else
M.log_message("was cremated", LOG_ATTACK)
M.death(1)
if(M) //some animals get automatically deleted on death.
M.ghostize()
qdel(M)
for(var/obj/O in conts) //conts defined above, ignores crematorium and tray
qdel(O)
if(!locate(/obj/effect/decal/cleanable/ash) in get_step(src, dir))//prevent pile-up
new/obj/effect/decal/cleanable/ash/crematorium(src)
sleep(30)
if(!QDELETED(src))
locked = FALSE
update_icon()
playsound(src.loc, 'sound/machines/ding.ogg', 50, 1) //you horrible people
/obj/structure/bodycontainer/crematorium/creamatorium
name = "creamatorium"
desc = "A human incinerator. Works well during ice cream socials."
/obj/structure/bodycontainer/crematorium/creamatorium/cremate(mob/user)
var/list/icecreams = new()
for(var/mob/living/i_scream in GetAllContents())
var/obj/item/reagent_containers/food/snacks/icecream/IC = new()
IC.set_cone_type("waffle")
IC.add_mob_flavor(i_scream)
icecreams += IC
. = ..()
for(var/obj/IC in icecreams)
IC.forceMove(src)
/*
* Generic Tray
* Parent class for morguetray and crematoriumtray
* For overriding only
*/
/obj/structure/tray
icon = 'icons/obj/stationobjs.dmi'
density = TRUE
layer = BELOW_OBJ_LAYER
var/obj/structure/bodycontainer/connected = null
anchored = TRUE
pass_flags = LETPASSTHROW
max_integrity = 350
/obj/structure/tray/Destroy()
if(connected)
connected.connected = null
connected.update_icon()
connected = null
return ..()
/obj/structure/tray/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/metal (loc, 2)
qdel(src)
/obj/structure/tray/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/tray/attack_hand(mob/user)
. = ..()
if(.)
return
if (src.connected)
connected.close()
add_fingerprint(user)
else
to_chat(user, "<span class='warning'>That's not connected to anything!</span>")
/obj/structure/tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user)
if(!ismovableatom(O) || O.anchored || !Adjacent(user) || !user.Adjacent(O) || O.loc == user)
return
if(!ismob(O))
if(!istype(O, /obj/structure/closet/body_bag))
return
else
var/mob/M = O
if(M.buckled)
return
if(!ismob(user) || user.lying || user.incapacitated())
return
O.forceMove(src.loc)
if (user != O)
visible_message("<span class='warning'>[user] stuffs [O] into [src].</span>")
return
/*
* Crematorium tray
*/
/obj/structure/tray/c_tray
name = "crematorium tray"
desc = "Apply body before burning."
icon_state = "cremat"
/*
* Morgue tray
*/
/obj/structure/tray/m_tray
name = "morgue tray"
desc = "Apply corpse before closing."
icon_state = "morguet"
/obj/structure/tray/m_tray/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && (mover.pass_flags & PASSTABLE))
return 1
if(locate(/obj/structure/table) in get_turf(mover))
return 1
else
return 0
/obj/structure/tray/m_tray/CanAStarPass(ID, dir, caller)
. = !density
if(ismovableatom(caller))
var/atom/movable/mover = caller
. = . || (mover.pass_flags & PASSTABLE)
//Hyperstation edit starts here
/obj/structure/bodycontainer/morgue/attack_ghost(mob/user)
. = ..()
if(!beeper || inuse)
return
var/list/compiled = recursive_mob_check(src, 0, 0) // Search for mobs in all contents.
if(!length(compiled)) // No mobs?
return
for(var/mob/living/M in compiled)
var/mob/living/mob_occupant = get_mob_or_brainmob(M)
if(!mob_occupant.suiciding && !mob_occupant.hellbound)
if(mob_occupant.stat == DEAD && mob_occupant.mind.key == user.client.key)
inuse = TRUE
visible_message("One of the morgue coffins currently holds a soul that is eager to have its body revived.")
radio.talk_into(src, "One of the morgue coffins currently holds a soul that is eager to have its body revived.", medical_channel)
playsound(loc, 'sound/machines/ping.ogg', 50)
addtimer(CALLBACK(src, .proc/liftcooldown), 500)
/obj/structure/bodycontainer/morgue/proc/liftcooldown()
inuse = FALSE
//Hyperstation edit ends here

View File

@@ -168,10 +168,12 @@
return TRUE
/obj/structure/reflector/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
return
else if(finished)
rotate(user)
return TRUE
//TYPES OF REFLECTORS, SINGLE, DOUBLE, BOX