Merge remote-tracking branch 'citadel/master' into auxtools-atmos
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
return FALSE
|
||||
var/turf/T = get_turf(src)
|
||||
var/area/A = get_area(src)
|
||||
if(!A.blob_allowed)
|
||||
if(!(A.area_flags & BLOBS_ALLOWED))
|
||||
return FALSE
|
||||
if(!A.powered(EQUIP))
|
||||
return FALSE
|
||||
|
||||
@@ -16,12 +16,12 @@
|
||||
//Adding canvases
|
||||
/obj/structure/easel/attackby(obj/item/I, mob/user, params)
|
||||
if(istype(I, /obj/item/canvas))
|
||||
var/obj/item/canvas/C = I
|
||||
user.dropItemToGround(C)
|
||||
painting = C
|
||||
C.forceMove(get_turf(src))
|
||||
C.layer = layer+0.1
|
||||
user.visible_message("<span class='notice'>[user] puts \the [C] on \the [src].</span>","<span class='notice'>You place \the [C] on \the [src].</span>")
|
||||
var/obj/item/canvas/canvas = I
|
||||
user.dropItemToGround(canvas)
|
||||
painting = canvas
|
||||
canvas.forceMove(get_turf(src))
|
||||
canvas.layer = layer+0.1
|
||||
user.visible_message("<span class='notice'>[user] puts \the [canvas] on \the [src].</span>","<span class='notice'>You place \the [canvas] on \the [src].</span>")
|
||||
else
|
||||
return ..()
|
||||
|
||||
@@ -40,13 +40,14 @@
|
||||
desc = "Draw out your soul on this canvas!"
|
||||
icon = 'icons/obj/artstuff.dmi'
|
||||
icon_state = "11x11"
|
||||
// flags_1 = UNPAINTABLE_1
|
||||
resistance_flags = FLAMMABLE
|
||||
var/width = 11
|
||||
var/height = 11
|
||||
var/list/grid
|
||||
var/canvas_color = "#ffffff" //empty canvas color
|
||||
var/used = FALSE
|
||||
var/painting_name //Painting name, this is set after framing.
|
||||
var/painting_name = "Untitled Artwork" //Painting name, this is set after framing.
|
||||
var/finalized = FALSE //Blocks edits
|
||||
var/author_ckey
|
||||
var/icon_generated = FALSE
|
||||
@@ -132,17 +133,19 @@
|
||||
|
||||
/obj/item/canvas/update_overlays()
|
||||
. = ..()
|
||||
if(!icon_generated)
|
||||
if(used)
|
||||
var/mutable_appearance/detail = mutable_appearance(icon,"[icon_state]wip")
|
||||
detail.pixel_x = 1
|
||||
detail.pixel_y = 1
|
||||
. += detail
|
||||
else
|
||||
if(icon_generated)
|
||||
var/mutable_appearance/detail = mutable_appearance(generated_icon)
|
||||
detail.pixel_x = 1
|
||||
detail.pixel_y = 1
|
||||
. += detail
|
||||
return
|
||||
if(!used)
|
||||
return
|
||||
|
||||
var/mutable_appearance/detail = mutable_appearance(icon, "[icon_state]wip")
|
||||
detail.pixel_x = 1
|
||||
detail.pixel_y = 1
|
||||
. += detail
|
||||
|
||||
/obj/item/canvas/proc/generate_proper_overlay()
|
||||
if(icon_generated)
|
||||
@@ -167,8 +170,8 @@
|
||||
if(!I)
|
||||
return
|
||||
if(istype(I, /obj/item/toy/crayon))
|
||||
var/obj/item/toy/crayon/C = I
|
||||
return C.paint_color
|
||||
var/obj/item/toy/crayon/crayon = I
|
||||
return crayon.paint_color
|
||||
else if(istype(I, /obj/item/pen))
|
||||
var/obj/item/pen/P = I
|
||||
switch(P.colour)
|
||||
@@ -184,7 +187,7 @@
|
||||
|
||||
/obj/item/canvas/proc/try_rename(mob/user)
|
||||
var/new_name = stripped_input(user,"What do you want to name the painting?")
|
||||
if(!painting_name && new_name && user.canUseTopic(src,BE_CLOSE))
|
||||
if(new_name != painting_name && new_name && user.canUseTopic(src,BE_CLOSE))
|
||||
painting_name = new_name
|
||||
SStgui.update_uis(src)
|
||||
|
||||
@@ -215,12 +218,23 @@
|
||||
framed_offset_x = 5
|
||||
framed_offset_y = 6
|
||||
|
||||
/obj/item/canvas/twentyfour_twentyfour
|
||||
name = "ai universal standard canvas"
|
||||
desc = "Besides being very large, the AI can accept these as a display from their internal database after you've hung it up."
|
||||
icon_state = "24x24"
|
||||
width = 24
|
||||
height = 24
|
||||
pixel_x = 2
|
||||
pixel_y = 1
|
||||
framed_offset_x = 4
|
||||
framed_offset_y = 5
|
||||
|
||||
/obj/item/wallframe/painting
|
||||
name = "painting frame"
|
||||
desc = "The perfect showcase for your favorite deathtrap memories."
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
custom_materials = null
|
||||
flags_1 = 0
|
||||
custom_materials = list(/datum/material/wood = 2000)
|
||||
flags_1 = NONE
|
||||
icon_state = "frame-empty"
|
||||
result_path = /obj/structure/sign/painting
|
||||
|
||||
@@ -229,8 +243,13 @@
|
||||
desc = "Art or \"Art\"? You decide."
|
||||
icon = 'icons/obj/decals.dmi'
|
||||
icon_state = "frame-empty"
|
||||
// base_icon_state = "frame"
|
||||
custom_materials = list(/datum/material/wood = 2000)
|
||||
buildable_sign = FALSE
|
||||
var/obj/item/canvas/C
|
||||
///Canvas we're currently displaying.
|
||||
var/obj/item/canvas/current_canvas
|
||||
///Description set when canvas is added.
|
||||
var/desc_with_canvas
|
||||
var/persistence_id
|
||||
|
||||
/obj/structure/sign/painting/Initialize(mapload, dir, building)
|
||||
@@ -242,64 +261,78 @@
|
||||
if(building)
|
||||
pixel_x = (dir & 3)? 0 : (dir == 4 ? -30 : 30)
|
||||
pixel_y = (dir & 3)? (dir ==1 ? -30 : 30) : 0
|
||||
desc = current_canvas ? desc_with_canvas : initial(desc)
|
||||
|
||||
/obj/structure/sign/painting/Destroy()
|
||||
. = ..()
|
||||
SSpersistence.painting_frames -= src
|
||||
|
||||
/obj/structure/sign/painting/attackby(obj/item/I, mob/user, params)
|
||||
if(!C && istype(I, /obj/item/canvas))
|
||||
if(!current_canvas && istype(I, /obj/item/canvas))
|
||||
frame_canvas(user,I)
|
||||
else if(C && !C.painting_name && istype(I,/obj/item/pen))
|
||||
else if(current_canvas && current_canvas.painting_name == initial(current_canvas.painting_name) && istype(I,/obj/item/pen))
|
||||
try_rename(user)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/sign/painting/examine(mob/user)
|
||||
. = ..()
|
||||
if(C)
|
||||
C.ui_interact(user)
|
||||
if(persistence_id)
|
||||
. += "<span class='notice'>Any painting placed here will be archived at the end of the shift.</span>"
|
||||
if(current_canvas)
|
||||
current_canvas.ui_interact(user)
|
||||
. += "<span class='notice'>Use wirecutters to remove the painting.</span>"
|
||||
|
||||
/obj/structure/sign/painting/wirecutter_act(mob/living/user, obj/item/I)
|
||||
. = ..()
|
||||
if(C)
|
||||
C.forceMove(drop_location())
|
||||
C = null
|
||||
if(current_canvas)
|
||||
current_canvas.forceMove(drop_location())
|
||||
current_canvas = null
|
||||
to_chat(user, "<span class='notice'>You remove the painting from the frame.</span>")
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
/obj/structure/sign/painting/proc/frame_canvas(mob/user,obj/item/canvas/new_canvas)
|
||||
if(user.transferItemToLoc(new_canvas,src))
|
||||
C = new_canvas
|
||||
if(!C.finalized)
|
||||
C.finalize(user)
|
||||
to_chat(user,"<span class='notice'>You frame [C].</span>")
|
||||
current_canvas = new_canvas
|
||||
if(!current_canvas.finalized)
|
||||
current_canvas.finalize(user)
|
||||
to_chat(user,"<span class='notice'>You frame [current_canvas].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/structure/sign/painting/proc/try_rename(mob/user)
|
||||
if(!C.painting_name)
|
||||
C.try_rename(user)
|
||||
if(current_canvas.painting_name == initial(current_canvas.painting_name))
|
||||
current_canvas.try_rename(user)
|
||||
|
||||
// /obj/structure/sign/painting/update_name(updates)
|
||||
// name = current_canvas ? "painting - [current_canvas.painting_name]" : initial(name)
|
||||
// return ..()
|
||||
|
||||
// /obj/structure/sign/painting/update_desc(updates)
|
||||
// desc = current_canvas ? desc_with_canvas : initial(desc)
|
||||
// return ..()
|
||||
|
||||
/obj/structure/sign/painting/update_icon_state()
|
||||
. = ..()
|
||||
if(C && C.generated_icon)
|
||||
icon_state = null
|
||||
else
|
||||
// icon_state = "[base_icon_state]-[current_canvas?.generated_icon ? "overlay" : "empty"]"
|
||||
if(current_canvas?.generated_icon)
|
||||
icon_state = "frame-empty"
|
||||
|
||||
else
|
||||
icon_state = null // or "frame-empty"
|
||||
return ..()
|
||||
|
||||
/obj/structure/sign/painting/update_overlays()
|
||||
. = ..()
|
||||
if(C && C.generated_icon)
|
||||
var/mutable_appearance/MA = mutable_appearance(C.generated_icon)
|
||||
MA.pixel_x = C.framed_offset_x
|
||||
MA.pixel_y = C.framed_offset_y
|
||||
. += MA
|
||||
var/mutable_appearance/frame = mutable_appearance(C.icon,"[C.icon_state]frame")
|
||||
frame.pixel_x = C.framed_offset_x - 1
|
||||
frame.pixel_y = C.framed_offset_y - 1
|
||||
. += frame
|
||||
if(!current_canvas?.generated_icon)
|
||||
return
|
||||
|
||||
var/mutable_appearance/MA = mutable_appearance(current_canvas.generated_icon)
|
||||
MA.pixel_x = current_canvas.framed_offset_x
|
||||
MA.pixel_y = current_canvas.framed_offset_y
|
||||
. += MA
|
||||
var/mutable_appearance/frame = mutable_appearance(current_canvas.icon,"[current_canvas.icon_state]frame")
|
||||
frame.pixel_x = current_canvas.framed_offset_x - 1
|
||||
frame.pixel_y = current_canvas.framed_offset_y - 1
|
||||
. += frame
|
||||
|
||||
/obj/structure/sign/painting/proc/load_persistent()
|
||||
if(!persistence_id)
|
||||
@@ -310,6 +343,10 @@
|
||||
var/title = chosen["title"]
|
||||
var/author = chosen["ckey"]
|
||||
var/png = "data/paintings/[persistence_id]/[chosen["md5"]].png"
|
||||
if(!title)
|
||||
title = "Untitled Artwork" //Should prevent NULL named art from loading as NULL, if you're still getting the admin log chances are persistence is broken
|
||||
if(!title)
|
||||
message_admins("<span class='notice'>Painting with NO TITLE loaded on a [persistence_id] frame in [get_area(src)]. Please delete it, it is saved in the database with no name and will create bad assets.</span>")
|
||||
if(!fexists(png))
|
||||
stack_trace("Persistent painting [chosen["md5"]].png was not found in [persistence_id] directory.")
|
||||
return
|
||||
@@ -328,17 +365,20 @@
|
||||
new_canvas.finalized = TRUE
|
||||
new_canvas.painting_name = title
|
||||
new_canvas.author_ckey = author
|
||||
C = new_canvas
|
||||
new_canvas.name = "painting - [title]"
|
||||
current_canvas = new_canvas
|
||||
update_icon()
|
||||
|
||||
/obj/structure/sign/painting/proc/save_persistent()
|
||||
if(!persistence_id || !C)
|
||||
if(!persistence_id || !current_canvas)
|
||||
return
|
||||
if(sanitize_filename(persistence_id) != persistence_id)
|
||||
stack_trace("Invalid persistence_id - [persistence_id]")
|
||||
return
|
||||
var/data = C.get_data_string()
|
||||
var/md5 = md5(data)
|
||||
if(!current_canvas.painting_name)
|
||||
current_canvas.painting_name = "Untitled Artwork"
|
||||
var/data = current_canvas.get_data_string()
|
||||
var/md5 = md5(lowertext(data))
|
||||
var/list/current = SSpersistence.paintings[persistence_id]
|
||||
if(!current)
|
||||
current = list()
|
||||
@@ -347,10 +387,10 @@
|
||||
return
|
||||
var/png_directory = "data/paintings/[persistence_id]/"
|
||||
var/png_path = png_directory + "[md5].png"
|
||||
var/result = rustg_dmi_create_png(png_path,"[C.width]","[C.height]",data)
|
||||
var/result = rustg_dmi_create_png(png_path,"[current_canvas.width]","[current_canvas.height]",data)
|
||||
if(result)
|
||||
CRASH("Error saving persistent painting: [result]")
|
||||
current += list(list("title" = C.painting_name , "md5" = md5, "ckey" = C.author_ckey))
|
||||
current += list(list("title" = current_canvas.painting_name , "md5" = md5, "ckey" = current_canvas.author_ckey))
|
||||
SSpersistence.paintings[persistence_id] = current
|
||||
|
||||
/obj/item/canvas/proc/fill_grid_from_icon(icon/I)
|
||||
@@ -361,12 +401,21 @@
|
||||
|
||||
//Presets for art gallery mapping, for paintings to be shared across stations
|
||||
/obj/structure/sign/painting/library
|
||||
name = "\improper Public Painting Exhibit mounting"
|
||||
desc = "For art pieces hung by the public."
|
||||
desc_with_canvas = "A piece of art (or \"art\"). Anyone could've hung it."
|
||||
persistence_id = "library"
|
||||
|
||||
/obj/structure/sign/painting/library_secure
|
||||
name = "\improper Curated Painting Exhibit mounting"
|
||||
desc = "For masterpieces hand-picked by the curator."
|
||||
desc_with_canvas = "A masterpiece hand-picked by the curator, supposedly."
|
||||
persistence_id = "library_secure"
|
||||
|
||||
/obj/structure/sign/painting/library_private // keep your smut away from prying eyes, or non-librarians at least
|
||||
name = "\improper Private Painting Exhibit mounting"
|
||||
desc = "For art pieces deemed too subversive or too illegal to be shared outside of curators."
|
||||
desc_with_canvas = "A painting hung away from lesser minds."
|
||||
persistence_id = "library_private"
|
||||
|
||||
/obj/structure/sign/painting/vv_get_dropdown()
|
||||
@@ -379,11 +428,11 @@
|
||||
if(!check_rights(NONE))
|
||||
return
|
||||
var/mob/user = usr
|
||||
if(!persistence_id || !C)
|
||||
if(!persistence_id || !current_canvas)
|
||||
to_chat(user,"<span class='warning'>This is not a persistent painting.</span>")
|
||||
return
|
||||
var/md5 = md5(C.get_data_string())
|
||||
var/author = C.author_ckey
|
||||
var/md5 = md5(lowertext(current_canvas.get_data_string()))
|
||||
var/author = current_canvas.author_ckey
|
||||
var/list/current = SSpersistence.paintings[persistence_id]
|
||||
if(current)
|
||||
for(var/list/entry in current)
|
||||
@@ -392,7 +441,8 @@
|
||||
var/png = "data/paintings/[persistence_id]/[md5].png"
|
||||
fdel(png)
|
||||
for(var/obj/structure/sign/painting/P in SSpersistence.painting_frames)
|
||||
if(P.C && md5(P.C.get_data_string()) == md5)
|
||||
QDEL_NULL(P.C)
|
||||
if(P.current_canvas && md5(P.current_canvas.get_data_string()) == md5)
|
||||
QDEL_NULL(P.current_canvas)
|
||||
P.update_icon()
|
||||
log_admin("[key_name(user)] has deleted a persistent painting made by [author].")
|
||||
message_admins("<span class='notice'>[key_name_admin(user)] has deleted persistent painting made by [author].</span>")
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
icon = 'icons/obj/closet.dmi'
|
||||
icon_state = "generic"
|
||||
density = TRUE
|
||||
max_integrity = 200
|
||||
integrity_failure = 0.25
|
||||
armor = list("melee" = 20, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 60)
|
||||
|
||||
var/icon_door = null
|
||||
var/icon_door_override = FALSE //override to have open overlay use icon different to its base's
|
||||
var/secure = FALSE //secure locker or not, also used if overriding a non-secure locker with a secure door overlay to add fancy lights
|
||||
@@ -12,9 +16,6 @@
|
||||
var/locked = FALSE
|
||||
var/large = TRUE
|
||||
var/wall_mounted = 0 //never solid (You can always pass over it)
|
||||
max_integrity = 200
|
||||
integrity_failure = 0.25
|
||||
armor = list("melee" = 20, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 60)
|
||||
var/breakout_time = 1200
|
||||
var/message_cooldown
|
||||
var/can_weld_shut = TRUE
|
||||
@@ -40,12 +41,12 @@
|
||||
var/should_populate_contents = TRUE
|
||||
|
||||
/obj/structure/closet/Initialize(mapload)
|
||||
if(mapload && !opened) // if closed, any item at the crate's loc is put in the contents
|
||||
addtimer(CALLBACK(src, .proc/take_contents), 0)
|
||||
. = ..()
|
||||
update_icon()
|
||||
if(should_populate_contents)
|
||||
PopulateContents()
|
||||
if(mapload && !opened) // if closed, any item at the crate's loc is put in the contents
|
||||
addtimer(CALLBACK(src, .proc/take_contents), 0)
|
||||
if(secure)
|
||||
lockerelectronics = new(src)
|
||||
lockerelectronics.accesses = req_access
|
||||
@@ -60,10 +61,10 @@
|
||||
|
||||
/obj/structure/closet/update_icon()
|
||||
. = ..()
|
||||
if(!opened)
|
||||
layer = OBJ_LAYER
|
||||
else
|
||||
layer = BELOW_OBJ_LAYER
|
||||
if(istype(src, /obj/structure/closet/supplypod))
|
||||
return
|
||||
|
||||
layer = opened ? BELOW_OBJ_LAYER : OBJ_LAYER
|
||||
|
||||
/obj/structure/closet/update_overlays()
|
||||
. = ..()
|
||||
@@ -71,61 +72,57 @@
|
||||
|
||||
/obj/structure/closet/proc/closet_update_overlays(list/new_overlays)
|
||||
. = new_overlays
|
||||
if(!opened)
|
||||
if(icon_door)
|
||||
. += "[icon_door]_door"
|
||||
else
|
||||
. += "[icon_state]_door"
|
||||
if(welded)
|
||||
. += "welded"
|
||||
if(!secure)
|
||||
return
|
||||
if(broken)
|
||||
. += "off"
|
||||
. += "sparking"
|
||||
else if(locked)
|
||||
. += "locked"
|
||||
else
|
||||
. += "unlocked"
|
||||
else
|
||||
if(icon_door_override)
|
||||
. += "[icon_door]_open"
|
||||
else
|
||||
. += "[icon_state]_open"
|
||||
if(opened)
|
||||
. += "[icon_door_override ? icon_door : icon_state]_open"
|
||||
return
|
||||
|
||||
. += "[icon_door || icon_state]_door"
|
||||
if(welded)
|
||||
. += icon_welded
|
||||
|
||||
if(!secure)
|
||||
return
|
||||
if(broken)
|
||||
. += "off"
|
||||
. += "sparking"
|
||||
//Overlay is similar enough for both that we can use the same mask for both
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "locked", EMISSIVE_LAYER, EMISSIVE_PLANE, dir, alpha)
|
||||
. += locked ? "locked" : "unlocked"
|
||||
|
||||
|
||||
/obj/structure/closet/examine(mob/user)
|
||||
. = ..()
|
||||
if(welded)
|
||||
. += "<span class='notice'>It's <b>welded</b> shut.</span>"
|
||||
. += "<span class='notice'>It's welded shut.</span>"
|
||||
if(anchored)
|
||||
. += "<span class='notice'>It is <b>bolted</b> to the ground.</span>"
|
||||
if(opened)
|
||||
. += "<span class='notice'>The parts are <b>welded</b> together.</span>"
|
||||
else if(secure && !opened)
|
||||
. += "<span class='notice'>Alt-click to [locked ? "unlock" : "lock"].</span>"
|
||||
else if(broken)
|
||||
. += "<span class='notice'>The lock is <b>screwed</b> in.</span>"
|
||||
else if(secure)
|
||||
. += "<span class='notice'>Alt-click to [locked ? "unlock" : "lock"].</span>"
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(HAS_TRAIT(L, TRAIT_SKITTISH))
|
||||
. += "<span class='notice'>Ctrl-Shift-click [src] to jump inside.</span>"
|
||||
|
||||
if(isobserver(user))
|
||||
. += "<span class='info'>It contains: [english_list(contents)].</span>"
|
||||
investigate_log("had its contents examined by [user] as a ghost.", INVESTIGATE_GHOST)
|
||||
|
||||
if(HAS_TRAIT(user, TRAIT_SKITTISH))
|
||||
. += "<span class='notice'>If you bump into [p_them()] while running, you will jump inside.</span>"
|
||||
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
|
||||
if(wall_mounted)
|
||||
return TRUE
|
||||
return !density
|
||||
|
||||
/obj/structure/closet/proc/can_open(mob/living/user)
|
||||
/obj/structure/closet/proc/can_open(mob/living/user, force = FALSE)
|
||||
if(force)
|
||||
return TRUE
|
||||
if(welded || locked)
|
||||
return FALSE
|
||||
var/turf/T = get_turf(src)
|
||||
for(var/mob/living/L in T)
|
||||
if(L.move_resist >= MOVE_FORCE_VERY_STRONG || (horizontal && L.mob_size > MOB_SIZE_TINY && L.density))
|
||||
if(L.anchored || L.move_resist >= MOVE_FORCE_VERY_STRONG || (horizontal && L.mob_size > MOB_SIZE_TINY && L.density))
|
||||
if(user)
|
||||
to_chat(user, "<span class='danger'>There's something large on top of [src], preventing it from opening.</span>" )
|
||||
return FALSE
|
||||
@@ -137,44 +134,16 @@
|
||||
if(closet != src && !closet.wall_mounted)
|
||||
return FALSE
|
||||
for(var/mob/living/L in T)
|
||||
if(L.move_resist >= MOVE_FORCE_VERY_STRONG || horizontal && L.mob_size > MOB_SIZE_TINY && L.density)
|
||||
if(L.anchored || L.move_resist >= MOVE_FORCE_VERY_STRONG || (horizontal && L.mob_size > MOB_SIZE_TINY && L.density))
|
||||
if(user)
|
||||
to_chat(user, "<span class='danger'>There's something too large in [src], preventing it from closing.</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/proc/can_lock(mob/living/user, var/check_access = TRUE) //set check_access to FALSE if you only need to check if a locker has a functional lock rather than access
|
||||
if(!secure)
|
||||
return FALSE
|
||||
if(broken)
|
||||
to_chat(user, "<span class='notice'>[src] is broken!</span>")
|
||||
return FALSE
|
||||
if(QDELETED(lockerelectronics) && !locked) //We want to be able to unlock it regardless of electronics, but only lockable with electronics
|
||||
to_chat(user, "<span class='notice'>[src] is missing locker electronics!</span>")
|
||||
return FALSE
|
||||
if(!check_access)
|
||||
return TRUE
|
||||
if(allowed(user))
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>Access denied.</span>")
|
||||
|
||||
/obj/structure/closet/proc/togglelock(mob/living/user)
|
||||
add_fingerprint(user)
|
||||
if(eigen_target)
|
||||
return
|
||||
if(opened)
|
||||
return
|
||||
if(!can_lock(user))
|
||||
return
|
||||
locked = !locked
|
||||
user.visible_message("<span class='notice'>[user] [locked ? null : "un"]locks [src].</span>",
|
||||
"<span class='notice'>You [locked ? null : "un"]lock [src].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/structure/closet/proc/dump_contents(var/override = TRUE) //Override is for not revealing the locker electronics when you open the locker, for example
|
||||
/obj/structure/closet/proc/dump_contents(override = TRUE) //Override is for not revealing the locker electronics when you open the locker, for example
|
||||
var/atom/L = drop_location()
|
||||
for(var/atom/movable/AM in src)
|
||||
if(AM == lockerelectronics && override)
|
||||
if(AM == lockerelectronics && override) // this stops the electronics from being dumped out? huh
|
||||
continue
|
||||
AM.forceMove(L)
|
||||
if(throwing) // you keep some momentum when getting out of a thrown closet
|
||||
@@ -187,18 +156,30 @@
|
||||
for(var/atom/movable/AM in L)
|
||||
if(AM != src && insert(AM) == -1) // limit reached
|
||||
break
|
||||
// for(var/i in reverseRange(L.GetAllContents()))
|
||||
// var/atom/movable/thing = i
|
||||
// SEND_SIGNAL(thing, COMSIG_TRY_STORAGE_HIDE_ALL)
|
||||
|
||||
/obj/structure/closet/proc/open(mob/living/user)
|
||||
if(opened || !can_open(user))
|
||||
/obj/structure/closet/proc/open(mob/living/user, force = FALSE)
|
||||
if(!can_open(user, force))
|
||||
return
|
||||
playsound(loc, open_sound, 15, 1, -3)
|
||||
if(opened)
|
||||
return
|
||||
welded = FALSE
|
||||
locked = FALSE // if you manage to open it, then its not welded/locked, hello?!
|
||||
playsound(loc, open_sound, 15, TRUE, -3)
|
||||
opened = TRUE
|
||||
if(!dense_when_open)
|
||||
density = FALSE
|
||||
climb_time *= 0.5 //it's faster to climb onto an open thing
|
||||
dump_contents()
|
||||
update_icon()
|
||||
return 1
|
||||
after_open(user, force)
|
||||
return TRUE
|
||||
|
||||
///Proc to override for effects after opening a door
|
||||
/obj/structure/closet/proc/after_open(mob/living/user, force = FALSE)
|
||||
return
|
||||
|
||||
/obj/structure/closet/proc/insert(atom/movable/AM)
|
||||
if(contents.len >= storage_capacity)
|
||||
@@ -208,19 +189,19 @@
|
||||
do_teleport(AM, get_turf(eigen_target), 0)
|
||||
if(eigen_target.opened == FALSE)
|
||||
eigen_target.bust_open()
|
||||
else
|
||||
AM.forceMove(src)
|
||||
return TRUE
|
||||
|
||||
AM.forceMove(src)
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
|
||||
/obj/structure/closet/proc/insertion_allowed(atom/movable/AM)
|
||||
if(ismob(AM))
|
||||
if(!isliving(AM)) //let's not put ghosts or camera mobs inside closets...
|
||||
return FALSE
|
||||
var/mob/living/L = AM
|
||||
if(L.move_resist >= MOVE_FORCE_VERY_STRONG || L.buckled || L.incorporeal_move || L.has_buckled_mobs())
|
||||
if(L.anchored || L.move_resist >= MOVE_FORCE_VERY_STRONG || L.buckled || L.incorporeal_move || L.has_buckled_mobs())
|
||||
return FALSE
|
||||
if(L.mob_size > MOB_SIZE_TINY) // Tiny mobs are treated as items.
|
||||
if(horizontal && L.density)
|
||||
@@ -236,13 +217,13 @@
|
||||
else if(istype(AM, /obj/structure/closet))
|
||||
return FALSE
|
||||
|
||||
else if(istype(AM, /obj/effect))
|
||||
else if(iseffect(AM)) // todo: move to atom/movable
|
||||
return FALSE
|
||||
|
||||
else if(isobj(AM))
|
||||
if((!allow_dense && AM.density) || AM.anchored || AM.has_buckled_mobs())
|
||||
return FALSE
|
||||
if(isitem(AM) && !HAS_TRAIT(AM, TRAIT_NODROP))
|
||||
else if(isitem(AM) && !HAS_TRAIT(AM, TRAIT_NODROP))
|
||||
return TRUE
|
||||
else if(!allow_objects && !istype(AM, /obj/effect/dummy/chameleon))
|
||||
return FALSE
|
||||
@@ -255,25 +236,365 @@
|
||||
if(!opened || !can_close(user))
|
||||
return FALSE
|
||||
take_contents()
|
||||
playsound(loc, close_sound, 15, 1, -3)
|
||||
climb_time = initial(climb_time)
|
||||
playsound(loc, close_sound, 15, TRUE, -3)
|
||||
opened = FALSE
|
||||
density = TRUE
|
||||
update_icon()
|
||||
after_close(user)
|
||||
return TRUE
|
||||
|
||||
///Proc to override for effects after closing a door
|
||||
/obj/structure/closet/proc/after_close(mob/living/user)
|
||||
return
|
||||
|
||||
|
||||
/obj/structure/closet/proc/toggle(mob/living/user)
|
||||
if(opened)
|
||||
return close(user)
|
||||
else
|
||||
return open(user)
|
||||
|
||||
|
||||
/obj/structure/closet/deconstruct(disassembled = TRUE)
|
||||
if(ispath(material_drop) && material_drop_amount && !(flags_1 & NODECONSTRUCT_1))
|
||||
new material_drop(loc, material_drop_amount)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/obj_break(damage_flag)
|
||||
if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
bust_open()
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/W, mob/user, params)
|
||||
if(user in src)
|
||||
return
|
||||
if(src.tool_interact(W,user))
|
||||
return 1 // No afterattack
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/proc/tool_interact(obj/item/W, mob/living/user)//returns TRUE if attackBy call shouldn't be continued (because tool was used/closet was of wrong type), FALSE if otherwise
|
||||
. = TRUE
|
||||
if(opened)
|
||||
if(W.tool_behaviour == cutting_tool)
|
||||
// eigen check
|
||||
if(eigen_teleport)
|
||||
to_chat(user, "<span class='notice'>The unstable nature of \the [src] makes it impossible to deconstruct!</span>")
|
||||
return
|
||||
|
||||
if(W.tool_behaviour == TOOL_WELDER)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
|
||||
if(W.use_tool(src, user, 40, volume=50))
|
||||
if(!opened)
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
|
||||
"<span class='notice'>You cut \the [src] apart with \the [W].</span>",
|
||||
"<span class='hear'>You hear welding.</span>")
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
else if(W.tool_behaviour == TOOL_WIRECUTTER)
|
||||
W.use_tool(src, user, 40, volume=50)
|
||||
user.visible_message("<span class='notice'>[user] cut apart \the [src].</span>", \
|
||||
"<span class='notice'>You cut \the [src] apart with \the [W].</span>")
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
W.use_tool(src, user, 40, volume=50)
|
||||
user.visible_message("<span class='notice'>[user] deconstructed \the [src].</span>", \
|
||||
"<span class='notice'>You deconstructed \the [src] with \the [W].</span>")
|
||||
deconstruct(TRUE) //Honestly by this point, if all checks were right and this is the cutting tool, just cut it
|
||||
return
|
||||
if(user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
|
||||
return
|
||||
else if(!opened && user.a_intent == INTENT_HELP)
|
||||
var/item_is_id = W.GetID()
|
||||
if(!item_is_id)
|
||||
if(!open(user))
|
||||
togglelock(user)
|
||||
return
|
||||
return
|
||||
if(item_is_id || !toggle(user))
|
||||
togglelock(user)
|
||||
return
|
||||
else if(W.tool_behaviour == TOOL_WELDER && can_weld_shut)
|
||||
// eigen check
|
||||
if(eigen_teleport)
|
||||
to_chat(user, "<span class='notice'>The unstable nature of \the [src] makes it impossible to deconstruct!</span>")
|
||||
return
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You begin [welded ? "unwelding":"welding"] \the [src]...</span>")
|
||||
if(W.use_tool(src, user, 40, volume=50))
|
||||
if(opened)
|
||||
return
|
||||
welded = !welded
|
||||
after_weld(welded)
|
||||
user.visible_message("<span class='notice'>[user] [welded ? "welds shut" : "unwelded"] \the [src].</span>",
|
||||
"<span class='notice'>You [welded ? "weld" : "unwelded"] \the [src] with \the [W].</span>",
|
||||
"<span class='hear'>You hear welding.</span>")
|
||||
log_game("[key_name(user)] [welded ? "welded":"unwelded"] closet [src] with [W] at [AREACOORD(src)]")
|
||||
update_icon()
|
||||
else if(W.tool_behaviour == TOOL_WRENCH && anchorable)
|
||||
if(isinspace() && !anchored)
|
||||
return
|
||||
set_anchored(!anchored)
|
||||
W.play_tool_sound(src, 75)
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
|
||||
"<span class='notice'>You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
|
||||
"<span class='hear'>You hear a ratchet.</span>")
|
||||
// cit addons
|
||||
else if(istype(W, /obj/item/electronics/airlock))
|
||||
handle_lock_addition(user, W)
|
||||
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
handle_lock_removal(user, W)
|
||||
|
||||
else
|
||||
return FALSE
|
||||
|
||||
/obj/structure/closet/proc/after_weld(weld_state)
|
||||
return
|
||||
|
||||
/obj/structure/closet/MouseDrop_T(atom/movable/O, mob/living/user)
|
||||
if(!istype(O) || O.anchored || istype(O, /obj/screen))
|
||||
return
|
||||
if(!istype(user) || user.incapacitated() || user.lying)
|
||||
return
|
||||
if(!Adjacent(user) || !user.Adjacent(O))
|
||||
return
|
||||
if(user == O) //try to climb onto it
|
||||
return ..()
|
||||
if(!opened)
|
||||
return
|
||||
if(!isturf(O.loc))
|
||||
return
|
||||
|
||||
var/actuallyismob = 0
|
||||
if(isliving(O))
|
||||
actuallyismob = 1
|
||||
else if(!isitem(O))
|
||||
return
|
||||
var/turf/T = get_turf(src)
|
||||
var/list/targets = list(O, src)
|
||||
add_fingerprint(user)
|
||||
user.visible_message("<span class='warning'>[user] [actuallyismob ? "tries to ":""]stuff [O] into [src].</span>", \
|
||||
"<span class='warning'>You [actuallyismob ? "try to ":""]stuff [O] into [src].</span>", \
|
||||
"<span class='hear'>You hear clanging.</span>")
|
||||
if(actuallyismob)
|
||||
if(do_after_mob(user, targets, 40))
|
||||
user.visible_message("<span class='notice'>[user] stuffs [O] into [src].</span>", \
|
||||
"<span class='notice'>You stuff [O] into [src].</span>", \
|
||||
"<span class='hear'>You hear a loud metal bang.</span>")
|
||||
var/mob/living/L = O
|
||||
if(!issilicon(L))
|
||||
L.DefaultCombatKnockdown(40)
|
||||
if(istype(src, /obj/structure/closet/supplypod/extractionpod))
|
||||
O.forceMove(src)
|
||||
else
|
||||
O.forceMove(T)
|
||||
close()
|
||||
else
|
||||
O.forceMove(T)
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/relaymove(mob/living/user, direction)
|
||||
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
|
||||
container_resist(user)
|
||||
|
||||
/obj/structure/closet/on_attack_hand(mob/user)
|
||||
if(user.lying && get_dist(src, user) > 0)
|
||||
return
|
||||
|
||||
if(!toggle(user))
|
||||
togglelock(user)
|
||||
|
||||
|
||||
/obj/structure/closet/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/closet/attack_robot(mob/user)
|
||||
if(user.Adjacent(src))
|
||||
return attack_hand(user)
|
||||
|
||||
// tk grab then use on self
|
||||
/obj/structure/closet/attack_self_tk(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/closet/verb/verb_toggleopen()
|
||||
set src in view(1)
|
||||
set category = "Object"
|
||||
set name = "Toggle Open"
|
||||
|
||||
if(!usr.canUseTopic(src, BE_CLOSE) || !isturf(loc))
|
||||
return
|
||||
|
||||
if(iscarbon(usr) || issilicon(usr) || isdrone(usr))
|
||||
return toggle(usr)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
|
||||
|
||||
// Objects that try to exit a locker by stepping were doing so successfully,
|
||||
// and due to an oversight in turf/Enter() were going through walls. That
|
||||
// should be independently resolved, but this is also an interesting twist.
|
||||
/obj/structure/closet/Exit(atom/movable/AM)
|
||||
open()
|
||||
if(AM.loc == src)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/container_resist(mob/living/user)
|
||||
if(opened)
|
||||
return
|
||||
if(ismovable(loc))
|
||||
// user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
// user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
var/atom/movable/AM = loc
|
||||
AM.relay_container_resist(user, src)
|
||||
return
|
||||
if(!welded && !locked)
|
||||
open()
|
||||
return
|
||||
|
||||
//okay, so the closet is either welded or locked... resist!!!
|
||||
// user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
// user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message("<span class='warning'>[src] begins to shake violently!</span>", \
|
||||
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='hear'>You hear banging from [src].</span>")
|
||||
if(do_after(user,(breakout_time), target = src, required_mobility_flags = MOBILITY_RESIST))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded) )
|
||||
return
|
||||
//we check after a while whether there is a point of resisting anymore and whether the user is capable of resisting
|
||||
user.visible_message("<span class='danger'>[user] successfully broke out of [src]!</span>",
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
bust_open()
|
||||
else
|
||||
if(user.loc == src) //so we don't get the message if we resisted multiple times and succeeded.
|
||||
to_chat(user, "<span class='warning'>You fail to break out of [src]!</span>")
|
||||
|
||||
/obj/structure/closet/proc/bust_open()
|
||||
welded = FALSE //applies to all lockers
|
||||
locked = FALSE //applies to critter crates and secure lockers only
|
||||
broken = TRUE //applies to secure lockers only
|
||||
open()
|
||||
|
||||
/obj/structure/closet/AltClick(mob/user)
|
||||
..()
|
||||
if(!user.canUseTopic(src, BE_CLOSE) || !isturf(loc))
|
||||
return
|
||||
if(opened || !secure)
|
||||
return
|
||||
else
|
||||
togglelock(user)
|
||||
|
||||
/obj/structure/closet/proc/togglelock(mob/living/user, silent)
|
||||
if(secure && !broken)
|
||||
if(allowed(user))
|
||||
if(iscarbon(user))
|
||||
add_fingerprint(user)
|
||||
locked = !locked
|
||||
user.visible_message("<span class='notice'>[user] [locked ? null : "un"]locks [src].</span>",
|
||||
"<span class='notice'>You [locked ? null : "un"]lock [src].</span>")
|
||||
update_icon()
|
||||
else if(!silent)
|
||||
to_chat(user, "<span class='alert'>Access Denied.</span>")
|
||||
else if(secure && broken)
|
||||
to_chat(user, "<span class='warning'>\The [src] is broken!</span>")
|
||||
|
||||
/obj/structure/closet/CtrlShiftClick(mob/living/user)
|
||||
if(!HAS_TRAIT(user, TRAIT_SKITTISH))
|
||||
return ..()
|
||||
if(!user.canUseTopic(src) || !isturf(user.loc) || !user.Adjacent(src) || !user.CanReach(src))
|
||||
return
|
||||
dive_into(user)
|
||||
|
||||
/obj/structure/closet/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(!secure || broken)
|
||||
return
|
||||
if(user)
|
||||
user.visible_message("<span class='warning'>Sparks fly from [src]!</span>",
|
||||
"<span class='warning'>You scramble [src]'s lock, breaking it open!</span>",
|
||||
"<span class='hear'>You hear a faint electrical spark.</span>")
|
||||
playsound(src, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
broken = TRUE
|
||||
locked = FALSE
|
||||
if(!QDELETED(lockerelectronics))
|
||||
QDEL_NULL(lockerelectronics)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/closet/get_remote_view_fullscreens(mob/user)
|
||||
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
|
||||
|
||||
/obj/structure/closet/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if (!(. & EMP_PROTECT_CONTENTS))
|
||||
for(var/obj/O in src)
|
||||
O.emp_act(severity)
|
||||
if(secure && !broken && !(. & EMP_PROTECT_SELF))
|
||||
if(prob(50 / severity))
|
||||
locked = !locked
|
||||
update_icon()
|
||||
if(prob(20 / severity) && !opened)
|
||||
if(!locked)
|
||||
open()
|
||||
else
|
||||
req_access = list()
|
||||
req_access += pick(get_all_accesses())
|
||||
if(!QDELETED(lockerelectronics))
|
||||
lockerelectronics.accesses = req_access
|
||||
|
||||
/obj/structure/closet/contents_explosion(severity, target)
|
||||
for(var/atom/A in contents)
|
||||
A.ex_act(severity, target)
|
||||
CHECK_TICK
|
||||
|
||||
/obj/structure/closet/singularity_act()
|
||||
dump_contents()
|
||||
..()
|
||||
|
||||
/obj/structure/closet/AllowDrop()
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/structure/closet/return_temperature()
|
||||
return
|
||||
|
||||
/obj/structure/closet/proc/dive_into(mob/living/user)
|
||||
var/turf/T1 = get_turf(user)
|
||||
var/turf/T2 = get_turf(src)
|
||||
if(!opened)
|
||||
if(locked)
|
||||
togglelock(user, TRUE)
|
||||
if(!open(user))
|
||||
to_chat(user, "<span class='warning'>It won't budge!</span>")
|
||||
return
|
||||
step_towards(user, T2)
|
||||
T1 = get_turf(user)
|
||||
if(T1 == T2)
|
||||
user.set_resting(TRUE, TRUE)
|
||||
if(!close(user))
|
||||
to_chat(user, "<span class='warning'>You can't get [src] to close!</span>")
|
||||
user.set_resting(FALSE, TRUE)
|
||||
return
|
||||
user.set_resting(FALSE, TRUE)
|
||||
togglelock(user)
|
||||
T1.visible_message("<span class='warning'>[user] dives into [src]!</span>")
|
||||
|
||||
/obj/structure/closet/canReachInto(atom/user, atom/target, list/next, view_only, obj/item/tool)
|
||||
return (user in src)
|
||||
|
||||
/// cit specific ///
|
||||
|
||||
/obj/structure/closet/proc/handle_lock_addition(mob/user, obj/item/electronics/airlock/E)
|
||||
add_fingerprint(user)
|
||||
if(lock_in_use)
|
||||
@@ -336,294 +657,17 @@
|
||||
update_icon()
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/structure/closet/deconstruct(disassembled = TRUE)
|
||||
if(ispath(material_drop) && material_drop_amount && !(flags_1 & NODECONSTRUCT_1))
|
||||
new material_drop(loc, material_drop_amount)
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/closet/obj_break(damage_flag)
|
||||
if(!broken && !(flags_1 & NODECONSTRUCT_1))
|
||||
bust_open()
|
||||
|
||||
/obj/structure/closet/attackby(obj/item/W, mob/user, params)
|
||||
if(user in src)
|
||||
return
|
||||
if(src.tool_interact(W,user))
|
||||
return 1 // No afterattack
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/proc/tool_interact(obj/item/W, mob/user)//returns TRUE if attackBy call shouldnt be continued (because tool was used/closet was of wrong type), FALSE if otherwise
|
||||
. = TRUE
|
||||
if(opened)
|
||||
if(istype(W, cutting_tool))
|
||||
var/welder = FALSE
|
||||
if(W.tool_behaviour == TOOL_WELDER)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You begin [welder ? "slicing" : "deconstructing"] \the [src] apart...</span>")
|
||||
welder = TRUE
|
||||
if(W.use_tool(src, user, 40, volume=50))
|
||||
if(eigen_teleport)
|
||||
to_chat(user, "<span class='notice'>The unstable nature of \the [src] makes it impossible to [welder ? "slice" : "deconstruct"]!</span>")
|
||||
return
|
||||
if(!opened)
|
||||
return
|
||||
user.visible_message("<span class='notice'>[user] [welder ? "slice" : "deconstruct"]s apart \the [src].</span>",
|
||||
"<span class='notice'>You [welder ? "slice" : "deconstruct"] \the [src] apart with \the [W].</span>",
|
||||
"<span class='italics'>You hear [welder ? "welding" : "rustling of screws and metal"].</span>")
|
||||
deconstruct(TRUE)
|
||||
return
|
||||
if(user.a_intent != INTENT_HARM && user.transferItemToLoc(W, drop_location())) // so we put in unlit welder too
|
||||
return TRUE
|
||||
else if(istype(W, /obj/item/electronics/airlock))
|
||||
handle_lock_addition(user, W)
|
||||
else if(W.tool_behaviour == TOOL_SCREWDRIVER)
|
||||
handle_lock_removal(user, W)
|
||||
else if(W.tool_behaviour == TOOL_WELDER && can_weld_shut)
|
||||
if(!W.tool_start_check(user, amount=0))
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You begin [welded ? "unwelding":"welding"] \the [src]...</span>")
|
||||
if(W.use_tool(src, user, 40, volume=50))
|
||||
if(eigen_teleport)
|
||||
to_chat(user, "<span class='notice'>The unstable nature of \the [src] makes it impossible to weld!</span>")
|
||||
return
|
||||
if(opened)
|
||||
return
|
||||
welded = !welded
|
||||
after_weld(welded)
|
||||
user.visible_message("<span class='notice'>[user] [welded ? "welds shut" : "unwelds"] \the [src].</span>",
|
||||
"<span class='notice'>You [welded ? "weld" : "unwelded"] \the [src] with \the [W].</span>",
|
||||
"<span class='italics'>You hear welding.</span>")
|
||||
update_icon()
|
||||
else if(W.tool_behaviour == TOOL_WRENCH && anchorable)
|
||||
if(isinspace() && !anchored)
|
||||
return
|
||||
setAnchored(!anchored)
|
||||
W.play_tool_sound(src, 75)
|
||||
user.visible_message("<span class='notice'>[user] [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
|
||||
"<span class='notice'>You [anchored ? "anchored" : "unanchored"] \the [src] [anchored ? "to" : "from"] the ground.</span>", \
|
||||
"<span class='italics'>You hear a ratchet.</span>")
|
||||
else if(user.a_intent != INTENT_HARM && !(W.item_flags & NOBLUDGEON))
|
||||
if(W.GetID() || !toggle(user))
|
||||
togglelock(user)
|
||||
else
|
||||
/obj/structure/closet/proc/can_lock(mob/living/user, var/check_access = TRUE) //set check_access to FALSE if you only need to check if a locker has a functional lock rather than access
|
||||
if(!secure)
|
||||
return FALSE
|
||||
|
||||
/obj/structure/closet/proc/after_weld(weld_state)
|
||||
return
|
||||
|
||||
/obj/structure/closet/MouseDrop_T(atom/movable/O, mob/living/user)
|
||||
if(!istype(O) || O.anchored || istype(O, /obj/screen))
|
||||
return
|
||||
if(!istype(user) || user.incapacitated() || user.lying)
|
||||
return
|
||||
if(!Adjacent(user) || !user.Adjacent(O))
|
||||
return
|
||||
if(user == O) //try to climb onto it
|
||||
return ..()
|
||||
if(!opened)
|
||||
return
|
||||
if(!isturf(O.loc))
|
||||
return
|
||||
|
||||
var/actuallyismob = 0
|
||||
if(isliving(O))
|
||||
actuallyismob = 1
|
||||
else if(!isitem(O))
|
||||
return
|
||||
var/turf/T = get_turf(src)
|
||||
var/list/targets = list(O, src)
|
||||
add_fingerprint(user)
|
||||
user.visible_message("<span class='warning'>[user] [actuallyismob ? "tries to ":""]stuff [O] into [src].</span>", \
|
||||
"<span class='warning'>You [actuallyismob ? "try to ":""]stuff [O] into [src].</span>", \
|
||||
"<span class='italics'>You hear clanging.</span>")
|
||||
if(actuallyismob)
|
||||
if(do_after_mob(user, targets, 40))
|
||||
user.visible_message("<span class='notice'>[user] stuffs [O] into [src].</span>", \
|
||||
"<span class='notice'>You stuff [O] into [src].</span>", \
|
||||
"<span class='italics'>You hear a loud metal bang.</span>")
|
||||
var/mob/living/L = O
|
||||
if(!issilicon(L))
|
||||
L.DefaultCombatKnockdown(40)
|
||||
if(istype(src, /obj/structure/closet/supplypod/extractionpod))
|
||||
O.forceMove(src)
|
||||
else
|
||||
O.forceMove(T)
|
||||
close()
|
||||
else
|
||||
O.forceMove(T)
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/relaymove(mob/user)
|
||||
if(user.stat || !isturf(loc) || !isliving(user))
|
||||
return
|
||||
if(locked || welded)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
return
|
||||
container_resist(user)
|
||||
|
||||
/obj/structure/closet/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
if(user.lying && get_dist(src, user) > 0)
|
||||
return
|
||||
|
||||
if(!toggle(user))
|
||||
togglelock(user)
|
||||
|
||||
/obj/structure/closet/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/closet/attack_robot(mob/user)
|
||||
if(user.Adjacent(src))
|
||||
return attack_hand(user)
|
||||
|
||||
// tk grab then use on self
|
||||
/obj/structure/closet/attack_self_tk(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/structure/closet/verb/verb_toggleopen()
|
||||
set src in oview(1)
|
||||
set category = "Object"
|
||||
set name = "Toggle Open"
|
||||
|
||||
var/mob/living/L = usr
|
||||
if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
|
||||
if(broken)
|
||||
to_chat(user, "<span class='notice'>[src] is broken!</span>")
|
||||
return FALSE
|
||||
|
||||
if(iscarbon(usr) || issilicon(usr) || isdrone(usr))
|
||||
return attack_hand(usr)
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>This mob type can't use this verb.</span>")
|
||||
|
||||
// Objects that try to exit a locker by stepping were doing so successfully,
|
||||
// and due to an oversight in turf/Enter() were going through walls. That
|
||||
// should be independently resolved, but this is also an interesting twist.
|
||||
/obj/structure/closet/Exit(atom/movable/AM)
|
||||
open()
|
||||
if(AM.loc == src)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/structure/closet/container_resist(mob/living/user)
|
||||
if(opened)
|
||||
return
|
||||
if(ismovable(loc))
|
||||
var/atom/movable/AM = loc
|
||||
AM.relay_container_resist(user, src)
|
||||
return
|
||||
if(!welded && !locked)
|
||||
open()
|
||||
return
|
||||
|
||||
//okay, so the closet is either welded or locked... resist!!!
|
||||
user.visible_message("<span class='warning'>[src] begins to shake violently!</span>", \
|
||||
"<span class='notice'>You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear banging from [src].</span>")
|
||||
if(do_after(user,(breakout_time), target = src, required_mobility_flags = MOBILITY_RESIST))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded) )
|
||||
return
|
||||
//we check after a while whether there is a point of resisting anymore and whether the user is capable of resisting
|
||||
user.visible_message("<span class='danger'>[user] successfully broke out of [src]!</span>",
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
bust_open()
|
||||
else
|
||||
if(user.loc == src) //so we don't get the message if we resisted multiple times and succeeded.
|
||||
to_chat(user, "<span class='warning'>You fail to break out of [src]!</span>")
|
||||
|
||||
/obj/structure/closet/AltClick(mob/user)
|
||||
. = ..()
|
||||
if(!user.canUseTopic(src, be_close=TRUE) || !isturf(loc))
|
||||
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
|
||||
if(QDELETED(lockerelectronics) && !locked) //We want to be able to unlock it regardless of electronics, but only lockable with electronics
|
||||
to_chat(user, "<span class='notice'>[src] is missing locker electronics!</span>")
|
||||
return FALSE
|
||||
if(!check_access)
|
||||
return TRUE
|
||||
togglelock(user)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/CtrlShiftClick(mob/living/user)
|
||||
if(!HAS_TRAIT(user, TRAIT_SKITTISH))
|
||||
return ..()
|
||||
if(!user.canUseTopic(src) || !isturf(user.loc) || !user.Adjacent(src) || !user.CanReach(src))
|
||||
return
|
||||
dive_into(user)
|
||||
|
||||
/obj/structure/closet/emag_act(mob/user)
|
||||
. = ..()
|
||||
if(!secure || broken)
|
||||
return
|
||||
user.visible_message("<span class='warning'>Sparks fly from [src]!</span>",
|
||||
"<span class='warning'>You scramble [src]'s lock, breaking it open!</span>",
|
||||
"<span class='italics'>You hear a faint electrical spark.</span>")
|
||||
playsound(src, "sparks", 50, 1)
|
||||
broken = TRUE
|
||||
locked = FALSE
|
||||
if(!QDELETED(lockerelectronics))
|
||||
QDEL_NULL(lockerelectronics)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/closet/get_remote_view_fullscreens(mob/user)
|
||||
if(user.stat == DEAD || !(user.sight & (SEEOBJS|SEEMOBS)))
|
||||
user.overlay_fullscreen("remote_view", /obj/screen/fullscreen/impaired, 1)
|
||||
|
||||
/obj/structure/closet/emp_act(severity)
|
||||
. = ..()
|
||||
if(. & EMP_PROTECT_SELF)
|
||||
return
|
||||
if (!(. & EMP_PROTECT_CONTENTS))
|
||||
for(var/obj/O in src)
|
||||
O.emp_act(severity)
|
||||
if(!secure || broken)
|
||||
return ..()
|
||||
if(prob(severity/2))
|
||||
locked = !locked
|
||||
update_icon()
|
||||
if(prob(severity/5) && !opened)
|
||||
if(!locked)
|
||||
open()
|
||||
else
|
||||
req_access = list()
|
||||
req_access += pick(get_all_accesses())
|
||||
if(!QDELETED(lockerelectronics))
|
||||
lockerelectronics.accesses = req_access
|
||||
|
||||
/obj/structure/closet/contents_explosion(severity, target)
|
||||
for(var/atom/A in contents)
|
||||
A.ex_act(severity, target)
|
||||
CHECK_TICK
|
||||
|
||||
/obj/structure/closet/singularity_act()
|
||||
dump_contents()
|
||||
..()
|
||||
|
||||
/obj/structure/closet/AllowDrop()
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/structure/closet/return_temperature()
|
||||
return
|
||||
|
||||
/obj/structure/closet/proc/dive_into(mob/living/user)
|
||||
var/turf/T1 = get_turf(user)
|
||||
var/turf/T2 = get_turf(src)
|
||||
if(!opened)
|
||||
if(locked)
|
||||
togglelock(user, TRUE)
|
||||
if(!open(user))
|
||||
to_chat(user, "<span class='warning'>It won't budge!</span>")
|
||||
return
|
||||
step_towards(user, T2)
|
||||
T1 = get_turf(user)
|
||||
if(T1 == T2)
|
||||
user.set_resting(TRUE, TRUE)
|
||||
if(!close(user))
|
||||
to_chat(user, "<span class='warning'>You can't get [src] to close!</span>")
|
||||
user.set_resting(FALSE, TRUE)
|
||||
return
|
||||
user.set_resting(FALSE, TRUE)
|
||||
togglelock(user)
|
||||
T1.visible_message("<span class='warning'>[user] dives into [src]!</span>")
|
||||
|
||||
/obj/structure/closet/canReachInto(atom/user, atom/target, list/next, view_only, obj/item/tool)
|
||||
return ..() && opened
|
||||
if(allowed(user))
|
||||
return TRUE
|
||||
to_chat(user, "<span class='notice'>Access denied.</span>")
|
||||
|
||||
@@ -19,3 +19,50 @@
|
||||
desc = "A sturdier card-locked storage unit used for bulky shipments."
|
||||
max_integrity = 500 // Same as crates.
|
||||
melee_min_damage = 25 // Idem.
|
||||
|
||||
/obj/structure/closet/secure_closet/goodies/owned
|
||||
name = "private locker"
|
||||
desc = "A locker designed to only open for who purchased its contents."
|
||||
///Account of the person buying the crate if private purchasing.
|
||||
var/datum/bank_account/buyer_account
|
||||
///Department of the person buying the crate if buying via the NIRN app.
|
||||
var/datum/bank_account/department/department_account
|
||||
///Is the secure crate opened or closed?
|
||||
var/privacy_lock = TRUE
|
||||
///Is the crate being bought by a person, or a budget card?
|
||||
var/department_purchase = FALSE
|
||||
|
||||
/obj/structure/closet/secure_closet/goodies/owned/examine(mob/user)
|
||||
. = ..()
|
||||
. += "<span class='notice'>It's locked with a privacy lock, and can only be unlocked by the buyer's ID.</span>"
|
||||
|
||||
/obj/structure/closet/secure_closet/goodies/owned/Initialize(mapload, datum/bank_account/_buyer_account)
|
||||
. = ..()
|
||||
buyer_account = _buyer_account
|
||||
if(istype(buyer_account, /datum/bank_account/department))
|
||||
department_purchase = TRUE
|
||||
department_account = buyer_account
|
||||
|
||||
/obj/structure/closet/secure_closet/goodies/owned/togglelock(mob/living/user, silent)
|
||||
if(privacy_lock)
|
||||
if(!broken)
|
||||
var/obj/item/card/id/id_card = user.get_idcard(TRUE)
|
||||
if(id_card)
|
||||
if(id_card.registered_account)
|
||||
if(id_card.registered_account == buyer_account || (department_purchase && (id_card.registered_account?.account_job?.paycheck_department) == (department_account.department_id)))
|
||||
if(iscarbon(user))
|
||||
add_fingerprint(user)
|
||||
locked = !locked
|
||||
user.visible_message("<span class='notice'>[user] unlocks [src]'s privacy lock.</span>",
|
||||
"<span class='notice'>You unlock [src]'s privacy lock.</span>")
|
||||
privacy_lock = FALSE
|
||||
update_icon()
|
||||
else if(!silent)
|
||||
to_chat(user, "<span class='notice'>Bank account does not match with buyer!</span>")
|
||||
else if(!silent)
|
||||
to_chat(user, "<span class='notice'>No linked bank account detected!</span>")
|
||||
else if(!silent)
|
||||
to_chat(user, "<span class='notice'>No ID detected!</span>")
|
||||
else if(!silent)
|
||||
to_chat(user, "<span class='warning'>[src] is broken!</span>")
|
||||
else ..()
|
||||
|
||||
@@ -17,10 +17,13 @@
|
||||
material_drop_amount = 5
|
||||
var/obj/item/paper/fluff/jobs/cargo/manifest/manifest
|
||||
|
||||
/obj/structure/closet/crate/New()
|
||||
..()
|
||||
/obj/structure/closet/crate/Initialize()
|
||||
. = ..()
|
||||
if(icon_state == "[initial(icon_state)]open")
|
||||
opened = TRUE
|
||||
// AddElement(/datum/element/climbable, climb_time = crate_climb_time * 0.5, climb_stun = 0)
|
||||
// else
|
||||
// AddElement(/datum/element/climbable, climb_time = crate_climb_time, climb_stun = 0)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/closet/crate/CanPass(atom/movable/mover, turf/target)
|
||||
@@ -46,21 +49,16 @@
|
||||
if(manifest)
|
||||
tear_manifest(user)
|
||||
|
||||
/obj/structure/closet/crate/tool_interact(obj/item/W, mob/user)
|
||||
if(W.tool_behaviour == TOOL_WIRECUTTER && manifest)
|
||||
tear_manifest(user)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/structure/closet/crate/open(mob/living/user)
|
||||
/obj/structure/closet/crate/open(mob/living/user, force = FALSE)
|
||||
. = ..()
|
||||
if(. && manifest)
|
||||
to_chat(user, "<span class='notice'>The manifest is torn off [src].</span>")
|
||||
playsound(src, 'sound/items/poster_ripped.ogg', 75, 1)
|
||||
playsound(src, 'sound/items/poster_ripped.ogg', 75, TRUE)
|
||||
manifest.forceMove(get_turf(src))
|
||||
manifest = null
|
||||
update_icon()
|
||||
|
||||
// cit specific
|
||||
/obj/structure/closet/crate/handle_lock_addition()
|
||||
return
|
||||
|
||||
@@ -69,7 +67,7 @@
|
||||
|
||||
/obj/structure/closet/crate/proc/tear_manifest(mob/user)
|
||||
to_chat(user, "<span class='notice'>You tear the manifest off of [src].</span>")
|
||||
playsound(src, 'sound/items/poster_ripped.ogg', 75, 1)
|
||||
playsound(src, 'sound/items/poster_ripped.ogg', 75, TRUE)
|
||||
|
||||
manifest.forceMove(loc)
|
||||
if(ishuman(user))
|
||||
|
||||
@@ -80,16 +80,25 @@
|
||||
name = "private crate"
|
||||
desc = "A crate cover designed to only open for who purchased its contents."
|
||||
icon_state = "privatecrate"
|
||||
///Account of the person buying the crate if private purchasing.
|
||||
var/datum/bank_account/buyer_account
|
||||
///Department of the person buying the crate if buying via the NIRN app.
|
||||
var/datum/bank_account/department/department_account
|
||||
///Is the secure crate opened or closed?
|
||||
var/privacy_lock = TRUE
|
||||
///Is the crate being bought by a person, or a budget card?
|
||||
var/department_purchase = FALSE
|
||||
|
||||
/obj/structure/closet/crate/secure/owned/examine(mob/user)
|
||||
. = ..()
|
||||
to_chat(user, "<span class='notice'>It's locked with a privacy lock, and can only be unlocked by the buyer's ID.</span>")
|
||||
. += "<span class='notice'>It's locked with a privacy lock, and can only be unlocked by the buyer's ID.</span>"
|
||||
|
||||
/obj/structure/closet/crate/secure/owned/Initialize(mapload, datum/bank_account/_buyer_account)
|
||||
. = ..()
|
||||
buyer_account = _buyer_account
|
||||
if(istype(buyer_account, /datum/bank_account/department))
|
||||
department_purchase = TRUE
|
||||
department_account = buyer_account
|
||||
|
||||
/obj/structure/closet/crate/secure/owned/togglelock(mob/living/user, silent)
|
||||
if(privacy_lock)
|
||||
@@ -97,7 +106,7 @@
|
||||
var/obj/item/card/id/id_card = user.get_idcard(TRUE)
|
||||
if(id_card)
|
||||
if(id_card.registered_account)
|
||||
if(id_card.registered_account == buyer_account)
|
||||
if(id_card.registered_account == buyer_account || (department_purchase && (id_card.registered_account?.account_job?.paycheck_department) == (department_account.department_id)))
|
||||
if(iscarbon(user))
|
||||
add_fingerprint(user)
|
||||
locked = !locked
|
||||
|
||||
@@ -73,9 +73,14 @@
|
||||
icon_state = "breaker_drop"
|
||||
|
||||
/obj/structure/femur_breaker/proc/damage_leg(mob/living/carbon/human/H)
|
||||
H.emote("scream")
|
||||
H.apply_damage(150, BRUTE, pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG))
|
||||
H.adjustBruteLoss(rand(5,20) + (max(0, H.health))) //Make absolutely sure they end up in crit, so that they can succumb if they wish.
|
||||
var/where_we_snappin_boys = pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG)
|
||||
H.emote("scream")
|
||||
H.apply_damage(150, BRUTE, where_we_snappin_boys)
|
||||
var/obj/item/bodypart/cracka = H.get_bodypart(where_we_snappin_boys)
|
||||
if(cracka)
|
||||
var/datum/wound/blunt/critical/cracka_lackin = new
|
||||
cracka_lackin.apply_wound(cracka)
|
||||
H.adjustBruteLoss(rand(5,20) + (max(0, H.health))) //Make absolutely sure they end up in crit, so that they can succumb if they wish.
|
||||
|
||||
/obj/structure/femur_breaker/proc/raise_slat()
|
||||
slat_status = BREAKER_SLAT_RAISED
|
||||
|
||||
@@ -590,7 +590,7 @@
|
||||
|
||||
/obj/effect/mob_spawn/human/pirate
|
||||
name = "space pirate sleeper"
|
||||
desc = "A cryo sleeper smelling faintly of rum."
|
||||
desc = "A cryo sleeper smelling faintly of rum. The sleeper looks unstable. <i>Perhaps the pirate within can be killed with the right tools...</i>"
|
||||
job_description = "Space Pirate"
|
||||
random = TRUE
|
||||
icon = 'icons/obj/machines/sleeper.dmi'
|
||||
@@ -608,6 +608,54 @@
|
||||
assignedrole = "Space Pirate"
|
||||
var/rank = "Mate"
|
||||
|
||||
/obj/effect/mob_spawn/human/pirate/on_attack_hand(mob/living/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(user.mind.has_antag_datum(/datum/antagonist/pirate))
|
||||
to_chat(user, "<span class='notice'>Your shipmate sails within their dreams for now. Perhaps they may wake up eventually.</span>")
|
||||
else
|
||||
to_chat(user, "<span class='notice'>If you want to kill the pirate off, something to pry open the sleeper might be the best way to do it.</span>")
|
||||
|
||||
|
||||
/obj/effect/mob_spawn/human/pirate/attackby(obj/item/W, mob/user, params)
|
||||
if(W.tool_behaviour == TOOL_CROWBAR && user.a_intent != INTENT_HARM)
|
||||
if(user.mind.has_antag_datum(/datum/antagonist/pirate))
|
||||
to_chat(user,"<span class='warning'>Why would you want to do that to your shipmate? That'd kill them.</span>")
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] start to pry open [src]...</span>",
|
||||
"<span class='notice'>You start to pry open [src]...</span>",
|
||||
"<span class='italics'>You hear prying...</span>")
|
||||
W.play_tool_sound(src)
|
||||
if(do_after(user, 100*W.toolspeed, target = src))
|
||||
user.visible_message("<span class='warning'>[user] pries open [src], disrupting the sleep of the pirate within and killing them.</span>",
|
||||
"<span class='notice'>You pry open [src], disrupting the sleep of the pirate within and killing them.</span>",
|
||||
"<span class='italics'>You hear prying, followed by the death rattling of bones.</span>")
|
||||
log_game("[key_name(user)] has successfully pried open [src] and disabled a space pirate spawner.")
|
||||
W.play_tool_sound(src)
|
||||
playsound(src.loc, 'modular_citadel/sound/voice/scream_skeleton.ogg', 50, 1, 4, 1.2)
|
||||
if(rank == "Captain")
|
||||
new /obj/effect/mob_spawn/human/pirate/corpse/captain(get_turf(src))
|
||||
else
|
||||
new /obj/effect/mob_spawn/human/pirate/corpse(get_turf(src))
|
||||
qdel(src)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/effect/mob_spawn/human/pirate/corpse //occurs when someone pries a pirate out of their sleeper.
|
||||
mob_name = "Dead Space Pirate"
|
||||
death = TRUE
|
||||
instant = TRUE
|
||||
random = FALSE
|
||||
|
||||
/obj/effect/mob_spawn/human/pirate/corpse/Destroy()
|
||||
return ..()
|
||||
|
||||
/obj/effect/mob_spawn/human/pirate/corpse/captain
|
||||
rank = "Captain"
|
||||
mob_name = "Dead Space Pirate Captain"
|
||||
outfit = /datum/outfit/pirate/space/captain
|
||||
|
||||
/obj/effect/mob_spawn/human/pirate/special(mob/living/new_spawn)
|
||||
new_spawn.fully_replace_character_name(new_spawn.real_name,generate_pirate_name())
|
||||
new_spawn.mind.add_antag_datum(/datum/antagonist/pirate)
|
||||
@@ -662,6 +710,72 @@
|
||||
to_chat(M,"<span class='notice'>You're once again longer hearing deadchat.</span>")
|
||||
|
||||
|
||||
/datum/action/disguise
|
||||
name = "Disguise"
|
||||
button_icon_state = "ling_transform"
|
||||
icon_icon = 'icons/mob/actions/actions_changeling.dmi'
|
||||
background_icon_state = "bg_mime"
|
||||
var/currently_disguised = FALSE
|
||||
var/static/list/mob_blacklist = typecacheof(list(
|
||||
/mob/living/simple_animal/pet,
|
||||
/mob/living/simple_animal/hostile/retaliate/goose,
|
||||
/mob/living/simple_animal/hostile/poison,
|
||||
/mob/living/simple_animal/hostile/retaliate/goat,
|
||||
/mob/living/simple_animal/cow,
|
||||
/mob/living/simple_animal/chick,
|
||||
/mob/living/simple_animal/chicken,
|
||||
/mob/living/simple_animal/kiwi,
|
||||
/mob/living/simple_animal/babyKiwi,
|
||||
/mob/living/simple_animal/deer,
|
||||
/mob/living/simple_animal/parrot,
|
||||
/mob/living/simple_animal/hostile/lizard,
|
||||
/mob/living/simple_animal/crab,
|
||||
/mob/living/simple_animal/cockroach,
|
||||
/mob/living/simple_animal/butterfly,
|
||||
/mob/living/simple_animal/mouse,
|
||||
/mob/living/simple_animal/sloth,
|
||||
/mob/living/simple_animal/opossum,
|
||||
/mob/living/simple_animal/hostile/bear,
|
||||
/mob/living/simple_animal/hostile/asteroid/polarbear,
|
||||
/mob/living/simple_animal/hostile/asteroid/wolf,
|
||||
/mob/living/carbon/monkey,
|
||||
/mob/living/simple_animal/hostile/gorilla,
|
||||
/mob/living/carbon/alien/larva,
|
||||
/mob/living/simple_animal/hostile/retaliate/frog
|
||||
))
|
||||
|
||||
|
||||
/datum/action/disguise/Trigger()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
if(!currently_disguised)
|
||||
var/user_object_type = input(H, "Disguising as OBJECT or MOB?") as null|anything in list("OBJECT", "MOB")
|
||||
if(user_object_type)
|
||||
var/search_term = stripped_input(H, "Enter the search term")
|
||||
if(search_term)
|
||||
var/list_to_search
|
||||
if(user_object_type == "MOB")
|
||||
list_to_search = subtypesof(/mob) - mob_blacklist
|
||||
else
|
||||
list_to_search = subtypesof(/obj)
|
||||
var/list/filtered_results = list()
|
||||
for(var/some_search_item in list_to_search)
|
||||
if(findtext("[some_search_item]", search_term))
|
||||
filtered_results += some_search_item
|
||||
if(!length(filtered_results))
|
||||
to_chat(H, "Nothing matched your search query!")
|
||||
else
|
||||
var/disguise_selection = input("Select item to disguise as") as null|anything in filtered_results
|
||||
if(disguise_selection)
|
||||
var/atom/disguise_item = disguise_selection
|
||||
var/image/I = image(icon = initial(disguise_item.icon), icon_state = initial(disguise_item.icon_state), loc = H)
|
||||
I.override = TRUE
|
||||
I.layer = ABOVE_MOB_LAYER
|
||||
H.add_alt_appearance(/datum/atom_hud/alternate_appearance/basic/everyone, "ghost_cafe_disguise", I)
|
||||
currently_disguised = TRUE
|
||||
else
|
||||
H.remove_alt_appearance("ghost_cafe_disguise")
|
||||
currently_disguised = FALSE
|
||||
|
||||
/obj/effect/mob_spawn/human/ghostcafe/special(mob/living/carbon/human/new_spawn)
|
||||
if(new_spawn.client)
|
||||
new_spawn.client.prefs.copy_to(new_spawn)
|
||||
@@ -676,10 +790,11 @@
|
||||
ADD_TRAIT(new_spawn, TRAIT_SIXTHSENSE, GHOSTROLE_TRAIT)
|
||||
ADD_TRAIT(new_spawn, TRAIT_EXEMPT_HEALTH_EVENTS, GHOSTROLE_TRAIT)
|
||||
ADD_TRAIT(new_spawn, TRAIT_NO_MIDROUND_ANTAG, GHOSTROLE_TRAIT) //The mob can't be made into a random antag, they are still eligible for ghost roles popups.
|
||||
ADD_TRAIT(new_spawn, TRAIT_PACIFISM, GHOSTROLE_TRAIT)
|
||||
to_chat(new_spawn,"<span class='boldwarning'>Ghosting is free!</span>")
|
||||
var/datum/action/toggle_dead_chat_mob/D = new(new_spawn)
|
||||
D.Grant(new_spawn)
|
||||
var/datum/action/disguise/disguise_action = new(new_spawn)
|
||||
disguise_action.Grant(new_spawn)
|
||||
|
||||
/datum/outfit/ghostcafe
|
||||
name = "ID, jumpsuit and shoes"
|
||||
|
||||
@@ -199,8 +199,7 @@
|
||||
return TRUE
|
||||
|
||||
/obj/item/gun_control/attack(mob/living/M, mob/living/user)
|
||||
M.lastattacker = user.real_name
|
||||
M.lastattackerckey = user.ckey
|
||||
M.set_last_attacker(user)
|
||||
M.attacked_by(src, user)
|
||||
add_fingerprint(user)
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#define STAIR_TERMINATOR_YES 2
|
||||
|
||||
// dir determines the direction of travel to go upwards (due to lack of sprites, currently only 1 and 2 make sense)
|
||||
// stairs require /turf/open/transparent/openspace as the tile above them to work
|
||||
// stairs require /turf/open/openspace as the tile above them to work
|
||||
// multiple stair objects can be chained together; the Z level transition will happen on the final stair object in the chain
|
||||
|
||||
/obj/structure/stairs
|
||||
@@ -12,7 +12,7 @@
|
||||
icon_state = "stairs"
|
||||
anchored = TRUE
|
||||
|
||||
var/force_open_above = FALSE // replaces the turf above this stair obj with /turf/open/transparent/openspace
|
||||
var/force_open_above = FALSE // replaces the turf above this stair obj with /turf/open/openspace
|
||||
var/terminator_mode = STAIR_TERMINATOR_AUTOMATIC
|
||||
var/turf/listeningTo
|
||||
|
||||
@@ -107,23 +107,23 @@
|
||||
/obj/structure/stairs/proc/build_signal_listener()
|
||||
if(listeningTo)
|
||||
UnregisterSignal(listeningTo, COMSIG_TURF_MULTIZ_NEW)
|
||||
var/turf/open/transparent/openspace/T = get_step_multiz(get_turf(src), UP)
|
||||
var/turf/open/openspace/T = get_step_multiz(get_turf(src), UP)
|
||||
RegisterSignal(T, COMSIG_TURF_MULTIZ_NEW, .proc/on_multiz_new)
|
||||
listeningTo = T
|
||||
|
||||
/obj/structure/stairs/proc/force_open_above()
|
||||
var/turf/open/transparent/openspace/T = get_step_multiz(get_turf(src), UP)
|
||||
var/turf/open/openspace/T = get_step_multiz(get_turf(src), UP)
|
||||
if(T && !istype(T))
|
||||
T.ChangeTurf(/turf/open/transparent/openspace, flags = CHANGETURF_INHERIT_AIR)
|
||||
T.ChangeTurf(/turf/open/openspace, flags = CHANGETURF_INHERIT_AIR)
|
||||
|
||||
/obj/structure/stairs/proc/on_multiz_new(turf/source, dir)
|
||||
//SIGNAL_HANDLER
|
||||
SHOULD_NOT_SLEEP(TRUE) //the same thing.
|
||||
|
||||
if(dir == UP)
|
||||
var/turf/open/transparent/openspace/T = get_step_multiz(get_turf(src), UP)
|
||||
var/turf/open/openspace/T = get_step_multiz(get_turf(src), UP)
|
||||
if(T && !istype(T))
|
||||
T.ChangeTurf(/turf/open/transparent/openspace, flags = CHANGETURF_INHERIT_AIR)
|
||||
T.ChangeTurf(/turf/open/openspace, flags = CHANGETURF_INHERIT_AIR)
|
||||
|
||||
/obj/structure/stairs/intercept_zImpact(atom/movable/AM, levels = 1)
|
||||
. = ..()
|
||||
|
||||
@@ -93,6 +93,9 @@
|
||||
user.stop_pulling()
|
||||
return ..()
|
||||
|
||||
/obj/structure/table/attack_robot(mob/user)
|
||||
on_attack_hand(user)
|
||||
|
||||
/obj/structure/table/attack_tk()
|
||||
return FALSE
|
||||
|
||||
|
||||
@@ -67,6 +67,9 @@
|
||||
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
|
||||
update_icon()
|
||||
|
||||
/obj/structure/tank_dispenser/attack_robot(mob/user)
|
||||
return _try_interact(user)
|
||||
|
||||
/obj/structure/tank_dispenser/ui_state(mob/user)
|
||||
return GLOB.physical_state
|
||||
|
||||
|
||||
@@ -554,7 +554,7 @@
|
||||
if(B.cell)
|
||||
if(B.cell.charge > 0 && B.turned_on)
|
||||
flick("baton_active", src)
|
||||
var/stunforce = B.stamforce
|
||||
var/stunforce = B.stamina_loss_amount
|
||||
user.DefaultCombatKnockdown(stunforce * 2)
|
||||
user.stuttering = stunforce/20
|
||||
B.deductcharge(B.hitcost)
|
||||
|
||||
Reference in New Issue
Block a user