Merge remote-tracking branch 'citadel/master' into mobility_flags

This commit is contained in:
kevinz000
2020-01-16 21:12:56 -07:00
1616 changed files with 214985 additions and 211224 deletions
+329 -329
View File
@@ -1,329 +1,329 @@
/obj/structure/AIcore
density = TRUE
anchored = FALSE
name = "\improper AI core"
icon = 'icons/mob/ai.dmi'
icon_state = "0"
desc = "The framework for an artificial intelligence core."
max_integrity = 500
var/state = 0
var/datum/ai_laws/laws
var/obj/item/circuitboard/circuit = null
var/obj/item/mmi/brain = null
var/can_deconstruct = TRUE
/obj/structure/AIcore/Initialize()
. = ..()
laws = new
laws.set_laws_config()
/obj/structure/AIcore/Destroy()
if(circuit)
qdel(circuit)
circuit = null
if(brain)
qdel(brain)
brain = null
return ..()
/obj/structure/AIcore/latejoin_inactive
name = "Networked AI core"
desc = "This AI core is connected by bluespace transmitters to NTNet, allowing for an AI personality to be downloaded to it on the fly mid-shift."
can_deconstruct = FALSE
icon_state = "ai-empty"
anchored = TRUE
state = AI_READY_CORE
var/available = TRUE
var/safety_checks = TRUE
var/active = TRUE
/obj/structure/AIcore/latejoin_inactive/examine(mob/user)
. = ..()
. += "Its transmitter seems to be [active? "on" : "off"]."
/obj/structure/AIcore/latejoin_inactive/proc/is_available() //If people still manage to use this feature to spawn-kill AI latejoins ahelp them.
if(!available)
return FALSE
if(!safety_checks)
return TRUE
if(!active)
return FALSE
var/turf/T = get_turf(src)
var/area/A = get_area(src)
if(!A.blob_allowed)
return FALSE
if(!A.power_equip)
return FALSE
if(!SSmapping.level_trait(T.z,ZTRAIT_STATION))
return FALSE
if(!istype(T, /turf/open/floor))
return FALSE
return TRUE
/obj/structure/AIcore/latejoin_inactive/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/multitool))
active = !active
to_chat(user, "You [active? "activate" : "deactivate"] [src]'s transmitters.")
return
return ..()
/obj/structure/AIcore/latejoin_inactive/Initialize()
. = ..()
GLOB.latejoin_ai_cores += src
/obj/structure/AIcore/latejoin_inactive/Destroy()
GLOB.latejoin_ai_cores -= src
return ..()
/obj/structure/AIcore/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/wrench))
return default_unfasten_wrench(user, P, 20)
if(!anchored)
if(istype(P, /obj/item/weldingtool) && can_deconstruct)
if(state != EMPTY_CORE)
to_chat(user, "<span class='warning'>The core must be empty to deconstruct it!</span>")
return
if(!P.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You start to deconstruct the frame...</span>")
if(P.use_tool(src, user, 20, volume=50) && state == EMPTY_CORE)
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
deconstruct(TRUE)
return
else
switch(state)
if(EMPTY_CORE)
if(istype(P, /obj/item/circuitboard/aicore))
if(!user.transferItemToLoc(P, src))
return
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You place the circuit board inside the frame.</span>")
update_icon()
state = CIRCUIT_CORE
circuit = P
return
if(CIRCUIT_CORE)
if(istype(P, /obj/item/screwdriver))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You screw the circuit board into place.</span>")
state = SCREWED_CORE
update_icon()
return
if(istype(P, /obj/item/crowbar))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
state = EMPTY_CORE
update_icon()
circuit.forceMove(loc)
circuit = null
return
if(SCREWED_CORE)
if(istype(P, /obj/item/screwdriver) && circuit)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
state = CIRCUIT_CORE
update_icon()
return
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = P
if(C.get_amount() >= 5)
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start to add cables to the frame...</span>")
if(do_after(user, 20, target = src) && state == SCREWED_CORE && C.use(5))
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
state = CABLED_CORE
update_icon()
else
to_chat(user, "<span class='warning'>You need five lengths of cable to wire the AI core!</span>")
return
if(CABLED_CORE)
if(istype(P, /obj/item/wirecutters))
if(brain)
to_chat(user, "<span class='warning'>Get that [brain.name] out of there first!</span>")
else
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the cables.</span>")
state = SCREWED_CORE
update_icon()
new /obj/item/stack/cable_coil(drop_location(), 5)
return
if(istype(P, /obj/item/stack/sheet/rglass))
var/obj/item/stack/sheet/rglass/G = P
if(G.get_amount() >= 2)
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start to put in the glass panel...</span>")
if(do_after(user, 20, target = src) && state == CABLED_CORE && G.use(2))
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
state = GLASS_CORE
update_icon()
else
to_chat(user, "<span class='warning'>You need two sheets of reinforced glass to insert them into the AI core!</span>")
return
if(istype(P, /obj/item/aiModule))
if(brain && brain.laws.id != DEFAULT_AI_LAWID)
to_chat(user, "<span class='warning'>The installed [brain.name] already has set laws!</span>")
return
var/obj/item/aiModule/module = P
module.install(laws, user)
return
if(istype(P, /obj/item/mmi) && !brain)
var/obj/item/mmi/M = P
if(!M.brainmob)
to_chat(user, "<span class='warning'>Sticking an empty [M.name] into the frame would sort of defeat the purpose!</span>")
return
if(M.brainmob.stat == DEAD)
to_chat(user, "<span class='warning'>Sticking a dead [M.name] into the frame would sort of defeat the purpose!</span>")
return
if(!M.brainmob.client)
to_chat(user, "<span class='warning'>Sticking an inactive [M.name] into the frame would sort of defeat the purpose.</span>")
return
if(!CONFIG_GET(flag/allow_ai) || (jobban_isbanned(M.brainmob, "AI") && !QDELETED(src) && !QDELETED(user) && !QDELETED(M) && !QDELETED(user) && Adjacent(user)))
if(!QDELETED(M))
to_chat(user, "<span class='warning'>This [M.name] does not seem to fit!</span>")
return
if(!M.brainmob.mind)
to_chat(user, "<span class='warning'>This [M.name] is mindless!</span>")
return
if(!user.transferItemToLoc(M,src))
return
brain = M
to_chat(user, "<span class='notice'>You add [M.name] to the frame.</span>")
update_icon()
return
if(istype(P, /obj/item/crowbar) && brain)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the brain.</span>")
brain.forceMove(loc)
brain = null
update_icon()
return
if(GLASS_CORE)
if(istype(P, /obj/item/crowbar))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
state = CABLED_CORE
update_icon()
new /obj/item/stack/sheet/rglass(loc, 2)
return
if(istype(P, /obj/item/screwdriver))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
if(brain)
SSticker.mode.remove_antag_for_borging(brain.brainmob.mind)
if(!istype(brain.laws, /datum/ai_laws/ratvar))
remove_servant_of_ratvar(brain.brainmob, TRUE)
var/mob/living/silicon/ai/A = null
if (brain.overrides_aicore_laws)
A = new /mob/living/silicon/ai(loc, brain.laws, brain.brainmob)
else
A = new /mob/living/silicon/ai(loc, laws, brain.brainmob)
if(brain.force_replace_ai_name)
A.fully_replace_character_name(A.name, brain.replacement_ai_name())
SSblackbox.record_feedback("amount", "ais_created", 1)
qdel(src)
else
state = AI_READY_CORE
update_icon()
return
if(AI_READY_CORE)
if(istype(P, /obj/item/aicard))
P.transfer_ai("INACTIVE", "AICARD", src, user)
return
if(istype(P, /obj/item/screwdriver))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You disconnect the monitor.</span>")
state = GLASS_CORE
update_icon()
return
return ..()
/obj/structure/AIcore/update_icon()
switch(state)
if(EMPTY_CORE)
icon_state = "0"
if(CIRCUIT_CORE)
icon_state = "1"
if(SCREWED_CORE)
icon_state = "2"
if(CABLED_CORE)
if(brain)
icon_state = "3b"
else
icon_state = "3"
if(GLASS_CORE)
icon_state = "4"
if(AI_READY_CORE)
icon_state = "ai-empty"
/obj/structure/AIcore/deconstruct(disassembled = TRUE)
if(state == GLASS_CORE)
new /obj/item/stack/sheet/rglass(loc, 2)
if(state >= CABLED_CORE)
new /obj/item/stack/cable_coil(loc, 5)
if(circuit)
circuit.forceMove(loc)
circuit = null
new /obj/item/stack/sheet/plasteel(loc, 4)
qdel(src)
/obj/structure/AIcore/deactivated
name = "inactive AI"
icon_state = "ai-empty"
anchored = TRUE
state = AI_READY_CORE
/obj/structure/AIcore/deactivated/New()
..()
circuit = new(src)
/*
This is a good place for AI-related object verbs so I'm sticking it here.
If adding stuff to this, don't forget that an AI need to cancel_camera() whenever it physically moves to a different location.
That prevents a few funky behaviors.
*/
//The type of interaction, the player performing the operation, the AI itself, and the card object, if any.
/atom/proc/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card)
if(istype(card))
if(card.flush)
to_chat(user, "<span class='boldannounce'>ERROR</span>: AI flush is in progress, cannot execute transfer protocol.")
return 0
return 1
/obj/structure/AIcore/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card)
if(state != AI_READY_CORE || !..())
return
//Transferring a carded AI to a core.
if(interaction == AI_TRANS_FROM_CARD)
AI.control_disabled = 0
AI.radio_enabled = 1
AI.forceMove(loc) // to replace the terminal.
to_chat(AI, "You have been uploaded to a stationary terminal. Remote device connection restored.")
to_chat(user, "<span class='boldnotice'>Transfer successful</span>: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.")
card.AI = null
qdel(src)
else //If for some reason you use an empty card on an empty AI terminal.
to_chat(user, "There is no AI loaded on this terminal!")
/obj/item/circuitboard/aicore
name = "AI core (AI Core Board)" //Well, duh, but best to be consistent
/obj/structure/AIcore
density = TRUE
anchored = FALSE
name = "\improper AI core"
icon = 'icons/mob/ai.dmi'
icon_state = "0"
desc = "The framework for an artificial intelligence core."
max_integrity = 500
var/state = 0
var/datum/ai_laws/laws
var/obj/item/circuitboard/circuit = null
var/obj/item/mmi/brain = null
var/can_deconstruct = TRUE
/obj/structure/AIcore/Initialize()
. = ..()
laws = new
laws.set_laws_config()
/obj/structure/AIcore/Destroy()
if(circuit)
qdel(circuit)
circuit = null
if(brain)
qdel(brain)
brain = null
return ..()
/obj/structure/AIcore/latejoin_inactive
name = "Networked AI core"
desc = "This AI core is connected by bluespace transmitters to NTNet, allowing for an AI personality to be downloaded to it on the fly mid-shift."
can_deconstruct = FALSE
icon_state = "ai-empty"
anchored = TRUE
state = AI_READY_CORE
var/available = TRUE
var/safety_checks = TRUE
var/active = TRUE
/obj/structure/AIcore/latejoin_inactive/examine(mob/user)
. = ..()
. += "Its transmitter seems to be [active? "on" : "off"]."
/obj/structure/AIcore/latejoin_inactive/proc/is_available() //If people still manage to use this feature to spawn-kill AI latejoins ahelp them.
if(!available)
return FALSE
if(!safety_checks)
return TRUE
if(!active)
return FALSE
var/turf/T = get_turf(src)
var/area/A = get_area(src)
if(!A.blob_allowed)
return FALSE
if(!A.power_equip)
return FALSE
if(!SSmapping.level_trait(T.z,ZTRAIT_STATION))
return FALSE
if(!istype(T, /turf/open/floor))
return FALSE
return TRUE
/obj/structure/AIcore/latejoin_inactive/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/multitool))
active = !active
to_chat(user, "You [active? "activate" : "deactivate"] [src]'s transmitters.")
return
return ..()
/obj/structure/AIcore/latejoin_inactive/Initialize()
. = ..()
GLOB.latejoin_ai_cores += src
/obj/structure/AIcore/latejoin_inactive/Destroy()
GLOB.latejoin_ai_cores -= src
return ..()
/obj/structure/AIcore/attackby(obj/item/P, mob/user, params)
if(istype(P, /obj/item/wrench))
return default_unfasten_wrench(user, P, 20)
if(!anchored)
if(istype(P, /obj/item/weldingtool) && can_deconstruct)
if(state != EMPTY_CORE)
to_chat(user, "<span class='warning'>The core must be empty to deconstruct it!</span>")
return
if(!P.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You start to deconstruct the frame...</span>")
if(P.use_tool(src, user, 20, volume=50) && state == EMPTY_CORE)
to_chat(user, "<span class='notice'>You deconstruct the frame.</span>")
deconstruct(TRUE)
return
else
switch(state)
if(EMPTY_CORE)
if(istype(P, /obj/item/circuitboard/aicore))
if(!user.transferItemToLoc(P, src))
return
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You place the circuit board inside the frame.</span>")
update_icon()
state = CIRCUIT_CORE
circuit = P
return
if(CIRCUIT_CORE)
if(istype(P, /obj/item/screwdriver))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You screw the circuit board into place.</span>")
state = SCREWED_CORE
update_icon()
return
if(istype(P, /obj/item/crowbar))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the circuit board.</span>")
state = EMPTY_CORE
update_icon()
circuit.forceMove(loc)
circuit = null
return
if(SCREWED_CORE)
if(istype(P, /obj/item/screwdriver) && circuit)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You unfasten the circuit board.</span>")
state = CIRCUIT_CORE
update_icon()
return
if(istype(P, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = P
if(C.get_amount() >= 5)
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start to add cables to the frame...</span>")
if(do_after(user, 20, target = src) && state == SCREWED_CORE && C.use(5))
to_chat(user, "<span class='notice'>You add cables to the frame.</span>")
state = CABLED_CORE
update_icon()
else
to_chat(user, "<span class='warning'>You need five lengths of cable to wire the AI core!</span>")
return
if(CABLED_CORE)
if(istype(P, /obj/item/wirecutters))
if(brain)
to_chat(user, "<span class='warning'>Get that [brain.name] out of there first!</span>")
else
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the cables.</span>")
state = SCREWED_CORE
update_icon()
new /obj/item/stack/cable_coil(drop_location(), 5)
return
if(istype(P, /obj/item/stack/sheet/rglass))
var/obj/item/stack/sheet/rglass/G = P
if(G.get_amount() >= 2)
playsound(loc, 'sound/items/deconstruct.ogg', 50, 1)
to_chat(user, "<span class='notice'>You start to put in the glass panel...</span>")
if(do_after(user, 20, target = src) && state == CABLED_CORE && G.use(2))
to_chat(user, "<span class='notice'>You put in the glass panel.</span>")
state = GLASS_CORE
update_icon()
else
to_chat(user, "<span class='warning'>You need two sheets of reinforced glass to insert them into the AI core!</span>")
return
if(istype(P, /obj/item/aiModule))
if(brain && brain.laws.id != DEFAULT_AI_LAWID)
to_chat(user, "<span class='warning'>The installed [brain.name] already has set laws!</span>")
return
var/obj/item/aiModule/module = P
module.install(laws, user)
return
if(istype(P, /obj/item/mmi) && !brain)
var/obj/item/mmi/M = P
if(!M.brainmob)
to_chat(user, "<span class='warning'>Sticking an empty [M.name] into the frame would sort of defeat the purpose!</span>")
return
if(M.brainmob.stat == DEAD)
to_chat(user, "<span class='warning'>Sticking a dead [M.name] into the frame would sort of defeat the purpose!</span>")
return
if(!M.brainmob.client)
to_chat(user, "<span class='warning'>Sticking an inactive [M.name] into the frame would sort of defeat the purpose.</span>")
return
if(!CONFIG_GET(flag/allow_ai) || (jobban_isbanned(M.brainmob, "AI") && !QDELETED(src) && !QDELETED(user) && !QDELETED(M) && !QDELETED(user) && Adjacent(user)))
if(!QDELETED(M))
to_chat(user, "<span class='warning'>This [M.name] does not seem to fit!</span>")
return
if(!M.brainmob.mind)
to_chat(user, "<span class='warning'>This [M.name] is mindless!</span>")
return
if(!user.transferItemToLoc(M,src))
return
brain = M
to_chat(user, "<span class='notice'>You add [M.name] to the frame.</span>")
update_icon()
return
if(istype(P, /obj/item/crowbar) && brain)
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the brain.</span>")
brain.forceMove(loc)
brain = null
update_icon()
return
if(GLASS_CORE)
if(istype(P, /obj/item/crowbar))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You remove the glass panel.</span>")
state = CABLED_CORE
update_icon()
new /obj/item/stack/sheet/rglass(loc, 2)
return
if(istype(P, /obj/item/screwdriver))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You connect the monitor.</span>")
if(brain)
SSticker.mode.remove_antag_for_borging(brain.brainmob.mind)
if(!istype(brain.laws, /datum/ai_laws/ratvar))
remove_servant_of_ratvar(brain.brainmob, TRUE)
var/mob/living/silicon/ai/A = null
if (brain.overrides_aicore_laws)
A = new /mob/living/silicon/ai(loc, brain.laws, brain.brainmob)
else
A = new /mob/living/silicon/ai(loc, laws, brain.brainmob)
if(brain.force_replace_ai_name)
A.fully_replace_character_name(A.name, brain.replacement_ai_name())
SSblackbox.record_feedback("amount", "ais_created", 1)
qdel(src)
else
state = AI_READY_CORE
update_icon()
return
if(AI_READY_CORE)
if(istype(P, /obj/item/aicard))
P.transfer_ai("INACTIVE", "AICARD", src, user)
return
if(istype(P, /obj/item/screwdriver))
P.play_tool_sound(src)
to_chat(user, "<span class='notice'>You disconnect the monitor.</span>")
state = GLASS_CORE
update_icon()
return
return ..()
/obj/structure/AIcore/update_icon()
switch(state)
if(EMPTY_CORE)
icon_state = "0"
if(CIRCUIT_CORE)
icon_state = "1"
if(SCREWED_CORE)
icon_state = "2"
if(CABLED_CORE)
if(brain)
icon_state = "3b"
else
icon_state = "3"
if(GLASS_CORE)
icon_state = "4"
if(AI_READY_CORE)
icon_state = "ai-empty"
/obj/structure/AIcore/deconstruct(disassembled = TRUE)
if(state == GLASS_CORE)
new /obj/item/stack/sheet/rglass(loc, 2)
if(state >= CABLED_CORE)
new /obj/item/stack/cable_coil(loc, 5)
if(circuit)
circuit.forceMove(loc)
circuit = null
new /obj/item/stack/sheet/plasteel(loc, 4)
qdel(src)
/obj/structure/AIcore/deactivated
name = "inactive AI"
icon_state = "ai-empty"
anchored = TRUE
state = AI_READY_CORE
/obj/structure/AIcore/deactivated/New()
..()
circuit = new(src)
/*
This is a good place for AI-related object verbs so I'm sticking it here.
If adding stuff to this, don't forget that an AI need to cancel_camera() whenever it physically moves to a different location.
That prevents a few funky behaviors.
*/
//The type of interaction, the player performing the operation, the AI itself, and the card object, if any.
/atom/proc/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card)
if(istype(card))
if(card.flush)
to_chat(user, "<span class='boldannounce'>ERROR</span>: AI flush is in progress, cannot execute transfer protocol.")
return 0
return 1
/obj/structure/AIcore/transfer_ai(interaction, mob/user, mob/living/silicon/ai/AI, obj/item/aicard/card)
if(state != AI_READY_CORE || !..())
return
//Transferring a carded AI to a core.
if(interaction == AI_TRANS_FROM_CARD)
AI.control_disabled = 0
AI.radio_enabled = 1
AI.forceMove(loc) // to replace the terminal.
to_chat(AI, "You have been uploaded to a stationary terminal. Remote device connection restored.")
to_chat(user, "<span class='boldnotice'>Transfer successful</span>: [AI.name] ([rand(1000,9999)].exe) installed and executed successfully. Local copy has been removed.")
card.AI = null
qdel(src)
else //If for some reason you use an empty card on an empty AI terminal.
to_chat(user, "There is no AI loaded on this terminal!")
/obj/item/circuitboard/aicore
name = "AI core (AI Core Board)" //Well, duh, but best to be consistent
@@ -88,6 +88,28 @@
else
return ..()
/obj/structure/chair/alt_attack_hand(mob/living/user)
if(Adjacent(user) && istype(user))
if(!item_chair || !user.can_hold_items() || !has_buckled_mobs() || buckled_mobs.len > 1 || dir != user.dir || flags_1 & NODECONSTRUCT_1)
return TRUE
if(!user.canUseTopic(src, BE_CLOSE, ismonkey(user)))
to_chat(user, "<span class='warning'>You can't do that right now!</span>")
return TRUE
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)
to_chat(user, "<span class='warning'>You're too exhausted for that.</span>")
return TRUE
var/mob/living/poordude = buckled_mobs[1]
if(!istype(poordude))
return TRUE
user.visible_message("<span class='notice'>[user] pulls [src] out from under [poordude].</span>", "<span class='notice'>You pull [src] out from under [poordude].</span>")
var/C = new item_chair(loc)
user.put_in_hands(C)
poordude.Knockdown(20)//rip in peace
user.adjustStaminaLoss(5)
unbuckle_all_mobs(TRUE)
qdel(src)
return TRUE
/obj/structure/chair/attack_tk(mob/user)
if(!anchored || has_buckled_mobs() || !isturf(user.loc))
..()
+398 -398
View File
@@ -1,399 +1,399 @@
/*
CONTAINS:
BEDSHEETS
LINEN BINS
*/
/obj/item/bedsheet
name = "bedsheet"
desc = "A surprisingly soft linen bedsheet."
icon = 'icons/obj/bedsheets.dmi'
icon_state = "sheetwhite"
item_state = "bedsheet"
slot_flags = ITEM_SLOT_NECK
layer = MOB_LAYER
throwforce = 0
throw_speed = 1
throw_range = 2
w_class = WEIGHT_CLASS_TINY
item_color = "white"
resistance_flags = FLAMMABLE
dog_fashion = /datum/dog_fashion/head/ghost
var/list/dream_messages = list("white")
/obj/item/bedsheet/attack(mob/living/M, mob/user)
if(!attempt_initiate_surgery(src, M, user))
..()
/obj/item/bedsheet/attack_self(mob/user)
if(!user.CanReach(src)) //No telekenetic grabbing.
return
if(!user.dropItemToGround(src))
return
if(layer == initial(layer))
layer = ABOVE_MOB_LAYER
to_chat(user, "<span class='notice'>You cover yourself with [src].</span>")
else
layer = initial(layer)
to_chat(user, "<span class='notice'>You smooth [src] out beneath you.</span>")
add_fingerprint(user)
return
/obj/item/bedsheet/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wirecutters) || I.get_sharpness())
var/obj/item/stack/sheet/cloth/C = new (get_turf(src), 3)
transfer_fingerprints_to(C)
C.add_fingerprint(user)
qdel(src)
to_chat(user, "<span class='notice'>You tear [src] up.</span>")
else
return ..()
/obj/item/bedsheet/blue
icon_state = "sheetblue"
item_color = "blue"
dream_messages = list("blue")
/obj/item/bedsheet/green
icon_state = "sheetgreen"
item_color = "green"
dream_messages = list("green")
/obj/item/bedsheet/grey
icon_state = "sheetgrey"
item_color = "grey"
dream_messages = list("grey")
/obj/item/bedsheet/orange
icon_state = "sheetorange"
item_color = "orange"
dream_messages = list("orange")
/obj/item/bedsheet/purple
icon_state = "sheetpurple"
item_color = "purple"
dream_messages = list("purple")
/obj/item/bedsheet/patriot
name = "patriotic bedsheet"
desc = "You've never felt more free than when sleeping on this."
icon_state = "sheetUSA"
item_color = "sheetUSA"
dream_messages = list("America", "freedom", "fireworks", "bald eagles")
/obj/item/bedsheet/rainbow
name = "rainbow bedsheet"
desc = "A multicolored blanket. It's actually several different sheets cut up and sewn together."
icon_state = "sheetrainbow"
item_color = "rainbow"
dream_messages = list("red", "orange", "yellow", "green", "blue", "purple", "a rainbow")
/obj/item/bedsheet/red
icon_state = "sheetred"
item_color = "red"
dream_messages = list("red")
/obj/item/bedsheet/yellow
icon_state = "sheetyellow"
item_color = "yellow"
dream_messages = list("yellow")
/obj/item/bedsheet/mime
name = "mime's blanket"
desc = "A very soothing striped blanket. All the noise just seems to fade out when you're under the covers in this."
icon_state = "sheetmime"
item_color = "mime"
dream_messages = list("silence", "gestures", "a pale face", "a gaping mouth", "the mime")
/obj/item/bedsheet/clown
name = "clown's blanket"
desc = "A rainbow blanket with a clown mask woven in. It smells faintly of bananas."
icon_state = "sheetclown"
item_color = "clown"
dream_messages = list("honk", "laughter", "a prank", "a joke", "a smiling face", "the clown")
/obj/item/bedsheet/captain
name = "captain's bedsheet"
desc = "It has a Nanotrasen symbol on it, and was woven with a revolutionary new kind of thread guaranteed to have 0.01% permeability for most non-chemical substances, popular among most modern captains."
icon_state = "sheetcaptain"
item_color = "captain"
dream_messages = list("authority", "a golden ID", "sunglasses", "a green disc", "an antique gun", "the captain")
/obj/item/bedsheet/rd
name = "research director's bedsheet"
desc = "It appears to have a beaker emblem, and is made out of fire-resistant material, although it probably won't protect you in the event of fires you're familiar with every day."
icon_state = "sheetrd"
item_color = "director"
dream_messages = list("authority", "a silvery ID", "a bomb", "a mech", "a facehugger", "maniacal laughter", "the research director")
// for Free Golems.
/obj/item/bedsheet/rd/royal_cape
name = "Royal Cape of the Liberator"
desc = "Majestic."
dream_messages = list("mining", "stone", "a golem", "freedom", "doing whatever")
/obj/item/bedsheet/medical
name = "medical blanket"
desc = "It's a sterilized* blanket commonly used in the Medbay. *Sterilization is voided if a virologist is present onboard the station."
icon_state = "sheetmedical"
item_color = "medical"
dream_messages = list("healing", "life", "surgery", "a doctor")
/obj/item/bedsheet/cmo
name = "chief medical officer's bedsheet"
desc = "It's a sterilized blanket that has a cross emblem. There's some cat fur on it, likely from Runtime."
icon_state = "sheetcmo"
item_color = "cmo"
dream_messages = list("authority", "a silvery ID", "healing", "life", "surgery", "a cat", "the chief medical officer")
/obj/item/bedsheet/hos
name = "head of security's bedsheet"
desc = "It is decorated with a shield emblem. While crime doesn't sleep, you do, but you are still THE LAW!"
icon_state = "sheethos"
item_color = "hosred"
dream_messages = list("authority", "a silvery ID", "handcuffs", "a baton", "a flashbang", "sunglasses", "the head of security")
/obj/item/bedsheet/hop
name = "head of personnel's bedsheet"
desc = "It is decorated with a key emblem. For those rare moments when you can rest and cuddle with Ian without someone screaming for you over the radio."
icon_state = "sheethop"
item_color = "hop"
dream_messages = list("authority", "a silvery ID", "obligation", "a computer", "an ID", "a corgi", "the head of personnel")
/obj/item/bedsheet/ce
name = "chief engineer's bedsheet"
desc = "It is decorated with a wrench emblem. It's highly reflective and stain resistant, so you don't need to worry about ruining it with oil."
icon_state = "sheetce"
item_color = "chief"
dream_messages = list("authority", "a silvery ID", "the engine", "power tools", "an APC", "a parrot", "the chief engineer")
/obj/item/bedsheet/qm
name = "quartermaster's bedsheet"
desc = "It is decorated with a crate emblem in silver lining. It's rather tough, and just the thing to lie on after a hard day of pushing paper."
icon_state = "sheetqm"
item_color = "qm"
dream_messages = list("a grey ID", "a shuttle", "a crate", "a sloth", "the quartermaster")
/obj/item/bedsheet/brown
icon_state = "sheetbrown"
item_color = "cargo"
dream_messages = list("brown")
/obj/item/bedsheet/black
icon_state = "sheetblack"
item_color = "black"
dream_messages = list("black")
/obj/item/bedsheet/centcom
name = "\improper CentCom bedsheet"
desc = "Woven with advanced nanothread for warmth as well as being very decorated, essential for all officials."
icon_state = "sheetcentcom"
item_color = "centcom"
dream_messages = list("a unique ID", "authority", "artillery", "an ending")
/obj/item/bedsheet/syndie
name = "syndicate bedsheet"
desc = "It has a syndicate emblem and it has an aura of evil."
icon_state = "sheetsyndie"
item_color = "syndie"
dream_messages = list("a green disc", "a red crystal", "a glowing blade", "a wire-covered ID")
/obj/item/bedsheet/cult
name = "cultist's bedsheet"
desc = "You might dream of Nar'Sie if you sleep with this. It seems rather tattered and glows of an eldritch presence."
icon_state = "sheetcult"
item_color = "cult"
dream_messages = list("a tome", "a floating red crystal", "a glowing sword", "a bloody symbol", "a massive humanoid figure")
/obj/item/bedsheet/wiz
name = "wizard's bedsheet"
desc = "A special fabric enchanted with magic so you can have an enchanted night. It even glows!"
icon_state = "sheetwiz"
item_color = "wiz"
dream_messages = list("a book", "an explosion", "lightning", "a staff", "a skeleton", "a robe", "magic")
/obj/item/bedsheet/nanotrasen
name = "nanotrasen bedsheet"
desc = "It has the Nanotrasen logo on it and has an aura of duty."
icon_state = "sheetNT"
item_color = "nanotrasen"
dream_messages = list("authority", "an ending")
/obj/item/bedsheet/ian
icon_state = "sheetian"
item_color = "ian"
dream_messages = list("a dog", "a corgi", "woof", "bark", "arf")
/obj/item/bedsheet/runtime
icon_state = "sheetruntime"
item_color = "runtime"
dream_messages = list("a kitty", "a cat", "meow", "purr", "nya~")
/obj/item/bedsheet/pirate
name = "pirate's bedsheet"
desc = "It has a Jolly Roger emblem on it and has a faint scent of grog."
icon_state = "sheetpirate"
item_color = "black"
dream_messages = list("doing whatever oneself wants", "cause a pirate is free", "being a pirate", "stealing", "landlubbers", "gold", "a buried treasure", "yarr", "avast", "a swashbuckler", "sailing the Seven Seas", "a parrot", "a monkey", "an island", "a talking skull")
/obj/item/bedsheet/gondola
name = "gondola bedsheet"
desc = "A precious bedsheet made from the hide of a rare and peculiar critter."
icon_state = "sheetgondola"
item_color = "cargo"
var/g_mouth
var/g_eyes
/obj/item/bedsheet/gondola/Initialize()
. = ..()
g_mouth = "sheetgondola_mouth[rand(1, 4)]"
g_eyes = "sheetgondola_eyes[rand(1, 4)]"
add_overlay(g_mouth)
add_overlay(g_eyes)
/obj/item/bedsheet/gondola/worn_overlays(isinhands = FALSE, icon_file)
. = ..()
if(!isinhands)
. += mutable_appearance(icon_file, g_mouth)
. += mutable_appearance(icon_file, g_eyes)
/obj/item/bedsheet/cosmos
name = "cosmic space bedsheet"
desc = "Made from the dreams of those who wonder at the stars."
icon_state = "sheetcosmos"
item_color = "cosmos"
dream_messages = list("the infinite cosmos", "Hans Zimmer music", "a flight through space", "the galaxy", "being fabulous", "shooting stars")
light_power = 2
light_range = 1.4
/obj/item/bedsheet/random
icon_state = "random_bedsheet"
item_color = "rainbow"
name = "random bedsheet"
desc = "If you're reading this description ingame, something has gone wrong! Honk!"
/obj/item/bedsheet/random/Initialize()
..()
var/type = pick(typesof(/obj/item/bedsheet) - /obj/item/bedsheet/random)
new type(loc)
return INITIALIZE_HINT_QDEL
/obj/structure/bedsheetbin
name = "linen bin"
desc = "It looks rather cosy."
icon = 'icons/obj/structures.dmi'
icon_state = "linenbin-full"
anchored = TRUE
resistance_flags = FLAMMABLE
max_integrity = 70
var/amount = 10
var/list/sheet_types = list(/obj/item/bedsheet)
var/static/allowed_sheets = list(/obj/item/bedsheet, /obj/item/reagent_containers/rag/towel)
var/list/sheets = list()
var/obj/item/hidden = null
/obj/structure/bedsheetbin/examine(mob/user)
. = ..()
if(amount < 1)
. += "There are no sheets in the bin."
else if(amount == 1)
. += "There is one sheet in the bin."
else
. += "There are [amount] sheets in the bin."
/obj/structure/bedsheetbin/update_icon()
switch(amount)
if(0)
icon_state = "linenbin-empty"
if(1 to 5)
icon_state = "linenbin-half"
else
icon_state = "linenbin-full"
/obj/structure/bedsheetbin/fire_act(exposed_temperature, exposed_volume)
if(amount)
amount = 0
update_icon()
..()
/obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params)
if(is_type_in_list(I, allowed_sheets))
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot place it into the bin!</span>")
return
sheets.Add(I)
amount++
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon()
else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot hide it among the sheets!</span>")
return
hidden = I
to_chat(user, "<span class='notice'>You hide [I] among the sheets.</span>")
/obj/structure/bedsheetbin/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/bedsheetbin/attack_hand(mob/user)
. = ..()
if(.)
return
if(user.incapacitated())
return
if(amount >= 1)
amount--
var/obj/item/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
else
var/chosen = pick(sheet_types)
B = new chosen
B.forceMove(drop_location())
user.put_in_hands(B)
to_chat(user, "<span class='notice'>You take [B] out of [src].</span>")
update_icon()
if(hidden)
hidden.forceMove(drop_location())
to_chat(user, "<span class='notice'>[hidden] falls out of [B]!</span>")
hidden = null
add_fingerprint(user)
/obj/structure/bedsheetbin/attack_tk(mob/user)
if(amount >= 1)
amount--
var/obj/item/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
else
var/chosen = pick(sheet_types)
B = new chosen
B.forceMove(drop_location())
to_chat(user, "<span class='notice'>You telekinetically remove [B] from [src].</span>")
update_icon()
if(hidden)
hidden.forceMove(drop_location())
hidden = null
/obj/structure/bedsheetbin/towel
desc = "It looks rather cosy. This one is designed to hold towels."
sheet_types = list(/obj/item/reagent_containers/rag/towel)
/obj/structure/bedsheetbin/color
sheet_types = list(/obj/item/bedsheet, /obj/item/bedsheet/blue, /obj/item/bedsheet/green, /obj/item/bedsheet/orange, \
/obj/item/bedsheet/purple, /obj/item/bedsheet/red, /obj/item/bedsheet/yellow, /obj/item/bedsheet/brown, \
/*
CONTAINS:
BEDSHEETS
LINEN BINS
*/
/obj/item/bedsheet
name = "bedsheet"
desc = "A surprisingly soft linen bedsheet."
icon = 'icons/obj/bedsheets.dmi'
icon_state = "sheetwhite"
item_state = "bedsheet"
slot_flags = ITEM_SLOT_NECK
layer = MOB_LAYER
throwforce = 0
throw_speed = 1
throw_range = 2
w_class = WEIGHT_CLASS_TINY
item_color = "white"
resistance_flags = FLAMMABLE
dog_fashion = /datum/dog_fashion/head/ghost
var/list/dream_messages = list("white")
/obj/item/bedsheet/attack(mob/living/M, mob/user)
if(!attempt_initiate_surgery(src, M, user))
..()
/obj/item/bedsheet/attack_self(mob/user)
if(!user.CanReach(src)) //No telekenetic grabbing.
return
if(!user.dropItemToGround(src))
return
if(layer == initial(layer))
layer = ABOVE_MOB_LAYER
to_chat(user, "<span class='notice'>You cover yourself with [src].</span>")
else
layer = initial(layer)
to_chat(user, "<span class='notice'>You smooth [src] out beneath you.</span>")
add_fingerprint(user)
return
/obj/item/bedsheet/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wirecutters) || I.get_sharpness())
var/obj/item/stack/sheet/cloth/C = new (get_turf(src), 3)
transfer_fingerprints_to(C)
C.add_fingerprint(user)
qdel(src)
to_chat(user, "<span class='notice'>You tear [src] up.</span>")
else
return ..()
/obj/item/bedsheet/blue
icon_state = "sheetblue"
item_color = "blue"
dream_messages = list("blue")
/obj/item/bedsheet/green
icon_state = "sheetgreen"
item_color = "green"
dream_messages = list("green")
/obj/item/bedsheet/grey
icon_state = "sheetgrey"
item_color = "grey"
dream_messages = list("grey")
/obj/item/bedsheet/orange
icon_state = "sheetorange"
item_color = "orange"
dream_messages = list("orange")
/obj/item/bedsheet/purple
icon_state = "sheetpurple"
item_color = "purple"
dream_messages = list("purple")
/obj/item/bedsheet/patriot
name = "patriotic bedsheet"
desc = "You've never felt more free than when sleeping on this."
icon_state = "sheetUSA"
item_color = "sheetUSA"
dream_messages = list("America", "freedom", "fireworks", "bald eagles")
/obj/item/bedsheet/rainbow
name = "rainbow bedsheet"
desc = "A multicolored blanket. It's actually several different sheets cut up and sewn together."
icon_state = "sheetrainbow"
item_color = "rainbow"
dream_messages = list("red", "orange", "yellow", "green", "blue", "purple", "a rainbow")
/obj/item/bedsheet/red
icon_state = "sheetred"
item_color = "red"
dream_messages = list("red")
/obj/item/bedsheet/yellow
icon_state = "sheetyellow"
item_color = "yellow"
dream_messages = list("yellow")
/obj/item/bedsheet/mime
name = "mime's blanket"
desc = "A very soothing striped blanket. All the noise just seems to fade out when you're under the covers in this."
icon_state = "sheetmime"
item_color = "mime"
dream_messages = list("silence", "gestures", "a pale face", "a gaping mouth", "the mime")
/obj/item/bedsheet/clown
name = "clown's blanket"
desc = "A rainbow blanket with a clown mask woven in. It smells faintly of bananas."
icon_state = "sheetclown"
item_color = "clown"
dream_messages = list("honk", "laughter", "a prank", "a joke", "a smiling face", "the clown")
/obj/item/bedsheet/captain
name = "captain's bedsheet"
desc = "It has a Nanotrasen symbol on it, and was woven with a revolutionary new kind of thread guaranteed to have 0.01% permeability for most non-chemical substances, popular among most modern captains."
icon_state = "sheetcaptain"
item_color = "captain"
dream_messages = list("authority", "a golden ID", "sunglasses", "a green disc", "an antique gun", "the captain")
/obj/item/bedsheet/rd
name = "research director's bedsheet"
desc = "It appears to have a beaker emblem, and is made out of fire-resistant material, although it probably won't protect you in the event of fires you're familiar with every day."
icon_state = "sheetrd"
item_color = "director"
dream_messages = list("authority", "a silvery ID", "a bomb", "a mech", "a facehugger", "maniacal laughter", "the research director")
// for Free Golems.
/obj/item/bedsheet/rd/royal_cape
name = "Royal Cape of the Liberator"
desc = "Majestic."
dream_messages = list("mining", "stone", "a golem", "freedom", "doing whatever")
/obj/item/bedsheet/medical
name = "medical blanket"
desc = "It's a sterilized* blanket commonly used in the Medbay. *Sterilization is voided if a virologist is present onboard the station."
icon_state = "sheetmedical"
item_color = "medical"
dream_messages = list("healing", "life", "surgery", "a doctor")
/obj/item/bedsheet/cmo
name = "chief medical officer's bedsheet"
desc = "It's a sterilized blanket that has a cross emblem. There's some cat fur on it, likely from Runtime."
icon_state = "sheetcmo"
item_color = "cmo"
dream_messages = list("authority", "a silvery ID", "healing", "life", "surgery", "a cat", "the chief medical officer")
/obj/item/bedsheet/hos
name = "head of security's bedsheet"
desc = "It is decorated with a shield emblem. While crime doesn't sleep, you do, but you are still THE LAW!"
icon_state = "sheethos"
item_color = "hosred"
dream_messages = list("authority", "a silvery ID", "handcuffs", "a baton", "a flashbang", "sunglasses", "the head of security")
/obj/item/bedsheet/hop
name = "head of personnel's bedsheet"
desc = "It is decorated with a key emblem. For those rare moments when you can rest and cuddle with Ian without someone screaming for you over the radio."
icon_state = "sheethop"
item_color = "hop"
dream_messages = list("authority", "a silvery ID", "obligation", "a computer", "an ID", "a corgi", "the head of personnel")
/obj/item/bedsheet/ce
name = "chief engineer's bedsheet"
desc = "It is decorated with a wrench emblem. It's highly reflective and stain resistant, so you don't need to worry about ruining it with oil."
icon_state = "sheetce"
item_color = "chief"
dream_messages = list("authority", "a silvery ID", "the engine", "power tools", "an APC", "a parrot", "the chief engineer")
/obj/item/bedsheet/qm
name = "quartermaster's bedsheet"
desc = "It is decorated with a crate emblem in silver lining. It's rather tough, and just the thing to lie on after a hard day of pushing paper."
icon_state = "sheetqm"
item_color = "qm"
dream_messages = list("a grey ID", "a shuttle", "a crate", "a sloth", "the quartermaster")
/obj/item/bedsheet/brown
icon_state = "sheetbrown"
item_color = "cargo"
dream_messages = list("brown")
/obj/item/bedsheet/black
icon_state = "sheetblack"
item_color = "black"
dream_messages = list("black")
/obj/item/bedsheet/centcom
name = "\improper CentCom bedsheet"
desc = "Woven with advanced nanothread for warmth as well as being very decorated, essential for all officials."
icon_state = "sheetcentcom"
item_color = "centcom"
dream_messages = list("a unique ID", "authority", "artillery", "an ending")
/obj/item/bedsheet/syndie
name = "syndicate bedsheet"
desc = "It has a syndicate emblem and it has an aura of evil."
icon_state = "sheetsyndie"
item_color = "syndie"
dream_messages = list("a green disc", "a red crystal", "a glowing blade", "a wire-covered ID")
/obj/item/bedsheet/cult
name = "cultist's bedsheet"
desc = "You might dream of Nar'Sie if you sleep with this. It seems rather tattered and glows of an eldritch presence."
icon_state = "sheetcult"
item_color = "cult"
dream_messages = list("a tome", "a floating red crystal", "a glowing sword", "a bloody symbol", "a massive humanoid figure")
/obj/item/bedsheet/wiz
name = "wizard's bedsheet"
desc = "A special fabric enchanted with magic so you can have an enchanted night. It even glows!"
icon_state = "sheetwiz"
item_color = "wiz"
dream_messages = list("a book", "an explosion", "lightning", "a staff", "a skeleton", "a robe", "magic")
/obj/item/bedsheet/nanotrasen
name = "nanotrasen bedsheet"
desc = "It has the Nanotrasen logo on it and has an aura of duty."
icon_state = "sheetNT"
item_color = "nanotrasen"
dream_messages = list("authority", "an ending")
/obj/item/bedsheet/ian
icon_state = "sheetian"
item_color = "ian"
dream_messages = list("a dog", "a corgi", "woof", "bark", "arf")
/obj/item/bedsheet/runtime
icon_state = "sheetruntime"
item_color = "runtime"
dream_messages = list("a kitty", "a cat", "meow", "purr", "nya~")
/obj/item/bedsheet/pirate
name = "pirate's bedsheet"
desc = "It has a Jolly Roger emblem on it and has a faint scent of grog."
icon_state = "sheetpirate"
item_color = "black"
dream_messages = list("doing whatever oneself wants", "cause a pirate is free", "being a pirate", "stealing", "landlubbers", "gold", "a buried treasure", "yarr", "avast", "a swashbuckler", "sailing the Seven Seas", "a parrot", "a monkey", "an island", "a talking skull")
/obj/item/bedsheet/gondola
name = "gondola bedsheet"
desc = "A precious bedsheet made from the hide of a rare and peculiar critter."
icon_state = "sheetgondola"
item_color = "cargo"
var/g_mouth
var/g_eyes
/obj/item/bedsheet/gondola/Initialize()
. = ..()
g_mouth = "sheetgondola_mouth[rand(1, 4)]"
g_eyes = "sheetgondola_eyes[rand(1, 4)]"
add_overlay(g_mouth)
add_overlay(g_eyes)
/obj/item/bedsheet/gondola/worn_overlays(isinhands = FALSE, icon_file, style_flags = NONE)
. = ..()
if(!isinhands)
. += mutable_appearance(icon_file, g_mouth)
. += mutable_appearance(icon_file, g_eyes)
/obj/item/bedsheet/cosmos
name = "cosmic space bedsheet"
desc = "Made from the dreams of those who wonder at the stars."
icon_state = "sheetcosmos"
item_color = "cosmos"
dream_messages = list("the infinite cosmos", "Hans Zimmer music", "a flight through space", "the galaxy", "being fabulous", "shooting stars")
light_power = 2
light_range = 1.4
/obj/item/bedsheet/random
icon_state = "random_bedsheet"
item_color = "rainbow"
name = "random bedsheet"
desc = "If you're reading this description ingame, something has gone wrong! Honk!"
/obj/item/bedsheet/random/Initialize()
..()
var/type = pick(typesof(/obj/item/bedsheet) - /obj/item/bedsheet/random)
new type(loc)
return INITIALIZE_HINT_QDEL
/obj/structure/bedsheetbin
name = "linen bin"
desc = "It looks rather cosy."
icon = 'icons/obj/structures.dmi'
icon_state = "linenbin-full"
anchored = TRUE
resistance_flags = FLAMMABLE
max_integrity = 70
var/amount = 10
var/list/sheet_types = list(/obj/item/bedsheet)
var/static/allowed_sheets = list(/obj/item/bedsheet, /obj/item/reagent_containers/rag/towel)
var/list/sheets = list()
var/obj/item/hidden = null
/obj/structure/bedsheetbin/examine(mob/user)
. = ..()
if(amount < 1)
. += "There are no sheets in the bin."
else if(amount == 1)
. += "There is one sheet in the bin."
else
. += "There are [amount] sheets in the bin."
/obj/structure/bedsheetbin/update_icon()
switch(amount)
if(0)
icon_state = "linenbin-empty"
if(1 to 5)
icon_state = "linenbin-half"
else
icon_state = "linenbin-full"
/obj/structure/bedsheetbin/fire_act(exposed_temperature, exposed_volume)
if(amount)
amount = 0
update_icon()
..()
/obj/structure/bedsheetbin/attackby(obj/item/I, mob/user, params)
if(is_type_in_list(I, allowed_sheets))
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot place it into the bin!</span>")
return
sheets.Add(I)
amount++
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon()
else if(amount && !hidden && I.w_class < WEIGHT_CLASS_BULKY) //make sure there's sheets to hide it among, make sure nothing else is hidden in there.
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot hide it among the sheets!</span>")
return
hidden = I
to_chat(user, "<span class='notice'>You hide [I] among the sheets.</span>")
/obj/structure/bedsheetbin/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/bedsheetbin/attack_hand(mob/user)
. = ..()
if(.)
return
if(user.incapacitated())
return
if(amount >= 1)
amount--
var/obj/item/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
else
var/chosen = pick(sheet_types)
B = new chosen
B.forceMove(drop_location())
user.put_in_hands(B)
to_chat(user, "<span class='notice'>You take [B] out of [src].</span>")
update_icon()
if(hidden)
hidden.forceMove(drop_location())
to_chat(user, "<span class='notice'>[hidden] falls out of [B]!</span>")
hidden = null
add_fingerprint(user)
/obj/structure/bedsheetbin/attack_tk(mob/user)
if(amount >= 1)
amount--
var/obj/item/B
if(sheets.len > 0)
B = sheets[sheets.len]
sheets.Remove(B)
else
var/chosen = pick(sheet_types)
B = new chosen
B.forceMove(drop_location())
to_chat(user, "<span class='notice'>You telekinetically remove [B] from [src].</span>")
update_icon()
if(hidden)
hidden.forceMove(drop_location())
hidden = null
/obj/structure/bedsheetbin/towel
desc = "It looks rather cosy. This one is designed to hold towels."
sheet_types = list(/obj/item/reagent_containers/rag/towel)
/obj/structure/bedsheetbin/color
sheet_types = list(/obj/item/bedsheet, /obj/item/bedsheet/blue, /obj/item/bedsheet/green, /obj/item/bedsheet/orange, \
/obj/item/bedsheet/purple, /obj/item/bedsheet/red, /obj/item/bedsheet/yellow, /obj/item/bedsheet/brown, \
/obj/item/bedsheet/black)
File diff suppressed because it is too large Load Diff
@@ -22,7 +22,9 @@
if(opened || move_delay || !CHECK_BITFIELD(user.mobility_flags, MOBILITY_MOVE) || !isturf(loc) || !has_gravity(loc))
return
move_delay = TRUE
if(step(src, direction))
var/oldloc = loc
step(src, direction)
if(oldloc != loc)
addtimer(CALLBACK(src, .proc/ResetMoveDelay), (use_mob_movespeed ? user.movement_delay() : CONFIG_GET(number/movedelay/walk_delay)) * move_speed_multiplier)
else
ResetMoveDelay()
@@ -1,109 +1,109 @@
/obj/structure/closet/cabinet
name = "cabinet"
desc = "Old will forever be in fashion."
icon_state = "cabinet"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
cutting_tool = /obj/item/screwdriver
/obj/structure/closet/acloset
name = "strange closet"
desc = "It looks alien!"
icon_state = "alien"
/obj/structure/closet/gimmick
name = "administrative supply closet"
desc = "It's a storage unit for things that have no right being here."
icon_state = "syndicate"
/obj/structure/closet/gimmick/russian
name = "\improper Russian surplus closet"
desc = "It's a storage unit for Russian standard-issue surplus."
/obj/structure/closet/gimmick/russian/PopulateContents()
..()
for(var/i in 1 to 5)
new /obj/item/clothing/head/ushanka(src)
for(var/i in 1 to 5)
new /obj/item/clothing/under/soviet(src)
/obj/structure/closet/gimmick/tacticool
name = "tacticool gear closet"
desc = "It's a storage unit for Tacticool gear."
/obj/structure/closet/gimmick/tacticool/PopulateContents()
..()
new /obj/item/clothing/glasses/eyepatch(src)
new /obj/item/clothing/glasses/sunglasses(src)
new /obj/item/clothing/gloves/combat(src)
new /obj/item/clothing/gloves/combat(src)
new /obj/item/clothing/head/helmet/swat(src)
new /obj/item/clothing/head/helmet/swat(src)
new /obj/item/clothing/mask/gas/sechailer/swat(src)
new /obj/item/clothing/mask/gas/sechailer/swat(src)
new /obj/item/clothing/shoes/combat/swat(src)
new /obj/item/clothing/shoes/combat/swat(src)
new /obj/item/clothing/suit/space/hardsuit/deathsquad(src)
new /obj/item/clothing/suit/space/hardsuit/deathsquad(src)
new /obj/item/clothing/under/syndicate/tacticool(src)
new /obj/item/clothing/under/syndicate/tacticool(src)
/obj/structure/closet/thunderdome
name = "\improper Thunderdome closet"
desc = "Everything you need!"
anchored = TRUE
/obj/structure/closet/thunderdome/tdred
name = "red-team Thunderdome closet"
icon_door = "red"
/obj/structure/closet/thunderdome/tdred/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/clothing/suit/armor/tdome/red(src)
for(var/i in 1 to 3)
new /obj/item/melee/transforming/energy/sword/saber(src)
for(var/i in 1 to 3)
new /obj/item/gun/energy/laser(src)
for(var/i in 1 to 3)
new /obj/item/melee/baton/loaded(src)
for(var/i in 1 to 3)
new /obj/item/storage/box/flashbangs(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/helmet/thunderdome(src)
/obj/structure/closet/thunderdome/tdgreen
name = "green-team Thunderdome closet"
icon_door = "green"
/obj/structure/closet/thunderdome/tdgreen/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/clothing/suit/armor/tdome/green(src)
for(var/i in 1 to 3)
new /obj/item/melee/transforming/energy/sword/saber(src)
for(var/i in 1 to 3)
new /obj/item/gun/energy/laser(src)
for(var/i in 1 to 3)
new /obj/item/melee/baton/loaded(src)
for(var/i in 1 to 3)
new /obj/item/storage/box/flashbangs(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/helmet/thunderdome(src)
/obj/structure/closet/malf/suits
desc = "It's a storage unit for operational gear."
icon_state = "syndicate"
/obj/structure/closet/malf/suits/PopulateContents()
..()
new /obj/item/tank/jetpack/void(src)
new /obj/item/clothing/mask/breath(src)
new /obj/item/clothing/head/helmet/space/nasavoid(src)
new /obj/item/clothing/suit/space/nasavoid(src)
new /obj/item/crowbar(src)
new /obj/item/stock_parts/cell(src)
new /obj/item/multitool(src)
/obj/structure/closet/cabinet
name = "cabinet"
desc = "Old will forever be in fashion."
icon_state = "cabinet"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
cutting_tool = /obj/item/screwdriver
/obj/structure/closet/acloset
name = "strange closet"
desc = "It looks alien!"
icon_state = "alien"
/obj/structure/closet/gimmick
name = "administrative supply closet"
desc = "It's a storage unit for things that have no right being here."
icon_state = "syndicate"
/obj/structure/closet/gimmick/russian
name = "\improper Russian surplus closet"
desc = "It's a storage unit for Russian standard-issue surplus."
/obj/structure/closet/gimmick/russian/PopulateContents()
..()
for(var/i in 1 to 5)
new /obj/item/clothing/head/ushanka(src)
for(var/i in 1 to 5)
new /obj/item/clothing/under/soviet(src)
/obj/structure/closet/gimmick/tacticool
name = "tacticool gear closet"
desc = "It's a storage unit for Tacticool gear."
/obj/structure/closet/gimmick/tacticool/PopulateContents()
..()
new /obj/item/clothing/glasses/eyepatch(src)
new /obj/item/clothing/glasses/sunglasses(src)
new /obj/item/clothing/gloves/combat(src)
new /obj/item/clothing/gloves/combat(src)
new /obj/item/clothing/head/helmet/swat(src)
new /obj/item/clothing/head/helmet/swat(src)
new /obj/item/clothing/mask/gas/sechailer/swat(src)
new /obj/item/clothing/mask/gas/sechailer/swat(src)
new /obj/item/clothing/shoes/combat/swat(src)
new /obj/item/clothing/shoes/combat/swat(src)
new /obj/item/clothing/suit/space/hardsuit/deathsquad(src)
new /obj/item/clothing/suit/space/hardsuit/deathsquad(src)
new /obj/item/clothing/under/syndicate/tacticool(src)
new /obj/item/clothing/under/syndicate/tacticool(src)
/obj/structure/closet/thunderdome
name = "\improper Thunderdome closet"
desc = "Everything you need!"
anchored = TRUE
/obj/structure/closet/thunderdome/tdred
name = "red-team Thunderdome closet"
icon_door = "red"
/obj/structure/closet/thunderdome/tdred/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/clothing/suit/armor/tdome/red(src)
for(var/i in 1 to 3)
new /obj/item/melee/transforming/energy/sword/saber(src)
for(var/i in 1 to 3)
new /obj/item/gun/energy/laser(src)
for(var/i in 1 to 3)
new /obj/item/melee/baton/loaded(src)
for(var/i in 1 to 3)
new /obj/item/storage/box/flashbangs(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/helmet/thunderdome(src)
/obj/structure/closet/thunderdome/tdgreen
name = "green-team Thunderdome closet"
icon_door = "green"
/obj/structure/closet/thunderdome/tdgreen/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/clothing/suit/armor/tdome/green(src)
for(var/i in 1 to 3)
new /obj/item/melee/transforming/energy/sword/saber(src)
for(var/i in 1 to 3)
new /obj/item/gun/energy/laser(src)
for(var/i in 1 to 3)
new /obj/item/melee/baton/loaded(src)
for(var/i in 1 to 3)
new /obj/item/storage/box/flashbangs(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/helmet/thunderdome(src)
/obj/structure/closet/malf/suits
desc = "It's a storage unit for operational gear."
icon_state = "syndicate"
/obj/structure/closet/malf/suits/PopulateContents()
..()
new /obj/item/tank/jetpack/void(src)
new /obj/item/clothing/mask/breath(src)
new /obj/item/clothing/head/helmet/space/nasavoid(src)
new /obj/item/clothing/suit/space/nasavoid(src)
new /obj/item/crowbar(src)
new /obj/item/stock_parts/cell(src)
new /obj/item/multitool(src)
@@ -1,366 +1,366 @@
// Closets for specific jobs
/obj/structure/closet/gmcloset
name = "formal closet"
desc = "It's a storage unit for formal clothing."
icon_door = "black"
/obj/structure/closet/gmcloset/PopulateContents()
..()
new /obj/item/clothing/head/that(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/clothing/head/that(src)
new /obj/item/clothing/under/sl_suit(src)
new /obj/item/clothing/under/sl_suit(src)
new /obj/item/clothing/under/rank/bartender(src)
new /obj/item/clothing/under/rank/bartender(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/head/soft/black(src)
new /obj/item/clothing/head/soft/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/reagent_containers/rag(src)
new /obj/item/reagent_containers/rag(src)
new /obj/item/storage/box/beanbag(src)
new /obj/item/clothing/suit/armor/vest/alt(src)
new /obj/item/circuitboard/machine/dish_drive(src)
new /obj/item/clothing/glasses/sunglasses/reagent(src)
new /obj/item/clothing/neck/petcollar(src)
new /obj/item/storage/belt/bandolier(src)
/obj/structure/closet/chefcloset
name = "\proper chef's closet"
desc = "It's a storage unit for foodservice garments and mouse traps."
icon_door = "black"
/obj/structure/closet/chefcloset/PopulateContents()
..()
new /obj/item/clothing/under/waiter(src)
new /obj/item/clothing/under/waiter(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/accessory/waistcoat(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/apron/chef(src)
new /obj/item/clothing/head/soft/mime(src)
new /obj/item/clothing/head/soft/mime(src)
new /obj/item/storage/box/mousetraps(src)
new /obj/item/storage/box/mousetraps(src)
new /obj/item/circuitboard/machine/dish_drive(src)
new /obj/item/clothing/suit/toggle/chef(src)
new /obj/item/clothing/under/rank/chef(src)
new /obj/item/clothing/head/chefhat(src)
new /obj/item/reagent_containers/rag(src)
/obj/structure/closet/jcloset
name = "custodial closet"
desc = "It's a storage unit for janitorial clothes and gear."
icon_door = "mixed"
/obj/structure/closet/jcloset/PopulateContents()
..()
new /obj/item/clothing/under/rank/janitor(src)
new /obj/item/cartridge/janitor(src)
new /obj/item/clothing/gloves/color/black(src)
new /obj/item/clothing/head/soft/purple(src)
new /obj/item/paint/paint_remover(src)
new /obj/item/melee/flyswatter(src)
new /obj/item/flashlight(src)
for(var/i in 1 to 3)
new /obj/item/caution(src)
new /obj/item/holosign_creator(src)
new /obj/item/lightreplacer(src)
new /obj/item/soap(src)
new /obj/item/storage/bag/trash(src)
new /obj/item/clothing/shoes/galoshes(src)
new /obj/item/watertank/janitor(src)
new /obj/item/storage/belt/janitor(src)
/obj/structure/closet/lawcloset
name = "legal closet"
desc = "It's a storage unit for courtroom apparel and items."
icon_door = "blue"
/obj/structure/closet/lawcloset/PopulateContents()
..()
new /obj/item/clothing/under/lawyer/female(src)
new /obj/item/clothing/under/lawyer/black(src)
new /obj/item/clothing/under/lawyer/red(src)
new /obj/item/clothing/under/lawyer/bluesuit(src)
new /obj/item/clothing/suit/toggle/lawyer(src)
new /obj/item/clothing/under/lawyer/purpsuit(src)
new /obj/item/clothing/suit/toggle/lawyer/purple(src)
new /obj/item/clothing/under/lawyer/blacksuit(src)
new /obj/item/clothing/suit/toggle/lawyer/black(src)
new /obj/item/clothing/shoes/laceup(src)
new /obj/item/clothing/shoes/laceup(src)
new /obj/item/clothing/accessory/lawyers_badge(src)
new /obj/item/clothing/accessory/lawyers_badge(src)
/obj/structure/closet/wardrobe/chaplain_black
name = "chapel wardrobe"
desc = "It's a storage unit for Nanotrasen-approved religious attire."
icon_door = "black"
/obj/structure/closet/wardrobe/chaplain_black/PopulateContents()
new /obj/item/holybeacon(src)
new /obj/item/clothing/accessory/pocketprotector/cosmetology(src)
new /obj/item/clothing/under/rank/chaplain(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/suit/chaplain/nun(src)
new /obj/item/clothing/head/nun_hood(src)
new /obj/item/clothing/suit/chaplain/holidaypriest(src)
new /obj/item/storage/backpack/cultpack(src)
new /obj/item/storage/fancy/candle_box(src)
new /obj/item/storage/fancy/candle_box(src)
return
/obj/structure/closet/wardrobe/red
name = "security wardrobe"
icon_door = "red"
/obj/structure/closet/wardrobe/red/PopulateContents()
new /obj/item/clothing/suit/hooded/wintercoat/security(src)
new /obj/item/storage/backpack/security(src)
new /obj/item/storage/backpack/satchel/sec(src)
new /obj/item/storage/backpack/duffelbag/sec(src)
new /obj/item/storage/backpack/duffelbag/sec(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/security(src)
for(var/i in 1 to 2)
new /obj/item/clothing/under/rank/security/skirt(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/jackboots(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/beret/sec(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/soft/sec(src)
new /obj/item/clothing/mask/bandana/red(src)
new /obj/item/clothing/mask/bandana/red(src)
return
/obj/structure/closet/wardrobe/cargotech
name = "cargo wardrobe"
icon_door = "orange"
/obj/structure/closet/wardrobe/cargotech/PopulateContents()
new /obj/item/clothing/suit/hooded/wintercoat/cargo(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/cargotech(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/sneakers/black(src)
for(var/i in 1 to 3)
new /obj/item/clothing/gloves/fingerless(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/soft(src)
new /obj/item/radio/headset/headset_cargo(src)
/obj/structure/closet/wardrobe/atmospherics_yellow
name = "atmospherics wardrobe"
icon_door = "atmos_wardrobe"
/obj/structure/closet/wardrobe/atmospherics_yellow/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/duffelbag/engineering(src)
new /obj/item/storage/backpack/satchel/eng(src)
new /obj/item/storage/backpack/industrial(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/hooded/wintercoat/engineering/atmos(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/atmospheric_technician(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/sneakers/black(src)
return
/obj/structure/closet/wardrobe/engineering_yellow
name = "engineering wardrobe"
icon_door = "yellow"
/obj/structure/closet/wardrobe/engineering_yellow/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/duffelbag/engineering(src)
new /obj/item/storage/backpack/industrial(src)
new /obj/item/storage/backpack/satchel/eng(src)
new /obj/item/clothing/suit/hooded/wintercoat/engineering(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/engineer(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/hazardvest(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/workboots(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/hardhat(src)
return
/obj/structure/closet/wardrobe/white/medical
name = "medical doctor's wardrobe"
/obj/structure/closet/wardrobe/white/medical/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/duffelbag/med(src)
new /obj/item/storage/backpack/medic(src)
new /obj/item/storage/backpack/satchel/med(src)
new /obj/item/clothing/suit/hooded/wintercoat/medical(src)
new /obj/item/clothing/under/rank/nursesuit(src)
new /obj/item/clothing/head/nursehat(src)
new /obj/item/clothing/under/rank/medical/blue(src)
new /obj/item/clothing/under/rank/medical/green(src)
new /obj/item/clothing/under/rank/medical/purple(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/medical(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/toggle/labcoat(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/toggle/labcoat/emt(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/sneakers/white(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/soft/emt(src)
return
/obj/structure/closet/wardrobe/robotics_black
name = "robotics wardrobe"
icon_door = "black"
/obj/structure/closet/wardrobe/robotics_black/PopulateContents()
new /obj/item/clothing/glasses/hud/diagnostic(src)
new /obj/item/clothing/glasses/hud/diagnostic(src)
new /obj/item/clothing/under/rank/roboticist(src)
new /obj/item/clothing/under/rank/roboticist(src)
new /obj/item/clothing/suit/toggle/labcoat(src)
new /obj/item/clothing/suit/toggle/labcoat(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/gloves/fingerless(src)
new /obj/item/clothing/gloves/fingerless(src)
new /obj/item/clothing/head/soft/black(src)
new /obj/item/clothing/head/soft/black(src)
if(prob(40))
new /obj/item/clothing/mask/bandana/skull(src)
if(prob(40))
new /obj/item/clothing/mask/bandana/skull(src)
return
/obj/structure/closet/wardrobe/chemistry_white
name = "chemistry wardrobe"
icon_door = "white"
/obj/structure/closet/wardrobe/chemistry_white/PopulateContents()
new /obj/item/clothing/under/rank/chemist(src)
new /obj/item/clothing/under/rank/chemist(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/suit/toggle/labcoat/chemist(src)
new /obj/item/clothing/suit/toggle/labcoat/chemist(src)
new /obj/item/storage/backpack/chemistry(src)
new /obj/item/storage/backpack/chemistry(src)
new /obj/item/storage/backpack/satchel/chem(src)
new /obj/item/storage/backpack/satchel/chem(src)
new /obj/item/storage/bag/chemistry(src)
new /obj/item/storage/bag/chemistry(src)
return
/obj/structure/closet/wardrobe/genetics_white
name = "genetics wardrobe"
icon_door = "white"
/obj/structure/closet/wardrobe/genetics_white/PopulateContents()
new /obj/item/clothing/under/rank/geneticist(src)
new /obj/item/clothing/under/rank/geneticist(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/suit/toggle/labcoat/genetics(src)
new /obj/item/clothing/suit/toggle/labcoat/genetics(src)
new /obj/item/storage/backpack/genetics(src)
new /obj/item/storage/backpack/genetics(src)
new /obj/item/storage/backpack/satchel/gen(src)
new /obj/item/storage/backpack/satchel/gen(src)
return
/obj/structure/closet/wardrobe/virology_white
name = "virology wardrobe"
icon_door = "white"
/obj/structure/closet/wardrobe/virology_white/PopulateContents()
new /obj/item/clothing/under/rank/virologist(src)
new /obj/item/clothing/under/rank/virologist(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/suit/toggle/labcoat/virologist(src)
new /obj/item/clothing/suit/toggle/labcoat/virologist(src)
new /obj/item/clothing/mask/surgical(src)
new /obj/item/clothing/mask/surgical(src)
new /obj/item/storage/backpack/virology(src)
new /obj/item/storage/backpack/virology(src)
new /obj/item/storage/backpack/satchel/vir(src)
new /obj/item/storage/backpack/satchel/vir(src)
return
/obj/structure/closet/wardrobe/science_white
name = "science wardrobe"
icon_door = "white"
/obj/structure/closet/wardrobe/science_white/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/science(src)
new /obj/item/storage/backpack/science(src)
new /obj/item/storage/backpack/satchel/tox(src)
new /obj/item/storage/backpack/satchel/tox(src)
new /obj/item/clothing/suit/hooded/wintercoat/science(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/scientist(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/toggle/labcoat/science(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/radio/headset/headset_sci(src)
new /obj/item/radio/headset/headset_sci(src)
for(var/i in 1 to 3)
new /obj/item/clothing/mask/gas(src)
return
/obj/structure/closet/wardrobe/botanist
name = "botanist wardrobe"
icon_door = "green"
/obj/structure/closet/wardrobe/botanist/PopulateContents()
new /obj/item/storage/backpack/botany(src)
new /obj/item/storage/backpack/botany(src)
new /obj/item/storage/backpack/satchel/hyd(src)
new /obj/item/storage/backpack/satchel/hyd(src)
new /obj/item/clothing/suit/hooded/wintercoat/hydro(src)
new /obj/item/clothing/suit/apron(src)
new /obj/item/clothing/suit/apron(src)
new /obj/item/clothing/suit/apron/overalls(src)
new /obj/item/clothing/suit/apron/overalls(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/hydroponics(src)
for(var/i in 1 to 3)
new /obj/item/clothing/mask/bandana(src)
/obj/structure/closet/wardrobe/curator
name = "treasure hunting wardrobe"
icon_door = "black"
/obj/structure/closet/wardrobe/curator/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector/full(src)
new /obj/item/clothing/head/fedora/curator(src)
new /obj/item/clothing/suit/curator(src)
new /obj/item/clothing/under/rank/curator/treasure_hunter(src)
new /obj/item/clothing/shoes/workboots/mining(src)
new /obj/item/storage/backpack/satchel/explorer(src)
/obj/structure/closet/coffin/handle_lock_addition()
return
/obj/structure/closet/coffin/handle_lock_removal()
return
// Closets for specific jobs
/obj/structure/closet/gmcloset
name = "formal closet"
desc = "It's a storage unit for formal clothing."
icon_door = "black"
/obj/structure/closet/gmcloset/PopulateContents()
..()
new /obj/item/clothing/head/that(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/clothing/head/that(src)
new /obj/item/clothing/under/sl_suit(src)
new /obj/item/clothing/under/sl_suit(src)
new /obj/item/clothing/under/rank/bartender(src)
new /obj/item/clothing/under/rank/bartender(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/head/soft/black(src)
new /obj/item/clothing/head/soft/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/reagent_containers/rag(src)
new /obj/item/reagent_containers/rag(src)
new /obj/item/storage/box/beanbag(src)
new /obj/item/clothing/suit/armor/vest/alt(src)
new /obj/item/circuitboard/machine/dish_drive(src)
new /obj/item/clothing/glasses/sunglasses/reagent(src)
new /obj/item/clothing/neck/petcollar(src)
new /obj/item/storage/belt/bandolier(src)
/obj/structure/closet/chefcloset
name = "\proper chef's closet"
desc = "It's a storage unit for foodservice garments and mouse traps."
icon_door = "black"
/obj/structure/closet/chefcloset/PopulateContents()
..()
new /obj/item/clothing/under/waiter(src)
new /obj/item/clothing/under/waiter(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/accessory/waistcoat(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/apron/chef(src)
new /obj/item/clothing/head/soft/mime(src)
new /obj/item/clothing/head/soft/mime(src)
new /obj/item/storage/box/mousetraps(src)
new /obj/item/storage/box/mousetraps(src)
new /obj/item/circuitboard/machine/dish_drive(src)
new /obj/item/clothing/suit/toggle/chef(src)
new /obj/item/clothing/under/rank/chef(src)
new /obj/item/clothing/head/chefhat(src)
new /obj/item/reagent_containers/rag(src)
/obj/structure/closet/jcloset
name = "custodial closet"
desc = "It's a storage unit for janitorial clothes and gear."
icon_door = "mixed"
/obj/structure/closet/jcloset/PopulateContents()
..()
new /obj/item/clothing/under/rank/janitor(src)
new /obj/item/cartridge/janitor(src)
new /obj/item/clothing/gloves/color/black(src)
new /obj/item/clothing/head/soft/purple(src)
new /obj/item/paint/paint_remover(src)
new /obj/item/melee/flyswatter(src)
new /obj/item/flashlight(src)
for(var/i in 1 to 3)
new /obj/item/caution(src)
new /obj/item/holosign_creator(src)
new /obj/item/lightreplacer(src)
new /obj/item/soap(src)
new /obj/item/storage/bag/trash(src)
new /obj/item/clothing/shoes/galoshes(src)
new /obj/item/watertank/janitor(src)
new /obj/item/storage/belt/janitor(src)
/obj/structure/closet/lawcloset
name = "legal closet"
desc = "It's a storage unit for courtroom apparel and items."
icon_door = "blue"
/obj/structure/closet/lawcloset/PopulateContents()
..()
new /obj/item/clothing/under/lawyer/female(src)
new /obj/item/clothing/under/lawyer/black(src)
new /obj/item/clothing/under/lawyer/red(src)
new /obj/item/clothing/under/lawyer/bluesuit(src)
new /obj/item/clothing/suit/toggle/lawyer(src)
new /obj/item/clothing/under/lawyer/purpsuit(src)
new /obj/item/clothing/suit/toggle/lawyer/purple(src)
new /obj/item/clothing/under/lawyer/blacksuit(src)
new /obj/item/clothing/suit/toggle/lawyer/black(src)
new /obj/item/clothing/shoes/laceup(src)
new /obj/item/clothing/shoes/laceup(src)
new /obj/item/clothing/accessory/lawyers_badge(src)
new /obj/item/clothing/accessory/lawyers_badge(src)
/obj/structure/closet/wardrobe/chaplain_black
name = "chapel wardrobe"
desc = "It's a storage unit for Nanotrasen-approved religious attire."
icon_door = "black"
/obj/structure/closet/wardrobe/chaplain_black/PopulateContents()
new /obj/item/holybeacon(src)
new /obj/item/clothing/accessory/pocketprotector/cosmetology(src)
new /obj/item/clothing/under/rank/chaplain(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/suit/chaplain/nun(src)
new /obj/item/clothing/head/nun_hood(src)
new /obj/item/clothing/suit/chaplain/holidaypriest(src)
new /obj/item/storage/backpack/cultpack(src)
new /obj/item/storage/fancy/candle_box(src)
new /obj/item/storage/fancy/candle_box(src)
return
/obj/structure/closet/wardrobe/red
name = "security wardrobe"
icon_door = "red"
/obj/structure/closet/wardrobe/red/PopulateContents()
new /obj/item/clothing/suit/hooded/wintercoat/security(src)
new /obj/item/storage/backpack/security(src)
new /obj/item/storage/backpack/satchel/sec(src)
new /obj/item/storage/backpack/duffelbag/sec(src)
new /obj/item/storage/backpack/duffelbag/sec(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/security(src)
for(var/i in 1 to 2)
new /obj/item/clothing/under/rank/security/skirt(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/jackboots(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/beret/sec(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/soft/sec(src)
new /obj/item/clothing/mask/bandana/red(src)
new /obj/item/clothing/mask/bandana/red(src)
return
/obj/structure/closet/wardrobe/cargotech
name = "cargo wardrobe"
icon_door = "orange"
/obj/structure/closet/wardrobe/cargotech/PopulateContents()
new /obj/item/clothing/suit/hooded/wintercoat/cargo(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/cargotech(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/sneakers/black(src)
for(var/i in 1 to 3)
new /obj/item/clothing/gloves/fingerless(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/soft(src)
new /obj/item/radio/headset/headset_cargo(src)
/obj/structure/closet/wardrobe/atmospherics_yellow
name = "atmospherics wardrobe"
icon_door = "atmos_wardrobe"
/obj/structure/closet/wardrobe/atmospherics_yellow/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/duffelbag/engineering(src)
new /obj/item/storage/backpack/satchel/eng(src)
new /obj/item/storage/backpack/industrial(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/hooded/wintercoat/engineering/atmos(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/atmospheric_technician(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/sneakers/black(src)
return
/obj/structure/closet/wardrobe/engineering_yellow
name = "engineering wardrobe"
icon_door = "yellow"
/obj/structure/closet/wardrobe/engineering_yellow/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/duffelbag/engineering(src)
new /obj/item/storage/backpack/industrial(src)
new /obj/item/storage/backpack/satchel/eng(src)
new /obj/item/clothing/suit/hooded/wintercoat/engineering(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/engineer(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/hazardvest(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/workboots(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/hardhat(src)
return
/obj/structure/closet/wardrobe/white/medical
name = "medical doctor's wardrobe"
/obj/structure/closet/wardrobe/white/medical/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/duffelbag/med(src)
new /obj/item/storage/backpack/medic(src)
new /obj/item/storage/backpack/satchel/med(src)
new /obj/item/clothing/suit/hooded/wintercoat/medical(src)
new /obj/item/clothing/under/rank/nursesuit(src)
new /obj/item/clothing/head/nursehat(src)
new /obj/item/clothing/under/rank/medical/blue(src)
new /obj/item/clothing/under/rank/medical/green(src)
new /obj/item/clothing/under/rank/medical/purple(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/medical(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/toggle/labcoat(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/toggle/labcoat/emt(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/sneakers/white(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/soft/emt(src)
return
/obj/structure/closet/wardrobe/robotics_black
name = "robotics wardrobe"
icon_door = "black"
/obj/structure/closet/wardrobe/robotics_black/PopulateContents()
new /obj/item/clothing/glasses/hud/diagnostic(src)
new /obj/item/clothing/glasses/hud/diagnostic(src)
new /obj/item/clothing/under/rank/roboticist(src)
new /obj/item/clothing/under/rank/roboticist(src)
new /obj/item/clothing/suit/toggle/labcoat(src)
new /obj/item/clothing/suit/toggle/labcoat(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/gloves/fingerless(src)
new /obj/item/clothing/gloves/fingerless(src)
new /obj/item/clothing/head/soft/black(src)
new /obj/item/clothing/head/soft/black(src)
if(prob(40))
new /obj/item/clothing/mask/bandana/skull(src)
if(prob(40))
new /obj/item/clothing/mask/bandana/skull(src)
return
/obj/structure/closet/wardrobe/chemistry_white
name = "chemistry wardrobe"
icon_door = "white"
/obj/structure/closet/wardrobe/chemistry_white/PopulateContents()
new /obj/item/clothing/under/rank/chemist(src)
new /obj/item/clothing/under/rank/chemist(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/suit/toggle/labcoat/chemist(src)
new /obj/item/clothing/suit/toggle/labcoat/chemist(src)
new /obj/item/storage/backpack/chemistry(src)
new /obj/item/storage/backpack/chemistry(src)
new /obj/item/storage/backpack/satchel/chem(src)
new /obj/item/storage/backpack/satchel/chem(src)
new /obj/item/storage/bag/chemistry(src)
new /obj/item/storage/bag/chemistry(src)
return
/obj/structure/closet/wardrobe/genetics_white
name = "genetics wardrobe"
icon_door = "white"
/obj/structure/closet/wardrobe/genetics_white/PopulateContents()
new /obj/item/clothing/under/rank/geneticist(src)
new /obj/item/clothing/under/rank/geneticist(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/suit/toggle/labcoat/genetics(src)
new /obj/item/clothing/suit/toggle/labcoat/genetics(src)
new /obj/item/storage/backpack/genetics(src)
new /obj/item/storage/backpack/genetics(src)
new /obj/item/storage/backpack/satchel/gen(src)
new /obj/item/storage/backpack/satchel/gen(src)
return
/obj/structure/closet/wardrobe/virology_white
name = "virology wardrobe"
icon_door = "white"
/obj/structure/closet/wardrobe/virology_white/PopulateContents()
new /obj/item/clothing/under/rank/virologist(src)
new /obj/item/clothing/under/rank/virologist(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/clothing/suit/toggle/labcoat/virologist(src)
new /obj/item/clothing/suit/toggle/labcoat/virologist(src)
new /obj/item/clothing/mask/surgical(src)
new /obj/item/clothing/mask/surgical(src)
new /obj/item/storage/backpack/virology(src)
new /obj/item/storage/backpack/virology(src)
new /obj/item/storage/backpack/satchel/vir(src)
new /obj/item/storage/backpack/satchel/vir(src)
return
/obj/structure/closet/wardrobe/science_white
name = "science wardrobe"
icon_door = "white"
/obj/structure/closet/wardrobe/science_white/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector(src)
new /obj/item/storage/backpack/science(src)
new /obj/item/storage/backpack/science(src)
new /obj/item/storage/backpack/satchel/tox(src)
new /obj/item/storage/backpack/satchel/tox(src)
new /obj/item/clothing/suit/hooded/wintercoat/science(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/scientist(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/toggle/labcoat/science(src)
for(var/i in 1 to 3)
new /obj/item/clothing/shoes/sneakers/white(src)
new /obj/item/radio/headset/headset_sci(src)
new /obj/item/radio/headset/headset_sci(src)
for(var/i in 1 to 3)
new /obj/item/clothing/mask/gas(src)
return
/obj/structure/closet/wardrobe/botanist
name = "botanist wardrobe"
icon_door = "green"
/obj/structure/closet/wardrobe/botanist/PopulateContents()
new /obj/item/storage/backpack/botany(src)
new /obj/item/storage/backpack/botany(src)
new /obj/item/storage/backpack/satchel/hyd(src)
new /obj/item/storage/backpack/satchel/hyd(src)
new /obj/item/clothing/suit/hooded/wintercoat/hydro(src)
new /obj/item/clothing/suit/apron(src)
new /obj/item/clothing/suit/apron(src)
new /obj/item/clothing/suit/apron/overalls(src)
new /obj/item/clothing/suit/apron/overalls(src)
for(var/i in 1 to 3)
new /obj/item/clothing/under/rank/hydroponics(src)
for(var/i in 1 to 3)
new /obj/item/clothing/mask/bandana(src)
/obj/structure/closet/wardrobe/curator
name = "treasure hunting wardrobe"
icon_door = "black"
/obj/structure/closet/wardrobe/curator/PopulateContents()
new /obj/item/clothing/accessory/pocketprotector/full(src)
new /obj/item/clothing/head/fedora/curator(src)
new /obj/item/clothing/suit/curator(src)
new /obj/item/clothing/under/rank/curator/treasure_hunter(src)
new /obj/item/clothing/shoes/workboots/mining(src)
new /obj/item/storage/backpack/satchel/explorer(src)
/obj/structure/closet/coffin/handle_lock_addition()
return
/obj/structure/closet/coffin/handle_lock_removal()
return
@@ -1,13 +1,13 @@
/obj/structure/closet/secure_closet/bar
name = "booze storage"
req_access = list(ACCESS_BAR)
icon_state = "cabinet"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
cutting_tool = /obj/item/screwdriver
/obj/structure/closet/secure_closet/bar/PopulateContents()
..()
for(var/i in 1 to 10)
new /obj/item/reagent_containers/food/drinks/beer( src )
/obj/structure/closet/secure_closet/bar
name = "booze storage"
req_access = list(ACCESS_BAR)
icon_state = "cabinet"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
cutting_tool = /obj/item/screwdriver
/obj/structure/closet/secure_closet/bar/PopulateContents()
..()
for(var/i in 1 to 10)
new /obj/item/reagent_containers/food/drinks/beer( src )
@@ -1,26 +1,26 @@
/obj/structure/closet/secure_closet/quartermaster
name = "\proper quartermaster's locker"
req_access = list(ACCESS_QM)
icon_state = "qm"
/obj/structure/closet/secure_closet/quartermaster/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/qm(src)
new /obj/item/clothing/head/beret/qm(src)
new /obj/item/storage/lockbox/medal/cargo(src)
new /obj/item/clothing/under/rank/cargo(src)
new /obj/item/clothing/under/rank/cargo/skirt(src)
new /obj/item/clothing/shoes/sneakers/brown(src)
new /obj/item/radio/headset/heads/qm(src)
new /obj/item/clothing/suit/fire/firefighter(src)
new /obj/item/clothing/gloves/fingerless(src)
new /obj/item/megaphone/cargo(src)
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/clothing/head/soft(src)
new /obj/item/export_scanner(src)
new /obj/item/door_remote/quartermaster(src)
new /obj/item/circuitboard/machine/techfab/department/cargo(src)
new /obj/item/storage/photo_album/QM(src)
new /obj/item/circuitboard/machine/ore_silo(src)
new /obj/item/clothing/suit/hooded/wintercoat/qm(src)
/obj/structure/closet/secure_closet/quartermaster
name = "\proper quartermaster's locker"
req_access = list(ACCESS_QM)
icon_state = "qm"
/obj/structure/closet/secure_closet/quartermaster/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/qm(src)
new /obj/item/clothing/head/beret/qm(src)
new /obj/item/storage/lockbox/medal/cargo(src)
new /obj/item/clothing/under/rank/cargo(src)
new /obj/item/clothing/under/rank/cargo/skirt(src)
new /obj/item/clothing/shoes/sneakers/brown(src)
new /obj/item/radio/headset/heads/qm(src)
new /obj/item/clothing/suit/fire/firefighter(src)
new /obj/item/clothing/gloves/fingerless(src)
new /obj/item/megaphone/cargo(src)
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/clothing/head/soft(src)
new /obj/item/export_scanner(src)
new /obj/item/door_remote/quartermaster(src)
new /obj/item/circuitboard/machine/techfab/department/cargo(src)
new /obj/item/storage/photo_album/QM(src)
new /obj/item/circuitboard/machine/ore_silo(src)
new /obj/item/clothing/suit/hooded/wintercoat/qm(src)
@@ -1,128 +1,129 @@
/obj/structure/closet/secure_closet/engineering_chief
name = "\proper chief engineer's locker"
req_access = list(ACCESS_CE)
icon_state = "ce"
/obj/structure/closet/secure_closet/engineering_chief/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/ce(src)
new /obj/item/clothing/head/beret/ce(src)
new /obj/item/clothing/under/rank/chief_engineer(src)
new /obj/item/clothing/under/rank/chief_engineer/skirt(src)
new /obj/item/clothing/head/hardhat/white(src)
new /obj/item/clothing/head/hardhat/weldhat/white(src)
new /obj/item/clothing/gloves/color/yellow(src)
new /obj/item/tank/jetpack/suit(src)
new /obj/item/cartridge/ce(src)
new /obj/item/radio/headset/heads/ce(src)
new /obj/item/megaphone/command(src)
new /obj/item/areaeditor/blueprints(src)
new /obj/item/holosign_creator/engineering(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/clothing/glasses/meson/engine(src)
new /obj/item/door_remote/chief_engineer(src)
new /obj/item/pipe_dispenser(src)
new /obj/item/inducer(src)
new /obj/item/circuitboard/machine/techfab/department/engineering(src)
new /obj/item/extinguisher/advanced(src)
new /obj/item/storage/photo_album/CE(src)
new /obj/item/storage/lockbox/medal/engineering(src)
new /obj/item/construction/rcd/loaded/upgraded(src)
new /obj/item/clothing/suit/hooded/wintercoat/ce(src)
new /obj/item/clothing/head/beret/ce/white(src)
/obj/structure/closet/secure_closet/engineering_electrical
name = "electrical supplies locker"
req_access = list(ACCESS_ENGINE_EQUIP)
icon_state = "eng"
icon_door = "eng_elec"
/obj/structure/closet/secure_closet/engineering_electrical/PopulateContents()
..()
new /obj/item/clothing/gloves/color/yellow(src)
new /obj/item/clothing/gloves/color/yellow(src)
new /obj/item/inducer(src)
new /obj/item/inducer(src)
for(var/i in 1 to 3)
new /obj/item/storage/toolbox/electrical(src)
for(var/i in 1 to 3)
new /obj/item/electronics/apc(src)
for(var/i in 1 to 3)
new /obj/item/multitool(src)
/obj/structure/closet/secure_closet/engineering_welding
name = "welding supplies locker"
req_access = list(ACCESS_ENGINE_EQUIP)
icon_state = "eng"
icon_door = "eng_weld"
/obj/structure/closet/secure_closet/engineering_welding/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/clothing/head/welding(src)
for(var/i in 1 to 3)
new /obj/item/weldingtool/largetank(src)
/obj/structure/closet/secure_closet/engineering_personal
name = "engineer's locker"
req_access = list(ACCESS_ENGINE_EQUIP)
icon_state = "eng_secure"
/obj/structure/closet/secure_closet/engineering_personal/PopulateContents()
..()
new /obj/item/radio/headset/headset_eng(src)
new /obj/item/storage/toolbox/mechanical(src)
new /obj/item/tank/internals/emergency_oxygen/engi(src)
new /obj/item/holosign_creator/engineering(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/clothing/glasses/meson/engine(src)
new /obj/item/storage/box/emptysandbags(src)
/obj/structure/closet/secure_closet/atmospherics
name = "\proper atmospheric technician's locker"
req_access = list(ACCESS_ATMOSPHERICS)
icon_state = "atmos"
/obj/structure/closet/secure_closet/atmospherics/PopulateContents()
..()
new /obj/item/radio/headset/headset_eng(src)
new /obj/item/pipe_dispenser(src)
new /obj/item/storage/toolbox/mechanical(src)
new /obj/item/tank/internals/emergency_oxygen/engi(src)
new /obj/item/analyzer(src)
new /obj/item/holosign_creator/atmos(src)
new /obj/item/watertank/atmos(src)
new /obj/item/clothing/suit/fire/atmos(src)
new /obj/item/clothing/head/hardhat/atmos(src)
new /obj/item/clothing/glasses/meson/engine/tray(src)
new /obj/item/extinguisher/advanced(src)
/*
* Empty lockers
* Some of the lockers are filled with junk, and sometimes its nice to just fill it with your own set-up for your own map gimmicks.
*/
/obj/structure/closet/secure_closet/engineering_chief/empty
/obj/structure/closet/secure_closet/engineering_chief/empty/PopulateContents()
return
/obj/structure/closet/secure_closet/engineering_electrical/empty
/obj/structure/closet/secure_closet/engineering_electrical/empty/PopulateContents()
return
/obj/structure/closet/secure_closet/engineering_welding/empty
/obj/structure/closet/secure_closet/engineering_welding/empty/PopulateContents()
return
/obj/structure/closet/secure_closet/engineering_personal/empty
/obj/structure/closet/secure_closet/engineering_personal/empty/PopulateContents()
return
/obj/structure/closet/secure_closet/atmospherics/empty
/obj/structure/closet/secure_closet/atmospherics/empty/PopulateContents()
return
/obj/structure/closet/secure_closet/engineering_chief
name = "\proper chief engineer's locker"
req_access = list(ACCESS_CE)
icon_state = "ce"
/obj/structure/closet/secure_closet/engineering_chief/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/ce(src)
new /obj/item/clothing/head/beret/ce(src)
new /obj/item/clothing/under/rank/chief_engineer(src)
new /obj/item/clothing/under/rank/chief_engineer/skirt(src)
new /obj/item/clothing/head/hardhat/white(src)
new /obj/item/clothing/head/hardhat/weldhat/white(src)
new /obj/item/clothing/gloves/color/yellow(src)
new /obj/item/tank/jetpack/suit(src)
new /obj/item/cartridge/ce(src)
new /obj/item/radio/headset/heads/ce(src)
new /obj/item/megaphone/command(src)
new /obj/item/areaeditor/blueprints(src)
new /obj/item/holosign_creator/engineering(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/clothing/glasses/meson/engine(src)
new /obj/item/door_remote/chief_engineer(src)
new /obj/item/pipe_dispenser(src)
new /obj/item/inducer(src)
new /obj/item/circuitboard/machine/techfab/department/engineering(src)
new /obj/item/extinguisher/advanced(src)
new /obj/item/storage/photo_album/CE(src)
new /obj/item/storage/lockbox/medal/engineering(src)
new /obj/item/construction/rcd/loaded/upgraded(src)
new /obj/item/clothing/suit/hooded/wintercoat/ce(src)
new /obj/item/clothing/head/beret/ce/white(src)
/obj/structure/closet/secure_closet/engineering_electrical
name = "electrical supplies locker"
req_access = list(ACCESS_ENGINE_EQUIP)
icon_state = "eng"
icon_door = "eng_elec"
/obj/structure/closet/secure_closet/engineering_electrical/PopulateContents()
..()
new /obj/item/clothing/gloves/color/yellow(src)
new /obj/item/clothing/gloves/color/yellow(src)
new /obj/item/inducer(src)
new /obj/item/inducer(src)
for(var/i in 1 to 3)
new /obj/item/storage/toolbox/electrical(src)
for(var/i in 1 to 3)
new /obj/item/electronics/apc(src)
for(var/i in 1 to 3)
new /obj/item/multitool(src)
/obj/structure/closet/secure_closet/engineering_welding
name = "welding supplies locker"
req_access = list(ACCESS_ENGINE_EQUIP)
icon_state = "eng"
icon_door = "eng_weld"
/obj/structure/closet/secure_closet/engineering_welding/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/clothing/head/welding(src)
for(var/i in 1 to 3)
new /obj/item/weldingtool/largetank(src)
/obj/structure/closet/secure_closet/engineering_personal
name = "engineer's locker"
req_access = list(ACCESS_ENGINE_EQUIP)
icon_state = "eng_secure"
/obj/structure/closet/secure_closet/engineering_personal/PopulateContents()
..()
new /obj/item/radio/headset/headset_eng(src)
new /obj/item/storage/toolbox/mechanical(src)
new /obj/item/tank/internals/emergency_oxygen/engi(src)
new /obj/item/holosign_creator/engineering(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/clothing/glasses/meson/engine(src)
new /obj/item/storage/box/emptysandbags(src)
/obj/structure/closet/secure_closet/atmospherics
name = "\proper atmospheric technician's locker"
req_access = list(ACCESS_ATMOSPHERICS)
icon_state = "atmos"
/obj/structure/closet/secure_closet/atmospherics/PopulateContents()
..()
new /obj/item/radio/headset/headset_eng(src)
new /obj/item/pipe_dispenser(src)
new /obj/item/storage/toolbox/mechanical(src)
new /obj/item/tank/internals/emergency_oxygen/engi(src)
new /obj/item/analyzer(src)
new /obj/item/holosign_creator/atmos(src)
new /obj/item/holosign_creator/firelock(src)
new /obj/item/watertank/atmos(src)
new /obj/item/clothing/suit/fire/atmos(src)
new /obj/item/clothing/head/hardhat/atmos(src)
new /obj/item/clothing/glasses/meson/engine/tray(src)
new /obj/item/extinguisher/advanced(src)
/*
* Empty lockers
* Some of the lockers are filled with junk, and sometimes its nice to just fill it with your own set-up for your own map gimmicks.
*/
/obj/structure/closet/secure_closet/engineering_chief/empty
/obj/structure/closet/secure_closet/engineering_chief/empty/PopulateContents()
return
/obj/structure/closet/secure_closet/engineering_electrical/empty
/obj/structure/closet/secure_closet/engineering_electrical/empty/PopulateContents()
return
/obj/structure/closet/secure_closet/engineering_welding/empty
/obj/structure/closet/secure_closet/engineering_welding/empty/PopulateContents()
return
/obj/structure/closet/secure_closet/engineering_personal/empty
/obj/structure/closet/secure_closet/engineering_personal/empty/PopulateContents()
return
/obj/structure/closet/secure_closet/atmospherics/empty
/obj/structure/closet/secure_closet/atmospherics/empty/PopulateContents()
return
@@ -1,106 +1,106 @@
/obj/structure/closet/secure_closet/freezer
icon_state = "freezer"
var/jones = FALSE
/obj/structure/closet/secure_closet/freezer/Destroy()
recursive_organ_check(src)
..()
/obj/structure/closet/secure_closet/freezer/Initialize()
..()
recursive_organ_check(src)
/obj/structure/closet/secure_closet/freezer/open(mob/living/user)
if(opened || !can_open(user)) //dupe check just so we don't let the organs decay when someone fails to open the locker
return FALSE
recursive_organ_check(src)
return ..()
/obj/structure/closet/secure_closet/freezer/close(mob/living/user)
if(..()) //if we actually closed the locker
recursive_organ_check(src)
/obj/structure/closet/secure_closet/freezer/ex_act()
if(!jones)
jones = TRUE
else
..()
/obj/structure/closet/secure_closet/freezer/kitchen
name = "kitchen Cabinet"
req_access = list(ACCESS_KITCHEN)
/obj/structure/closet/secure_closet/freezer/kitchen/PopulateContents()
..()
for(var/i = 0, i < 3, i++)
new /obj/item/reagent_containers/food/condiment/flour(src)
new /obj/item/reagent_containers/food/condiment/rice(src)
new /obj/item/reagent_containers/food/condiment/sugar(src)
/obj/structure/closet/secure_closet/freezer/kitchen/maintenance
name = "maintenance refrigerator"
desc = "This refrigerator looks quite dusty, is there anything edible still inside?"
req_access = list()
/obj/structure/closet/secure_closet/freezer/kitchen/maintenance/PopulateContents()
..()
for(var/i = 0, i < 5, i++)
new /obj/item/reagent_containers/food/condiment/milk(src)
for(var/i = 0, i < 5, i++)
new /obj/item/reagent_containers/food/condiment/soymilk(src)
for(var/i = 0, i < 2, i++)
new /obj/item/storage/fancy/egg_box(src)
/obj/structure/closet/secure_closet/freezer/kitchen/mining
req_access = list()
/obj/structure/closet/secure_closet/freezer/meat
name = "meat fridge"
/obj/structure/closet/secure_closet/freezer/meat/PopulateContents()
..()
for(var/i = 0, i < 4, i++)
new /obj/item/reagent_containers/food/snacks/meat/slab/monkey(src)
/obj/structure/closet/secure_closet/freezer/meat/open
req_access = null
locked = FALSE
/obj/structure/closet/secure_closet/freezer/fridge
name = "refrigerator"
/obj/structure/closet/secure_closet/freezer/fridge/PopulateContents()
..()
for(var/i = 0, i < 5, i++)
new /obj/item/reagent_containers/food/condiment/milk(src)
for(var/i = 0, i < 5, i++)
new /obj/item/reagent_containers/food/condiment/soymilk(src)
for(var/i = 0, i < 2, i++)
new /obj/item/storage/fancy/egg_box(src)
/obj/structure/closet/secure_closet/freezer/fridge/open
req_access = null
locked = FALSE
/obj/structure/closet/secure_closet/freezer/money
name = "freezer"
desc = "This contains cold hard cash."
req_access = list(ACCESS_VAULT)
/obj/structure/closet/secure_closet/freezer/money/PopulateContents()
..()
for(var/i = 0, i < 3, i++)
new /obj/item/stack/spacecash/c1000(src)
for(var/i = 0, i < 5, i++)
new /obj/item/stack/spacecash/c500(src)
for(var/i = 0, i < 6, i++)
new /obj/item/stack/spacecash/c200(src)
/obj/structure/closet/secure_closet/freezer/cream_pie
name = "cream pie closet"
desc = "Contains pies filled with cream and/or custard, you sickos."
req_access = list(ACCESS_THEATRE)
/obj/structure/closet/secure_closet/freezer/cream_pie/PopulateContents()
..()
new /obj/item/reagent_containers/food/snacks/pie/cream(src)
/obj/structure/closet/secure_closet/freezer
icon_state = "freezer"
var/jones = FALSE
/obj/structure/closet/secure_closet/freezer/Destroy()
recursive_organ_check(src)
..()
/obj/structure/closet/secure_closet/freezer/Initialize()
..()
recursive_organ_check(src)
/obj/structure/closet/secure_closet/freezer/open(mob/living/user)
if(opened || !can_open(user)) //dupe check just so we don't let the organs decay when someone fails to open the locker
return FALSE
recursive_organ_check(src)
return ..()
/obj/structure/closet/secure_closet/freezer/close(mob/living/user)
if(..()) //if we actually closed the locker
recursive_organ_check(src)
/obj/structure/closet/secure_closet/freezer/ex_act()
if(!jones)
jones = TRUE
else
..()
/obj/structure/closet/secure_closet/freezer/kitchen
name = "kitchen Cabinet"
req_access = list(ACCESS_KITCHEN)
/obj/structure/closet/secure_closet/freezer/kitchen/PopulateContents()
..()
for(var/i = 0, i < 3, i++)
new /obj/item/reagent_containers/food/condiment/flour(src)
new /obj/item/reagent_containers/food/condiment/rice(src)
new /obj/item/reagent_containers/food/condiment/sugar(src)
/obj/structure/closet/secure_closet/freezer/kitchen/maintenance
name = "maintenance refrigerator"
desc = "This refrigerator looks quite dusty, is there anything edible still inside?"
req_access = list()
/obj/structure/closet/secure_closet/freezer/kitchen/maintenance/PopulateContents()
..()
for(var/i = 0, i < 5, i++)
new /obj/item/reagent_containers/food/condiment/milk(src)
for(var/i = 0, i < 5, i++)
new /obj/item/reagent_containers/food/condiment/soymilk(src)
for(var/i = 0, i < 2, i++)
new /obj/item/storage/fancy/egg_box(src)
/obj/structure/closet/secure_closet/freezer/kitchen/mining
req_access = list()
/obj/structure/closet/secure_closet/freezer/meat
name = "meat fridge"
/obj/structure/closet/secure_closet/freezer/meat/PopulateContents()
..()
for(var/i = 0, i < 4, i++)
new /obj/item/reagent_containers/food/snacks/meat/slab/monkey(src)
/obj/structure/closet/secure_closet/freezer/meat/open
req_access = null
locked = FALSE
/obj/structure/closet/secure_closet/freezer/fridge
name = "refrigerator"
/obj/structure/closet/secure_closet/freezer/fridge/PopulateContents()
..()
for(var/i = 0, i < 5, i++)
new /obj/item/reagent_containers/food/condiment/milk(src)
for(var/i = 0, i < 5, i++)
new /obj/item/reagent_containers/food/condiment/soymilk(src)
for(var/i = 0, i < 2, i++)
new /obj/item/storage/fancy/egg_box(src)
/obj/structure/closet/secure_closet/freezer/fridge/open
req_access = null
locked = FALSE
/obj/structure/closet/secure_closet/freezer/money
name = "freezer"
desc = "This contains cold hard cash."
req_access = list(ACCESS_VAULT)
/obj/structure/closet/secure_closet/freezer/money/PopulateContents()
..()
for(var/i = 0, i < 3, i++)
new /obj/item/stack/spacecash/c1000(src)
for(var/i = 0, i < 5, i++)
new /obj/item/stack/spacecash/c500(src)
for(var/i = 0, i < 6, i++)
new /obj/item/stack/spacecash/c200(src)
/obj/structure/closet/secure_closet/freezer/cream_pie
name = "cream pie closet"
desc = "Contains pies filled with cream and/or custard, you sickos."
req_access = list(ACCESS_THEATRE)
/obj/structure/closet/secure_closet/freezer/cream_pie/PopulateContents()
..()
new /obj/item/reagent_containers/food/snacks/pie/cream(src)
@@ -1,13 +1,13 @@
/obj/structure/closet/secure_closet/hydroponics
name = "botanist's locker"
req_access = list(ACCESS_HYDROPONICS)
icon_state = "hydro"
/obj/structure/closet/secure_closet/hydroponics/PopulateContents()
..()
new /obj/item/storage/bag/plants/portaseeder(src)
new /obj/item/plant_analyzer(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/cultivator(src)
new /obj/item/hatchet(src)
/obj/structure/closet/secure_closet/hydroponics
name = "botanist's locker"
req_access = list(ACCESS_HYDROPONICS)
icon_state = "hydro"
/obj/structure/closet/secure_closet/hydroponics/PopulateContents()
..()
new /obj/item/storage/bag/plants/portaseeder(src)
new /obj/item/plant_analyzer(src)
new /obj/item/radio/headset/headset_srv(src)
new /obj/item/cultivator(src)
new /obj/item/hatchet(src)
new /obj/item/storage/box/disks_plantgene(src)
@@ -1,107 +1,107 @@
/obj/structure/closet/secure_closet/medical1
name = "medicine closet"
desc = "Filled to the brim with medical junk."
icon_state = "med"
req_access = list(ACCESS_MEDICAL)
/obj/structure/closet/secure_closet/medical1/PopulateContents()
..()
new /obj/item/reagent_containers/glass/beaker(src)
new /obj/item/reagent_containers/glass/beaker(src)
new /obj/item/reagent_containers/dropper(src)
new /obj/item/reagent_containers/dropper(src)
new /obj/item/storage/belt/medical(src)
new /obj/item/storage/box/syringes(src)
new /obj/item/reagent_containers/glass/bottle/toxin(src)
new /obj/item/reagent_containers/glass/bottle/morphine(src)
new /obj/item/reagent_containers/glass/bottle/morphine(src)
for(var/i in 1 to 3)
new /obj/item/reagent_containers/glass/bottle/epinephrine(src)
for(var/i in 1 to 3)
new /obj/item/reagent_containers/glass/bottle/charcoal(src)
new /obj/item/storage/box/rxglasses(src)
/obj/structure/closet/secure_closet/medical2
name = "anesthetic closet"
desc = "Used to knock people out."
req_access = list(ACCESS_SURGERY)
/obj/structure/closet/secure_closet/medical2/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/tank/internals/anesthetic(src)
for(var/i in 1 to 3)
new /obj/item/clothing/mask/breath/medical(src)
/obj/structure/closet/secure_closet/medical3
name = "medical doctor's locker"
req_access = list(ACCESS_SURGERY)
icon_state = "med_secure"
/obj/structure/closet/secure_closet/medical3/PopulateContents()
..()
new /obj/item/radio/headset/headset_med(src)
new /obj/item/defibrillator/loaded(src)
new /obj/item/clothing/gloves/color/latex/nitrile(src)
new /obj/item/storage/belt/medical(src)
new /obj/item/clothing/glasses/hud/health(src)
return
/obj/structure/closet/secure_closet/CMO
name = "\proper chief medical officer's locker"
req_access = list(ACCESS_CMO)
icon_state = "cmo"
/obj/structure/closet/secure_closet/CMO/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/cmo(src)
new /obj/item/clothing/head/beret/cmo(src)
new /obj/item/storage/backpack/duffelbag/med(src)
new /obj/item/clothing/suit/bio_suit/cmo(src)
new /obj/item/clothing/head/bio_hood/cmo(src)
new /obj/item/clothing/suit/toggle/labcoat/cmo(src)
new /obj/item/clothing/under/rank/chief_medical_officer(src)
new /obj/item/clothing/under/rank/chief_medical_officer/skirt(src)
new /obj/item/clothing/shoes/sneakers/brown (src)
new /obj/item/cartridge/cmo(src)
new /obj/item/radio/headset/heads/cmo(src)
new /obj/item/megaphone/command(src)
new /obj/item/defibrillator/compact/loaded(src)
new /obj/item/clothing/gloves/color/latex/nitrile(src)
new /obj/item/storage/belt/medical(src)
new /obj/item/healthanalyzer/advanced(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/storage/hypospraykit/cmo(src)
new /obj/item/autosurgeon/cmo(src)
new /obj/item/door_remote/chief_medical_officer(src)
new /obj/item/clothing/neck/petcollar(src)
new /obj/item/pet_carrier(src)
new /obj/item/storage/belt/medical/surgery_belt_adv(src)
new /obj/item/wallframe/defib_mount(src)
new /obj/item/circuitboard/machine/techfab/department/medical(src)
new /obj/item/storage/photo_album/CMO(src)
new /obj/item/storage/lockbox/medal/medical(src)
new /obj/item/clothing/suit/hooded/wintercoat/cmo(src)
new /obj/item/clothing/head/beret/cmo/blue(src)
/obj/structure/closet/secure_closet/animal
name = "animal control"
req_access = list(ACCESS_SURGERY)
/obj/structure/closet/secure_closet/animal/PopulateContents()
..()
new /obj/item/assembly/signaler(src)
for(var/i in 1 to 3)
new /obj/item/electropack(src)
/obj/structure/closet/secure_closet/chemical
name = "chemical closet"
desc = "Store dangerous chemicals in here."
icon_door = "chemical"
/obj/structure/closet/secure_closet/chemical/PopulateContents()
..()
new /obj/item/storage/box/pillbottles(src)
new /obj/item/storage/box/pillbottles(src)
new /obj/item/storage/box/medsprays(src)
new /obj/item/storage/box/medsprays(src)
/obj/structure/closet/secure_closet/medical1
name = "medicine closet"
desc = "Filled to the brim with medical junk."
icon_state = "med"
req_access = list(ACCESS_MEDICAL)
/obj/structure/closet/secure_closet/medical1/PopulateContents()
..()
new /obj/item/reagent_containers/glass/beaker(src)
new /obj/item/reagent_containers/glass/beaker(src)
new /obj/item/reagent_containers/dropper(src)
new /obj/item/reagent_containers/dropper(src)
new /obj/item/storage/belt/medical(src)
new /obj/item/storage/box/syringes(src)
new /obj/item/reagent_containers/glass/bottle/toxin(src)
new /obj/item/reagent_containers/glass/bottle/morphine(src)
new /obj/item/reagent_containers/glass/bottle/morphine(src)
for(var/i in 1 to 3)
new /obj/item/reagent_containers/glass/bottle/epinephrine(src)
for(var/i in 1 to 3)
new /obj/item/reagent_containers/glass/bottle/charcoal(src)
new /obj/item/storage/box/rxglasses(src)
/obj/structure/closet/secure_closet/medical2
name = "anesthetic closet"
desc = "Used to knock people out."
req_access = list(ACCESS_SURGERY)
/obj/structure/closet/secure_closet/medical2/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/tank/internals/anesthetic(src)
for(var/i in 1 to 3)
new /obj/item/clothing/mask/breath/medical(src)
/obj/structure/closet/secure_closet/medical3
name = "medical doctor's locker"
req_access = list(ACCESS_SURGERY)
icon_state = "med_secure"
/obj/structure/closet/secure_closet/medical3/PopulateContents()
..()
new /obj/item/radio/headset/headset_med(src)
new /obj/item/defibrillator/loaded(src)
new /obj/item/clothing/gloves/color/latex/nitrile(src)
new /obj/item/storage/belt/medical(src)
new /obj/item/clothing/glasses/hud/health(src)
return
/obj/structure/closet/secure_closet/CMO
name = "\proper chief medical officer's locker"
req_access = list(ACCESS_CMO)
icon_state = "cmo"
/obj/structure/closet/secure_closet/CMO/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/cmo(src)
new /obj/item/clothing/head/beret/cmo(src)
new /obj/item/storage/backpack/duffelbag/med(src)
new /obj/item/clothing/suit/bio_suit/cmo(src)
new /obj/item/clothing/head/bio_hood/cmo(src)
new /obj/item/clothing/suit/toggle/labcoat/cmo(src)
new /obj/item/clothing/under/rank/chief_medical_officer(src)
new /obj/item/clothing/under/rank/chief_medical_officer/skirt(src)
new /obj/item/clothing/shoes/sneakers/brown (src)
new /obj/item/cartridge/cmo(src)
new /obj/item/radio/headset/heads/cmo(src)
new /obj/item/megaphone/command(src)
new /obj/item/defibrillator/compact/loaded(src)
new /obj/item/clothing/gloves/color/latex/nitrile(src)
new /obj/item/storage/belt/medical(src)
new /obj/item/healthanalyzer/advanced(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/storage/hypospraykit/cmo(src)
new /obj/item/autosurgeon/cmo(src)
new /obj/item/door_remote/chief_medical_officer(src)
new /obj/item/clothing/neck/petcollar(src)
new /obj/item/pet_carrier(src)
new /obj/item/storage/belt/medical/surgery_belt_adv(src)
new /obj/item/wallframe/defib_mount(src)
new /obj/item/circuitboard/machine/techfab/department/medical(src)
new /obj/item/storage/photo_album/CMO(src)
new /obj/item/storage/lockbox/medal/medical(src)
new /obj/item/clothing/suit/hooded/wintercoat/cmo(src)
new /obj/item/clothing/head/beret/cmo/blue(src)
/obj/structure/closet/secure_closet/animal
name = "animal control"
req_access = list(ACCESS_SURGERY)
/obj/structure/closet/secure_closet/animal/PopulateContents()
..()
new /obj/item/assembly/signaler(src)
for(var/i in 1 to 3)
new /obj/item/electropack(src)
/obj/structure/closet/secure_closet/chemical
name = "chemical closet"
desc = "Store dangerous chemicals in here."
icon_door = "chemical"
/obj/structure/closet/secure_closet/chemical/PopulateContents()
..()
new /obj/item/storage/box/pillbottles(src)
new /obj/item/storage/box/pillbottles(src)
new /obj/item/storage/box/medsprays(src)
new /obj/item/storage/box/medsprays(src)
@@ -1,75 +1,75 @@
/obj/structure/closet/secure_closet/personal
desc = "It's a secure locker for personnel. The first card swiped gains control."
name = "personal closet"
req_access = list(ACCESS_ALL_PERSONAL_LOCKERS)
var/registered_name = null
/obj/structure/closet/secure_closet/personal/examine(mob/user)
. = ..()
if(registered_name)
. += "<span class='notice'>The display reads, \"Owned by [registered_name]\".</span>"
/obj/structure/closet/secure_closet/personal/check_access(obj/item/I)
. = ..()
if(!I || !istype(I))
return
if(istype(I,/obj/item/modular_computer/tablet))
var/obj/item/modular_computer/tablet/ourTablet = I
var/obj/item/computer_hardware/card_slot/card_slot = ourTablet.all_components[MC_CARD]
if(card_slot)
return registered_name == card_slot.stored_card.registered_name || registered_name == card_slot.stored_card2.registered_name
var/obj/item/card/id/ID = I.GetID()
if(ID && registered_name == ID.registered_name)
return TRUE
return FALSE
/obj/structure/closet/secure_closet/personal/PopulateContents()
..()
if(prob(50))
new /obj/item/storage/backpack/duffelbag(src)
if(prob(50))
new /obj/item/storage/backpack(src)
else
new /obj/item/storage/backpack/satchel(src)
new /obj/item/radio/headset( src )
/obj/structure/closet/secure_closet/personal/patient
name = "patient's closet"
/obj/structure/closet/secure_closet/personal/patient/PopulateContents()
new /obj/item/clothing/under/color/white( src )
new /obj/item/clothing/shoes/sneakers/white( src )
/obj/structure/closet/secure_closet/personal/cabinet
icon_state = "cabinet"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
cutting_tool = /obj/item/screwdriver
/obj/structure/closet/secure_closet/personal/cabinet/PopulateContents()
new /obj/item/storage/backpack/satchel/leather/withwallet( src )
new /obj/item/instrument/piano_synth(src)
new /obj/item/radio/headset( src )
new /obj/item/clothing/head/colour(src)
/obj/structure/closet/secure_closet/personal/attackby(obj/item/W, mob/user, params)
var/obj/item/card/id/I = W.GetID()
if(!I || !istype(I))
return ..()
if(!can_lock(user, FALSE)) //Can't do anything if there isn't a lock!
return
if(I.registered_name && !registered_name)
to_chat(user, "<span class='notice'>You claim [src].</span>")
registered_name = I.registered_name
else
..()
/obj/structure/closet/secure_closet/personal/handle_lock_addition() //If lock construction is successful we don't care what access the electronics had, so we override it
if(..())
req_access = list(ACCESS_ALL_PERSONAL_LOCKERS)
lockerelectronics.accesses = req_access
/obj/structure/closet/secure_closet/personal/handle_lock_removal()
if(..())
registered_name = null
/obj/structure/closet/secure_closet/personal
desc = "It's a secure locker for personnel. The first card swiped gains control."
name = "personal closet"
req_access = list(ACCESS_ALL_PERSONAL_LOCKERS)
var/registered_name = null
/obj/structure/closet/secure_closet/personal/examine(mob/user)
. = ..()
if(registered_name)
. += "<span class='notice'>The display reads, \"Owned by [registered_name]\".</span>"
/obj/structure/closet/secure_closet/personal/check_access(obj/item/I)
. = ..()
if(!I || !istype(I))
return
if(istype(I,/obj/item/modular_computer/tablet))
var/obj/item/modular_computer/tablet/ourTablet = I
var/obj/item/computer_hardware/card_slot/card_slot = ourTablet.all_components[MC_CARD]
if(card_slot)
return registered_name == card_slot.stored_card.registered_name || registered_name == card_slot.stored_card2.registered_name
var/obj/item/card/id/ID = I.GetID()
if(ID && registered_name == ID.registered_name)
return TRUE
return FALSE
/obj/structure/closet/secure_closet/personal/PopulateContents()
..()
if(prob(50))
new /obj/item/storage/backpack/duffelbag(src)
if(prob(50))
new /obj/item/storage/backpack(src)
else
new /obj/item/storage/backpack/satchel(src)
new /obj/item/radio/headset( src )
/obj/structure/closet/secure_closet/personal/patient
name = "patient's closet"
/obj/structure/closet/secure_closet/personal/patient/PopulateContents()
new /obj/item/clothing/under/color/white( src )
new /obj/item/clothing/shoes/sneakers/white( src )
/obj/structure/closet/secure_closet/personal/cabinet
icon_state = "cabinet"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
cutting_tool = /obj/item/screwdriver
/obj/structure/closet/secure_closet/personal/cabinet/PopulateContents()
new /obj/item/storage/backpack/satchel/leather/withwallet( src )
new /obj/item/instrument/piano_synth(src)
new /obj/item/radio/headset( src )
new /obj/item/clothing/head/colour(src)
/obj/structure/closet/secure_closet/personal/attackby(obj/item/W, mob/user, params)
var/obj/item/card/id/I = W.GetID()
if(!I || !istype(I))
return ..()
if(!can_lock(user, FALSE)) //Can't do anything if there isn't a lock!
return
if(I.registered_name && !registered_name)
to_chat(user, "<span class='notice'>You claim [src].</span>")
registered_name = I.registered_name
else
..()
/obj/structure/closet/secure_closet/personal/handle_lock_addition() //If lock construction is successful we don't care what access the electronics had, so we override it
if(..())
req_access = list(ACCESS_ALL_PERSONAL_LOCKERS)
lockerelectronics.accesses = req_access
/obj/structure/closet/secure_closet/personal/handle_lock_removal()
if(..())
registered_name = null
@@ -1,34 +1,34 @@
/obj/structure/closet/secure_closet/RD
name = "\proper research director's locker"
req_access = list(ACCESS_RD)
icon_state = "rd"
/obj/structure/closet/secure_closet/RD/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/rd(src)
new /obj/item/clothing/head/beret/rd(src)
new /obj/item/clothing/suit/bio_suit/scientist(src)
new /obj/item/clothing/head/bio_hood/scientist(src)
new /obj/item/clothing/suit/toggle/labcoat(src)
new /obj/item/clothing/under/rank/research_director(src)
new /obj/item/clothing/under/rank/research_director/skirt(src)
new /obj/item/clothing/under/rank/research_director/alt(src)
new /obj/item/clothing/under/rank/research_director/alt/skirt(src)
new /obj/item/clothing/under/rank/research_director/turtleneck(src)
new /obj/item/clothing/under/rank/research_director/turtleneck/skirt(src)
new /obj/item/clothing/shoes/sneakers/brown(src)
new /obj/item/cartridge/rd(src)
new /obj/item/clothing/gloves/color/latex(src)
new /obj/item/radio/headset/heads/rd(src)
new /obj/item/tank/internals/air(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/megaphone/command(src)
new /obj/item/storage/lockbox/medal/sci(src)
new /obj/item/clothing/suit/armor/reactive/teleport(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/laser_pointer(src)
new /obj/item/door_remote/research_director(src)
new /obj/item/circuitboard/machine/techfab/department/science(src)
new /obj/item/storage/photo_album/RD(src)
new /obj/item/clothing/suit/hooded/wintercoat/rd(src)
/obj/structure/closet/secure_closet/RD
name = "\proper research director's locker"
req_access = list(ACCESS_RD)
icon_state = "rd"
/obj/structure/closet/secure_closet/RD/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/rd(src)
new /obj/item/clothing/head/beret/rd(src)
new /obj/item/clothing/suit/bio_suit/scientist(src)
new /obj/item/clothing/head/bio_hood/scientist(src)
new /obj/item/clothing/suit/toggle/labcoat(src)
new /obj/item/clothing/under/rank/research_director(src)
new /obj/item/clothing/under/rank/research_director/skirt(src)
new /obj/item/clothing/under/rank/research_director/alt(src)
new /obj/item/clothing/under/rank/research_director/alt/skirt(src)
new /obj/item/clothing/under/rank/research_director/turtleneck(src)
new /obj/item/clothing/under/rank/research_director/turtleneck/skirt(src)
new /obj/item/clothing/shoes/sneakers/brown(src)
new /obj/item/cartridge/rd(src)
new /obj/item/clothing/gloves/color/latex(src)
new /obj/item/radio/headset/heads/rd(src)
new /obj/item/tank/internals/air(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/megaphone/command(src)
new /obj/item/storage/lockbox/medal/sci(src)
new /obj/item/clothing/suit/armor/reactive/teleport(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/laser_pointer(src)
new /obj/item/door_remote/research_director(src)
new /obj/item/circuitboard/machine/techfab/department/science(src)
new /obj/item/storage/photo_album/RD(src)
new /obj/item/clothing/suit/hooded/wintercoat/rd(src)
@@ -1,13 +1,13 @@
/obj/structure/closet/secure_closet
name = "secure locker"
desc = "It's a card-locked storage unit."
locked = TRUE
icon_state = "secure"
max_integrity = 250
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
secure = TRUE
/obj/structure/closet/secure_closet/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee" && damage_amount < 20)
return 0
/obj/structure/closet/secure_closet
name = "secure locker"
desc = "It's a card-locked storage unit."
locked = TRUE
icon_state = "secure"
max_integrity = 250
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
secure = TRUE
/obj/structure/closet/secure_closet/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee" && damage_amount < 20)
return 0
. = ..()
@@ -1,293 +1,292 @@
/obj/structure/closet/secure_closet/captains
name = "\proper captain's locker"
req_access = list(ACCESS_CAPTAIN)
icon_state = "cap"
/obj/structure/closet/secure_closet/captains/PopulateContents()
..()
new /obj/item/clothing/suit/hooded/wintercoat/captain(src)
new /obj/item/storage/backpack/captain(src)
new /obj/item/storage/backpack/satchel/cap(src)
new /obj/item/storage/backpack/duffelbag/captain(src)
new /obj/item/clothing/neck/cloak/cap(src)
new /obj/item/clothing/neck/petcollar(src)
new /obj/item/pet_carrier(src)
new /obj/item/clothing/shoes/sneakers/brown(src)
new /obj/item/clothing/under/rank/captain(src)
new /obj/item/clothing/under/rank/captain/skirt(src)
new /obj/item/clothing/suit/armor/vest/capcarapace(src)
new /obj/item/clothing/head/caphat(src)
new /obj/item/clothing/under/captainparade(src)
new /obj/item/clothing/suit/armor/vest/capcarapace/alt(src)
new /obj/item/clothing/head/caphat/parade(src)
new /obj/item/clothing/head/caphat/beret(src)
new /obj/item/clothing/suit/captunic(src)
new /obj/item/clothing/under/rank/captain/femformal(src) //citadel edit
new /obj/item/clothing/head/crown/fancy(src)
new /obj/item/cartridge/captain(src)
new /obj/item/storage/box/silver_ids(src)
new /obj/item/radio/headset/heads/captain/alt(src)
new /obj/item/radio/headset/heads/captain(src)
new /obj/item/clothing/glasses/sunglasses/gar/supergar(src)
new /obj/item/clothing/gloves/color/captain(src)
new /obj/item/restraints/handcuffs/cable/zipties(src)
new /obj/item/storage/belt/sabre(src)
new /obj/item/gun/energy/e_gun(src)
new /obj/item/door_remote/captain(src)
new /obj/item/storage/photo_album/Captain(src)
new /obj/item/clothing/head/caphat/beret/white(src)
/obj/structure/closet/secure_closet/hop
name = "\proper head of personnel's locker"
req_access = list(ACCESS_HOP)
icon_state = "hop"
/obj/structure/closet/secure_closet/hop/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/hop(src)
new /obj/item/clothing/under/rank/head_of_personnel(src)
new /obj/item/clothing/under/rank/head_of_personnel/skirt(src)
new /obj/item/clothing/head/hopcap(src)
new /obj/item/clothing/head/hopcap/beret(src)
new /obj/item/cartridge/hop(src)
new /obj/item/radio/headset/heads/hop(src)
new /obj/item/clothing/shoes/sneakers/brown(src)
new /obj/item/storage/box/ids(src)
new /obj/item/storage/box/ids(src)
new /obj/item/megaphone/command(src)
new /obj/item/clothing/suit/armor/vest/alt(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/clothing/glasses/sunglasses(src)
new /obj/item/restraints/handcuffs/cable/zipties(src)
new /obj/item/gun/energy/e_gun(src)
new /obj/item/clothing/neck/petcollar(src)
new /obj/item/pet_carrier(src)
new /obj/item/door_remote/civillian(src)
new /obj/item/circuitboard/machine/techfab/department/service(src)
new /obj/item/storage/photo_album/HoP(src)
new /obj/item/clothing/suit/hooded/wintercoat/hop(src)
new /obj/item/clothing/head/hopcap/beret/white(src)
/obj/structure/closet/secure_closet/hos
name = "\proper head of security's locker"
req_access = list(ACCESS_HOS)
icon_state = "hos"
/obj/structure/closet/secure_closet/hos/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/hos(src)
new /obj/item/cartridge/hos(src)
new /obj/item/radio/headset/heads/hos(src)
new /obj/item/clothing/under/hosparadefem(src)
new /obj/item/clothing/under/hosparademale(src)
new /obj/item/clothing/suit/armor/vest/leather(src)
new /obj/item/clothing/suit/armor/hos(src)
new /obj/item/clothing/under/rank/head_of_security/skirt(src)
new /obj/item/clothing/under/rank/head_of_security/alt(src)
new /obj/item/clothing/under/rank/head_of_security/alt/skirt(src)
new /obj/item/clothing/head/HoS(src)
new /obj/item/clothing/glasses/hud/security/sunglasses/eyepatch(src)
new /obj/item/clothing/glasses/hud/security/sunglasses/gars/supergars(src)
new /obj/item/clothing/under/rank/head_of_security/grey(src)
new /obj/item/storage/lockbox/medal/sec(src)
new /obj/item/megaphone/sec(src)
new /obj/item/holosign_creator/security(src)
new /obj/item/storage/lockbox/loyalty(src)
new /obj/item/clothing/mask/gas/sechailer/swat(src)
new /obj/item/storage/box/flashbangs(src)
new /obj/item/shield/riot/tele(src)
new /obj/item/storage/belt/security/full(src)
new /obj/item/gun/energy/e_gun/hos(src)
new /obj/item/flashlight/seclite(src)
new /obj/item/pinpointer/nuke(src)
new /obj/item/circuitboard/machine/techfab/department/security(src)
new /obj/item/storage/photo_album/HoS(src)
new /obj/item/clothing/suit/hooded/wintercoat/hos(src)
/obj/structure/closet/secure_closet/warden
name = "\proper warden's locker"
req_access = list(ACCESS_ARMORY)
icon_state = "warden"
/obj/structure/closet/secure_closet/warden/PopulateContents()
..()
new /obj/item/radio/headset/headset_sec(src)
new /obj/item/clothing/suit/armor/vest/warden(src)
new /obj/item/clothing/head/warden(src)
new /obj/item/clothing/head/warden/drill(src)
new /obj/item/clothing/head/beret/sec/navywarden(src)
new /obj/item/clothing/suit/armor/vest/warden/alt(src)
new /obj/item/clothing/under/rank/warden/navyblue(src)
new /obj/item/clothing/under/rank/warden/skirt(src)
new /obj/item/clothing/glasses/hud/security/sunglasses(src)
new /obj/item/holosign_creator/security(src)
new /obj/item/clothing/mask/gas/sechailer(src)
new /obj/item/storage/box/zipties(src)
new /obj/item/storage/box/flashbangs(src)
new /obj/item/storage/belt/security/full(src)
new /obj/item/flashlight/seclite(src)
new /obj/item/clothing/gloves/krav_maga/sec(src)
new /obj/item/door_remote/head_of_security(src)
new /obj/item/gun/ballistic/shotgun/automatic/combat/compact(src)
new /obj/item/clothing/head/beret/sec/corporatewarden(src)
/obj/structure/closet/secure_closet/security
name = "security officer's locker"
req_access = list(ACCESS_SECURITY)
icon_state = "sec"
/obj/structure/closet/secure_closet/security/PopulateContents()
..()
new /obj/item/clothing/suit/armor/vest(src)
new /obj/item/clothing/head/helmet/sec(src)
new /obj/item/radio/headset/headset_sec(src)
new /obj/item/radio/headset/headset_sec/alt(src)
new /obj/item/clothing/glasses/hud/security/sunglasses(src)
new /obj/item/flashlight/seclite(src)
/obj/structure/closet/secure_closet/security/sec
/obj/structure/closet/secure_closet/security/sec/PopulateContents()
..()
new /obj/item/storage/belt/security/full(src)
/obj/structure/closet/secure_closet/security/cargo
/obj/structure/closet/secure_closet/security/cargo/PopulateContents()
..()
new /obj/item/clothing/accessory/armband/cargo(src)
new /obj/item/encryptionkey/headset_cargo(src)
/obj/structure/closet/secure_closet/security/engine
/obj/structure/closet/secure_closet/security/engine/PopulateContents()
..()
new /obj/item/clothing/accessory/armband/engine(src)
new /obj/item/encryptionkey/headset_eng(src)
/obj/structure/closet/secure_closet/security/science
/obj/structure/closet/secure_closet/security/science/PopulateContents()
..()
new /obj/item/clothing/accessory/armband/science(src)
new /obj/item/encryptionkey/headset_sci(src)
/obj/structure/closet/secure_closet/security/med
/obj/structure/closet/secure_closet/security/med/PopulateContents()
..()
new /obj/item/clothing/accessory/armband/medblue(src)
new /obj/item/encryptionkey/headset_med(src)
/obj/structure/closet/secure_closet/detective
name = "\improper detective's cabinet"
req_access = list(ACCESS_FORENSICS_LOCKERS)
icon_state = "cabinet"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
cutting_tool = /obj/item/screwdriver
/obj/structure/closet/secure_closet/detective/PopulateContents()
..()
new /obj/item/clothing/under/rank/det(src)
new /obj/item/clothing/under/rank/det/skirt(src)
new /obj/item/clothing/suit/det_suit(src)
new /obj/item/clothing/head/fedora/det_hat(src)
new /obj/item/clothing/gloves/color/black(src)
new /obj/item/clothing/under/rank/det/grey(src)
new /obj/item/clothing/under/rank/det/grey/skirt(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/suit/det_suit/grey(src)
new /obj/item/clothing/head/fedora(src)
new /obj/item/clothing/shoes/laceup(src)
new /obj/item/storage/box/evidence(src)
new /obj/item/radio/headset/headset_sec(src)
new /obj/item/detective_scanner(src)
new /obj/item/flashlight/seclite(src)
new /obj/item/holosign_creator/security(src)
new /obj/item/reagent_containers/spray/pepper(src)
new /obj/item/clothing/suit/armor/vest/det_suit(src)
new /obj/item/storage/belt/holster/full(src)
new /obj/item/pinpointer/crew(src)
/obj/structure/closet/secure_closet/injection
name = "lethal injections"
req_access = list(ACCESS_HOS)
/obj/structure/closet/secure_closet/injection/PopulateContents()
..()
for(var/i in 1 to 5)
new /obj/item/reagent_containers/syringe/lethal/execution(src)
/obj/structure/closet/secure_closet/brig
name = "brig locker"
req_access = list(ACCESS_BRIG)
anchored = TRUE
var/id = null
/obj/structure/closet/secure_closet/evidence
anchored = TRUE
name = "Secure Evidence Closet"
req_access_txt = "0"
req_one_access_txt = list(ACCESS_ARMORY, ACCESS_FORENSICS_LOCKERS)
/obj/structure/closet/secure_closet/brig/PopulateContents()
..()
new /obj/item/clothing/under/rank/prisoner( src )
new /obj/item/clothing/under/rank/prisoner/skirt( src )
new /obj/item/clothing/shoes/sneakers/orange( src )
/obj/structure/closet/secure_closet/courtroom
name = "courtroom locker"
req_access = list(ACCESS_COURT)
/obj/structure/closet/secure_closet/courtroom/PopulateContents()
..()
new /obj/item/clothing/shoes/sneakers/brown(src)
for(var/i in 1 to 3)
new /obj/item/paper/fluff/jobs/security/court_judgement (src)
new /obj/item/pen (src)
new /obj/item/clothing/suit/judgerobe (src)
new /obj/item/clothing/head/powdered_wig (src)
new /obj/item/storage/briefcase(src)
/obj/structure/closet/secure_closet/contraband/armory
anchored = TRUE
name = "Contraband Locker"
req_access = list(ACCESS_ARMORY)
/obj/structure/closet/secure_closet/contraband/heads
anchored = TRUE
name = "Contraband Locker"
req_access = list(ACCESS_HEADS)
/obj/structure/closet/secure_closet/armory1
name = "armory armor locker"
req_access = list(ACCESS_ARMORY)
icon_state = "armory"
/obj/structure/closet/secure_closet/armory1/PopulateContents()
..()
new /obj/item/clothing/suit/armor/laserproof(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/armor/riot(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/helmet/riot(src)
for(var/i in 1 to 3)
new /obj/item/shield/riot(src)
/obj/structure/closet/secure_closet/armory2
name = "armory ballistics locker"
req_access = list(ACCESS_ARMORY)
icon_state = "armory"
/obj/structure/closet/secure_closet/armory2/PopulateContents()
..()
new /obj/item/storage/box/firingpins(src)
for(var/i in 1 to 3)
new /obj/item/storage/box/rubbershot(src)
for(var/i in 1 to 3)
new /obj/item/gun/ballistic/shotgun/riot(src)
/obj/structure/closet/secure_closet/armory3
name = "armory energy gun locker"
req_access = list(ACCESS_ARMORY)
icon_state = "armory"
/obj/structure/closet/secure_closet/armory3/PopulateContents()
..()
new /obj/item/storage/box/firingpins(src)
new /obj/item/gun/energy/ionrifle(src)
for(var/i in 1 to 3)
new /obj/item/gun/energy/e_gun(src)
for(var/i in 1 to 3)
new /obj/item/gun/energy/laser(src)
/obj/structure/closet/secure_closet/tac
name = "armory tac locker"
req_access = list(ACCESS_ARMORY)
icon_state = "tac"
/obj/structure/closet/secure_closet/tac/PopulateContents()
..()
new /obj/item/gun/ballistic/automatic/wt550(src)
new /obj/item/clothing/head/helmet/alt(src)
new /obj/item/clothing/mask/gas/sechailer(src)
new /obj/item/clothing/suit/armor/bulletproof(src)
/obj/structure/closet/secure_closet/lethalshots
name = "shotgun lethal rounds"
req_access = list(ACCESS_ARMORY)
icon_state = "tac"
/obj/structure/closet/secure_closet/lethalshots/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/storage/box/lethalshot(src)
/obj/structure/closet/secure_closet/captains
name = "\proper captain's locker"
req_access = list(ACCESS_CAPTAIN)
icon_state = "cap"
/obj/structure/closet/secure_closet/captains/PopulateContents()
..()
new /obj/item/clothing/suit/hooded/wintercoat/captain(src)
new /obj/item/storage/backpack/captain(src)
new /obj/item/storage/backpack/satchel/cap(src)
new /obj/item/storage/backpack/duffelbag/captain(src)
new /obj/item/clothing/neck/cloak/cap(src)
new /obj/item/clothing/neck/petcollar(src)
new /obj/item/pet_carrier(src)
new /obj/item/clothing/shoes/sneakers/brown(src)
new /obj/item/clothing/under/rank/captain(src)
new /obj/item/clothing/under/rank/captain/skirt(src)
new /obj/item/clothing/suit/armor/vest/capcarapace(src)
new /obj/item/clothing/head/caphat(src)
new /obj/item/clothing/under/captainparade(src)
new /obj/item/clothing/suit/armor/vest/capcarapace/alt(src)
new /obj/item/clothing/head/caphat/parade(src)
new /obj/item/clothing/head/caphat/beret(src)
new /obj/item/clothing/suit/captunic(src)
new /obj/item/clothing/under/rank/captain/femformal(src) //citadel edit
new /obj/item/clothing/head/crown/fancy(src)
new /obj/item/cartridge/captain(src)
new /obj/item/storage/box/silver_ids(src)
new /obj/item/radio/headset/heads/captain/alt(src)
new /obj/item/radio/headset/heads/captain(src)
new /obj/item/clothing/glasses/sunglasses/gar/supergar(src)
new /obj/item/clothing/gloves/color/captain(src)
new /obj/item/storage/belt/sabre(src)
new /obj/item/gun/energy/e_gun(src)
new /obj/item/door_remote/captain(src)
new /obj/item/storage/photo_album/Captain(src)
new /obj/item/clothing/head/caphat/beret/white(src)
/obj/structure/closet/secure_closet/hop
name = "\proper head of personnel's locker"
req_access = list(ACCESS_HOP)
icon_state = "hop"
/obj/structure/closet/secure_closet/hop/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/hop(src)
new /obj/item/clothing/under/rank/head_of_personnel(src)
new /obj/item/clothing/under/rank/head_of_personnel/skirt(src)
new /obj/item/clothing/head/hopcap(src)
new /obj/item/clothing/head/hopcap/beret(src)
new /obj/item/cartridge/hop(src)
new /obj/item/radio/headset/heads/hop(src)
new /obj/item/clothing/shoes/sneakers/brown(src)
new /obj/item/storage/box/ids(src)
new /obj/item/storage/box/ids(src)
new /obj/item/megaphone/command(src)
new /obj/item/clothing/suit/armor/vest/alt(src)
new /obj/item/assembly/flash/handheld(src)
new /obj/item/clothing/glasses/sunglasses(src)
new /obj/item/restraints/handcuffs/cable/zipties(src)
new /obj/item/gun/energy/e_gun(src)
new /obj/item/clothing/neck/petcollar(src)
new /obj/item/pet_carrier(src)
new /obj/item/door_remote/civillian(src)
new /obj/item/circuitboard/machine/techfab/department/service(src)
new /obj/item/storage/photo_album/HoP(src)
new /obj/item/clothing/suit/hooded/wintercoat/hop(src)
new /obj/item/clothing/head/hopcap/beret/white(src)
/obj/structure/closet/secure_closet/hos
name = "\proper head of security's locker"
req_access = list(ACCESS_HOS)
icon_state = "hos"
/obj/structure/closet/secure_closet/hos/PopulateContents()
..()
new /obj/item/clothing/neck/cloak/hos(src)
new /obj/item/cartridge/hos(src)
new /obj/item/radio/headset/heads/hos(src)
new /obj/item/clothing/under/hosparadefem(src)
new /obj/item/clothing/under/hosparademale(src)
new /obj/item/clothing/suit/armor/vest/leather(src)
new /obj/item/clothing/suit/armor/hos(src)
new /obj/item/clothing/under/rank/head_of_security/skirt(src)
new /obj/item/clothing/under/rank/head_of_security/alt(src)
new /obj/item/clothing/under/rank/head_of_security/alt/skirt(src)
new /obj/item/clothing/head/HoS(src)
new /obj/item/clothing/glasses/hud/security/sunglasses/eyepatch(src)
new /obj/item/clothing/glasses/hud/security/sunglasses/gars/supergars(src)
new /obj/item/clothing/under/rank/head_of_security/grey(src)
new /obj/item/storage/lockbox/medal/sec(src)
new /obj/item/megaphone/sec(src)
new /obj/item/holosign_creator/security(src)
new /obj/item/storage/lockbox/loyalty(src)
new /obj/item/clothing/mask/gas/sechailer/swat(src)
new /obj/item/storage/box/flashbangs(src)
new /obj/item/shield/riot/tele(src)
new /obj/item/storage/belt/security/full(src)
new /obj/item/gun/energy/e_gun/hos(src)
new /obj/item/flashlight/seclite(src)
new /obj/item/pinpointer/nuke(src)
new /obj/item/circuitboard/machine/techfab/department/security(src)
new /obj/item/storage/photo_album/HoS(src)
new /obj/item/clothing/suit/hooded/wintercoat/hos(src)
/obj/structure/closet/secure_closet/warden
name = "\proper warden's locker"
req_access = list(ACCESS_ARMORY)
icon_state = "warden"
/obj/structure/closet/secure_closet/warden/PopulateContents()
..()
new /obj/item/radio/headset/headset_sec(src)
new /obj/item/clothing/suit/armor/vest/warden(src)
new /obj/item/clothing/head/warden(src)
new /obj/item/clothing/head/warden/drill(src)
new /obj/item/clothing/head/beret/sec/navywarden(src)
new /obj/item/clothing/suit/armor/vest/warden/alt(src)
new /obj/item/clothing/under/rank/warden/navyblue(src)
new /obj/item/clothing/under/rank/warden/skirt(src)
new /obj/item/clothing/glasses/hud/security/sunglasses(src)
new /obj/item/holosign_creator/security(src)
new /obj/item/clothing/mask/gas/sechailer(src)
new /obj/item/storage/box/zipties(src)
new /obj/item/storage/box/flashbangs(src)
new /obj/item/storage/belt/security/full(src)
new /obj/item/flashlight/seclite(src)
new /obj/item/clothing/gloves/krav_maga/sec(src)
new /obj/item/door_remote/head_of_security(src)
new /obj/item/gun/ballistic/shotgun/automatic/combat/compact(src)
new /obj/item/clothing/head/beret/sec/corporatewarden(src)
/obj/structure/closet/secure_closet/security
name = "security officer's locker"
req_access = list(ACCESS_SECURITY)
icon_state = "sec"
/obj/structure/closet/secure_closet/security/PopulateContents()
..()
new /obj/item/clothing/suit/armor/vest(src)
new /obj/item/clothing/head/helmet/sec(src)
new /obj/item/radio/headset/headset_sec(src)
new /obj/item/radio/headset/headset_sec/alt(src)
new /obj/item/clothing/glasses/hud/security/sunglasses(src)
new /obj/item/flashlight/seclite(src)
/obj/structure/closet/secure_closet/security/sec
/obj/structure/closet/secure_closet/security/sec/PopulateContents()
..()
new /obj/item/storage/belt/security/full(src)
/obj/structure/closet/secure_closet/security/cargo
/obj/structure/closet/secure_closet/security/cargo/PopulateContents()
..()
new /obj/item/clothing/accessory/armband/cargo(src)
new /obj/item/encryptionkey/headset_cargo(src)
/obj/structure/closet/secure_closet/security/engine
/obj/structure/closet/secure_closet/security/engine/PopulateContents()
..()
new /obj/item/clothing/accessory/armband/engine(src)
new /obj/item/encryptionkey/headset_eng(src)
/obj/structure/closet/secure_closet/security/science
/obj/structure/closet/secure_closet/security/science/PopulateContents()
..()
new /obj/item/clothing/accessory/armband/science(src)
new /obj/item/encryptionkey/headset_sci(src)
/obj/structure/closet/secure_closet/security/med
/obj/structure/closet/secure_closet/security/med/PopulateContents()
..()
new /obj/item/clothing/accessory/armband/medblue(src)
new /obj/item/encryptionkey/headset_med(src)
/obj/structure/closet/secure_closet/detective
name = "\improper detective's cabinet"
req_access = list(ACCESS_FORENSICS_LOCKERS)
icon_state = "cabinet"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
cutting_tool = /obj/item/screwdriver
/obj/structure/closet/secure_closet/detective/PopulateContents()
..()
new /obj/item/clothing/under/rank/det(src)
new /obj/item/clothing/under/rank/det/skirt(src)
new /obj/item/clothing/suit/det_suit(src)
new /obj/item/clothing/head/fedora/det_hat(src)
new /obj/item/clothing/gloves/color/black(src)
new /obj/item/clothing/under/rank/det/grey(src)
new /obj/item/clothing/under/rank/det/grey/skirt(src)
new /obj/item/clothing/accessory/waistcoat(src)
new /obj/item/clothing/suit/det_suit/grey(src)
new /obj/item/clothing/head/fedora(src)
new /obj/item/clothing/shoes/laceup(src)
new /obj/item/storage/box/evidence(src)
new /obj/item/radio/headset/headset_sec(src)
new /obj/item/detective_scanner(src)
new /obj/item/flashlight/seclite(src)
new /obj/item/holosign_creator/security(src)
new /obj/item/reagent_containers/spray/pepper(src)
new /obj/item/clothing/suit/armor/vest/det_suit(src)
new /obj/item/storage/belt/holster/full(src)
new /obj/item/pinpointer/crew(src)
/obj/structure/closet/secure_closet/injection
name = "lethal injections"
req_access = list(ACCESS_HOS)
/obj/structure/closet/secure_closet/injection/PopulateContents()
..()
for(var/i in 1 to 5)
new /obj/item/reagent_containers/syringe/lethal/execution(src)
/obj/structure/closet/secure_closet/brig
name = "brig locker"
req_access = list(ACCESS_BRIG)
anchored = TRUE
var/id = null
/obj/structure/closet/secure_closet/evidence
anchored = TRUE
name = "Secure Evidence Closet"
req_access_txt = "0"
req_one_access_txt = list(ACCESS_ARMORY, ACCESS_FORENSICS_LOCKERS)
/obj/structure/closet/secure_closet/brig/PopulateContents()
..()
new /obj/item/clothing/under/rank/prisoner( src )
new /obj/item/clothing/under/rank/prisoner/skirt( src )
new /obj/item/clothing/shoes/sneakers/orange( src )
/obj/structure/closet/secure_closet/courtroom
name = "courtroom locker"
req_access = list(ACCESS_COURT)
/obj/structure/closet/secure_closet/courtroom/PopulateContents()
..()
new /obj/item/clothing/shoes/sneakers/brown(src)
for(var/i in 1 to 3)
new /obj/item/paper/fluff/jobs/security/court_judgement (src)
new /obj/item/pen (src)
new /obj/item/clothing/suit/judgerobe (src)
new /obj/item/clothing/head/powdered_wig (src)
new /obj/item/storage/briefcase(src)
/obj/structure/closet/secure_closet/contraband/armory
anchored = TRUE
name = "Contraband Locker"
req_access = list(ACCESS_ARMORY)
/obj/structure/closet/secure_closet/contraband/heads
anchored = TRUE
name = "Contraband Locker"
req_access = list(ACCESS_HEADS)
/obj/structure/closet/secure_closet/armory1
name = "armory armor locker"
req_access = list(ACCESS_ARMORY)
icon_state = "armory"
/obj/structure/closet/secure_closet/armory1/PopulateContents()
..()
new /obj/item/clothing/suit/armor/laserproof(src)
for(var/i in 1 to 3)
new /obj/item/clothing/suit/armor/riot(src)
for(var/i in 1 to 3)
new /obj/item/clothing/head/helmet/riot(src)
for(var/i in 1 to 3)
new /obj/item/shield/riot(src)
/obj/structure/closet/secure_closet/armory2
name = "armory ballistics locker"
req_access = list(ACCESS_ARMORY)
icon_state = "armory"
/obj/structure/closet/secure_closet/armory2/PopulateContents()
..()
new /obj/item/storage/box/firingpins(src)
for(var/i in 1 to 3)
new /obj/item/storage/box/rubbershot(src)
for(var/i in 1 to 3)
new /obj/item/gun/ballistic/shotgun/riot(src)
/obj/structure/closet/secure_closet/armory3
name = "armory energy gun locker"
req_access = list(ACCESS_ARMORY)
icon_state = "armory"
/obj/structure/closet/secure_closet/armory3/PopulateContents()
..()
new /obj/item/storage/box/firingpins(src)
new /obj/item/gun/energy/ionrifle(src)
for(var/i in 1 to 3)
new /obj/item/gun/energy/e_gun(src)
for(var/i in 1 to 3)
new /obj/item/gun/energy/laser(src)
/obj/structure/closet/secure_closet/tac
name = "armory tac locker"
req_access = list(ACCESS_ARMORY)
icon_state = "tac"
/obj/structure/closet/secure_closet/tac/PopulateContents()
..()
new /obj/item/gun/ballistic/automatic/wt550(src)
new /obj/item/clothing/head/helmet/alt(src)
new /obj/item/clothing/mask/gas/sechailer(src)
new /obj/item/clothing/suit/armor/bulletproof(src)
/obj/structure/closet/secure_closet/lethalshots
name = "shotgun lethal rounds"
req_access = list(ACCESS_ARMORY)
icon_state = "tac"
/obj/structure/closet/secure_closet/lethalshots/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/storage/box/lethalshot(src)
@@ -1,120 +1,120 @@
/obj/structure/closet/syndicate
name = "armory closet"
desc = "Why is this here?"
icon_state = "syndicate"
/obj/structure/closet/syndicate/personal
desc = "It's a personal storage unit for operative gear."
/obj/structure/closet/syndicate/personal/PopulateContents()
..()
new /obj/item/clothing/under/syndicate(src)
new /obj/item/clothing/under/syndicate/skirt(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/radio/headset/syndicate(src)
new /obj/item/ammo_box/magazine/m10mm(src)
new /obj/item/storage/belt/military(src)
new /obj/item/crowbar/red(src)
new /obj/item/clothing/glasses/night(src)
/obj/structure/closet/syndicate/nuclear
desc = "It's a storage unit for a Syndicate boarding party."
/obj/structure/closet/syndicate/nuclear/PopulateContents()
for(var/i in 1 to 5)
new /obj/item/ammo_box/magazine/m10mm(src)
new /obj/item/storage/box/flashbangs(src)
new /obj/item/storage/box/teargas(src)
new /obj/item/storage/backpack/duffelbag/syndie/med(src)
new /obj/item/pda/syndicate(src)
/obj/structure/closet/syndicate/resources
desc = "An old, dusty locker."
/obj/structure/closet/syndicate/resources/PopulateContents()
..()
var/common_min = 30 //Minimum amount of minerals in the stack for common minerals
var/common_max = 50 //Maximum amount of HONK in the stack for HONK common minerals
var/rare_min = 5 //Minimum HONK of HONK in the stack HONK HONK rare minerals
var/rare_max = 20 //Maximum HONK HONK HONK in the HONK for HONK rare HONK
var/pickednum = rand(1, 50)
//Sad trombone
if(pickednum == 1)
var/obj/item/paper/P = new /obj/item/paper(src)
P.name = "\improper IOU"
P.info = "Sorry man, we needed the money so we sold your stash. It's ok, we'll double our money for sure this time!"
//Metal (common ore)
if(pickednum >= 2)
new /obj/item/stack/sheet/metal(src, rand(common_min, common_max))
//Glass (common ore)
if(pickednum >= 5)
new /obj/item/stack/sheet/glass(src, rand(common_min, common_max))
//Plasteel (common ore) Because it has a million more uses then plasma
if(pickednum >= 10)
new /obj/item/stack/sheet/plasteel(src, rand(common_min, common_max))
//Plasma (rare ore)
if(pickednum >= 15)
new /obj/item/stack/sheet/mineral/plasma(src, rand(rare_min, rare_max))
//Silver (rare ore)
if(pickednum >= 20)
new /obj/item/stack/sheet/mineral/silver(src, rand(rare_min, rare_max))
//Gold (rare ore)
if(pickednum >= 30)
new /obj/item/stack/sheet/mineral/gold(src, rand(rare_min, rare_max))
//Uranium (rare ore)
if(pickednum >= 40)
new /obj/item/stack/sheet/mineral/uranium(src, rand(rare_min, rare_max))
//Titanium (rare ore)
if(pickednum >= 40)
new /obj/item/stack/sheet/mineral/titanium(src, rand(rare_min, rare_max))
//Plastitanium (rare ore)
if(pickednum >= 40)
new /obj/item/stack/sheet/mineral/plastitanium(src, rand(rare_min, rare_max))
//Diamond (rare HONK)
if(pickednum >= 45)
new /obj/item/stack/sheet/mineral/diamond(src, rand(rare_min, rare_max))
//Jetpack (You hit the jackpot!)
if(pickednum == 50)
new /obj/item/tank/jetpack/carbondioxide(src)
/obj/structure/closet/syndicate/resources/everything
desc = "It's an emergency storage closet for repairs."
/obj/structure/closet/syndicate/resources/everything/PopulateContents()
var/list/resources = list(
/obj/item/stack/sheet/metal,
/obj/item/stack/sheet/glass,
/obj/item/stack/sheet/mineral/gold,
/obj/item/stack/sheet/mineral/silver,
/obj/item/stack/sheet/mineral/plasma,
/obj/item/stack/sheet/mineral/uranium,
/obj/item/stack/sheet/mineral/diamond,
/obj/item/stack/sheet/mineral/bananium,
/obj/item/stack/sheet/plasteel,
/obj/item/stack/sheet/mineral/titanium,
/obj/item/stack/sheet/mineral/plastitanium,
/obj/item/stack/rods,
/obj/item/stack/sheet/bluespace_crystal,
/obj/item/stack/sheet/mineral/abductor,
/obj/item/stack/sheet/plastic,
/obj/item/stack/sheet/mineral/wood
)
for(var/i = 0, i<2, i++)
for(var/res in resources)
var/obj/item/stack/R = res
new res(src, initial(R.max_amount))
/obj/structure/closet/syndicate
name = "armory closet"
desc = "Why is this here?"
icon_state = "syndicate"
/obj/structure/closet/syndicate/personal
desc = "It's a personal storage unit for operative gear."
/obj/structure/closet/syndicate/personal/PopulateContents()
..()
new /obj/item/clothing/under/syndicate(src)
new /obj/item/clothing/under/syndicate/skirt(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/radio/headset/syndicate(src)
new /obj/item/ammo_box/magazine/m10mm(src)
new /obj/item/storage/belt/military(src)
new /obj/item/crowbar/red(src)
new /obj/item/clothing/glasses/night(src)
/obj/structure/closet/syndicate/nuclear
desc = "It's a storage unit for a Syndicate boarding party."
/obj/structure/closet/syndicate/nuclear/PopulateContents()
for(var/i in 1 to 5)
new /obj/item/ammo_box/magazine/m10mm(src)
new /obj/item/storage/box/flashbangs(src)
new /obj/item/storage/box/teargas(src)
new /obj/item/storage/backpack/duffelbag/syndie/med(src)
new /obj/item/pda/syndicate(src)
/obj/structure/closet/syndicate/resources
desc = "An old, dusty locker."
/obj/structure/closet/syndicate/resources/PopulateContents()
..()
var/common_min = 30 //Minimum amount of minerals in the stack for common minerals
var/common_max = 50 //Maximum amount of HONK in the stack for HONK common minerals
var/rare_min = 5 //Minimum HONK of HONK in the stack HONK HONK rare minerals
var/rare_max = 20 //Maximum HONK HONK HONK in the HONK for HONK rare HONK
var/pickednum = rand(1, 50)
//Sad trombone
if(pickednum == 1)
var/obj/item/paper/P = new /obj/item/paper(src)
P.name = "\improper IOU"
P.info = "Sorry man, we needed the money so we sold your stash. It's ok, we'll double our money for sure this time!"
//Metal (common ore)
if(pickednum >= 2)
new /obj/item/stack/sheet/metal(src, rand(common_min, common_max))
//Glass (common ore)
if(pickednum >= 5)
new /obj/item/stack/sheet/glass(src, rand(common_min, common_max))
//Plasteel (common ore) Because it has a million more uses then plasma
if(pickednum >= 10)
new /obj/item/stack/sheet/plasteel(src, rand(common_min, common_max))
//Plasma (rare ore)
if(pickednum >= 15)
new /obj/item/stack/sheet/mineral/plasma(src, rand(rare_min, rare_max))
//Silver (rare ore)
if(pickednum >= 20)
new /obj/item/stack/sheet/mineral/silver(src, rand(rare_min, rare_max))
//Gold (rare ore)
if(pickednum >= 30)
new /obj/item/stack/sheet/mineral/gold(src, rand(rare_min, rare_max))
//Uranium (rare ore)
if(pickednum >= 40)
new /obj/item/stack/sheet/mineral/uranium(src, rand(rare_min, rare_max))
//Titanium (rare ore)
if(pickednum >= 40)
new /obj/item/stack/sheet/mineral/titanium(src, rand(rare_min, rare_max))
//Plastitanium (rare ore)
if(pickednum >= 40)
new /obj/item/stack/sheet/mineral/plastitanium(src, rand(rare_min, rare_max))
//Diamond (rare HONK)
if(pickednum >= 45)
new /obj/item/stack/sheet/mineral/diamond(src, rand(rare_min, rare_max))
//Jetpack (You hit the jackpot!)
if(pickednum == 50)
new /obj/item/tank/jetpack/carbondioxide(src)
/obj/structure/closet/syndicate/resources/everything
desc = "It's an emergency storage closet for repairs."
/obj/structure/closet/syndicate/resources/everything/PopulateContents()
var/list/resources = list(
/obj/item/stack/sheet/metal,
/obj/item/stack/sheet/glass,
/obj/item/stack/sheet/mineral/gold,
/obj/item/stack/sheet/mineral/silver,
/obj/item/stack/sheet/mineral/plasma,
/obj/item/stack/sheet/mineral/uranium,
/obj/item/stack/sheet/mineral/diamond,
/obj/item/stack/sheet/mineral/bananium,
/obj/item/stack/sheet/plasteel,
/obj/item/stack/sheet/mineral/titanium,
/obj/item/stack/sheet/mineral/plastitanium,
/obj/item/stack/rods,
/obj/item/stack/sheet/bluespace_crystal,
/obj/item/stack/sheet/mineral/abductor,
/obj/item/stack/sheet/plastic,
/obj/item/stack/sheet/mineral/wood
)
for(var/i = 0, i<2, i++)
for(var/res in resources)
var/obj/item/stack/R = res
new res(src, initial(R.max_amount))
@@ -1,199 +1,199 @@
/* Utility Closets
* Contains:
* Emergency Closet
* Fire Closet
* Tool Closet
* Radiation Closet
* Bombsuit Closet
* Hydrant
* First Aid
*/
/*
* Emergency Closet
*/
/obj/structure/closet/emcloset
name = "emergency closet"
desc = "It's a storage unit for emergency breath masks and O2 tanks."
icon_state = "emergency"
/obj/structure/closet/emcloset/anchored
anchored = TRUE
/obj/structure/closet/emcloset/PopulateContents()
..()
if (prob(40))
new /obj/item/storage/toolbox/emergency(src)
switch (pickweight(list("small" = 40, "aid" = 25, "tank" = 20, "both" = 10, "nothing" = 5)))
if ("small")
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/clothing/mask/breath(src)
new /obj/item/clothing/mask/breath(src)
if ("aid")
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/storage/firstaid/o2(src)
new /obj/item/clothing/mask/breath(src)
if ("tank")
new /obj/item/tank/internals/air(src)
new /obj/item/clothing/mask/breath(src)
if ("both")
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/clothing/mask/breath(src)
if ("nothing")
// doot
return
/*
* Fire Closet
*/
/obj/structure/closet/firecloset
name = "fire-safety closet"
desc = "It's a storage unit for fire-fighting supplies."
icon_state = "fire"
/obj/structure/closet/firecloset/PopulateContents()
..()
if (prob(50))
new /obj/item/reagent_containers/hypospray/medipen/firelocker(src)
new /obj/item/clothing/suit/fire/firefighter(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/tank/internals/oxygen/red(src)
new /obj/item/extinguisher(src)
new /obj/item/clothing/head/hardhat/red(src)
/obj/structure/closet/firecloset/full/PopulateContents()
..()
if (prob(50))
new /obj/item/reagent_containers/hypospray/medipen/firelocker(src)
new /obj/item/clothing/suit/fire/firefighter(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/flashlight(src)
new /obj/item/tank/internals/oxygen/red(src)
new /obj/item/extinguisher(src)
new /obj/item/clothing/head/hardhat/red(src)
/*
* Tool Closet
*/
/obj/structure/closet/toolcloset
name = "tool closet"
desc = "It's a storage unit for tools."
icon_state = "eng"
icon_door = "eng_tool"
/obj/structure/closet/toolcloset/PopulateContents()
..()
if(prob(40))
new /obj/item/clothing/suit/hazardvest(src)
if(prob(70))
new /obj/item/flashlight(src)
if(prob(70))
new /obj/item/screwdriver(src)
if(prob(70))
new /obj/item/wrench(src)
if(prob(70))
new /obj/item/weldingtool(src)
if(prob(70))
new /obj/item/crowbar(src)
if(prob(70))
new /obj/item/wirecutters(src)
if(prob(70))
new /obj/item/t_scanner(src)
if(prob(20))
new /obj/item/storage/belt/utility(src)
if(prob(30))
new /obj/item/stack/cable_coil/random(src)
if(prob(30))
new /obj/item/stack/cable_coil/random(src)
if(prob(30))
new /obj/item/stack/cable_coil/random(src)
if(prob(20))
new /obj/item/multitool(src)
if(prob(5))
new /obj/item/clothing/gloves/color/yellow(src)
if(prob(40))
new /obj/item/clothing/head/hardhat(src)
/*
* Radiation Closet
*/
/obj/structure/closet/radiation
name = "radiation suit closet"
desc = "It's a storage unit for rad-protective suits."
icon_state = "eng"
icon_door = "eng_rad"
/obj/structure/closet/radiation/PopulateContents()
..()
if(prob(50))
new /obj/item/storage/firstaid/radbgone(src)
new /obj/item/geiger_counter(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
/*
* Bombsuit closet
*/
/obj/structure/closet/bombcloset
name = "\improper EOD closet"
desc = "It's a storage unit for explosion-protective suits."
icon_state = "bomb"
/obj/structure/closet/bombcloset/PopulateContents()
..()
if(prob(70))
new /obj/item/screwdriver(src)
if(prob(50))
new /obj/item/multitool(src)
if(prob(70))
new /obj/item/wirecutters(src)
new /obj/item/clothing/suit/bomb_suit(src)
new /obj/item/clothing/under/color/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/head/bomb_hood(src)
/obj/structure/closet/bombcloset/security/PopulateContents()
..()
if(prob(90))
new /obj/item/screwdriver(src)
if(prob(70))
new /obj/item/multitool(src)
if(prob(90))
new /obj/item/wirecutters(src)
new /obj/item/clothing/suit/bomb_suit/security(src)
new /obj/item/clothing/under/rank/security(src)
new /obj/item/clothing/shoes/jackboots(src)
new /obj/item/clothing/head/bomb_hood/security(src)
/obj/structure/closet/bombcloset/white/PopulateContents()
..()
if(prob(50))
new /obj/item/screwdriver(src)
if(prob(20))
new /obj/item/multitool(src)
if(prob(50))
new /obj/item/wirecutters(src)
new /obj/item/clothing/suit/bomb_suit/white(src)
new /obj/item/clothing/under/color/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/head/bomb_hood/white(src)
/*
* Ammunition
*/
/obj/structure/closet/ammunitionlocker
name = "ammunition locker"
/obj/structure/closet/ammunitionlocker/PopulateContents()
..()
for(var/i in 1 to 8)
new /obj/item/ammo_casing/shotgun/beanbag(src)
/* Utility Closets
* Contains:
* Emergency Closet
* Fire Closet
* Tool Closet
* Radiation Closet
* Bombsuit Closet
* Hydrant
* First Aid
*/
/*
* Emergency Closet
*/
/obj/structure/closet/emcloset
name = "emergency closet"
desc = "It's a storage unit for emergency breath masks and O2 tanks."
icon_state = "emergency"
/obj/structure/closet/emcloset/anchored
anchored = TRUE
/obj/structure/closet/emcloset/PopulateContents()
..()
if (prob(40))
new /obj/item/storage/toolbox/emergency(src)
switch (pickweight(list("small" = 40, "aid" = 25, "tank" = 20, "both" = 10, "nothing" = 5)))
if ("small")
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/clothing/mask/breath(src)
new /obj/item/clothing/mask/breath(src)
if ("aid")
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/storage/firstaid/o2(src)
new /obj/item/clothing/mask/breath(src)
if ("tank")
new /obj/item/tank/internals/air(src)
new /obj/item/clothing/mask/breath(src)
if ("both")
new /obj/item/tank/internals/emergency_oxygen(src)
new /obj/item/clothing/mask/breath(src)
if ("nothing")
// doot
return
/*
* Fire Closet
*/
/obj/structure/closet/firecloset
name = "fire-safety closet"
desc = "It's a storage unit for fire-fighting supplies."
icon_state = "fire"
/obj/structure/closet/firecloset/PopulateContents()
..()
if (prob(50))
new /obj/item/reagent_containers/hypospray/medipen/firelocker(src)
new /obj/item/clothing/suit/fire/firefighter(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/tank/internals/oxygen/red(src)
new /obj/item/extinguisher(src)
new /obj/item/clothing/head/hardhat/red(src)
/obj/structure/closet/firecloset/full/PopulateContents()
..()
if (prob(50))
new /obj/item/reagent_containers/hypospray/medipen/firelocker(src)
new /obj/item/clothing/suit/fire/firefighter(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/flashlight(src)
new /obj/item/tank/internals/oxygen/red(src)
new /obj/item/extinguisher(src)
new /obj/item/clothing/head/hardhat/red(src)
/*
* Tool Closet
*/
/obj/structure/closet/toolcloset
name = "tool closet"
desc = "It's a storage unit for tools."
icon_state = "eng"
icon_door = "eng_tool"
/obj/structure/closet/toolcloset/PopulateContents()
..()
if(prob(40))
new /obj/item/clothing/suit/hazardvest(src)
if(prob(70))
new /obj/item/flashlight(src)
if(prob(70))
new /obj/item/screwdriver(src)
if(prob(70))
new /obj/item/wrench(src)
if(prob(70))
new /obj/item/weldingtool(src)
if(prob(70))
new /obj/item/crowbar(src)
if(prob(70))
new /obj/item/wirecutters(src)
if(prob(70))
new /obj/item/t_scanner(src)
if(prob(20))
new /obj/item/storage/belt/utility(src)
if(prob(30))
new /obj/item/stack/cable_coil/random(src)
if(prob(30))
new /obj/item/stack/cable_coil/random(src)
if(prob(30))
new /obj/item/stack/cable_coil/random(src)
if(prob(20))
new /obj/item/multitool(src)
if(prob(5))
new /obj/item/clothing/gloves/color/yellow(src)
if(prob(40))
new /obj/item/clothing/head/hardhat(src)
/*
* Radiation Closet
*/
/obj/structure/closet/radiation
name = "radiation suit closet"
desc = "It's a storage unit for rad-protective suits."
icon_state = "eng"
icon_door = "eng_rad"
/obj/structure/closet/radiation/PopulateContents()
..()
if(prob(50))
new /obj/item/storage/firstaid/radbgone(src)
new /obj/item/geiger_counter(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
/*
* Bombsuit closet
*/
/obj/structure/closet/bombcloset
name = "\improper EOD closet"
desc = "It's a storage unit for explosion-protective suits."
icon_state = "bomb"
/obj/structure/closet/bombcloset/PopulateContents()
..()
if(prob(70))
new /obj/item/screwdriver(src)
if(prob(50))
new /obj/item/multitool(src)
if(prob(70))
new /obj/item/wirecutters(src)
new /obj/item/clothing/suit/bomb_suit(src)
new /obj/item/clothing/under/color/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/head/bomb_hood(src)
/obj/structure/closet/bombcloset/security/PopulateContents()
..()
if(prob(90))
new /obj/item/screwdriver(src)
if(prob(70))
new /obj/item/multitool(src)
if(prob(90))
new /obj/item/wirecutters(src)
new /obj/item/clothing/suit/bomb_suit/security(src)
new /obj/item/clothing/under/rank/security(src)
new /obj/item/clothing/shoes/jackboots(src)
new /obj/item/clothing/head/bomb_hood/security(src)
/obj/structure/closet/bombcloset/white/PopulateContents()
..()
if(prob(50))
new /obj/item/screwdriver(src)
if(prob(20))
new /obj/item/multitool(src)
if(prob(50))
new /obj/item/wirecutters(src)
new /obj/item/clothing/suit/bomb_suit/white(src)
new /obj/item/clothing/under/color/black(src)
new /obj/item/clothing/shoes/sneakers/black(src)
new /obj/item/clothing/head/bomb_hood/white(src)
/*
* Ammunition
*/
/obj/structure/closet/ammunitionlocker
name = "ammunition locker"
/obj/structure/closet/ammunitionlocker/PopulateContents()
..()
for(var/i in 1 to 8)
new /obj/item/ammo_casing/shotgun/beanbag(src)
@@ -1,223 +1,223 @@
/obj/structure/closet/crate
name = "crate"
desc = "A rectangular steel crate."
icon = 'icons/obj/crates.dmi'
icon_state = "crate"
req_access = null
can_weld_shut = FALSE
horizontal = TRUE
allow_objects = TRUE
allow_dense = TRUE
dense_when_open = TRUE
climbable = TRUE
climb_time = 10 //real fast, because let's be honest stepping into or onto a crate is easy
climb_stun = 0 //climbing onto crates isn't hard, guys
delivery_icon = "deliverycrate"
var/obj/item/paper/fluff/jobs/cargo/manifest/manifest
/obj/structure/closet/crate/New()
..()
if(icon_state == "[initial(icon_state)]open")
opened = TRUE
update_icon()
/obj/structure/closet/crate/CanPass(atom/movable/mover, turf/target)
if(!istype(mover, /obj/structure/closet))
var/obj/structure/closet/crate/locatedcrate = locate(/obj/structure/closet/crate) in get_turf(mover)
if(locatedcrate) //you can walk on it like tables, if you're not in an open crate trying to move to a closed crate
if(opened) //if we're open, allow entering regardless of located crate openness
return 1
if(!locatedcrate.opened) //otherwise, if the located crate is closed, allow entering
return 1
return !density
/obj/structure/closet/crate/update_icon()
icon_state = "[initial(icon_state)][opened ? "open" : ""]"
cut_overlays()
if(manifest)
add_overlay("manifest")
/obj/structure/closet/crate/attack_hand(mob/user)
. = ..()
if(.)
return
if(manifest)
tear_manifest(user)
/obj/structure/closet/crate/open(mob/living/user)
. = ..()
if(. && manifest)
to_chat(user, "<span class='notice'>The manifest is torn off [src].</span>")
playsound(src, 'sound/items/poster_ripped.ogg', 75, 1)
manifest.forceMove(get_turf(src))
manifest = null
update_icon()
/obj/structure/closet/crate/handle_lock_addition()
return
/obj/structure/closet/crate/handle_lock_removal()
return
/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)
manifest.forceMove(loc)
if(ishuman(user))
user.put_in_hands(manifest)
manifest = null
update_icon()
/obj/structure/closet/crate/coffin
name = "coffin"
desc = "It's a burial receptacle for the dearly departed."
icon_state = "coffin"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
material_drop_amount = 5
/obj/structure/closet/crate/coffin/examine(mob/user)
. = ..()
if(user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
. += {"<span class='cult'>This is a coffin which you can use to regenerate your burns and other wounds faster.</span>"}
. += {"<span class='cult'>You can also thicken your blood if you survive the day, and hide from the sun safely while inside.</span>"}
/* if(user.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
. += {"<span class='cult'>This is a coffin which your master can use to shield himself from the unforgiving sun.\n
You yourself are still human and dont need it. Yet.</span>"} */
/obj/structure/closet/crate/internals
desc = "An internals crate."
name = "internals crate"
icon_state = "o2crate"
/obj/structure/closet/crate/trashcart
desc = "A heavy, metal trashcart with wheels."
name = "trash cart"
icon_state = "trashcart"
/obj/structure/closet/crate/medical
desc = "A medical crate."
name = "medical crate"
icon_state = "medicalcrate"
/obj/structure/closet/crate/freezer
desc = "A freezer."
name = "freezer"
icon_state = "freezer"
//Snowflake organ freezer code
//Order is important, since we check source, we need to do the check whenever we have all the organs in the crate
/obj/structure/closet/crate/freezer/open()
recursive_organ_check(src)
..()
/obj/structure/closet/crate/freezer/close()
..()
recursive_organ_check(src)
/obj/structure/closet/crate/freezer/Destroy()
recursive_organ_check(src)
..()
/obj/structure/closet/crate/freezer/Initialize()
. = ..()
recursive_organ_check(src)
/obj/structure/closet/crate/freezer/blood
name = "blood freezer"
desc = "A freezer containing packs of blood."
icon_state = "surgery"
/obj/structure/closet/crate/freezer/blood/PopulateContents()
. = ..()
new /obj/item/reagent_containers/blood(src)
new /obj/item/reagent_containers/blood(src)
new /obj/item/reagent_containers/blood/AMinus(src)
new /obj/item/reagent_containers/blood/BMinus(src)
new /obj/item/reagent_containers/blood/BPlus(src)
new /obj/item/reagent_containers/blood/OMinus(src)
new /obj/item/reagent_containers/blood/OPlus(src)
new /obj/item/reagent_containers/blood/lizard(src)
for(var/i in 1 to 3)
new /obj/item/reagent_containers/blood/random(src)
/obj/structure/closet/crate/freezer/surplus_limbs
name = "surplus prosthetic limbs"
desc = "A crate containing an assortment of cheap prosthetic limbs."
/obj/structure/closet/crate/freezer/surplus_limbs/PopulateContents()
. = ..()
new /obj/item/bodypart/l_arm/robot/surplus(src)
new /obj/item/bodypart/l_arm/robot/surplus(src)
new /obj/item/bodypart/r_arm/robot/surplus(src)
new /obj/item/bodypart/r_arm/robot/surplus(src)
new /obj/item/bodypart/l_leg/robot/surplus(src)
new /obj/item/bodypart/l_leg/robot/surplus(src)
new /obj/item/bodypart/r_leg/robot/surplus(src)
new /obj/item/bodypart/r_leg/robot/surplus(src)
/obj/structure/closet/crate/radiation
desc = "A crate with a radiation sign on it."
name = "radiation crate"
icon_state = "radiation"
/obj/structure/closet/crate/hydroponics
name = "hydroponics crate"
desc = "All you need to destroy those pesky weeds and pests."
icon_state = "hydrocrate"
/obj/structure/closet/crate/engineering
name = "engineering crate"
icon_state = "engi_crate"
/obj/structure/closet/crate/engineering/electrical
icon_state = "engi_e_crate"
/obj/structure/closet/crate/rcd
desc = "A crate for the storage of an RCD."
name = "\improper RCD crate"
icon_state = "engi_crate"
/obj/structure/closet/crate/rcd/PopulateContents()
..()
for(var/i in 1 to 4)
new /obj/item/rcd_ammo(src)
new /obj/item/construction/rcd(src)
/obj/structure/closet/crate/science
name = "science crate"
desc = "A science crate."
icon_state = "scicrate"
/obj/structure/closet/crate/solarpanel_small
name = "budget solar panel crate"
icon_state = "engi_e_crate"
/obj/structure/closet/crate/solarpanel_small/PopulateContents()
..()
for(var/i in 1 to 13)
new /obj/item/solar_assembly(src)
new /obj/item/circuitboard/computer/solar_control(src)
new /obj/item/paper/guides/jobs/engi/solars(src)
new /obj/item/electronics/tracker(src)
/obj/structure/closet/crate/goldcrate
name = "gold crate"
/obj/structure/closet/crate/goldcrate/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/stack/sheet/mineral/gold(src, 1, FALSE)
new /obj/item/storage/belt/champion(src)
/obj/structure/closet/crate/silvercrate
name = "silver crate"
/obj/structure/closet/crate/silvercrate/PopulateContents()
..()
for(var/i in 1 to 5)
new /obj/item/coin/silver(src)
/obj/structure/closet/crate
name = "crate"
desc = "A rectangular steel crate."
icon = 'icons/obj/crates.dmi'
icon_state = "crate"
req_access = null
can_weld_shut = FALSE
horizontal = TRUE
allow_objects = TRUE
allow_dense = TRUE
dense_when_open = TRUE
climbable = TRUE
climb_time = 10 //real fast, because let's be honest stepping into or onto a crate is easy
climb_stun = 0 //climbing onto crates isn't hard, guys
delivery_icon = "deliverycrate"
var/obj/item/paper/fluff/jobs/cargo/manifest/manifest
/obj/structure/closet/crate/New()
..()
if(icon_state == "[initial(icon_state)]open")
opened = TRUE
update_icon()
/obj/structure/closet/crate/CanPass(atom/movable/mover, turf/target)
if(!istype(mover, /obj/structure/closet))
var/obj/structure/closet/crate/locatedcrate = locate(/obj/structure/closet/crate) in get_turf(mover)
if(locatedcrate) //you can walk on it like tables, if you're not in an open crate trying to move to a closed crate
if(opened) //if we're open, allow entering regardless of located crate openness
return 1
if(!locatedcrate.opened) //otherwise, if the located crate is closed, allow entering
return 1
return !density
/obj/structure/closet/crate/update_icon()
icon_state = "[initial(icon_state)][opened ? "open" : ""]"
cut_overlays()
if(manifest)
add_overlay("manifest")
/obj/structure/closet/crate/attack_hand(mob/user)
. = ..()
if(.)
return
if(manifest)
tear_manifest(user)
/obj/structure/closet/crate/open(mob/living/user)
. = ..()
if(. && manifest)
to_chat(user, "<span class='notice'>The manifest is torn off [src].</span>")
playsound(src, 'sound/items/poster_ripped.ogg', 75, 1)
manifest.forceMove(get_turf(src))
manifest = null
update_icon()
/obj/structure/closet/crate/handle_lock_addition()
return
/obj/structure/closet/crate/handle_lock_removal()
return
/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)
manifest.forceMove(loc)
if(ishuman(user))
user.put_in_hands(manifest)
manifest = null
update_icon()
/obj/structure/closet/crate/coffin
name = "coffin"
desc = "It's a burial receptacle for the dearly departed."
icon_state = "coffin"
resistance_flags = FLAMMABLE
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
material_drop_amount = 5
/obj/structure/closet/crate/coffin/examine(mob/user)
. = ..()
if(user.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
. += {"<span class='cult'>This is a coffin which you can use to regenerate your burns and other wounds faster.</span>"}
. += {"<span class='cult'>You can also thicken your blood if you survive the day, and hide from the sun safely while inside.</span>"}
/* if(user.mind.has_antag_datum(ANTAG_DATUM_VASSAL)
. += {"<span class='cult'>This is a coffin which your master can use to shield himself from the unforgiving sun.\n
You yourself are still human and dont need it. Yet.</span>"} */
/obj/structure/closet/crate/internals
desc = "An internals crate."
name = "internals crate"
icon_state = "o2crate"
/obj/structure/closet/crate/trashcart
desc = "A heavy, metal trashcart with wheels."
name = "trash cart"
icon_state = "trashcart"
/obj/structure/closet/crate/medical
desc = "A medical crate."
name = "medical crate"
icon_state = "medicalcrate"
/obj/structure/closet/crate/freezer
desc = "A freezer."
name = "freezer"
icon_state = "freezer"
//Snowflake organ freezer code
//Order is important, since we check source, we need to do the check whenever we have all the organs in the crate
/obj/structure/closet/crate/freezer/open()
recursive_organ_check(src)
..()
/obj/structure/closet/crate/freezer/close()
..()
recursive_organ_check(src)
/obj/structure/closet/crate/freezer/Destroy()
recursive_organ_check(src)
..()
/obj/structure/closet/crate/freezer/Initialize()
. = ..()
recursive_organ_check(src)
/obj/structure/closet/crate/freezer/blood
name = "blood freezer"
desc = "A freezer containing packs of blood."
icon_state = "surgery"
/obj/structure/closet/crate/freezer/blood/PopulateContents()
. = ..()
new /obj/item/reagent_containers/blood(src)
new /obj/item/reagent_containers/blood(src)
new /obj/item/reagent_containers/blood/AMinus(src)
new /obj/item/reagent_containers/blood/BMinus(src)
new /obj/item/reagent_containers/blood/BPlus(src)
new /obj/item/reagent_containers/blood/OMinus(src)
new /obj/item/reagent_containers/blood/OPlus(src)
new /obj/item/reagent_containers/blood/lizard(src)
for(var/i in 1 to 3)
new /obj/item/reagent_containers/blood/random(src)
/obj/structure/closet/crate/freezer/surplus_limbs
name = "surplus prosthetic limbs"
desc = "A crate containing an assortment of cheap prosthetic limbs."
/obj/structure/closet/crate/freezer/surplus_limbs/PopulateContents()
. = ..()
new /obj/item/bodypart/l_arm/robot/surplus(src)
new /obj/item/bodypart/l_arm/robot/surplus(src)
new /obj/item/bodypart/r_arm/robot/surplus(src)
new /obj/item/bodypart/r_arm/robot/surplus(src)
new /obj/item/bodypart/l_leg/robot/surplus(src)
new /obj/item/bodypart/l_leg/robot/surplus(src)
new /obj/item/bodypart/r_leg/robot/surplus(src)
new /obj/item/bodypart/r_leg/robot/surplus(src)
/obj/structure/closet/crate/radiation
desc = "A crate with a radiation sign on it."
name = "radiation crate"
icon_state = "radiation"
/obj/structure/closet/crate/hydroponics
name = "hydroponics crate"
desc = "All you need to destroy those pesky weeds and pests."
icon_state = "hydrocrate"
/obj/structure/closet/crate/engineering
name = "engineering crate"
icon_state = "engi_crate"
/obj/structure/closet/crate/engineering/electrical
icon_state = "engi_e_crate"
/obj/structure/closet/crate/rcd
desc = "A crate for the storage of an RCD."
name = "\improper RCD crate"
icon_state = "engi_crate"
/obj/structure/closet/crate/rcd/PopulateContents()
..()
for(var/i in 1 to 4)
new /obj/item/rcd_ammo(src)
new /obj/item/construction/rcd(src)
/obj/structure/closet/crate/science
name = "science crate"
desc = "A science crate."
icon_state = "scicrate"
/obj/structure/closet/crate/solarpanel_small
name = "budget solar panel crate"
icon_state = "engi_e_crate"
/obj/structure/closet/crate/solarpanel_small/PopulateContents()
..()
for(var/i in 1 to 13)
new /obj/item/solar_assembly(src)
new /obj/item/circuitboard/computer/solar_control(src)
new /obj/item/paper/guides/jobs/engi/solars(src)
new /obj/item/electronics/tracker(src)
/obj/structure/closet/crate/goldcrate
name = "gold crate"
/obj/structure/closet/crate/goldcrate/PopulateContents()
..()
for(var/i in 1 to 3)
new /obj/item/stack/sheet/mineral/gold(src, 1, FALSE)
new /obj/item/storage/belt/champion(src)
/obj/structure/closet/crate/silvercrate
name = "silver crate"
/obj/structure/closet/crate/silvercrate/PopulateContents()
..()
for(var/i in 1 to 5)
new /obj/item/coin/silver(src)
@@ -1,44 +1,44 @@
/obj/structure/closet/crate/bin
desc = "A trash bin, place your trash here for the janitor to collect."
name = "trash bin"
icon_state = "largebins"
open_sound = 'sound/effects/bin_open.ogg'
close_sound = 'sound/effects/bin_close.ogg'
material_drop = /obj/item/stack/sheet/plastic
material_drop_amount = 40
anchored = TRUE
horizontal = FALSE
delivery_icon = null
/obj/structure/closet/crate/bin/New()
..()
update_icon()
/obj/structure/closet/crate/bin/update_icon()
..()
cut_overlays()
if(contents.len == 0)
add_overlay("largebing")
else if(contents.len >= storage_capacity)
add_overlay("largebinr")
else
add_overlay("largebino")
/obj/structure/closet/crate/bin/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/storage/bag/trash))
var/obj/item/storage/bag/trash/T = W
to_chat(user, "<span class='notice'>You fill the bag.</span>")
for(var/obj/item/O in src)
SEND_SIGNAL(T, COMSIG_TRY_STORAGE_INSERT, O, user, TRUE)
T.update_icon()
do_animate()
return TRUE
else
return ..()
/obj/structure/closet/crate/bin/proc/do_animate()
playsound(loc, open_sound, 15, 1, -3)
flick("animate_largebins", src)
spawn(13)
playsound(loc, close_sound, 15, 1, -3)
update_icon()
/obj/structure/closet/crate/bin
desc = "A trash bin, place your trash here for the janitor to collect."
name = "trash bin"
icon_state = "largebins"
open_sound = 'sound/effects/bin_open.ogg'
close_sound = 'sound/effects/bin_close.ogg'
material_drop = /obj/item/stack/sheet/plastic
material_drop_amount = 40
anchored = TRUE
horizontal = FALSE
delivery_icon = null
/obj/structure/closet/crate/bin/New()
..()
update_icon()
/obj/structure/closet/crate/bin/update_icon()
..()
cut_overlays()
if(contents.len == 0)
add_overlay("largebing")
else if(contents.len >= storage_capacity)
add_overlay("largebinr")
else
add_overlay("largebino")
/obj/structure/closet/crate/bin/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/storage/bag/trash))
var/obj/item/storage/bag/trash/T = W
to_chat(user, "<span class='notice'>You fill the bag.</span>")
for(var/obj/item/O in src)
SEND_SIGNAL(T, COMSIG_TRY_STORAGE_INSERT, O, user, TRUE)
T.update_icon()
do_animate()
return TRUE
else
return ..()
/obj/structure/closet/crate/bin/proc/do_animate()
playsound(loc, open_sound, 15, 1, -3)
flick("animate_largebins", src)
spawn(13)
playsound(loc, close_sound, 15, 1, -3)
update_icon()
@@ -1,38 +1,38 @@
/obj/structure/closet/crate/critter
name = "critter crate"
desc = "A crate designed for safe transport of animals. It has an oxygen tank for safe transport in space."
icon_state = "crittercrate"
horizontal = FALSE
allow_objects = FALSE
breakout_time = 600
material_drop = /obj/item/stack/sheet/mineral/wood
material_drop_amount = 4
delivery_icon = "deliverybox"
var/obj/item/tank/internals/emergency_oxygen/tank
/obj/structure/closet/crate/critter/New()
..()
tank = new
/obj/structure/closet/crate/critter/Destroy()
var/turf/T = get_turf(src)
if(tank)
tank.forceMove(T)
tank = null
return ..()
/obj/structure/closet/crate/critter/update_icon()
cut_overlays()
if(opened)
add_overlay("crittercrate_door_open")
else
add_overlay("crittercrate_door")
if(manifest)
add_overlay("manifest")
/obj/structure/closet/crate/critter/return_air()
if(tank)
return tank.air_contents
else
/obj/structure/closet/crate/critter
name = "critter crate"
desc = "A crate designed for safe transport of animals. It has an oxygen tank for safe transport in space."
icon_state = "crittercrate"
horizontal = FALSE
allow_objects = FALSE
breakout_time = 600
material_drop = /obj/item/stack/sheet/mineral/wood
material_drop_amount = 4
delivery_icon = "deliverybox"
var/obj/item/tank/internals/emergency_oxygen/tank
/obj/structure/closet/crate/critter/New()
..()
tank = new
/obj/structure/closet/crate/critter/Destroy()
var/turf/T = get_turf(src)
if(tank)
tank.forceMove(T)
tank = null
return ..()
/obj/structure/closet/crate/critter/update_icon()
cut_overlays()
if(opened)
add_overlay("crittercrate_door_open")
else
add_overlay("crittercrate_door")
if(manifest)
add_overlay("manifest")
/obj/structure/closet/crate/critter/return_air()
if(tank)
return tank.air_contents
else
return loc.return_air()
@@ -1,43 +1,43 @@
/obj/structure/closet/crate/large
name = "large crate"
desc = "A hefty wooden crate. You'll need a crowbar to get it open."
icon_state = "largecrate"
density = TRUE
material_drop = /obj/item/stack/sheet/mineral/wood
material_drop_amount = 4
delivery_icon = "deliverybox"
integrity_failure = 0 //Makes the crate break when integrity reaches 0, instead of opening and becoming an invisible sprite.
/obj/structure/closet/crate/large/attack_hand(mob/user)
add_fingerprint(user)
if(manifest)
tear_manifest(user)
else
to_chat(user, "<span class='warning'>You need a crowbar to pry this open!</span>")
/obj/structure/closet/crate/large/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/crowbar))
if(manifest)
tear_manifest(user)
user.visible_message("[user] pries \the [src] open.", \
"<span class='notice'>You pry open \the [src].</span>", \
"<span class='italics'>You hear splitting wood.</span>")
playsound(src.loc, 'sound/weapons/slashmiss.ogg', 75, 1)
var/turf/T = get_turf(src)
for(var/i in 1 to material_drop_amount)
new material_drop(src)
for(var/atom/movable/AM in contents)
AM.forceMove(T)
qdel(src)
else
if(user.a_intent == INTENT_HARM) //Only return ..() if intent is harm, otherwise return 0 or just end it.
return ..() //Stops it from opening and turning invisible when items are used on it.
else
to_chat(user, "<span class='warning'>You need a crowbar to pry this open!</span>")
return FALSE //Just stop. Do nothing. Don't turn into an invisible sprite. Don't open like a locker.
/obj/structure/closet/crate/large
name = "large crate"
desc = "A hefty wooden crate. You'll need a crowbar to get it open."
icon_state = "largecrate"
density = TRUE
material_drop = /obj/item/stack/sheet/mineral/wood
material_drop_amount = 4
delivery_icon = "deliverybox"
integrity_failure = 0 //Makes the crate break when integrity reaches 0, instead of opening and becoming an invisible sprite.
/obj/structure/closet/crate/large/attack_hand(mob/user)
add_fingerprint(user)
if(manifest)
tear_manifest(user)
else
to_chat(user, "<span class='warning'>You need a crowbar to pry this open!</span>")
/obj/structure/closet/crate/large/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/crowbar))
if(manifest)
tear_manifest(user)
user.visible_message("[user] pries \the [src] open.", \
"<span class='notice'>You pry open \the [src].</span>", \
"<span class='italics'>You hear splitting wood.</span>")
playsound(src.loc, 'sound/weapons/slashmiss.ogg', 75, 1)
var/turf/T = get_turf(src)
for(var/i in 1 to material_drop_amount)
new material_drop(src)
for(var/atom/movable/AM in contents)
AM.forceMove(T)
qdel(src)
else
if(user.a_intent == INTENT_HARM) //Only return ..() if intent is harm, otherwise return 0 or just end it.
return ..() //Stops it from opening and turning invisible when items are used on it.
else
to_chat(user, "<span class='warning'>You need a crowbar to pry this open!</span>")
return FALSE //Just stop. Do nothing. Don't turn into an invisible sprite. Don't open like a locker.
//The large crate has no non-attack interactions other than the crowbar, anyway.
@@ -1,72 +1,72 @@
/obj/structure/closet/crate/secure
desc = "A secure crate."
name = "secure crate"
icon_state = "securecrate"
secure = TRUE
locked = TRUE
max_integrity = 500
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
var/tamperproof = 0
/obj/structure/closet/crate/secure/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee" && damage_amount < 25)
return 0
. = ..()
/obj/structure/closet/crate/secure/update_icon()
..()
if(broken)
add_overlay("securecrateemag")
else if(locked)
add_overlay("securecrater")
else
add_overlay("securecrateg")
/obj/structure/closet/crate/secure/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
if(prob(tamperproof) && damage_amount >= DAMAGE_PRECISION)
boom()
else
..()
/obj/structure/closet/crate/secure/proc/boom(mob/user)
if(user)
to_chat(user, "<span class='danger'>The crate's anti-tamper system activates!</span>")
var/message = "[ADMIN_LOOKUPFLW(user)] has detonated [src.name]."
GLOB.bombers += message
message_admins(message)
log_game("[key_name(user)] has detonated [src.name].")
for(var/atom/movable/AM in src)
qdel(AM)
explosion(get_turf(src), 0, 1, 5, 5)
qdel(src)
/obj/structure/closet/crate/secure/weapon
desc = "A secure weapons crate."
name = "weapons crate"
icon_state = "weaponcrate"
/obj/structure/closet/crate/secure/plasma
desc = "A secure plasma crate."
name = "plasma crate"
icon_state = "plasmacrate"
/obj/structure/closet/crate/secure/gear
desc = "A secure gear crate."
name = "gear crate"
icon_state = "secgearcrate"
/obj/structure/closet/crate/secure/hydroponics
desc = "A crate with a lock on it, painted in the scheme of the station's botanists."
name = "secure hydroponics crate"
icon_state = "hydrosecurecrate"
/obj/structure/closet/crate/secure/engineering
desc = "A crate with a lock on it, painted in the scheme of the station's engineers."
name = "secure engineering crate"
icon_state = "engi_secure_crate"
/obj/structure/closet/crate/secure/science
name = "secure science crate"
desc = "A crate with a lock on it, painted in the scheme of the station's scientists."
icon_state = "scisecurecrate"
/obj/structure/closet/crate/secure
desc = "A secure crate."
name = "secure crate"
icon_state = "securecrate"
secure = TRUE
locked = TRUE
max_integrity = 500
armor = list("melee" = 30, "bullet" = 50, "laser" = 50, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 80)
var/tamperproof = 0
/obj/structure/closet/crate/secure/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
if(damage_flag == "melee" && damage_amount < 25)
return 0
. = ..()
/obj/structure/closet/crate/secure/update_icon()
..()
if(broken)
add_overlay("securecrateemag")
else if(locked)
add_overlay("securecrater")
else
add_overlay("securecrateg")
/obj/structure/closet/crate/secure/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
if(prob(tamperproof) && damage_amount >= DAMAGE_PRECISION)
boom()
else
..()
/obj/structure/closet/crate/secure/proc/boom(mob/user)
if(user)
to_chat(user, "<span class='danger'>The crate's anti-tamper system activates!</span>")
var/message = "[ADMIN_LOOKUPFLW(user)] has detonated [src.name]."
GLOB.bombers += message
message_admins(message)
log_game("[key_name(user)] has detonated [src.name].")
for(var/atom/movable/AM in src)
qdel(AM)
explosion(get_turf(src), 0, 1, 5, 5)
qdel(src)
/obj/structure/closet/crate/secure/weapon
desc = "A secure weapons crate."
name = "weapons crate"
icon_state = "weaponcrate"
/obj/structure/closet/crate/secure/plasma
desc = "A secure plasma crate."
name = "plasma crate"
icon_state = "plasmacrate"
/obj/structure/closet/crate/secure/gear
desc = "A secure gear crate."
name = "gear crate"
icon_state = "secgearcrate"
/obj/structure/closet/crate/secure/hydroponics
desc = "A crate with a lock on it, painted in the scheme of the station's botanists."
name = "secure hydroponics crate"
icon_state = "hydrosecurecrate"
/obj/structure/closet/crate/secure/engineering
desc = "A crate with a lock on it, painted in the scheme of the station's engineers."
name = "secure engineering crate"
icon_state = "engi_secure_crate"
/obj/structure/closet/crate/secure/science
name = "secure science crate"
desc = "A crate with a lock on it, painted in the scheme of the station's scientists."
icon_state = "scisecurecrate"
+349 -343
View File
@@ -1,343 +1,349 @@
/obj/structure/displaycase
name = "display case"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "glassbox0"
desc = "A display case for prized possessions."
density = TRUE
anchored = TRUE
resistance_flags = ACID_PROOF
armor = list("melee" = 30, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 100)
max_integrity = 200
integrity_failure = 50
var/obj/item/showpiece = null
var/alert = TRUE
var/open = FALSE
var/openable = TRUE
var/obj/item/electronics/airlock/electronics
var/start_showpiece_type = null //add type for items on display
var/list/start_showpieces = list() //Takes sublists in the form of list("type" = /obj/item/bikehorn, "trophy_message" = "henk")
var/trophy_message = ""
/obj/structure/displaycase/Initialize()
. = ..()
if(start_showpieces.len && !start_showpiece_type)
var/list/showpiece_entry = pick(start_showpieces)
if (showpiece_entry && showpiece_entry["type"])
start_showpiece_type = showpiece_entry["type"]
if (showpiece_entry["trophy_message"])
trophy_message = showpiece_entry["trophy_message"]
if(start_showpiece_type)
showpiece = new start_showpiece_type (src)
update_icon()
/obj/structure/displaycase/Destroy()
if(electronics)
QDEL_NULL(electronics)
if(showpiece)
QDEL_NULL(showpiece)
return ..()
/obj/structure/displaycase/examine(mob/user)
. = ..()
if(alert)
. += "<span class='notice'>Hooked up with an anti-theft system.</span>"
if(showpiece)
. += "<span class='notice'>There's [showpiece] inside.</span>"
if(trophy_message)
. += "The plaque reads:"
. += trophy_message
/obj/structure/displaycase/proc/dump()
if (showpiece)
showpiece.forceMove(loc)
showpiece = null
/obj/structure/displaycase/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
playsound(src.loc, 'sound/effects/glasshit.ogg', 75, 1)
if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
/obj/structure/displaycase/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
dump()
if(!disassembled)
new /obj/item/shard( src.loc )
trigger_alarm()
qdel(src)
/obj/structure/displaycase/obj_break(damage_flag)
if(!broken && !(flags_1 & NODECONSTRUCT_1))
density = FALSE
broken = 1
new /obj/item/shard( src.loc )
playsound(src, "shatter", 70, 1)
update_icon()
trigger_alarm()
/obj/structure/displaycase/proc/trigger_alarm()
//Activate Anti-theft
if(alert)
var/area/alarmed = get_area(src)
alarmed.burglaralert(src)
playsound(src, 'sound/effects/alert.ogg', 50, 1)
/obj/structure/displaycase/update_icon()
var/icon/I
if(open)
I = icon('icons/obj/stationobjs.dmi',"glassbox_open")
else
I = icon('icons/obj/stationobjs.dmi',"glassbox0")
if(broken)
I = icon('icons/obj/stationobjs.dmi',"glassboxb0")
if(showpiece)
var/icon/S = getFlatIcon(showpiece)
S.Scale(17,17)
I.Blend(S,ICON_UNDERLAY,8,8)
src.icon = I
return
/obj/structure/displaycase/attackby(obj/item/W, mob/user, params)
if(W.GetID() && !broken && openable)
if(allowed(user))
to_chat(user, "<span class='notice'>You [open ? "close":"open"] [src].</span>")
toggle_lock(user)
else
to_chat(user, "<span class='warning'>Access denied.</span>")
else if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=5))
return
to_chat(user, "<span class='notice'>You begin repairing [src].</span>")
if(W.use_tool(src, user, 40, amount=5, volume=50))
obj_integrity = max_integrity
update_icon()
to_chat(user, "<span class='notice'>You repair [src].</span>")
else
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
else if(!alert && istype(W, /obj/item/crowbar) && openable) //Only applies to the lab cage and player made display cases
if(broken)
if(showpiece)
to_chat(user, "<span class='notice'>Remove the displayed object first.</span>")
else
to_chat(user, "<span class='notice'>You remove the destroyed case</span>")
qdel(src)
else
to_chat(user, "<span class='notice'>You start to [open ? "close":"open"] [src].</span>")
if(W.use_tool(src, user, 20))
to_chat(user, "<span class='notice'>You [open ? "close":"open"] [src].</span>")
toggle_lock(user)
else if(open && !showpiece)
if(user.transferItemToLoc(W, src))
showpiece = W
to_chat(user, "<span class='notice'>You put [W] on display</span>")
update_icon()
else if(istype(W, /obj/item/stack/sheet/glass) && broken)
var/obj/item/stack/sheet/glass/G = W
if(G.get_amount() < 2)
to_chat(user, "<span class='warning'>You need two glass sheets to fix the case!</span>")
return
to_chat(user, "<span class='notice'>You start fixing [src]...</span>")
if(do_after(user, 20, target = src))
G.use(2)
broken = 0
obj_integrity = max_integrity
update_icon()
else
return ..()
/obj/structure/displaycase/proc/toggle_lock(mob/user)
open = !open
update_icon()
/obj/structure/displaycase/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/displaycase/attack_hand(mob/user)
. = ..()
if(.)
return
user.changeNext_move(CLICK_CD_MELEE)
if (showpiece && (broken || open))
to_chat(user, "<span class='notice'>You deactivate the hover field built into the case.</span>")
log_combat(user, src, "deactivates the hover field of")
dump()
src.add_fingerprint(user)
update_icon()
return
else
//prevents remote "kicks" with TK
if (!Adjacent(user))
return
user.visible_message("<span class='danger'>[user] kicks the display case.</span>", null, null, COMBAT_MESSAGE_RANGE)
log_combat(user, src, "kicks")
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
take_damage(2)
/obj/structure/displaycase_chassis
anchored = TRUE
density = FALSE
name = "display case chassis"
desc = "The wooden base of a display case."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "glassbox_chassis"
var/obj/item/electronics/airlock/electronics
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench)) //The player can only deconstruct the wooden frame
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 30))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
new /obj/item/stack/sheet/mineral/wood(get_turf(src), 5)
qdel(src)
else if(istype(I, /obj/item/electronics/airlock))
to_chat(user, "<span class='notice'>You start installing the electronics into [src]...</span>")
I.play_tool_sound(src)
if(do_after(user, 30, target = src) && user.transferItemToLoc(I,src))
electronics = I
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
else if(istype(I, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G = I
if(G.get_amount() < 10)
to_chat(user, "<span class='warning'>You need ten glass sheets to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [G] to [src]...</span>")
if(do_after(user, 20, target = src))
G.use(10)
var/obj/structure/displaycase/display = new(src.loc)
if(electronics)
electronics.forceMove(display)
display.electronics = electronics
if(electronics.one_access)
display.req_one_access = electronics.accesses
else
display.req_access = electronics.accesses
qdel(src)
else
return ..()
//The captains display case requiring specops ID access is intentional.
//The lab cage and captains display case do not spawn with electronics, which is why req_access is needed.
/obj/structure/displaycase/captain
alert = TRUE
start_showpiece_type = /obj/item/gun/energy/laser/captain
req_access = list(ACCESS_CENT_SPECOPS)
/obj/structure/displaycase/labcage
name = "lab cage"
desc = "A glass lab container for storing interesting creatures."
start_showpiece_type = /obj/item/clothing/mask/facehugger/lamarr
req_access = list(ACCESS_RD)
/obj/structure/displaycase/trophy
name = "trophy display case"
desc = "Store your trophies of accomplishment in here, and they will stay forever."
var/placer_key = ""
var/added_roundstart = TRUE
var/is_locked = TRUE
alert = TRUE
integrity_failure = 0
openable = FALSE
/obj/structure/displaycase/trophy/Initialize()
. = ..()
GLOB.trophy_cases += src
/obj/structure/displaycase/trophy/Destroy()
GLOB.trophy_cases -= src
return ..()
/obj/structure/displaycase/trophy/attackby(obj/item/W, mob/user, params)
if(!user.Adjacent(src)) //no TK museology
return
if(user.a_intent == INTENT_HARM)
return ..()
if(user.is_holding_item_of_type(/obj/item/key/displaycase))
if(added_roundstart)
is_locked = !is_locked
to_chat(user, "You [!is_locked ? "un" : ""]lock the case.")
else
to_chat(user, "<span class='danger'>The lock is stuck shut!</span>")
return
if(is_locked)
to_chat(user, "<span class='danger'>The case is shut tight with an old fashioned physical lock. Maybe you should ask the curator for the key?</span>")
return
if(!added_roundstart)
to_chat(user, "You've already put something new in this case.")
return
if(is_type_in_typecache(W, GLOB.blacklisted_cargo_types))
to_chat(user, "<span class='danger'>The case rejects the [W].</span>")
return
for(var/a in W.GetAllContents())
if(is_type_in_typecache(a, GLOB.blacklisted_cargo_types))
to_chat(user, "<span class='danger'>The case rejects the [W].</span>")
return
if(user.transferItemToLoc(W, src))
if(showpiece)
to_chat(user, "You press a button, and [showpiece] descends into the floor of the case.")
QDEL_NULL(showpiece)
to_chat(user, "You insert [W] into the case.")
showpiece = W
added_roundstart = FALSE
update_icon()
placer_key = user.ckey
trophy_message = W.desc //default value
var/chosen_plaque = stripped_input(user, "What would you like the plaque to say? Default value is item's description.", "Trophy Plaque")
if(chosen_plaque)
if(user.Adjacent(src))
trophy_message = chosen_plaque
to_chat(user, "You set the plaque's text.")
else
to_chat(user, "You are too far to set the plaque's text.")
SSpersistence.SaveTrophy(src)
return TRUE
else
to_chat(user, "<span class='warning'>\The [W] is stuck to your hand, you can't put it in the [src.name]!</span>")
return
/obj/structure/displaycase/trophy/dump()
if (showpiece)
if(added_roundstart)
visible_message("<span class='danger'>The [showpiece] crumbles to dust!</span>")
new /obj/effect/decal/cleanable/ash(loc)
QDEL_NULL(showpiece)
else
..()
/obj/item/key/displaycase
name = "display case key"
desc = "The key to the curator's display cases."
/obj/item/showpiece_dummy
name = "Cheap replica"
/obj/item/showpiece_dummy/Initialize(mapload, path)
. = ..()
var/obj/item/I = path
name = initial(I.name)
icon = initial(I.icon)
icon_state = initial(I.icon_state)
/obj/structure/displaycase
name = "display case"
icon = 'icons/obj/stationobjs.dmi'
icon_state = "glassbox0"
desc = "A display case for prized possessions."
density = TRUE
anchored = TRUE
resistance_flags = ACID_PROOF
armor = list("melee" = 30, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 100)
max_integrity = 200
integrity_failure = 50
var/obj/item/showpiece = null
var/alert = TRUE
var/open = FALSE
var/openable = TRUE
var/obj/item/electronics/airlock/electronics
var/start_showpiece_type = null //add type for items on display
var/list/start_showpieces = list() //Takes sublists in the form of list("type" = /obj/item/bikehorn, "trophy_message" = "henk")
var/trophy_message = ""
/obj/structure/displaycase/Initialize()
. = ..()
if(start_showpieces.len && !start_showpiece_type)
var/list/showpiece_entry = pick(start_showpieces)
if (showpiece_entry && showpiece_entry["type"])
start_showpiece_type = showpiece_entry["type"]
if (showpiece_entry["trophy_message"])
trophy_message = showpiece_entry["trophy_message"]
if(start_showpiece_type)
showpiece = new start_showpiece_type (src)
update_icon()
/obj/structure/displaycase/Destroy()
if(electronics)
QDEL_NULL(electronics)
if(showpiece)
QDEL_NULL(showpiece)
return ..()
/obj/structure/displaycase/examine(mob/user)
. = ..()
if(alert)
. += "<span class='notice'>Hooked up with an anti-theft system.</span>"
if(showpiece)
. += "<span class='notice'>There's [showpiece] inside.</span>"
if(trophy_message)
. += "The plaque reads:"
. += trophy_message
/obj/structure/displaycase/proc/dump()
if (showpiece)
showpiece.forceMove(loc)
showpiece = null
/obj/structure/displaycase/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
playsound(src.loc, 'sound/effects/glasshit.ogg', 75, 1)
if(BURN)
playsound(src.loc, 'sound/items/welder.ogg', 100, 1)
/obj/structure/displaycase/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
dump()
if(!disassembled)
new /obj/item/shard( src.loc )
trigger_alarm()
qdel(src)
/obj/structure/displaycase/obj_break(damage_flag)
if(!broken && !(flags_1 & NODECONSTRUCT_1))
density = FALSE
broken = 1
new /obj/item/shard( src.loc )
playsound(src, "shatter", 70, 1)
update_icon()
trigger_alarm()
/obj/structure/displaycase/proc/trigger_alarm()
//Activate Anti-theft
if(alert)
var/area/alarmed = get_area(src)
alarmed.burglaralert(src)
playsound(src, 'sound/effects/alert.ogg', 50, 1)
/obj/structure/displaycase/update_icon()
var/icon/I
if(open)
I = icon('icons/obj/stationobjs.dmi',"glassbox_open")
else
I = icon('icons/obj/stationobjs.dmi',"glassbox0")
if(broken)
I = icon('icons/obj/stationobjs.dmi',"glassboxb0")
if(showpiece)
var/icon/S = getFlatIcon(showpiece)
S.Scale(17,17)
I.Blend(S,ICON_UNDERLAY,8,8)
src.icon = I
return
/obj/structure/displaycase/attackby(obj/item/W, mob/user, params)
if(W.GetID() && !broken && openable)
if(allowed(user))
to_chat(user, "<span class='notice'>You [open ? "close":"open"] [src].</span>")
toggle_lock(user)
else
to_chat(user, "<span class='warning'>Access denied.</span>")
else if(istype(W, /obj/item/weldingtool) && user.a_intent == INTENT_HELP && !broken)
if(obj_integrity < max_integrity)
if(!W.tool_start_check(user, amount=5))
return
to_chat(user, "<span class='notice'>You begin repairing [src].</span>")
if(W.use_tool(src, user, 40, amount=5, volume=50))
obj_integrity = max_integrity
update_icon()
to_chat(user, "<span class='notice'>You repair [src].</span>")
else
to_chat(user, "<span class='warning'>[src] is already in good condition!</span>")
return
else if(!alert && istype(W, /obj/item/crowbar) && openable) //Only applies to the lab cage and player made display cases
if(broken)
if(showpiece)
to_chat(user, "<span class='notice'>Remove the displayed object first.</span>")
else
to_chat(user, "<span class='notice'>You remove the destroyed case</span>")
qdel(src)
else
to_chat(user, "<span class='notice'>You start to [open ? "close":"open"] [src].</span>")
if(W.use_tool(src, user, 20))
to_chat(user, "<span class='notice'>You [open ? "close":"open"] [src].</span>")
toggle_lock(user)
else if(open && !showpiece)
if(user.transferItemToLoc(W, src))
showpiece = W
to_chat(user, "<span class='notice'>You put [W] on display</span>")
update_icon()
else if(istype(W, /obj/item/stack/sheet/glass) && broken)
var/obj/item/stack/sheet/glass/G = W
if(G.get_amount() < 2)
to_chat(user, "<span class='warning'>You need two glass sheets to fix the case!</span>")
return
to_chat(user, "<span class='notice'>You start fixing [src]...</span>")
if(do_after(user, 20, target = src))
G.use(2)
broken = 0
obj_integrity = max_integrity
update_icon()
else
return ..()
/obj/structure/displaycase/proc/toggle_lock(mob/user)
open = !open
update_icon()
/obj/structure/displaycase/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/displaycase/attack_hand(mob/user)
. = ..()
if(.)
return
user.changeNext_move(CLICK_CD_MELEE)
if (showpiece && (broken || open))
to_chat(user, "<span class='notice'>You deactivate the hover field built into the case.</span>")
log_combat(user, src, "deactivates the hover field of")
dump()
src.add_fingerprint(user)
update_icon()
return
else
//prevents remote "kicks" with TK
if (!Adjacent(user))
return
user.visible_message("<span class='danger'>[user] kicks the display case.</span>", null, null, COMBAT_MESSAGE_RANGE)
log_combat(user, src, "kicks")
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
take_damage(2)
/obj/structure/displaycase_chassis
anchored = TRUE
density = FALSE
name = "display case chassis"
desc = "The wooden base of a display case."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "glassbox_chassis"
var/obj/item/electronics/airlock/electronics
/obj/structure/displaycase_chassis/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench)) //The player can only deconstruct the wooden frame
to_chat(user, "<span class='notice'>You start disassembling [src]...</span>")
I.play_tool_sound(src)
if(I.use_tool(src, user, 30))
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
new /obj/item/stack/sheet/mineral/wood(get_turf(src), 5)
qdel(src)
else if(istype(I, /obj/item/electronics/airlock))
to_chat(user, "<span class='notice'>You start installing the electronics into [src]...</span>")
I.play_tool_sound(src)
if(do_after(user, 30, target = src) && user.transferItemToLoc(I,src))
electronics = I
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
else if(istype(I, /obj/item/stack/sheet/glass))
var/obj/item/stack/sheet/glass/G = I
if(G.get_amount() < 10)
to_chat(user, "<span class='warning'>You need ten glass sheets to do this!</span>")
return
to_chat(user, "<span class='notice'>You start adding [G] to [src]...</span>")
if(do_after(user, 20, target = src))
G.use(10)
var/obj/structure/displaycase/display = new(src.loc)
if(electronics)
electronics.forceMove(display)
display.electronics = electronics
if(electronics.one_access)
display.req_one_access = electronics.accesses
else
display.req_access = electronics.accesses
qdel(src)
else
return ..()
//The captains display case requiring specops ID access is intentional.
//The lab cage and captains display case do not spawn with electronics, which is why req_access is needed.
/obj/structure/displaycase/captain
alert = TRUE
start_showpiece_type = /obj/item/gun/energy/laser/captain
req_access = list(ACCESS_CENT_SPECOPS)
/obj/structure/displaycase/labcage
name = "lab cage"
desc = "A glass lab container for storing interesting creatures."
start_showpiece_type = /obj/item/clothing/mask/facehugger/lamarr
req_access = list(ACCESS_RD)
/obj/structure/displaycase/clown
desc = "In the event of clown, honk glass."
alert = TRUE
start_showpiece_type = /obj/item/bikehorn
req_access = list(ACCESS_CENT_GENERAL)
/obj/structure/displaycase/trophy
name = "trophy display case"
desc = "Store your trophies of accomplishment in here, and they will stay forever."
var/placer_key = ""
var/added_roundstart = TRUE
var/is_locked = TRUE
alert = TRUE
integrity_failure = 0
openable = FALSE
/obj/structure/displaycase/trophy/Initialize()
. = ..()
GLOB.trophy_cases += src
/obj/structure/displaycase/trophy/Destroy()
GLOB.trophy_cases -= src
return ..()
/obj/structure/displaycase/trophy/attackby(obj/item/W, mob/user, params)
if(!user.Adjacent(src)) //no TK museology
return
if(user.a_intent == INTENT_HARM)
return ..()
if(user.is_holding_item_of_type(/obj/item/key/displaycase))
if(added_roundstart)
is_locked = !is_locked
to_chat(user, "You [!is_locked ? "un" : ""]lock the case.")
else
to_chat(user, "<span class='danger'>The lock is stuck shut!</span>")
return
if(is_locked)
to_chat(user, "<span class='danger'>The case is shut tight with an old fashioned physical lock. Maybe you should ask the curator for the key?</span>")
return
if(!added_roundstart)
to_chat(user, "You've already put something new in this case.")
return
if(is_type_in_typecache(W, GLOB.blacklisted_cargo_types))
to_chat(user, "<span class='danger'>The case rejects the [W].</span>")
return
for(var/a in W.GetAllContents())
if(is_type_in_typecache(a, GLOB.blacklisted_cargo_types))
to_chat(user, "<span class='danger'>The case rejects the [W].</span>")
return
if(user.transferItemToLoc(W, src))
if(showpiece)
to_chat(user, "You press a button, and [showpiece] descends into the floor of the case.")
QDEL_NULL(showpiece)
to_chat(user, "You insert [W] into the case.")
showpiece = W
added_roundstart = FALSE
update_icon()
placer_key = user.ckey
trophy_message = W.desc //default value
var/chosen_plaque = stripped_input(user, "What would you like the plaque to say? Default value is item's description.", "Trophy Plaque")
if(chosen_plaque)
if(user.Adjacent(src))
trophy_message = chosen_plaque
to_chat(user, "You set the plaque's text.")
else
to_chat(user, "You are too far to set the plaque's text.")
SSpersistence.SaveTrophy(src)
return TRUE
else
to_chat(user, "<span class='warning'>\The [W] is stuck to your hand, you can't put it in the [src.name]!</span>")
return
/obj/structure/displaycase/trophy/dump()
if (showpiece)
if(added_roundstart)
visible_message("<span class='danger'>The [showpiece] crumbles to dust!</span>")
new /obj/effect/decal/cleanable/ash(loc)
QDEL_NULL(showpiece)
else
..()
/obj/item/key/displaycase
name = "display case key"
desc = "The key to the curator's display cases."
/obj/item/showpiece_dummy
name = "Cheap replica"
/obj/item/showpiece_dummy/Initialize(mapload, path)
. = ..()
var/obj/item/I = path
name = initial(I.name)
icon = initial(I.icon)
icon_state = initial(I.icon_state)
+1 -1
View File
@@ -39,7 +39,7 @@
return
last_process = world.time
to_chat(user, "<span class='notice'>The water feels warm and soothing as you touch it. The fountain immediately dries up shortly afterwards.</span>")
user.reagents.add_reagent("godblood",20)
user.reagents.add_reagent(/datum/reagent/medicine/omnizine/godblood,20)
update_icon()
addtimer(CALLBACK(src, /atom/.proc/update_icon), time_between_uses)
+82 -82
View File
@@ -1,82 +1,82 @@
/obj/structure/dresser
name = "dresser"
desc = "A nicely-crafted wooden dresser. It's filled with lots of undies."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "dresser"
density = TRUE
anchored = TRUE
/obj/structure/dresser/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
setAnchored(!anchored)
else
return ..()
/obj/structure/dresser/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood(drop_location(), 10)
qdel(src)
/obj/structure/dresser/attack_hand(mob/user)
. = ..()
if(. || !ishuman(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
var/mob/living/carbon/human/H = user
if(H.dna && H.dna.species && (NO_UNDERWEAR in H.dna.species.species_traits))
to_chat(H, "<span class='warning'>You are not capable of wearing underwear.</span>")
return
var/list/undergarment_choices = list("Underwear", "Underwear Color", "Undershirt", "Undershirt Color", "Socks", "Socks Color")
if(!(GLOB.underwear_list[H.underwear]?.has_color))
undergarment_choices -= "Underwear Color"
if(!(GLOB.undershirt_list[H.undershirt]?.has_color))
undergarment_choices -= "Undershirt Color"
if(!(GLOB.socks_list[H.socks]?.has_color))
undergarment_choices -= "Socks Color"
var/choice = input(H, "Underwear, Undershirt, or Socks?", "Changing") as null|anything in undergarment_choices
if(!H.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
var/dye_undie = FALSE
var/dye_shirt = FALSE
var/dye_socks = FALSE
switch(choice)
if("Underwear")
var/new_undies = input(H, "Select your underwear", "Changing") as null|anything in GLOB.underwear_list
if(H.underwear)
H.underwear = new_undies
H.saved_underwear = new_undies
var/datum/sprite_accessory/underwear/bottom/B = GLOB.underwear_list[new_undies]
dye_undie = B?.has_color
if("Undershirt")
var/new_undershirt = input(H, "Select your undershirt", "Changing") as null|anything in GLOB.undershirt_list
if(new_undershirt)
H.undershirt = new_undershirt
H.saved_undershirt = new_undershirt
var/datum/sprite_accessory/underwear/top/T = GLOB.undershirt_list[new_undershirt]
dye_shirt = T?.has_color
if("Socks")
var/new_socks = input(H, "Select your socks", "Changing") as null|anything in GLOB.socks_list
if(new_socks)
H.socks = new_socks
H.saved_socks = new_socks
var/datum/sprite_accessory/underwear/socks/S = GLOB.socks_list[new_socks]
dye_socks = S?.has_color
if(dye_undie || choice == "Underwear Color")
H.undie_color = recolor_undergarment(H, "underwear", H.undie_color)
if(dye_shirt || choice == "Undershirt Color")
H.shirt_color = recolor_undergarment(H, "undershirt", H.shirt_color)
if(dye_socks || choice == "Socks Color")
H.socks_color = recolor_undergarment(H, "socks", H.socks_color)
add_fingerprint(H)
H.update_body()
/obj/structure/dresser/proc/recolor_undergarment(mob/living/carbon/human/H, garment_type = "underwear", default_color)
var/n_color = input(H, "Choose your [garment_type]'\s color.", "Character Preference", default_color) as color|null
if(!n_color || !H.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return default_color
return sanitize_hexcolor(n_color, 3, FALSE, default_color)
/obj/structure/dresser
name = "dresser"
desc = "A nicely-crafted wooden dresser. It's filled with lots of undies."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "dresser"
density = TRUE
anchored = TRUE
/obj/structure/dresser/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/wrench))
to_chat(user, "<span class='notice'>You begin to [anchored ? "unwrench" : "wrench"] [src].</span>")
if(I.use_tool(src, user, 20, volume=50))
to_chat(user, "<span class='notice'>You successfully [anchored ? "unwrench" : "wrench"] [src].</span>")
setAnchored(!anchored)
else
return ..()
/obj/structure/dresser/deconstruct(disassembled = TRUE)
new /obj/item/stack/sheet/mineral/wood(drop_location(), 10)
qdel(src)
/obj/structure/dresser/attack_hand(mob/user)
. = ..()
if(. || !ishuman(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
var/mob/living/carbon/human/H = user
if(H.dna && H.dna.species && (NO_UNDERWEAR in H.dna.species.species_traits))
to_chat(H, "<span class='warning'>You are not capable of wearing underwear.</span>")
return
var/list/undergarment_choices = list("Underwear", "Underwear Color", "Undershirt", "Undershirt Color", "Socks", "Socks Color")
if(!(GLOB.underwear_list[H.underwear]?.has_color))
undergarment_choices -= "Underwear Color"
if(!(GLOB.undershirt_list[H.undershirt]?.has_color))
undergarment_choices -= "Undershirt Color"
if(!(GLOB.socks_list[H.socks]?.has_color))
undergarment_choices -= "Socks Color"
var/choice = input(H, "Underwear, Undershirt, or Socks?", "Changing") as null|anything in undergarment_choices
if(!H.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
var/dye_undie = FALSE
var/dye_shirt = FALSE
var/dye_socks = FALSE
switch(choice)
if("Underwear")
var/new_undies = input(H, "Select your underwear", "Changing") as null|anything in GLOB.underwear_list
if(H.underwear)
H.underwear = new_undies
H.saved_underwear = new_undies
var/datum/sprite_accessory/underwear/bottom/B = GLOB.underwear_list[new_undies]
dye_undie = B?.has_color
if("Undershirt")
var/new_undershirt = input(H, "Select your undershirt", "Changing") as null|anything in GLOB.undershirt_list
if(new_undershirt)
H.undershirt = new_undershirt
H.saved_undershirt = new_undershirt
var/datum/sprite_accessory/underwear/top/T = GLOB.undershirt_list[new_undershirt]
dye_shirt = T?.has_color
if("Socks")
var/new_socks = input(H, "Select your socks", "Changing") as null|anything in GLOB.socks_list
if(new_socks)
H.socks = new_socks
H.saved_socks = new_socks
var/datum/sprite_accessory/underwear/socks/S = GLOB.socks_list[new_socks]
dye_socks = S?.has_color
if(dye_undie || choice == "Underwear Color")
H.undie_color = recolor_undergarment(H, "underwear", H.undie_color)
if(dye_shirt || choice == "Undershirt Color")
H.shirt_color = recolor_undergarment(H, "undershirt", H.shirt_color)
if(dye_socks || choice == "Socks Color")
H.socks_color = recolor_undergarment(H, "socks", H.socks_color)
add_fingerprint(H)
H.update_body()
/obj/structure/dresser/proc/recolor_undergarment(mob/living/carbon/human/H, garment_type = "underwear", default_color)
var/n_color = input(H, "Choose your [garment_type]'\s color.", "Character Preference", default_color) as color|null
if(!n_color || !H.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return default_color
return sanitize_hexcolor(n_color, 3, FALSE, default_color)
+46 -46
View File
@@ -1,46 +1,46 @@
/obj/structure/chair/e_chair
name = "electric chair"
desc = "Looks absolutely SHOCKING!"
icon_state = "echair0"
var/obj/item/assembly/shock_kit/part = null
var/last_time = 1
item_chair = null
/obj/structure/chair/e_chair/New()
..()
add_overlay(mutable_appearance('icons/obj/chairs.dmi', "echair_over", MOB_LAYER + 1))
/obj/structure/chair/e_chair/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
var/obj/structure/chair/C = new /obj/structure/chair(loc)
W.play_tool_sound(src)
C.setDir(dir)
part.forceMove(loc)
part.master = null
part = null
qdel(src)
/obj/structure/chair/e_chair/proc/shock()
if(last_time + 50 > world.time)
return
last_time = world.time
// special power handling
var/area/A = get_area(src)
if(!isarea(A))
return
if(!A.powered(EQUIP))
return
A.use_power(EQUIP, 5000)
flick("echair_shock", src)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(12, 1, src)
s.start()
if(has_buckled_mobs())
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
buckled_mob.electrocute_act(85, src, 1)
to_chat(buckled_mob, "<span class='userdanger'>You feel a deep shock course through your body!</span>")
addtimer(CALLBACK(buckled_mob, /mob/living.proc/electrocute_act, 85, src, 1), 1)
visible_message("<span class='danger'>The electric chair went off!</span>", "<span class='italics'>You hear a deep sharp shock!</span>")
/obj/structure/chair/e_chair
name = "electric chair"
desc = "Looks absolutely SHOCKING!"
icon_state = "echair0"
var/obj/item/assembly/shock_kit/part = null
var/last_time = 1
item_chair = null
/obj/structure/chair/e_chair/New()
..()
add_overlay(mutable_appearance('icons/obj/chairs.dmi', "echair_over", MOB_LAYER + 1))
/obj/structure/chair/e_chair/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/wrench))
var/obj/structure/chair/C = new /obj/structure/chair(loc)
W.play_tool_sound(src)
C.setDir(dir)
part.forceMove(loc)
part.master = null
part = null
qdel(src)
/obj/structure/chair/e_chair/proc/shock()
if(last_time + 50 > world.time)
return
last_time = world.time
// special power handling
var/area/A = get_area(src)
if(!isarea(A))
return
if(!A.powered(EQUIP))
return
A.use_power(EQUIP, 5000)
flick("echair_shock", src)
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
s.set_up(12, 1, src)
s.start()
if(has_buckled_mobs())
for(var/m in buckled_mobs)
var/mob/living/buckled_mob = m
buckled_mob.electrocute_act(85, src, 1)
to_chat(buckled_mob, "<span class='userdanger'>You feel a deep shock course through your body!</span>")
addtimer(CALLBACK(buckled_mob, /mob/living.proc/electrocute_act, 85, src, 1), 1)
visible_message("<span class='danger'>The electric chair went off!</span>", "<span class='italics'>You hear a deep sharp shock!</span>")
+156 -156
View File
@@ -1,156 +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)
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
/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
+427 -427
View File
@@ -1,427 +1,427 @@
/obj/structure/flora
resistance_flags = FLAMMABLE
max_integrity = 150
anchored = TRUE
//trees
/obj/structure/flora/tree
name = "tree"
desc = "A large tree."
density = TRUE
pixel_x = -16
layer = FLY_LAYER
var/log_amount = 10
/obj/structure/flora/tree/attackby(obj/item/W, mob/user, params)
if(log_amount && (!(flags_1 & NODECONSTRUCT_1)))
if(W.sharpness && W.force > 0)
if(W.hitsound)
playsound(get_turf(src), W.hitsound, 100, 0, 0)
user.visible_message("<span class='notice'>[user] begins to cut down [src] with [W].</span>","<span class='notice'>You begin to cut down [src] with [W].</span>", "You hear the sound of sawing.")
if(do_after(user, 1000/W.force, target = src)) //5 seconds with 20 force, 8 seconds with a hatchet, 20 seconds with a shard.
user.visible_message("<span class='notice'>[user] fells [src] with the [W].</span>","<span class='notice'>You fell [src] with the [W].</span>", "You hear the sound of a tree falling.")
playsound(get_turf(src), 'sound/effects/meteorimpact.ogg', 100 , 0, 0)
for(var/i=1 to log_amount)
new /obj/item/grown/log/tree(get_turf(src))
var/obj/structure/flora/stump/S = new(loc)
S.name = "[name] stump"
qdel(src)
else
return ..()
/obj/structure/flora/stump
name = "stump"
desc = "This represents our promise to the crew, and the station itself, to cut down as many trees as possible." //running naked through the trees
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "tree_stump"
density = FALSE
pixel_x = -16
/obj/structure/flora/tree/pine
name = "pine tree"
desc = "A coniferous pine tree."
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "pine_1"
var/list/icon_states = list("pine_1", "pine_2", "pine_3")
/obj/structure/flora/tree/pine/Initialize()
. = ..()
if(islist(icon_states && icon_states.len))
icon_state = pick(icon_states)
/obj/structure/flora/tree/pine/xmas
name = "xmas tree"
desc = "A wondrous decorated Christmas tree."
icon_state = "pine_c"
icon_states = null
/obj/structure/flora/tree/pine/xmas/presents
icon_state = "pinepresents"
desc = "A wondrous decorated Christmas tree. It has presents!"
var/gift_type = /obj/item/a_gift/anything
var/list/ckeys_that_took = list()
/obj/structure/flora/tree/pine/xmas/presents/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(!user.ckey)
return
if(ckeys_that_took[user.ckey])
to_chat(user, "<span class='warning'>There are no presents with your name on.</span>")
return
to_chat(user, "<span class='warning'>After a bit of rummaging, you locate a gift with your name on it!</span>")
ckeys_that_took[user.ckey] = TRUE
var/obj/item/G = new gift_type(src)
user.put_in_hands(G)
/obj/structure/flora/tree/dead
icon = 'icons/obj/flora/deadtrees.dmi'
desc = "A dead tree. How it died, you know not."
icon_state = "tree_1"
/obj/structure/flora/tree/palm
icon = 'icons/misc/beach2.dmi'
desc = "A tree straight from the tropics."
icon_state = "palm1"
/obj/structure/flora/tree/palm/Initialize()
. = ..()
icon_state = pick("palm1","palm2")
pixel_x = 0
/obj/structure/festivus
name = "festivus pole"
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "festivus_pole"
desc = "During last year's Feats of Strength the Research Director was able to suplex this passing immobile rod into a planter."
/obj/structure/festivus/anchored
name = "suplexed rod"
desc = "A true feat of strength, almost as good as last year."
icon_state = "anchored_rod"
anchored = TRUE
/obj/structure/flora/tree/dead/Initialize()
icon_state = "tree_[rand(1, 6)]"
. = ..()
/obj/structure/flora/tree/jungle
name = "tree"
icon_state = "tree"
desc = "It's seriously hampering your view of the jungle."
icon = 'icons/obj/flora/jungletrees.dmi'
pixel_x = -48
pixel_y = -20
/obj/structure/flora/tree/jungle/Initialize()
icon_state = "[icon_state][rand(1, 6)]"
. = ..()
/obj/structure/flora/tree/jungle/small
pixel_y = 0
pixel_x = -32
icon = 'icons/obj/flora/jungletreesmall.dmi'
//grass
/obj/structure/flora/grass
name = "grass"
desc = "A patch of overgrown grass."
icon = 'icons/obj/flora/snowflora.dmi'
gender = PLURAL //"this is grass" not "this is a grass"
/obj/structure/flora/grass/brown
icon_state = "snowgrass1bb"
/obj/structure/flora/grass/brown/Initialize()
icon_state = "snowgrass[rand(1, 3)]bb"
. = ..()
/obj/structure/flora/grass/green
icon_state = "snowgrass1gb"
/obj/structure/flora/grass/green/Initialize()
icon_state = "snowgrass[rand(1, 3)]gb"
. = ..()
/obj/structure/flora/grass/both
icon_state = "snowgrassall1"
/obj/structure/flora/grass/both/Initialize()
icon_state = "snowgrassall[rand(1, 3)]"
. = ..()
//bushes
/obj/structure/flora/bush
name = "bush"
desc = "Some type of shrub."
icon = 'icons/obj/flora/snowflora.dmi'
icon_state = "snowbush1"
anchored = TRUE
/obj/structure/flora/bush/Initialize()
icon_state = "snowbush[rand(1, 6)]"
. = ..()
//newbushes
/obj/structure/flora/ausbushes
name = "bush"
desc = "Some kind of plant."
icon = 'icons/obj/flora/ausflora.dmi'
icon_state = "firstbush_1"
/obj/structure/flora/ausbushes/Initialize()
if(icon_state == "firstbush_1")
icon_state = "firstbush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/reedbush
icon_state = "reedbush_1"
/obj/structure/flora/ausbushes/reedbush/Initialize()
icon_state = "reedbush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/leafybush
icon_state = "leafybush_1"
/obj/structure/flora/ausbushes/leafybush/Initialize()
icon_state = "leafybush_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/palebush
icon_state = "palebush_1"
/obj/structure/flora/ausbushes/palebush/Initialize()
icon_state = "palebush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/stalkybush
icon_state = "stalkybush_1"
/obj/structure/flora/ausbushes/stalkybush/Initialize()
icon_state = "stalkybush_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/grassybush
icon_state = "grassybush_1"
/obj/structure/flora/ausbushes/grassybush/Initialize()
icon_state = "grassybush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/fernybush
icon_state = "fernybush_1"
/obj/structure/flora/ausbushes/fernybush/Initialize()
icon_state = "fernybush_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/sunnybush
icon_state = "sunnybush_1"
/obj/structure/flora/ausbushes/sunnybush/Initialize()
icon_state = "sunnybush_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/genericbush
icon_state = "genericbush_1"
/obj/structure/flora/ausbushes/genericbush/Initialize()
icon_state = "genericbush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/pointybush
icon_state = "pointybush_1"
/obj/structure/flora/ausbushes/pointybush/Initialize()
icon_state = "pointybush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/lavendergrass
icon_state = "lavendergrass_1"
/obj/structure/flora/ausbushes/lavendergrass/Initialize()
icon_state = "lavendergrass_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/ywflowers
icon_state = "ywflowers_1"
/obj/structure/flora/ausbushes/ywflowers/Initialize()
icon_state = "ywflowers_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/brflowers
icon_state = "brflowers_1"
/obj/structure/flora/ausbushes/brflowers/Initialize()
icon_state = "brflowers_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/ppflowers
icon_state = "ppflowers_1"
/obj/structure/flora/ausbushes/ppflowers/Initialize()
icon_state = "ppflowers_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/sparsegrass
icon_state = "sparsegrass_1"
/obj/structure/flora/ausbushes/sparsegrass/Initialize()
icon_state = "sparsegrass_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/fullgrass
icon_state = "fullgrass_1"
/obj/structure/flora/ausbushes/fullgrass/Initialize()
icon_state = "fullgrass_[rand(1, 3)]"
. = ..()
/obj/item/twohanded/required/kirbyplants
name = "potted plant"
icon = 'icons/obj/flora/plants.dmi'
icon_state = "plant-01"
desc = "A little bit of nature contained in a pot."
layer = ABOVE_MOB_LAYER
w_class = WEIGHT_CLASS_HUGE
force = 10
throwforce = 13
throw_speed = 2
throw_range = 4
/obj/item/twohanded/required/kirbyplants/Initialize()
. = ..()
AddComponent(/datum/component/tactical)
/obj/item/twohanded/required/kirbyplants/random
icon = 'icons/obj/flora/_flora.dmi'
icon_state = "random_plant"
var/list/static/states
/obj/item/twohanded/required/kirbyplants/random/Initialize()
. = ..()
icon = 'icons/obj/flora/plants.dmi'
if(!states)
generate_states()
icon_state = pick(states)
/obj/item/twohanded/required/kirbyplants/random/proc/generate_states()
states = list()
for(var/i in 1 to 25)
var/number
if(i < 10)
number = "0[i]"
else
number = "[i]"
states += "plant-[number]"
states += "applebush"
/obj/item/twohanded/required/kirbyplants/dead
name = "RD's potted plant"
desc = "A gift from the botanical staff, presented after the RD's reassignment. There's a tag on it that says \"Y'all come back now, y'hear?\"\nIt doesn't look very healthy..."
icon_state = "plant-25"
/obj/item/twohanded/required/kirbyplants/photosynthetic
name = "photosynthetic potted plant"
desc = "A bioluminescent plant."
icon_state = "plant-09"
light_color = "#2cb2e8"
light_range = 3
//a rock is flora according to where the icon file is
//and now these defines
/obj/structure/flora/rock
icon_state = "basalt"
desc = "A volcanic rock. Pioneers used to ride these babies for miles."
icon = 'icons/obj/flora/rocks.dmi'
resistance_flags = FIRE_PROOF
density = TRUE
/obj/structure/flora/rock/Initialize()
. = ..()
icon_state = "[icon_state][rand(1,3)]"
/obj/structure/flora/rock/pile
icon_state = "lavarocks"
desc = "A pile of rocks."
//Jungle grass
/obj/structure/flora/grass/jungle
name = "jungle grass"
desc = "Thick alien flora."
icon = 'icons/obj/flora/jungleflora.dmi'
icon_state = "grassa"
/obj/structure/flora/grass/jungle/Initialize()
icon_state = "[icon_state][rand(1, 5)]"
. = ..()
/obj/structure/flora/grass/jungle/b
icon_state = "grassb"
//Jungle rocks
/obj/structure/flora/rock/jungle
icon_state = "pile of rocks"
desc = "A pile of rocks."
icon_state = "rock"
icon = 'icons/obj/flora/jungleflora.dmi'
density = FALSE
/obj/structure/flora/rock/jungle/Initialize()
. = ..()
icon_state = "[initial(icon_state)][rand(1,5)]"
//Jungle bushes
/obj/structure/flora/junglebush
name = "bush"
desc = "A wild plant that is found in jungles."
icon = 'icons/obj/flora/jungleflora.dmi'
icon_state = "busha"
/obj/structure/flora/junglebush/Initialize()
icon_state = "[icon_state][rand(1, 3)]"
. = ..()
/obj/structure/flora/junglebush/b
icon_state = "bushb"
/obj/structure/flora/junglebush/c
icon_state = "bushc"
/obj/structure/flora/junglebush/large
icon_state = "bush"
icon = 'icons/obj/flora/largejungleflora.dmi'
pixel_x = -16
pixel_y = -12
layer = ABOVE_ALL_MOB_LAYER
/obj/structure/flora/rock/pile/largejungle
name = "rocks"
icon_state = "rocks"
icon = 'icons/obj/flora/largejungleflora.dmi'
density = FALSE
pixel_x = -16
pixel_y = -16
/obj/structure/flora/rock/pile/largejungle/Initialize()
. = ..()
icon_state = "[initial(icon_state)][rand(1,3)]"
/obj/structure/flora
resistance_flags = FLAMMABLE
max_integrity = 150
anchored = TRUE
//trees
/obj/structure/flora/tree
name = "tree"
desc = "A large tree."
density = TRUE
pixel_x = -16
layer = FLY_LAYER
var/log_amount = 10
/obj/structure/flora/tree/attackby(obj/item/W, mob/user, params)
if(log_amount && (!(flags_1 & NODECONSTRUCT_1)))
if(W.sharpness && W.force > 0)
if(W.hitsound)
playsound(get_turf(src), W.hitsound, 100, 0, 0)
user.visible_message("<span class='notice'>[user] begins to cut down [src] with [W].</span>","<span class='notice'>You begin to cut down [src] with [W].</span>", "You hear the sound of sawing.")
if(do_after(user, 1000/W.force, target = src)) //5 seconds with 20 force, 8 seconds with a hatchet, 20 seconds with a shard.
user.visible_message("<span class='notice'>[user] fells [src] with the [W].</span>","<span class='notice'>You fell [src] with the [W].</span>", "You hear the sound of a tree falling.")
playsound(get_turf(src), 'sound/effects/meteorimpact.ogg', 100 , 0, 0)
for(var/i=1 to log_amount)
new /obj/item/grown/log/tree(get_turf(src))
var/obj/structure/flora/stump/S = new(loc)
S.name = "[name] stump"
qdel(src)
else
return ..()
/obj/structure/flora/stump
name = "stump"
desc = "This represents our promise to the crew, and the station itself, to cut down as many trees as possible." //running naked through the trees
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "tree_stump"
density = FALSE
pixel_x = -16
/obj/structure/flora/tree/pine
name = "pine tree"
desc = "A coniferous pine tree."
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "pine_1"
var/list/icon_states = list("pine_1", "pine_2", "pine_3")
/obj/structure/flora/tree/pine/Initialize()
. = ..()
if(islist(icon_states && icon_states.len))
icon_state = pick(icon_states)
/obj/structure/flora/tree/pine/xmas
name = "xmas tree"
desc = "A wondrous decorated Christmas tree."
icon_state = "pine_c"
icon_states = null
/obj/structure/flora/tree/pine/xmas/presents
icon_state = "pinepresents"
desc = "A wondrous decorated Christmas tree. It has presents!"
var/gift_type = /obj/item/a_gift/anything
var/list/ckeys_that_took = list()
/obj/structure/flora/tree/pine/xmas/presents/attack_hand(mob/living/user)
. = ..()
if(.)
return
if(!user.ckey)
return
if(ckeys_that_took[user.ckey])
to_chat(user, "<span class='warning'>There are no presents with your name on.</span>")
return
to_chat(user, "<span class='warning'>After a bit of rummaging, you locate a gift with your name on it!</span>")
ckeys_that_took[user.ckey] = TRUE
var/obj/item/G = new gift_type(src)
user.put_in_hands(G)
/obj/structure/flora/tree/dead
icon = 'icons/obj/flora/deadtrees.dmi'
desc = "A dead tree. How it died, you know not."
icon_state = "tree_1"
/obj/structure/flora/tree/palm
icon = 'icons/misc/beach2.dmi'
desc = "A tree straight from the tropics."
icon_state = "palm1"
/obj/structure/flora/tree/palm/Initialize()
. = ..()
icon_state = pick("palm1","palm2")
pixel_x = 0
/obj/structure/festivus
name = "festivus pole"
icon = 'icons/obj/flora/pinetrees.dmi'
icon_state = "festivus_pole"
desc = "During last year's Feats of Strength the Research Director was able to suplex this passing immobile rod into a planter."
/obj/structure/festivus/anchored
name = "suplexed rod"
desc = "A true feat of strength, almost as good as last year."
icon_state = "anchored_rod"
anchored = TRUE
/obj/structure/flora/tree/dead/Initialize()
icon_state = "tree_[rand(1, 6)]"
. = ..()
/obj/structure/flora/tree/jungle
name = "tree"
icon_state = "tree"
desc = "It's seriously hampering your view of the jungle."
icon = 'icons/obj/flora/jungletrees.dmi'
pixel_x = -48
pixel_y = -20
/obj/structure/flora/tree/jungle/Initialize()
icon_state = "[icon_state][rand(1, 6)]"
. = ..()
/obj/structure/flora/tree/jungle/small
pixel_y = 0
pixel_x = -32
icon = 'icons/obj/flora/jungletreesmall.dmi'
//grass
/obj/structure/flora/grass
name = "grass"
desc = "A patch of overgrown grass."
icon = 'icons/obj/flora/snowflora.dmi'
gender = PLURAL //"this is grass" not "this is a grass"
/obj/structure/flora/grass/brown
icon_state = "snowgrass1bb"
/obj/structure/flora/grass/brown/Initialize()
icon_state = "snowgrass[rand(1, 3)]bb"
. = ..()
/obj/structure/flora/grass/green
icon_state = "snowgrass1gb"
/obj/structure/flora/grass/green/Initialize()
icon_state = "snowgrass[rand(1, 3)]gb"
. = ..()
/obj/structure/flora/grass/both
icon_state = "snowgrassall1"
/obj/structure/flora/grass/both/Initialize()
icon_state = "snowgrassall[rand(1, 3)]"
. = ..()
//bushes
/obj/structure/flora/bush
name = "bush"
desc = "Some type of shrub."
icon = 'icons/obj/flora/snowflora.dmi'
icon_state = "snowbush1"
anchored = TRUE
/obj/structure/flora/bush/Initialize()
icon_state = "snowbush[rand(1, 6)]"
. = ..()
//newbushes
/obj/structure/flora/ausbushes
name = "bush"
desc = "Some kind of plant."
icon = 'icons/obj/flora/ausflora.dmi'
icon_state = "firstbush_1"
/obj/structure/flora/ausbushes/Initialize()
if(icon_state == "firstbush_1")
icon_state = "firstbush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/reedbush
icon_state = "reedbush_1"
/obj/structure/flora/ausbushes/reedbush/Initialize()
icon_state = "reedbush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/leafybush
icon_state = "leafybush_1"
/obj/structure/flora/ausbushes/leafybush/Initialize()
icon_state = "leafybush_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/palebush
icon_state = "palebush_1"
/obj/structure/flora/ausbushes/palebush/Initialize()
icon_state = "palebush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/stalkybush
icon_state = "stalkybush_1"
/obj/structure/flora/ausbushes/stalkybush/Initialize()
icon_state = "stalkybush_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/grassybush
icon_state = "grassybush_1"
/obj/structure/flora/ausbushes/grassybush/Initialize()
icon_state = "grassybush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/fernybush
icon_state = "fernybush_1"
/obj/structure/flora/ausbushes/fernybush/Initialize()
icon_state = "fernybush_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/sunnybush
icon_state = "sunnybush_1"
/obj/structure/flora/ausbushes/sunnybush/Initialize()
icon_state = "sunnybush_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/genericbush
icon_state = "genericbush_1"
/obj/structure/flora/ausbushes/genericbush/Initialize()
icon_state = "genericbush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/pointybush
icon_state = "pointybush_1"
/obj/structure/flora/ausbushes/pointybush/Initialize()
icon_state = "pointybush_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/lavendergrass
icon_state = "lavendergrass_1"
/obj/structure/flora/ausbushes/lavendergrass/Initialize()
icon_state = "lavendergrass_[rand(1, 4)]"
. = ..()
/obj/structure/flora/ausbushes/ywflowers
icon_state = "ywflowers_1"
/obj/structure/flora/ausbushes/ywflowers/Initialize()
icon_state = "ywflowers_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/brflowers
icon_state = "brflowers_1"
/obj/structure/flora/ausbushes/brflowers/Initialize()
icon_state = "brflowers_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/ppflowers
icon_state = "ppflowers_1"
/obj/structure/flora/ausbushes/ppflowers/Initialize()
icon_state = "ppflowers_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/sparsegrass
icon_state = "sparsegrass_1"
/obj/structure/flora/ausbushes/sparsegrass/Initialize()
icon_state = "sparsegrass_[rand(1, 3)]"
. = ..()
/obj/structure/flora/ausbushes/fullgrass
icon_state = "fullgrass_1"
/obj/structure/flora/ausbushes/fullgrass/Initialize()
icon_state = "fullgrass_[rand(1, 3)]"
. = ..()
/obj/item/twohanded/required/kirbyplants
name = "potted plant"
icon = 'icons/obj/flora/plants.dmi'
icon_state = "plant-01"
desc = "A little bit of nature contained in a pot."
layer = ABOVE_MOB_LAYER
w_class = WEIGHT_CLASS_HUGE
force = 10
throwforce = 13
throw_speed = 2
throw_range = 4
/obj/item/twohanded/required/kirbyplants/Initialize()
. = ..()
AddComponent(/datum/component/tactical)
/obj/item/twohanded/required/kirbyplants/random
icon = 'icons/obj/flora/_flora.dmi'
icon_state = "random_plant"
var/list/static/states
/obj/item/twohanded/required/kirbyplants/random/Initialize()
. = ..()
icon = 'icons/obj/flora/plants.dmi'
if(!states)
generate_states()
icon_state = pick(states)
/obj/item/twohanded/required/kirbyplants/random/proc/generate_states()
states = list()
for(var/i in 1 to 25)
var/number
if(i < 10)
number = "0[i]"
else
number = "[i]"
states += "plant-[number]"
states += "applebush"
/obj/item/twohanded/required/kirbyplants/dead
name = "RD's potted plant"
desc = "A gift from the botanical staff, presented after the RD's reassignment. There's a tag on it that says \"Y'all come back now, y'hear?\"\nIt doesn't look very healthy..."
icon_state = "plant-25"
/obj/item/twohanded/required/kirbyplants/photosynthetic
name = "photosynthetic potted plant"
desc = "A bioluminescent plant."
icon_state = "plant-09"
light_color = "#2cb2e8"
light_range = 3
//a rock is flora according to where the icon file is
//and now these defines
/obj/structure/flora/rock
icon_state = "basalt"
desc = "A volcanic rock. Pioneers used to ride these babies for miles."
icon = 'icons/obj/flora/rocks.dmi'
resistance_flags = FIRE_PROOF
density = TRUE
/obj/structure/flora/rock/Initialize()
. = ..()
icon_state = "[icon_state][rand(1,3)]"
/obj/structure/flora/rock/pile
icon_state = "lavarocks"
desc = "A pile of rocks."
//Jungle grass
/obj/structure/flora/grass/jungle
name = "jungle grass"
desc = "Thick alien flora."
icon = 'icons/obj/flora/jungleflora.dmi'
icon_state = "grassa"
/obj/structure/flora/grass/jungle/Initialize()
icon_state = "[icon_state][rand(1, 5)]"
. = ..()
/obj/structure/flora/grass/jungle/b
icon_state = "grassb"
//Jungle rocks
/obj/structure/flora/rock/jungle
icon_state = "pile of rocks"
desc = "A pile of rocks."
icon_state = "rock"
icon = 'icons/obj/flora/jungleflora.dmi'
density = FALSE
/obj/structure/flora/rock/jungle/Initialize()
. = ..()
icon_state = "[initial(icon_state)][rand(1,5)]"
//Jungle bushes
/obj/structure/flora/junglebush
name = "bush"
desc = "A wild plant that is found in jungles."
icon = 'icons/obj/flora/jungleflora.dmi'
icon_state = "busha"
/obj/structure/flora/junglebush/Initialize()
icon_state = "[icon_state][rand(1, 3)]"
. = ..()
/obj/structure/flora/junglebush/b
icon_state = "bushb"
/obj/structure/flora/junglebush/c
icon_state = "bushc"
/obj/structure/flora/junglebush/large
icon_state = "bush"
icon = 'icons/obj/flora/largejungleflora.dmi'
pixel_x = -16
pixel_y = -12
layer = ABOVE_ALL_MOB_LAYER
/obj/structure/flora/rock/pile/largejungle
name = "rocks"
icon_state = "rocks"
icon = 'icons/obj/flora/largejungleflora.dmi'
density = FALSE
pixel_x = -16
pixel_y = -16
/obj/structure/flora/rock/pile/largejungle/Initialize()
. = ..()
icon_state = "[initial(icon_state)][rand(1,3)]"
@@ -619,6 +619,24 @@
skip_reentry_check = TRUE
banType = "ghostcafe"
/datum/action/toggle_dead_chat_mob
icon_icon = 'icons/mob/mob.dmi'
button_icon_state = "ghost"
name = "Toggle deadchat"
desc = "Turn off or on your ability to hear ghosts."
/datum/action/toggle_dead_chat_mob/Trigger()
if(!..())
return 0
var/mob/M = target
if(HAS_TRAIT_FROM(M,TRAIT_SIXTHSENSE,GHOSTROLE_TRAIT))
REMOVE_TRAIT(M,TRAIT_SIXTHSENSE,GHOSTROLE_TRAIT)
to_chat(M,"<span class='notice'>You're no longer hearing deadchat.</span>")
else
ADD_TRAIT(M,TRAIT_SIXTHSENSE,GHOSTROLE_TRAIT)
to_chat(M,"<span class='notice'>You're once again longer hearing deadchat.</span>")
/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)
@@ -626,7 +644,16 @@
O.equip(new_spawn, FALSE, new_spawn.client)
SSjob.equip_loadout(null, new_spawn, FALSE)
SSquirks.AssignQuirks(new_spawn, new_spawn.client, TRUE, TRUE, null, FALSE, new_spawn)
new_spawn.AddElement(/datum/element/ghost_role_eligibility)
ADD_TRAIT(new_spawn, TRAIT_SIXTHSENSE, GHOSTROLE_TRAIT)
ADD_TRAIT(new_spawn,TRAIT_EXEMPT_HEALTH_EVENTS,GHOSTROLE_TRAIT)
ADD_TRAIT(new_spawn,TRAIT_PACIFISM,GHOSTROLE_TRAIT)
to_chat(new_spawn,"<span class='boldwarning'>You may be sharing your cafe with some ninja-captured individuals, so make sure to only interact with the ghosts you hear as a ghost!</span>")
to_chat(new_spawn,"<span class='boldwarning'>You can turn yourself into a ghost and freely reenter your body with the ghost action.</span>")
var/datum/action/ghost/G = new(new_spawn)
G.Grant(new_spawn)
var/datum/action/toggle_dead_chat_mob/D = new(new_spawn)
D.Grant(new_spawn)
/datum/outfit/ghostcafe
name = "ID, jumpsuit and shoes"
+1 -1
View File
@@ -84,7 +84,7 @@
/obj/structure/grille/attack_animal(mob/user)
. = ..()
if(!shock(user, 70))
if(!shock(user, 70) && !QDELETED(src)) //Last hit still shocks but shouldn't deal damage to the grille)
take_damage(rand(5,10), BRUTE, "melee", 1)
/obj/structure/grille/attack_paw(mob/user)
+36 -36
View File
@@ -1,36 +1,36 @@
/obj/structure/hivebot_beacon
name = "beacon"
desc = "Some odd beacon thing."
icon = 'icons/mob/hivebot.dmi'
icon_state = "def_radar-off"
anchored = TRUE
density = TRUE
var/bot_type = "norm"
var/bot_amt = 10
/obj/structure/hivebot_beacon/New()
..()
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(2, loc)
smoke.start()
visible_message("<span class='boldannounce'>[src] warps in!</span>")
playsound(src.loc, 'sound/effects/empulse.ogg', 25, 1)
addtimer(CALLBACK(src, .proc/warpbots), rand(10, 600))
/obj/structure/hivebot_beacon/proc/warpbots()
icon_state = "def_radar"
visible_message("<span class='danger'>[src] turns on!</span>")
while(bot_amt > 0)
bot_amt--
switch(bot_type)
if("norm")
new /mob/living/simple_animal/hostile/hivebot(get_turf(src))
if("range")
new /mob/living/simple_animal/hostile/hivebot/range(get_turf(src))
if("rapid")
new /mob/living/simple_animal/hostile/hivebot/rapid(get_turf(src))
sleep(100)
visible_message("<span class='boldannounce'>[src] warps out!</span>")
playsound(src.loc, 'sound/effects/empulse.ogg', 25, 1)
qdel(src)
return
/obj/structure/hivebot_beacon
name = "beacon"
desc = "Some odd beacon thing."
icon = 'icons/mob/hivebot.dmi'
icon_state = "def_radar-off"
anchored = TRUE
density = TRUE
var/bot_type = "norm"
var/bot_amt = 10
/obj/structure/hivebot_beacon/New()
..()
var/datum/effect_system/smoke_spread/smoke = new
smoke.set_up(2, loc)
smoke.start()
visible_message("<span class='boldannounce'>[src] warps in!</span>")
playsound(src.loc, 'sound/effects/empulse.ogg', 25, 1)
addtimer(CALLBACK(src, .proc/warpbots), rand(10, 600))
/obj/structure/hivebot_beacon/proc/warpbots()
icon_state = "def_radar"
visible_message("<span class='danger'>[src] turns on!</span>")
while(bot_amt > 0)
bot_amt--
switch(bot_type)
if("norm")
new /mob/living/simple_animal/hostile/hivebot(get_turf(src))
if("range")
new /mob/living/simple_animal/hostile/hivebot/range(get_turf(src))
if("rapid")
new /mob/living/simple_animal/hostile/hivebot/rapid(get_turf(src))
sleep(100)
visible_message("<span class='boldannounce'>[src] warps out!</span>")
playsound(src.loc, 'sound/effects/empulse.ogg', 25, 1)
qdel(src)
return
+15 -3
View File
@@ -69,9 +69,9 @@
rad_insulation = RAD_LIGHT_INSULATION
/obj/structure/holosign/barrier/atmos
name = "holo firelock"
desc = "A holographic barrier resembling a firelock. Though it does not prevent solid objects from passing through, gas is kept out."
icon_state = "holo_firelock"
name = "holo fan"
desc = "A holographic barrier resembling a tiny fan. Though it does not prevent solid objects from passing through, gas is kept out. Somehow."
icon_state = "holo_fan"
density = FALSE
anchored = TRUE
CanAtmosPass = ATMOS_PASS_NO
@@ -81,6 +81,18 @@
. = ..()
air_update_turf(TRUE)
/obj/structure/holosign/barrier/firelock
name = "holo firelock"
desc = "A holographic barrier resembling a firelock. Though it does not prevent solid objects or gas from passing through, temperature changes are kept out."
icon_state = "holo_firelock"
density = FALSE
anchored = TRUE
alpha = 150
resistance_flags = FIRE_PROOF
/obj/structure/holosign/barrier/firelock/blocksTemperature()
return TRUE
/obj/structure/holosign/barrier/cyborg
name = "Energy Field"
desc = "A fragile energy field that blocks movement. Excels at blocking lethal projectiles."
+156 -156
View File
@@ -1,156 +1,156 @@
//////Kitchen Spike
#define VIABLE_MOB_CHECK(X) (isliving(X) && !issilicon(X) && !isbot(X))
/obj/structure/kitchenspike_frame
name = "meatspike frame"
icon = 'icons/obj/kitchen.dmi'
icon_state = "spikeframe"
desc = "The frame of a meat spike."
density = TRUE
anchored = FALSE
max_integrity = 200
/obj/structure/kitchenspike_frame/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(default_unfasten_wrench(user, I))
return
else if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if(R.get_amount() >= 4)
R.use(4)
to_chat(user, "<span class='notice'>You add spikes to the frame.</span>")
var/obj/F = new /obj/structure/kitchenspike(src.loc)
transfer_fingerprints_to(F)
qdel(src)
else if(istype(I, /obj/item/weldingtool))
if(!I.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
if(I.use_tool(src, user, 50, volume=50))
visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [I].</span>",
"<span class='italics'>You hear welding.</span>")
new /obj/item/stack/sheet/metal(src.loc, 4)
qdel(src)
return
else
return ..()
/obj/structure/kitchenspike
name = "meat spike"
icon = 'icons/obj/kitchen.dmi'
icon_state = "spike"
desc = "A spike for collecting meat from animals."
density = TRUE
anchored = TRUE
buckle_lying = 0
can_buckle = 1
max_integrity = 250
/obj/structure/kitchenspike/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/kitchenspike/crowbar_act(mob/living/user, obj/item/I)
if(has_buckled_mobs())
to_chat(user, "<span class='notice'>You can't do that while something's on the spike!</span>")
return TRUE
if(I.use_tool(src, user, 20, volume=100))
to_chat(user, "<span class='notice'>You pry the spikes out of the frame.</span>")
deconstruct(TRUE)
return TRUE
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/kitchenspike/attack_hand(mob/user)
if(VIABLE_MOB_CHECK(user.pulling) && user.a_intent == INTENT_GRAB && !has_buckled_mobs())
var/mob/living/L = user.pulling
if(do_mob(user, src, 120))
if(has_buckled_mobs()) //to prevent spam/queing up attacks
return
if(L.buckled)
return
if(user.pulling != L)
return
playsound(src.loc, 'sound/effects/splat.ogg', 25, 1)
L.visible_message("<span class='danger'>[user] slams [L] onto the meat spike!</span>", "<span class='userdanger'>[user] slams you onto the meat spike!</span>", "<span class='italics'>You hear a squishy wet noise.</span>")
L.forceMove(drop_location())
L.emote("scream")
if(iscarbon(L))
var/mob/living/carbon/C = L
C.bleed(30)
else
L.add_splatter_floor()
L.adjustBruteLoss(30)
L.setDir(2)
buckle_mob(L, force=1)
var/matrix/m180 = matrix(L.transform)
m180.Turn(180)
animate(L, transform = m180, time = 3)
L.pixel_y = L.get_standard_pixel_y_offset(180)
else if (has_buckled_mobs())
for(var/mob/living/L in buckled_mobs)
user_unbuckle_mob(L, user)
else
..()
/obj/structure/kitchenspike/user_buckle_mob(mob/living/M, mob/living/user) //Don't want them getting put on the rack other than by spiking
return
/obj/structure/kitchenspike/user_unbuckle_mob(mob/living/buckled_mob, mob/living/carbon/human/user)
if(buckled_mob)
var/mob/living/M = buckled_mob
if(M != user)
M.visible_message(\
"[user] tries to pull [M] free of [src]!",\
"<span class='notice'>[user] is trying to pull you off [src], opening up fresh wounds!</span>",\
"<span class='italics'>You hear a squishy wet noise.</span>")
if(!do_after(user, 300, target = src))
if(M && M.buckled)
M.visible_message(\
"[user] fails to free [M]!",\
"<span class='notice'>[user] fails to pull you off of [src].</span>")
return
else
M.visible_message(\
"<span class='warning'>[M] struggles to break free from [src]!</span>",\
"<span class='notice'>You struggle to break free from [src], exacerbating your wounds! (Stay still for two minutes.)</span>",\
"<span class='italics'>You hear a wet squishing noise..</span>")
M.adjustBruteLoss(30)
if(!do_after(M, 1200, target = src))
if(M && M.buckled)
to_chat(M, "<span class='warning'>You fail to free yourself!</span>")
return
if(!M.buckled)
return
release_mob(M)
/obj/structure/kitchenspike/proc/release_mob(mob/living/M)
var/matrix/m180 = matrix(M.transform)
m180.Turn(180)
animate(M, transform = m180, time = 3)
M.pixel_y = M.get_standard_pixel_y_offset(180)
M.adjustBruteLoss(30)
src.visible_message(text("<span class='danger'>[M] falls free of [src]!</span>"))
unbuckle_mob(M,force=1)
M.emote("scream")
M.DefaultCombatKnockdown(20)
/obj/structure/kitchenspike/Destroy()
if(has_buckled_mobs())
for(var/mob/living/L in buckled_mobs)
release_mob(L)
return ..()
/obj/structure/kitchenspike/deconstruct(disassembled = TRUE)
if(disassembled)
var/obj/F = new /obj/structure/kitchenspike_frame(src.loc)
transfer_fingerprints_to(F)
else
new /obj/item/stack/sheet/metal(src.loc, 4)
new /obj/item/stack/rods(loc, 4)
qdel(src)
#undef VIABLE_MOB_CHECK
//////Kitchen Spike
#define VIABLE_MOB_CHECK(X) (isliving(X) && !issilicon(X) && !isbot(X))
/obj/structure/kitchenspike_frame
name = "meatspike frame"
icon = 'icons/obj/kitchen.dmi'
icon_state = "spikeframe"
desc = "The frame of a meat spike."
density = TRUE
anchored = FALSE
max_integrity = 200
/obj/structure/kitchenspike_frame/attackby(obj/item/I, mob/user, params)
add_fingerprint(user)
if(default_unfasten_wrench(user, I))
return
else if(istype(I, /obj/item/stack/rods))
var/obj/item/stack/rods/R = I
if(R.get_amount() >= 4)
R.use(4)
to_chat(user, "<span class='notice'>You add spikes to the frame.</span>")
var/obj/F = new /obj/structure/kitchenspike(src.loc)
transfer_fingerprints_to(F)
qdel(src)
else if(istype(I, /obj/item/weldingtool))
if(!I.tool_start_check(user, amount=0))
return
to_chat(user, "<span class='notice'>You begin cutting \the [src] apart...</span>")
if(I.use_tool(src, user, 50, volume=50))
visible_message("<span class='notice'>[user] slices apart \the [src].</span>",
"<span class='notice'>You cut \the [src] apart with \the [I].</span>",
"<span class='italics'>You hear welding.</span>")
new /obj/item/stack/sheet/metal(src.loc, 4)
qdel(src)
return
else
return ..()
/obj/structure/kitchenspike
name = "meat spike"
icon = 'icons/obj/kitchen.dmi'
icon_state = "spike"
desc = "A spike for collecting meat from animals."
density = TRUE
anchored = TRUE
buckle_lying = 0
can_buckle = 1
max_integrity = 250
/obj/structure/kitchenspike/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/kitchenspike/crowbar_act(mob/living/user, obj/item/I)
if(has_buckled_mobs())
to_chat(user, "<span class='notice'>You can't do that while something's on the spike!</span>")
return TRUE
if(I.use_tool(src, user, 20, volume=100))
to_chat(user, "<span class='notice'>You pry the spikes out of the frame.</span>")
deconstruct(TRUE)
return TRUE
//ATTACK HAND IGNORING PARENT RETURN VALUE
/obj/structure/kitchenspike/attack_hand(mob/user)
if(VIABLE_MOB_CHECK(user.pulling) && user.a_intent == INTENT_GRAB && !has_buckled_mobs())
var/mob/living/L = user.pulling
if(do_mob(user, src, 120))
if(has_buckled_mobs()) //to prevent spam/queing up attacks
return
if(L.buckled)
return
if(user.pulling != L)
return
playsound(src.loc, 'sound/effects/splat.ogg', 25, 1)
L.visible_message("<span class='danger'>[user] slams [L] onto the meat spike!</span>", "<span class='userdanger'>[user] slams you onto the meat spike!</span>", "<span class='italics'>You hear a squishy wet noise.</span>")
L.forceMove(drop_location())
L.emote("scream")
if(iscarbon(L))
var/mob/living/carbon/C = L
C.bleed(30)
else
L.add_splatter_floor()
L.adjustBruteLoss(30)
L.setDir(2)
buckle_mob(L, force=1)
var/matrix/m180 = matrix(L.transform)
m180.Turn(180)
animate(L, transform = m180, time = 3)
L.pixel_y = L.get_standard_pixel_y_offset(180)
else if (has_buckled_mobs())
for(var/mob/living/L in buckled_mobs)
user_unbuckle_mob(L, user)
else
..()
/obj/structure/kitchenspike/user_buckle_mob(mob/living/M, mob/living/user) //Don't want them getting put on the rack other than by spiking
return
/obj/structure/kitchenspike/user_unbuckle_mob(mob/living/buckled_mob, mob/living/carbon/human/user)
if(buckled_mob)
var/mob/living/M = buckled_mob
if(M != user)
M.visible_message(\
"[user] tries to pull [M] free of [src]!",\
"<span class='notice'>[user] is trying to pull you off [src], opening up fresh wounds!</span>",\
"<span class='italics'>You hear a squishy wet noise.</span>")
if(!do_after(user, 300, target = src))
if(M && M.buckled)
M.visible_message(\
"[user] fails to free [M]!",\
"<span class='notice'>[user] fails to pull you off of [src].</span>")
return
else
M.visible_message(\
"<span class='warning'>[M] struggles to break free from [src]!</span>",\
"<span class='notice'>You struggle to break free from [src], exacerbating your wounds! (Stay still for two minutes.)</span>",\
"<span class='italics'>You hear a wet squishing noise..</span>")
M.adjustBruteLoss(30)
if(!do_after(M, 1200, target = src))
if(M && M.buckled)
to_chat(M, "<span class='warning'>You fail to free yourself!</span>")
return
if(!M.buckled)
return
release_mob(M)
/obj/structure/kitchenspike/proc/release_mob(mob/living/M)
var/matrix/m180 = matrix(M.transform)
m180.Turn(180)
animate(M, transform = m180, time = 3)
M.pixel_y = M.get_standard_pixel_y_offset(180)
M.adjustBruteLoss(30)
src.visible_message(text("<span class='danger'>[M] falls free of [src]!</span>"))
unbuckle_mob(M,force=1)
M.emote("scream")
M.DefaultCombatKnockdown(20)
/obj/structure/kitchenspike/Destroy()
if(has_buckled_mobs())
for(var/mob/living/L in buckled_mobs)
release_mob(L)
return ..()
/obj/structure/kitchenspike/deconstruct(disassembled = TRUE)
if(disassembled)
var/obj/F = new /obj/structure/kitchenspike_frame(src.loc)
transfer_fingerprints_to(F)
else
new /obj/item/stack/sheet/metal(src.loc, 4)
new /obj/item/stack/rods(loc, 4)
qdel(src)
#undef VIABLE_MOB_CHECK
+231 -231
View File
@@ -1,231 +1,231 @@
// Basic ladder. By default links to the z-level above/below.
/obj/structure/ladder
name = "ladder"
desc = "A sturdy metal ladder."
icon = 'icons/obj/structures.dmi'
icon_state = "ladder11"
anchored = TRUE
var/obj/structure/ladder/down //the ladder below this one
var/obj/structure/ladder/up //the ladder above this one
/obj/structure/ladder/Initialize(mapload, obj/structure/ladder/up, obj/structure/ladder/down)
..()
if (up)
src.up = up
up.down = src
up.update_icon()
if (down)
src.down = down
down.up = src
down.update_icon()
return INITIALIZE_HINT_LATELOAD
/obj/structure/ladder/Destroy(force)
if ((resistance_flags & INDESTRUCTIBLE) && !force)
return QDEL_HINT_LETMELIVE
disconnect()
return ..()
/obj/structure/ladder/LateInitialize()
// By default, discover ladders above and below us vertically
var/turf/T = get_turf(src)
var/obj/structure/ladder/L
if (!down)
L = locate() in SSmapping.get_turf_below(T)
if (L)
down = L
L.up = src // Don't waste effort looping the other way
L.update_icon()
if (!up)
L = locate() in SSmapping.get_turf_above(T)
if (L)
up = L
L.down = src // Don't waste effort looping the other way
L.update_icon()
update_icon()
/obj/structure/ladder/proc/disconnect()
if(up && up.down == src)
up.down = null
up.update_icon()
if(down && down.up == src)
down.up = null
down.update_icon()
up = down = null
/obj/structure/ladder/update_icon()
if(up && down)
icon_state = "ladder11"
else if(up)
icon_state = "ladder10"
else if(down)
icon_state = "ladder01"
else //wtf make your ladders properly assholes
icon_state = "ladder00"
/obj/structure/ladder/singularity_pull()
if (!(resistance_flags & INDESTRUCTIBLE))
visible_message("<span class='danger'>[src] is torn to pieces by the gravitational pull!</span>")
qdel(src)
/obj/structure/ladder/proc/travel(going_up, mob/user, is_ghost, obj/structure/ladder/ladder)
if(!is_ghost)
show_fluff_message(going_up, user)
ladder.add_fingerprint(user)
var/turf/T = get_turf(ladder)
var/atom/movable/AM
if(user.pulling)
AM = user.pulling
AM.forceMove(T)
user.forceMove(T)
if(AM)
user.start_pulling(AM)
/obj/structure/ladder/proc/use(mob/user, is_ghost=FALSE)
if (!is_ghost && !in_range(src, user))
return
if (up && down)
var/result = alert("Go up or down [src]?", "Ladder", "Up", "Down", "Cancel")
if (!is_ghost && !in_range(src, user))
return // nice try
switch(result)
if("Up")
travel(TRUE, user, is_ghost, up)
if("Down")
travel(FALSE, user, is_ghost, down)
if("Cancel")
return
else if(up)
travel(TRUE, user, is_ghost, up)
else if(down)
travel(FALSE, user, is_ghost, down)
else
to_chat(user, "<span class='warning'>[src] doesn't seem to lead anywhere!</span>")
if(!is_ghost)
add_fingerprint(user)
/obj/structure/ladder/attack_hand(mob/user)
. = ..()
if(.)
return
use(user)
/obj/structure/ladder/attack_paw(mob/user)
return use(user)
/obj/structure/ladder/attackby(obj/item/W, mob/user, params)
return use(user)
/obj/structure/ladder/attack_robot(mob/living/silicon/robot/R)
if(R.Adjacent(src))
return use(R)
//ATTACK GHOST IGNORING PARENT RETURN VALUE
/obj/structure/ladder/attack_ghost(mob/dead/observer/user)
use(user, TRUE)
return ..()
/obj/structure/ladder/proc/show_fluff_message(going_up, mob/user)
if(going_up)
user.visible_message("[user] climbs up [src].","<span class='notice'>You climb up [src].</span>")
else
user.visible_message("[user] climbs down [src].","<span class='notice'>You climb down [src].</span>")
// Indestructible away mission ladders which link based on a mapped ID and height value rather than X/Y/Z.
/obj/structure/ladder/unbreakable
name = "sturdy ladder"
desc = "An extremely sturdy metal ladder."
resistance_flags = INDESTRUCTIBLE
var/id
var/height = 0 // higher numbers are considered physically higher
/obj/structure/ladder/unbreakable/Initialize()
GLOB.ladders += src
return ..()
/obj/structure/ladder/unbreakable/Destroy()
. = ..()
if (. != QDEL_HINT_LETMELIVE)
GLOB.ladders -= src
/obj/structure/ladder/unbreakable/LateInitialize()
// Override the parent to find ladders based on being height-linked
if (!id || (up && down))
update_icon()
return
for (var/O in GLOB.ladders)
var/obj/structure/ladder/unbreakable/L = O
if (L.id != id)
continue // not one of our pals
if (!down && L.height == height - 1)
down = L
L.up = src
L.update_icon()
if (up)
break // break if both our connections are filled
else if (!up && L.height == height + 1)
up = L
L.down = src
L.update_icon()
if (down)
break // break if both our connections are filled
update_icon()
/obj/structure/ladder/unbreakable/binary
name = "mysterious ladder"
desc = "Where does it go?"
height = 0
id = "lavaland_binary"
var/area_to_place = /area/lavaland/surface/outdoors
var/active = FALSE
/obj/structure/ladder/unbreakable/binary/proc/ActivateAlmonds()
if(area_to_place && !active)
var/turf/T = getTargetTurf()
if(T)
var/obj/structure/ladder/unbreakable/U = new (T)
U.id = id
U.height = height+1
LateInitialize() // LateInit both of these to build the links. It's fine.
U.LateInitialize()
for(var/turf/TT in range(2,U))
TT.TerraformTurf(/turf/open/indestructible/binary, /turf/open/indestructible/binary, CHANGETURF_INHERIT_AIR)
active = TRUE
/obj/structure/ladder/unbreakable/binary/proc/getTargetTurf()
var/list/turfList = get_area_turfs(area_to_place)
while (turfList.len && !.)
var/i = rand(1, turfList.len)
var/turf/potentialTurf = turfList[i]
if (is_centcom_level(potentialTurf.z)) // These ladders don't lead to centcom.
turfList.Cut(i,i+1)
continue
if(!istype(potentialTurf, /turf/open/lava) && !potentialTurf.density) // Or inside dense turfs or lava
var/clear = TRUE
for(var/obj/O in potentialTurf) // Let's not place these on dense objects either. Might be funny though.
if(O.density)
clear = FALSE
break
if(clear)
. = potentialTurf
if (!.)
turfList.Cut(i,i+1)
/obj/structure/ladder/unbreakable/binary/space
id = "space_binary"
area_to_place = /area/space
/obj/structure/ladder/unbreakable/binary/unlinked //Crew gets to complete one
id = "unlinked_binary"
area_to_place = null
// Basic ladder. By default links to the z-level above/below.
/obj/structure/ladder
name = "ladder"
desc = "A sturdy metal ladder."
icon = 'icons/obj/structures.dmi'
icon_state = "ladder11"
anchored = TRUE
var/obj/structure/ladder/down //the ladder below this one
var/obj/structure/ladder/up //the ladder above this one
/obj/structure/ladder/Initialize(mapload, obj/structure/ladder/up, obj/structure/ladder/down)
..()
if (up)
src.up = up
up.down = src
up.update_icon()
if (down)
src.down = down
down.up = src
down.update_icon()
return INITIALIZE_HINT_LATELOAD
/obj/structure/ladder/Destroy(force)
if ((resistance_flags & INDESTRUCTIBLE) && !force)
return QDEL_HINT_LETMELIVE
disconnect()
return ..()
/obj/structure/ladder/LateInitialize()
// By default, discover ladders above and below us vertically
var/turf/T = get_turf(src)
var/obj/structure/ladder/L
if (!down)
L = locate() in SSmapping.get_turf_below(T)
if (L)
down = L
L.up = src // Don't waste effort looping the other way
L.update_icon()
if (!up)
L = locate() in SSmapping.get_turf_above(T)
if (L)
up = L
L.down = src // Don't waste effort looping the other way
L.update_icon()
update_icon()
/obj/structure/ladder/proc/disconnect()
if(up && up.down == src)
up.down = null
up.update_icon()
if(down && down.up == src)
down.up = null
down.update_icon()
up = down = null
/obj/structure/ladder/update_icon()
if(up && down)
icon_state = "ladder11"
else if(up)
icon_state = "ladder10"
else if(down)
icon_state = "ladder01"
else //wtf make your ladders properly assholes
icon_state = "ladder00"
/obj/structure/ladder/singularity_pull()
if (!(resistance_flags & INDESTRUCTIBLE))
visible_message("<span class='danger'>[src] is torn to pieces by the gravitational pull!</span>")
qdel(src)
/obj/structure/ladder/proc/travel(going_up, mob/user, is_ghost, obj/structure/ladder/ladder)
if(!is_ghost)
show_fluff_message(going_up, user)
ladder.add_fingerprint(user)
var/turf/T = get_turf(ladder)
var/atom/movable/AM
if(user.pulling)
AM = user.pulling
AM.forceMove(T)
user.forceMove(T)
if(AM)
user.start_pulling(AM)
/obj/structure/ladder/proc/use(mob/user, is_ghost=FALSE)
if (!is_ghost && !in_range(src, user))
return
if (up && down)
var/result = alert("Go up or down [src]?", "Ladder", "Up", "Down", "Cancel")
if (!is_ghost && !in_range(src, user))
return // nice try
switch(result)
if("Up")
travel(TRUE, user, is_ghost, up)
if("Down")
travel(FALSE, user, is_ghost, down)
if("Cancel")
return
else if(up)
travel(TRUE, user, is_ghost, up)
else if(down)
travel(FALSE, user, is_ghost, down)
else
to_chat(user, "<span class='warning'>[src] doesn't seem to lead anywhere!</span>")
if(!is_ghost)
add_fingerprint(user)
/obj/structure/ladder/attack_hand(mob/user)
. = ..()
if(.)
return
use(user)
/obj/structure/ladder/attack_paw(mob/user)
return use(user)
/obj/structure/ladder/attackby(obj/item/W, mob/user, params)
return use(user)
/obj/structure/ladder/attack_robot(mob/living/silicon/robot/R)
if(R.Adjacent(src))
return use(R)
//ATTACK GHOST IGNORING PARENT RETURN VALUE
/obj/structure/ladder/attack_ghost(mob/dead/observer/user)
use(user, TRUE)
return ..()
/obj/structure/ladder/proc/show_fluff_message(going_up, mob/user)
if(going_up)
user.visible_message("[user] climbs up [src].","<span class='notice'>You climb up [src].</span>")
else
user.visible_message("[user] climbs down [src].","<span class='notice'>You climb down [src].</span>")
// Indestructible away mission ladders which link based on a mapped ID and height value rather than X/Y/Z.
/obj/structure/ladder/unbreakable
name = "sturdy ladder"
desc = "An extremely sturdy metal ladder."
resistance_flags = INDESTRUCTIBLE
var/id
var/height = 0 // higher numbers are considered physically higher
/obj/structure/ladder/unbreakable/Initialize()
GLOB.ladders += src
return ..()
/obj/structure/ladder/unbreakable/Destroy()
. = ..()
if (. != QDEL_HINT_LETMELIVE)
GLOB.ladders -= src
/obj/structure/ladder/unbreakable/LateInitialize()
// Override the parent to find ladders based on being height-linked
if (!id || (up && down))
update_icon()
return
for (var/O in GLOB.ladders)
var/obj/structure/ladder/unbreakable/L = O
if (L.id != id)
continue // not one of our pals
if (!down && L.height == height - 1)
down = L
L.up = src
L.update_icon()
if (up)
break // break if both our connections are filled
else if (!up && L.height == height + 1)
up = L
L.down = src
L.update_icon()
if (down)
break // break if both our connections are filled
update_icon()
/obj/structure/ladder/unbreakable/binary
name = "mysterious ladder"
desc = "Where does it go?"
height = 0
id = "lavaland_binary"
var/area_to_place = /area/lavaland/surface/outdoors
var/active = FALSE
/obj/structure/ladder/unbreakable/binary/proc/ActivateAlmonds()
if(area_to_place && !active)
var/turf/T = getTargetTurf()
if(T)
var/obj/structure/ladder/unbreakable/U = new (T)
U.id = id
U.height = height+1
LateInitialize() // LateInit both of these to build the links. It's fine.
U.LateInitialize()
for(var/turf/TT in range(2,U))
TT.TerraformTurf(/turf/open/indestructible/binary, /turf/open/indestructible/binary, CHANGETURF_INHERIT_AIR)
active = TRUE
/obj/structure/ladder/unbreakable/binary/proc/getTargetTurf()
var/list/turfList = get_area_turfs(area_to_place)
while (turfList.len && !.)
var/i = rand(1, turfList.len)
var/turf/potentialTurf = turfList[i]
if (is_centcom_level(potentialTurf.z)) // These ladders don't lead to centcom.
turfList.Cut(i,i+1)
continue
if(!istype(potentialTurf, /turf/open/lava) && !potentialTurf.density) // Or inside dense turfs or lava
var/clear = TRUE
for(var/obj/O in potentialTurf) // Let's not place these on dense objects either. Might be funny though.
if(O.density)
clear = FALSE
break
if(clear)
. = potentialTurf
if (!.)
turfList.Cut(i,i+1)
/obj/structure/ladder/unbreakable/binary/space
id = "space_binary"
area_to_place = /area/space
/obj/structure/ladder/unbreakable/binary/unlinked //Crew gets to complete one
id = "unlinked_binary"
area_to_place = null
+1 -1
View File
@@ -18,7 +18,7 @@
// flags = CONDUCT_1
/obj/structure/lattice/examine(mob/user)
..()
. = ..()
. += deconstruction_hints(user)
/obj/structure/lattice/proc/deconstruction_hints(mob/user)
+43 -43
View File
@@ -1,44 +1,44 @@
#define FABRIC_PER_SHEET 4
///This is a loom. It's usually made out of wood and used to weave fabric like durathread or cotton into their respective cloth types.
/obj/structure/loom
name = "loom"
desc = "A simple device used to weave cloth and other thread-based fabrics together into usable material."
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "loom"
density = TRUE
anchored = TRUE
/obj/structure/loom/attackby(obj/item/I, mob/user)
if(weave(I, user))
return
return ..()
/obj/structure/loom/wrench_act(mob/living/user, obj/item/I)
..()
default_unfasten_wrench(user, I, 5)
return TRUE
///Handles the weaving.
/obj/structure/loom/proc/weave(obj/item/stack/sheet/S, mob/user)
if(!istype(S) || !S.is_fabric)
return FALSE
if(!anchored)
user.show_message("<span class='notice'>The loom needs to be wrenched down.</span>", MSG_VISUAL)
return FALSE
if(S.amount < FABRIC_PER_SHEET)
user.show_message("<span class='notice'>You need at least [FABRIC_PER_SHEET] units of fabric before using this.</span>", 1)
return FALSE
user.show_message("<span class='notice'>You start weaving \the [S.name] through the loom..</span>", MSG_VISUAL)
if(S.use_tool(src, user, S.pull_effort))
if(S.amount >= FABRIC_PER_SHEET)
new S.loom_result(drop_location())
S.use(FABRIC_PER_SHEET)
user.show_message("<span class='notice'>You weave \the [S.name] into a workable fabric.</span>", MSG_VISUAL)
return TRUE
/obj/structure/loom/unanchored
anchored = FALSE
#define FABRIC_PER_SHEET 4
///This is a loom. It's usually made out of wood and used to weave fabric like durathread or cotton into their respective cloth types.
/obj/structure/loom
name = "loom"
desc = "A simple device used to weave cloth and other thread-based fabrics together into usable material."
icon = 'icons/obj/hydroponics/equipment.dmi'
icon_state = "loom"
density = TRUE
anchored = TRUE
/obj/structure/loom/attackby(obj/item/I, mob/user)
if(weave(I, user))
return
return ..()
/obj/structure/loom/wrench_act(mob/living/user, obj/item/I)
..()
default_unfasten_wrench(user, I, 5)
return TRUE
///Handles the weaving.
/obj/structure/loom/proc/weave(obj/item/stack/sheet/S, mob/user)
if(!istype(S) || !S.is_fabric)
return FALSE
if(!anchored)
user.show_message("<span class='notice'>The loom needs to be wrenched down.</span>", MSG_VISUAL)
return FALSE
if(S.amount < FABRIC_PER_SHEET)
user.show_message("<span class='notice'>You need at least [FABRIC_PER_SHEET] units of fabric before using this.</span>", 1)
return FALSE
user.show_message("<span class='notice'>You start weaving \the [S.name] through the loom..</span>", MSG_VISUAL)
if(S.use_tool(src, user, S.pull_effort))
if(S.amount >= FABRIC_PER_SHEET)
new S.loom_result(drop_location())
S.use(FABRIC_PER_SHEET)
user.show_message("<span class='notice'>You weave \the [S.name] into a workable fabric.</span>", MSG_VISUAL)
return TRUE
/obj/structure/loom/unanchored
anchored = FALSE
#undef FABRIC_PER_SHEET
+216 -216
View File
@@ -1,216 +1,216 @@
/////// MANNED TURRET ////////
/obj/machinery/manned_turret
name = "machine gun turret"
desc = "While the trigger is held down, this gun will redistribute recoil to allow its user to easily shift targets."
icon = 'icons/obj/turrets.dmi'
icon_state = "machinegun"
can_buckle = TRUE
anchored = FALSE
density = TRUE
max_integrity = 100
buckle_lying = FALSE
layer = ABOVE_MOB_LAYER
var/view_range = 10
var/cooldown = 0
var/projectile_type = /obj/item/projectile/bullet/manned_turret
var/rate_of_fire = 1
var/number_of_shots = 40
var/cooldown_duration = 90
var/atom/target
var/turf/target_turf
var/warned = FALSE
var/list/calculated_projectile_vars
/obj/machinery/manned_turret/Destroy()
target = null
target_turf = null
..()
//BUCKLE HOOKS
/obj/machinery/manned_turret/unbuckle_mob(mob/living/buckled_mob,force = FALSE)
playsound(src,'sound/mecha/mechmove01.ogg', 50, 1)
for(var/obj/item/I in buckled_mob.held_items)
if(istype(I, /obj/item/gun_control))
qdel(I)
if(istype(buckled_mob))
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 0
if(buckled_mob.client)
buckled_mob.client.change_view(CONFIG_GET(string/default_view))
anchored = FALSE
. = ..()
STOP_PROCESSING(SSfastprocess, src)
/obj/machinery/manned_turret/user_buckle_mob(mob/living/M, mob/living/carbon/user)
if(user.incapacitated() || !istype(user))
return
M.forceMove(get_turf(src))
. = ..()
if(!.)
return
for(var/V in M.held_items)
var/obj/item/I = V
if(istype(I))
if(M.dropItemToGround(I))
var/obj/item/gun_control/TC = new(src)
M.put_in_hands(TC)
else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand
var/obj/item/gun_control/TC = new(src)
M.put_in_hands(TC)
M.pixel_y = 14
layer = ABOVE_MOB_LAYER
setDir(SOUTH)
playsound(src,'sound/mecha/mechmove01.ogg', 50, 1)
anchored = TRUE
if(M.client)
M.client.change_view(view_range)
START_PROCESSING(SSfastprocess, src)
/obj/machinery/manned_turret/process()
if (!update_positioning())
return PROCESS_KILL
/obj/machinery/manned_turret/proc/update_positioning()
if (!LAZYLEN(buckled_mobs))
return FALSE
var/mob/living/controller = buckled_mobs[1]
if(!istype(controller))
return FALSE
var/client/C = controller.client
if(C)
var/atom/A = C.mouseObject
var/turf/T = get_turf(A)
if(istype(T)) //They're hovering over something in the map.
direction_track(controller, T)
calculated_projectile_vars = calculate_projectile_angle_and_pixel_offsets(controller, C.mouseParams)
/obj/machinery/manned_turret/proc/direction_track(mob/user, atom/targeted)
if(user.incapacitated())
return
setDir(get_dir(src,targeted))
user.setDir(dir)
switch(dir)
if(NORTH)
layer = BELOW_MOB_LAYER
user.pixel_x = 0
user.pixel_y = -14
if(NORTHEAST)
layer = BELOW_MOB_LAYER
user.pixel_x = -8
user.pixel_y = -4
if(EAST)
layer = ABOVE_MOB_LAYER
user.pixel_x = -14
user.pixel_y = 0
if(SOUTHEAST)
layer = BELOW_MOB_LAYER
user.pixel_x = -8
user.pixel_y = 4
if(SOUTH)
layer = ABOVE_MOB_LAYER
user.pixel_x = 0
user.pixel_y = 14
if(SOUTHWEST)
layer = BELOW_MOB_LAYER
user.pixel_x = 8
user.pixel_y = 4
if(WEST)
layer = ABOVE_MOB_LAYER
user.pixel_x = 14
user.pixel_y = 0
if(NORTHWEST)
layer = BELOW_MOB_LAYER
user.pixel_x = 8
user.pixel_y = -4
/obj/machinery/manned_turret/proc/checkfire(atom/targeted_atom, mob/user)
target = targeted_atom
if(target == user || user.incapacitated() || target == get_turf(src))
return
if(world.time < cooldown)
if(!warned && world.time > (cooldown - cooldown_duration + rate_of_fire*number_of_shots)) // To capture the window where one is done firing
warned = TRUE
playsound(src, 'sound/weapons/sear.ogg', 100, 1)
return
else
cooldown = world.time + cooldown_duration
warned = FALSE
volley(user)
/obj/machinery/manned_turret/proc/volley(mob/user)
target_turf = get_turf(target)
for(var/i in 1 to number_of_shots)
addtimer(CALLBACK(src, /obj/machinery/manned_turret/.proc/fire_helper, user), i*rate_of_fire)
/obj/machinery/manned_turret/proc/fire_helper(mob/user)
if(user.incapacitated() || !(user in buckled_mobs))
return
update_positioning() //REFRESH MOUSE TRACKING!!
var/turf/targets_from = get_turf(src)
if(QDELETED(target))
target = target_turf
var/obj/item/projectile/P = new projectile_type(targets_from)
P.starting = targets_from
P.firer = user
P.original = target
playsound(src, 'sound/weapons/gunshot_smg.ogg', 75, 1)
P.xo = target.x - targets_from.x
P.yo = target.y - targets_from.y
P.Angle = calculated_projectile_vars[1] + rand(-9, 9)
P.p_x = calculated_projectile_vars[2]
P.p_y = calculated_projectile_vars[3]
P.fire()
/obj/machinery/manned_turret/ultimate // Admin-only proof of concept for autoclicker automatics
name = "Infinity Gun"
view_range = 12
projectile_type = /obj/item/projectile/bullet/manned_turret
/obj/machinery/manned_turret/ultimate/checkfire(atom/targeted_atom, mob/user)
target = targeted_atom
if(target == user || target == get_turf(src))
return
target_turf = get_turf(target)
fire_helper(user)
/obj/item/gun_control
name = "turret controls"
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "offhand"
w_class = WEIGHT_CLASS_HUGE
item_flags = ABSTRACT | NOBLUDGEON | DROPDEL
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/obj/machinery/manned_turret/turret
/obj/item/gun_control/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
turret = loc
if(!istype(turret))
return INITIALIZE_HINT_QDEL
/obj/item/gun_control/Destroy()
turret = null
..()
/obj/item/gun_control/CanItemAutoclick()
return TRUE
/obj/item/gun_control/attack_obj(obj/O, mob/living/user)
user.changeNext_move(CLICK_CD_MELEE)
O.attacked_by(src, user)
/obj/item/gun_control/attack(mob/living/M, mob/living/user)
M.lastattacker = user.real_name
M.lastattackerckey = user.ckey
M.attacked_by(src, user)
add_fingerprint(user)
/obj/item/gun_control/afterattack(atom/targeted_atom, mob/user, flag, params)
. = ..()
var/obj/machinery/manned_turret/E = user.buckled
E.calculated_projectile_vars = calculate_projectile_angle_and_pixel_offsets(user, params)
E.direction_track(user, targeted_atom)
E.checkfire(targeted_atom, user)
/////// MANNED TURRET ////////
/obj/machinery/manned_turret
name = "machine gun turret"
desc = "While the trigger is held down, this gun will redistribute recoil to allow its user to easily shift targets."
icon = 'icons/obj/turrets.dmi'
icon_state = "machinegun"
can_buckle = TRUE
anchored = FALSE
density = TRUE
max_integrity = 100
buckle_lying = FALSE
layer = ABOVE_MOB_LAYER
var/view_range = 10
var/cooldown = 0
var/projectile_type = /obj/item/projectile/bullet/manned_turret
var/rate_of_fire = 1
var/number_of_shots = 40
var/cooldown_duration = 90
var/atom/target
var/turf/target_turf
var/warned = FALSE
var/list/calculated_projectile_vars
/obj/machinery/manned_turret/Destroy()
target = null
target_turf = null
..()
//BUCKLE HOOKS
/obj/machinery/manned_turret/unbuckle_mob(mob/living/buckled_mob,force = FALSE)
playsound(src,'sound/mecha/mechmove01.ogg', 50, 1)
for(var/obj/item/I in buckled_mob.held_items)
if(istype(I, /obj/item/gun_control))
qdel(I)
if(istype(buckled_mob))
buckled_mob.pixel_x = 0
buckled_mob.pixel_y = 0
if(buckled_mob.client)
buckled_mob.client.change_view(CONFIG_GET(string/default_view))
anchored = FALSE
. = ..()
STOP_PROCESSING(SSfastprocess, src)
/obj/machinery/manned_turret/user_buckle_mob(mob/living/M, mob/living/carbon/user)
if(user.incapacitated() || !istype(user))
return
M.forceMove(get_turf(src))
. = ..()
if(!.)
return
for(var/V in M.held_items)
var/obj/item/I = V
if(istype(I))
if(M.dropItemToGround(I))
var/obj/item/gun_control/TC = new(src)
M.put_in_hands(TC)
else //Entries in the list should only ever be items or null, so if it's not an item, we can assume it's an empty hand
var/obj/item/gun_control/TC = new(src)
M.put_in_hands(TC)
M.pixel_y = 14
layer = ABOVE_MOB_LAYER
setDir(SOUTH)
playsound(src,'sound/mecha/mechmove01.ogg', 50, 1)
anchored = TRUE
if(M.client)
M.client.change_view(view_range)
START_PROCESSING(SSfastprocess, src)
/obj/machinery/manned_turret/process()
if (!update_positioning())
return PROCESS_KILL
/obj/machinery/manned_turret/proc/update_positioning()
if (!LAZYLEN(buckled_mobs))
return FALSE
var/mob/living/controller = buckled_mobs[1]
if(!istype(controller))
return FALSE
var/client/C = controller.client
if(C)
var/atom/A = C.mouseObject
var/turf/T = get_turf(A)
if(istype(T)) //They're hovering over something in the map.
direction_track(controller, T)
calculated_projectile_vars = calculate_projectile_angle_and_pixel_offsets(controller, C.mouseParams)
/obj/machinery/manned_turret/proc/direction_track(mob/user, atom/targeted)
if(user.incapacitated())
return
setDir(get_dir(src,targeted))
user.setDir(dir)
switch(dir)
if(NORTH)
layer = BELOW_MOB_LAYER
user.pixel_x = 0
user.pixel_y = -14
if(NORTHEAST)
layer = BELOW_MOB_LAYER
user.pixel_x = -8
user.pixel_y = -4
if(EAST)
layer = ABOVE_MOB_LAYER
user.pixel_x = -14
user.pixel_y = 0
if(SOUTHEAST)
layer = BELOW_MOB_LAYER
user.pixel_x = -8
user.pixel_y = 4
if(SOUTH)
layer = ABOVE_MOB_LAYER
user.pixel_x = 0
user.pixel_y = 14
if(SOUTHWEST)
layer = BELOW_MOB_LAYER
user.pixel_x = 8
user.pixel_y = 4
if(WEST)
layer = ABOVE_MOB_LAYER
user.pixel_x = 14
user.pixel_y = 0
if(NORTHWEST)
layer = BELOW_MOB_LAYER
user.pixel_x = 8
user.pixel_y = -4
/obj/machinery/manned_turret/proc/checkfire(atom/targeted_atom, mob/user)
target = targeted_atom
if(target == user || user.incapacitated() || target == get_turf(src))
return
if(world.time < cooldown)
if(!warned && world.time > (cooldown - cooldown_duration + rate_of_fire*number_of_shots)) // To capture the window where one is done firing
warned = TRUE
playsound(src, 'sound/weapons/sear.ogg', 100, 1)
return
else
cooldown = world.time + cooldown_duration
warned = FALSE
volley(user)
/obj/machinery/manned_turret/proc/volley(mob/user)
target_turf = get_turf(target)
for(var/i in 1 to number_of_shots)
addtimer(CALLBACK(src, /obj/machinery/manned_turret/.proc/fire_helper, user), i*rate_of_fire)
/obj/machinery/manned_turret/proc/fire_helper(mob/user)
if(user.incapacitated() || !(user in buckled_mobs))
return
update_positioning() //REFRESH MOUSE TRACKING!!
var/turf/targets_from = get_turf(src)
if(QDELETED(target))
target = target_turf
var/obj/item/projectile/P = new projectile_type(targets_from)
P.starting = targets_from
P.firer = user
P.original = target
playsound(src, 'sound/weapons/gunshot_smg.ogg', 75, 1)
P.xo = target.x - targets_from.x
P.yo = target.y - targets_from.y
P.Angle = calculated_projectile_vars[1] + rand(-9, 9)
P.p_x = calculated_projectile_vars[2]
P.p_y = calculated_projectile_vars[3]
P.fire()
/obj/machinery/manned_turret/ultimate // Admin-only proof of concept for autoclicker automatics
name = "Infinity Gun"
view_range = 12
projectile_type = /obj/item/projectile/bullet/manned_turret
/obj/machinery/manned_turret/ultimate/checkfire(atom/targeted_atom, mob/user)
target = targeted_atom
if(target == user || target == get_turf(src))
return
target_turf = get_turf(target)
fire_helper(user)
/obj/item/gun_control
name = "turret controls"
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "offhand"
w_class = WEIGHT_CLASS_HUGE
item_flags = ABSTRACT | NOBLUDGEON | DROPDEL
resistance_flags = FIRE_PROOF | UNACIDABLE | ACID_PROOF
var/obj/machinery/manned_turret/turret
/obj/item/gun_control/Initialize()
. = ..()
ADD_TRAIT(src, TRAIT_NODROP, ABSTRACT_ITEM_TRAIT)
turret = loc
if(!istype(turret))
return INITIALIZE_HINT_QDEL
/obj/item/gun_control/Destroy()
turret = null
..()
/obj/item/gun_control/CanItemAutoclick()
return TRUE
/obj/item/gun_control/attack_obj(obj/O, mob/living/user)
user.changeNext_move(CLICK_CD_MELEE)
O.attacked_by(src, user)
/obj/item/gun_control/attack(mob/living/M, mob/living/user)
M.lastattacker = user.real_name
M.lastattackerckey = user.ckey
M.attacked_by(src, user)
add_fingerprint(user)
/obj/item/gun_control/afterattack(atom/targeted_atom, mob/user, flag, params)
. = ..()
var/obj/machinery/manned_turret/E = user.buckled
E.calculated_projectile_vars = calculate_projectile_angle_and_pixel_offsets(user, params)
E.direction_track(user, targeted_atom)
E.checkfire(targeted_atom, user)
+258 -258
View File
@@ -1,258 +1,258 @@
//NOT using the existing /obj/machinery/door type, since that has some complications on its own, mainly based on its
//machineryness
/obj/structure/mineral_door
name = "metal door"
density = TRUE
anchored = TRUE
opacity = TRUE
layer = CLOSED_DOOR_LAYER
icon = 'icons/obj/doors/mineral_doors.dmi'
icon_state = "metal"
var/initial_state
var/state = 0 //closed, 1 == open
var/isSwitchingStates = 0
var/close_delay = -1 //-1 if does not auto close.
max_integrity = 200
armor = list("melee" = 10, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 50, "acid" = 50)
var/sheetType = /obj/item/stack/sheet/metal
var/sheetAmount = 7
var/openSound = 'sound/effects/stonedoor_openclose.ogg'
var/closeSound = 'sound/effects/stonedoor_openclose.ogg'
CanAtmosPass = ATMOS_PASS_DENSITY
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
rad_insulation = RAD_MEDIUM_INSULATION
/obj/structure/mineral_door/Initialize()
. = ..()
initial_state = icon_state
air_update_turf(TRUE)
/obj/structure/mineral_door/Move()
var/turf/T = loc
. = ..()
move_update_air(T)
/obj/structure/mineral_door/Bumped(atom/movable/AM)
..()
if(!state)
return TryToSwitchState(AM)
/obj/structure/mineral_door/attack_ai(mob/user) //those aren't machinery, they're just big fucking slabs of a mineral
if(isAI(user)) //so the AI can't open it
return
else if(iscyborg(user)) //but cyborgs can
if(get_dist(user,src) <= 1) //not remotely though
return TryToSwitchState(user)
/obj/structure/mineral_door/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/mineral_door/attack_hand(mob/user)
. = ..()
if(.)
return
return TryToSwitchState(user)
/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target)
if(istype(mover, /obj/effect/beam))
return !opacity
return !density
/obj/structure/mineral_door/proc/TryToSwitchState(atom/user)
if(isSwitchingStates)
return
if(isliving(user))
var/mob/living/M = user
if(world.time - M.last_bumped <= 60)
return //NOTE do we really need that?
if(M.client)
if(iscarbon(M))
var/mob/living/carbon/C = M
if(!C.handcuffed)
SwitchState()
else
SwitchState()
else if(ismecha(user))
SwitchState()
/obj/structure/mineral_door/proc/SwitchState()
if(state)
Close()
else
Open()
/obj/structure/mineral_door/proc/Open()
isSwitchingStates = 1
playsound(src, openSound, 100, 1)
set_opacity(FALSE)
flick("[initial_state]opening",src)
sleep(10)
density = FALSE
layer = OPEN_DOOR_LAYER
state = 1
air_update_turf(1)
update_icon()
isSwitchingStates = 0
if(close_delay != -1)
addtimer(CALLBACK(src, .proc/Close), close_delay)
/obj/structure/mineral_door/proc/Close()
if(isSwitchingStates || state != 1)
return
var/turf/T = get_turf(src)
for(var/mob/living/L in T)
return
isSwitchingStates = 1
playsound(loc, closeSound, 100, 1)
flick("[initial_state]closing",src)
sleep(10)
density = TRUE
set_opacity(TRUE)
state = 0
layer = initial(layer)
air_update_turf(1)
update_icon()
isSwitchingStates = 0
/obj/structure/mineral_door/update_icon()
if(state)
icon_state = "[initial_state]open"
else
icon_state = initial_state
/obj/structure/mineral_door/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_MINING)
to_chat(user, "<span class='notice'>You start digging the [name]...</span>")
if(I.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You finish digging.</span>")
deconstruct(TRUE)
else if(user.a_intent != INTENT_HARM)
return attack_hand(user)
else
return ..()
/obj/structure/mineral_door/deconstruct(disassembled = TRUE)
var/turf/T = get_turf(src)
if(disassembled)
new sheetType(T, sheetAmount)
else
new sheetType(T, max(sheetAmount - 2, 1))
qdel(src)
/obj/structure/mineral_door/iron
name = "iron door"
max_integrity = 300
/obj/structure/mineral_door/silver
name = "silver door"
icon_state = "silver"
sheetType = /obj/item/stack/sheet/mineral/silver
max_integrity = 300
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/mineral_door/gold
name = "gold door"
icon_state = "gold"
sheetType = /obj/item/stack/sheet/mineral/gold
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/mineral_door/uranium
name = "uranium door"
icon_state = "uranium"
sheetType = /obj/item/stack/sheet/mineral/uranium
max_integrity = 300
light_range = 2
/obj/structure/mineral_door/uranium/ComponentInitialize()
return
/obj/structure/mineral_door/sandstone
name = "sandstone door"
icon_state = "sandstone"
sheetType = /obj/item/stack/sheet/mineral/sandstone
max_integrity = 100
/obj/structure/mineral_door/transparent
opacity = FALSE
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/transparent/Close()
..()
set_opacity(FALSE)
/obj/structure/mineral_door/transparent/plasma
name = "plasma door"
icon_state = "plasma"
sheetType = /obj/item/stack/sheet/mineral/plasma
/obj/structure/mineral_door/transparent/plasma/ComponentInitialize()
return
/obj/structure/mineral_door/transparent/plasma/attackby(obj/item/W, mob/user, params)
if(W.get_temperature())
var/turf/T = get_turf(src)
message_admins("Plasma mineral door ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_VERBOSEJMP(T)]")
log_game("Plasma mineral door ignited by [key_name(user)] in [AREACOORD(T)]")
TemperatureAct()
else
return ..()
/obj/structure/mineral_door/transparent/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
TemperatureAct()
/obj/structure/mineral_door/transparent/plasma/proc/TemperatureAct()
atmos_spawn_air("plasma=500;TEMP=1000")
deconstruct(FALSE)
/obj/structure/mineral_door/transparent/diamond
name = "diamond door"
icon_state = "diamond"
sheetType = /obj/item/stack/sheet/mineral/diamond
max_integrity = 1000
rad_insulation = RAD_EXTREME_INSULATION
/obj/structure/mineral_door/wood
name = "wood door"
icon_state = "wood"
openSound = 'sound/effects/doorcreaky.ogg'
closeSound = 'sound/effects/doorcreaky.ogg'
sheetType = /obj/item/stack/sheet/mineral/wood
resistance_flags = FLAMMABLE
max_integrity = 200
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/woodrustic
name = "rustic wood door"
icon_state = "woodrustic"
openSound = 'sound/effects/doorcreaky.ogg'
closeSound = 'sound/effects/doorcreaky.ogg'
sheetType = /obj/item/stack/sheet/mineral/wood
sheetAmount = 10
max_integrity = 200
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/paperframe
name = "paper frame door"
icon_state = "paperframe"
openSound = 'sound/effects/doorcreaky.ogg'
closeSound = 'sound/effects/doorcreaky.ogg'
sheetType = /obj/item/stack/sheet/paperframes
sheetAmount = 3
resistance_flags = FLAMMABLE
max_integrity = 20
/obj/structure/mineral_door/paperframe/Initialize()
. = ..()
queue_smooth_neighbors(src)
/obj/structure/mineral_door/paperframe/ComponentInitialize()
return
/obj/structure/mineral_door/paperframe/Destroy()
queue_smooth_neighbors(src)
return ..()
//NOT using the existing /obj/machinery/door type, since that has some complications on its own, mainly based on its
//machineryness
/obj/structure/mineral_door
name = "metal door"
density = TRUE
anchored = TRUE
opacity = TRUE
layer = CLOSED_DOOR_LAYER
icon = 'icons/obj/doors/mineral_doors.dmi'
icon_state = "metal"
var/initial_state
var/state = 0 //closed, 1 == open
var/isSwitchingStates = 0
var/close_delay = -1 //-1 if does not auto close.
max_integrity = 200
armor = list("melee" = 10, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 50, "acid" = 50)
var/sheetType = /obj/item/stack/sheet/metal
var/sheetAmount = 7
var/openSound = 'sound/effects/stonedoor_openclose.ogg'
var/closeSound = 'sound/effects/stonedoor_openclose.ogg'
CanAtmosPass = ATMOS_PASS_DENSITY
rad_flags = RAD_PROTECT_CONTENTS | RAD_NO_CONTAMINATE
rad_insulation = RAD_MEDIUM_INSULATION
/obj/structure/mineral_door/Initialize()
. = ..()
initial_state = icon_state
air_update_turf(TRUE)
/obj/structure/mineral_door/Move()
var/turf/T = loc
. = ..()
move_update_air(T)
/obj/structure/mineral_door/Bumped(atom/movable/AM)
..()
if(!state)
return TryToSwitchState(AM)
/obj/structure/mineral_door/attack_ai(mob/user) //those aren't machinery, they're just big fucking slabs of a mineral
if(isAI(user)) //so the AI can't open it
return
else if(iscyborg(user)) //but cyborgs can
if(get_dist(user,src) <= 1) //not remotely though
return TryToSwitchState(user)
/obj/structure/mineral_door/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/mineral_door/attack_hand(mob/user)
. = ..()
if(.)
return
return TryToSwitchState(user)
/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target)
if(istype(mover, /obj/effect/beam))
return !opacity
return !density
/obj/structure/mineral_door/proc/TryToSwitchState(atom/user)
if(isSwitchingStates)
return
if(isliving(user))
var/mob/living/M = user
if(world.time - M.last_bumped <= 60)
return //NOTE do we really need that?
if(M.client)
if(iscarbon(M))
var/mob/living/carbon/C = M
if(!C.handcuffed)
SwitchState()
else
SwitchState()
else if(ismecha(user))
SwitchState()
/obj/structure/mineral_door/proc/SwitchState()
if(state)
Close()
else
Open()
/obj/structure/mineral_door/proc/Open()
isSwitchingStates = 1
playsound(src, openSound, 100, 1)
set_opacity(FALSE)
flick("[initial_state]opening",src)
sleep(10)
density = FALSE
layer = OPEN_DOOR_LAYER
state = 1
air_update_turf(1)
update_icon()
isSwitchingStates = 0
if(close_delay != -1)
addtimer(CALLBACK(src, .proc/Close), close_delay)
/obj/structure/mineral_door/proc/Close()
if(isSwitchingStates || state != 1)
return
var/turf/T = get_turf(src)
for(var/mob/living/L in T)
return
isSwitchingStates = 1
playsound(loc, closeSound, 100, 1)
flick("[initial_state]closing",src)
sleep(10)
density = TRUE
set_opacity(TRUE)
state = 0
layer = initial(layer)
air_update_turf(1)
update_icon()
isSwitchingStates = 0
/obj/structure/mineral_door/update_icon()
if(state)
icon_state = "[initial_state]open"
else
icon_state = initial_state
/obj/structure/mineral_door/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_MINING)
to_chat(user, "<span class='notice'>You start digging the [name]...</span>")
if(I.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You finish digging.</span>")
deconstruct(TRUE)
else if(user.a_intent != INTENT_HARM)
return attack_hand(user)
else
return ..()
/obj/structure/mineral_door/deconstruct(disassembled = TRUE)
var/turf/T = get_turf(src)
if(disassembled)
new sheetType(T, sheetAmount)
else
new sheetType(T, max(sheetAmount - 2, 1))
qdel(src)
/obj/structure/mineral_door/iron
name = "iron door"
max_integrity = 300
/obj/structure/mineral_door/silver
name = "silver door"
icon_state = "silver"
sheetType = /obj/item/stack/sheet/mineral/silver
max_integrity = 300
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/mineral_door/gold
name = "gold door"
icon_state = "gold"
sheetType = /obj/item/stack/sheet/mineral/gold
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/mineral_door/uranium
name = "uranium door"
icon_state = "uranium"
sheetType = /obj/item/stack/sheet/mineral/uranium
max_integrity = 300
light_range = 2
/obj/structure/mineral_door/uranium/ComponentInitialize()
return
/obj/structure/mineral_door/sandstone
name = "sandstone door"
icon_state = "sandstone"
sheetType = /obj/item/stack/sheet/mineral/sandstone
max_integrity = 100
/obj/structure/mineral_door/transparent
opacity = FALSE
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/transparent/Close()
..()
set_opacity(FALSE)
/obj/structure/mineral_door/transparent/plasma
name = "plasma door"
icon_state = "plasma"
sheetType = /obj/item/stack/sheet/mineral/plasma
/obj/structure/mineral_door/transparent/plasma/ComponentInitialize()
return
/obj/structure/mineral_door/transparent/plasma/attackby(obj/item/W, mob/user, params)
if(W.get_temperature())
var/turf/T = get_turf(src)
message_admins("Plasma mineral door ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_VERBOSEJMP(T)]")
log_game("Plasma mineral door ignited by [key_name(user)] in [AREACOORD(T)]")
TemperatureAct()
else
return ..()
/obj/structure/mineral_door/transparent/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300)
TemperatureAct()
/obj/structure/mineral_door/transparent/plasma/proc/TemperatureAct()
atmos_spawn_air("plasma=500;TEMP=1000")
deconstruct(FALSE)
/obj/structure/mineral_door/transparent/diamond
name = "diamond door"
icon_state = "diamond"
sheetType = /obj/item/stack/sheet/mineral/diamond
max_integrity = 1000
rad_insulation = RAD_EXTREME_INSULATION
/obj/structure/mineral_door/wood
name = "wood door"
icon_state = "wood"
openSound = 'sound/effects/doorcreaky.ogg'
closeSound = 'sound/effects/doorcreaky.ogg'
sheetType = /obj/item/stack/sheet/mineral/wood
resistance_flags = FLAMMABLE
max_integrity = 200
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/woodrustic
name = "rustic wood door"
icon_state = "woodrustic"
openSound = 'sound/effects/doorcreaky.ogg'
closeSound = 'sound/effects/doorcreaky.ogg'
sheetType = /obj/item/stack/sheet/mineral/wood
sheetAmount = 10
max_integrity = 200
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/paperframe
name = "paper frame door"
icon_state = "paperframe"
openSound = 'sound/effects/doorcreaky.ogg'
closeSound = 'sound/effects/doorcreaky.ogg'
sheetType = /obj/item/stack/sheet/paperframes
sheetAmount = 3
resistance_flags = FLAMMABLE
max_integrity = 20
/obj/structure/mineral_door/paperframe/Initialize()
. = ..()
queue_smooth_neighbors(src)
/obj/structure/mineral_door/paperframe/ComponentInitialize()
return
/obj/structure/mineral_door/paperframe/Destroy()
queue_smooth_neighbors(src)
return ..()
+239 -239
View File
@@ -1,239 +1,239 @@
//wip wip wup
/obj/structure/mirror
name = "mirror"
desc = "Mirror mirror on the wall, who's the most robust of them all?"
icon = 'icons/obj/watercloset.dmi'
icon_state = "mirror"
density = FALSE
anchored = TRUE
max_integrity = 200
integrity_failure = 100
/obj/structure/mirror/Initialize(mapload)
. = ..()
if(icon_state == "mirror_broke" && !broken)
obj_break(null, mapload)
/obj/structure/mirror/attack_hand(mob/user)
. = ..()
if(.)
return
if(broken || !Adjacent(user))
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
//see code/modules/mob/dead/new_player/preferences.dm at approx line 545 for comments!
//this is largely copypasted from there.
//handle facial hair (if necessary)
if(H.gender == MALE)
var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in GLOB.facial_hair_styles_list
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return //no tele-grooming
if(new_style)
H.facial_hair_style = new_style
else
H.facial_hair_style = "Shaved"
//handle normal hair
var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in GLOB.hair_styles_list
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return //no tele-grooming
if(new_style)
H.hair_style = new_style
H.update_hair()
/obj/structure/mirror/examine_status(mob/user)
if(broken)
return // no message spam
..()
/obj/structure/mirror/obj_break(damage_flag, mapload)
if(!broken && !(flags_1 & NODECONSTRUCT_1))
icon_state = "mirror_broke"
if(!mapload)
playsound(src, "shatter", 70, 1)
if(desc == initial(desc))
desc = "Oh no, seven years of bad luck!"
broken = TRUE
/obj/structure/mirror/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!disassembled)
new /obj/item/shard( src.loc )
qdel(src)
/obj/structure/mirror/welder_act(mob/living/user, obj/item/I)
if(user.a_intent == INTENT_HARM)
return FALSE
if(!broken)
return TRUE
if(!I.tool_start_check(user, amount=0))
return TRUE
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(I.use_tool(src, user, 10, volume=50))
to_chat(user, "<span class='notice'>You repair [src].</span>")
broken = 0
icon_state = initial(icon_state)
desc = initial(desc)
return TRUE
/obj/structure/mirror/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
if(BURN)
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
/obj/structure/mirror/magic
name = "magic mirror"
desc = "Turn and face the strange... face."
icon_state = "magic_mirror"
var/list/races_blacklist = list("skeleton", "agent", "angel", "military_synth", "memezombies", "clockwork golem servant", "android", "synth", "mush", "zombie", "memezombie")
var/list/choosable_races = list()
/obj/structure/mirror/magic/New()
if(!choosable_races.len)
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
if(!(S.id in races_blacklist))
choosable_races += S.id
..()
/obj/structure/mirror/magic/lesser/New()
choosable_races = GLOB.roundstart_races.Copy()
..()
/obj/structure/mirror/magic/badmin/New()
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
choosable_races += S.id
..()
/obj/structure/mirror/magic/attack_hand(mob/user)
. = ..()
if(.)
return
if(!ishuman(user))
return
var/mob/living/carbon/human/H = user
var/choice = input(user, "Something to change?", "Magical Grooming") as null|anything in list("name", "race", "gender", "hair", "eyes")
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
switch(choice)
if("name")
var/newname = copytext(sanitize(input(H, "Who are we again?", "Name change", H.name) as null|text),1,MAX_NAME_LEN)
if(!newname)
return
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
H.real_name = newname
H.name = newname
if(H.dna)
H.dna.real_name = newname
if(H.mind)
H.mind.name = newname
if("race")
var/newrace
var/racechoice = input(H, "What are we again?", "Race change") as null|anything in choosable_races
newrace = GLOB.species_list[racechoice]
if(!newrace)
return
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
H.set_species(newrace, icon_update=0)
if(H.dna.species.use_skintones)
var/new_s_tone = input(user, "Choose your skin tone:", "Race change") as null|anything in GLOB.skin_tones
if(new_s_tone)
H.skin_tone = new_s_tone
H.dna.update_ui_block(DNA_SKIN_TONE_BLOCK)
if(MUTCOLORS in H.dna.species.species_traits)
var/new_mutantcolor = input(user, "Choose your skin color:", "Race change","#"+H.dna.features["mcolor"]) as color|null
if(new_mutantcolor)
var/temp_hsv = RGBtoHSV(new_mutantcolor)
if(ReadHSV(temp_hsv)[3] >= ReadHSV("#7F7F7F")[3]) // mutantcolors must be bright
H.dna.features["mcolor"] = sanitize_hexcolor(new_mutantcolor)
else
to_chat(H, "<span class='notice'>Invalid color. Your color is not bright enough.</span>")
H.update_body()
H.update_hair()
H.update_body_parts()
H.update_mutations_overlay() // no hulk lizard
if("gender")
if(!(H.gender in list("male", "female"))) //blame the patriarchy
return
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
if(H.gender == "male")
if(alert(H, "Become a Witch?", "Confirmation", "Yes", "No") == "Yes")
H.gender = "female"
to_chat(H, "<span class='notice'>Man, you feel like a woman!</span>")
else
return
else
if(alert(H, "Become a Warlock?", "Confirmation", "Yes", "No") == "Yes")
H.gender = "male"
to_chat(H, "<span class='notice'>Whoa man, you feel like a man!</span>")
else
return
H.dna.update_ui_block(DNA_GENDER_BLOCK)
H.update_body()
H.update_mutations_overlay() //(hulk male/female)
if("hair")
var/hairchoice = alert(H, "Hair style or hair color?", "Change Hair", "Style", "Color")
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
if(hairchoice == "Style") //So you just want to use a mirror then?
..()
else
var/new_hair_color = input(H, "Choose your hair color", "Hair Color","#"+H.hair_color) as color|null
if(new_hair_color)
H.hair_color = sanitize_hexcolor(new_hair_color)
H.dna.update_ui_block(DNA_HAIR_COLOR_BLOCK)
if(H.gender == "male")
var/new_face_color = input(H, "Choose your facial hair color", "Hair Color","#"+H.facial_hair_color) as color|null
if(new_face_color)
H.facial_hair_color = sanitize_hexcolor(new_face_color)
H.dna.update_ui_block(DNA_FACIAL_HAIR_COLOR_BLOCK)
H.update_hair()
if(BODY_ZONE_PRECISE_EYES)
var/new_eye_color = input(H, "Choose your eye color", "Eye Color","#"+H.eye_color) as color|null
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
if(new_eye_color)
var/n_color = sanitize_hexcolor(new_eye_color)
var/obj/item/organ/eyes/eyes = H.getorganslot(ORGAN_SLOT_EYES)
if(eyes)
eyes.eye_color = n_color
H.eye_color = n_color
H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK)
H.dna.species.handle_body()
if(choice)
curse(user)
/obj/structure/mirror/magic/proc/curse(mob/living/user)
return
//wip wip wup
/obj/structure/mirror
name = "mirror"
desc = "Mirror mirror on the wall, who's the most robust of them all?"
icon = 'icons/obj/watercloset.dmi'
icon_state = "mirror"
density = FALSE
anchored = TRUE
max_integrity = 200
integrity_failure = 100
/obj/structure/mirror/Initialize(mapload)
. = ..()
if(icon_state == "mirror_broke" && !broken)
obj_break(null, mapload)
/obj/structure/mirror/attack_hand(mob/user)
. = ..()
if(.)
return
if(broken || !Adjacent(user))
return
if(ishuman(user))
var/mob/living/carbon/human/H = user
//see code/modules/mob/dead/new_player/preferences.dm at approx line 545 for comments!
//this is largely copypasted from there.
//handle facial hair (if necessary)
if(H.gender == MALE)
var/new_style = input(user, "Select a facial hair style", "Grooming") as null|anything in GLOB.facial_hair_styles_list
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return //no tele-grooming
if(new_style)
H.facial_hair_style = new_style
else
H.facial_hair_style = "Shaved"
//handle normal hair
var/new_style = input(user, "Select a hair style", "Grooming") as null|anything in GLOB.hair_styles_list
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return //no tele-grooming
if(new_style)
H.hair_style = new_style
H.update_hair()
/obj/structure/mirror/examine_status(mob/user)
if(broken)
return // no message spam
..()
/obj/structure/mirror/obj_break(damage_flag, mapload)
if(!broken && !(flags_1 & NODECONSTRUCT_1))
icon_state = "mirror_broke"
if(!mapload)
playsound(src, "shatter", 70, 1)
if(desc == initial(desc))
desc = "Oh no, seven years of bad luck!"
broken = TRUE
/obj/structure/mirror/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!disassembled)
new /obj/item/shard( src.loc )
qdel(src)
/obj/structure/mirror/welder_act(mob/living/user, obj/item/I)
if(user.a_intent == INTENT_HARM)
return FALSE
if(!broken)
return TRUE
if(!I.tool_start_check(user, amount=0))
return TRUE
to_chat(user, "<span class='notice'>You begin repairing [src]...</span>")
if(I.use_tool(src, user, 10, volume=50))
to_chat(user, "<span class='notice'>You repair [src].</span>")
broken = 0
icon_state = initial(icon_state)
desc = initial(desc)
return TRUE
/obj/structure/mirror/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
if(BRUTE)
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
if(BURN)
playsound(src, 'sound/effects/hit_on_shattered_glass.ogg', 70, 1)
/obj/structure/mirror/magic
name = "magic mirror"
desc = "Turn and face the strange... face."
icon_state = "magic_mirror"
var/list/races_blacklist = list("skeleton", "agent", "angel", "military_synth", "memezombies", "clockwork golem servant", "android", "synth", "mush", "zombie", "memezombie")
var/list/choosable_races = list()
/obj/structure/mirror/magic/New()
if(!choosable_races.len)
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
if(!(S.id in races_blacklist))
choosable_races += S.id
..()
/obj/structure/mirror/magic/lesser/New()
choosable_races = GLOB.roundstart_races.Copy()
..()
/obj/structure/mirror/magic/badmin/New()
for(var/speciestype in subtypesof(/datum/species))
var/datum/species/S = new speciestype()
choosable_races += S.id
..()
/obj/structure/mirror/magic/attack_hand(mob/user)
. = ..()
if(.)
return
if(!ishuman(user))
return
var/mob/living/carbon/human/H = user
var/choice = input(user, "Something to change?", "Magical Grooming") as null|anything in list("name", "race", "gender", "hair", "eyes")
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
switch(choice)
if("name")
var/newname = copytext(sanitize(input(H, "Who are we again?", "Name change", H.name) as null|text),1,MAX_NAME_LEN)
if(!newname)
return
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
H.real_name = newname
H.name = newname
if(H.dna)
H.dna.real_name = newname
if(H.mind)
H.mind.name = newname
if("race")
var/newrace
var/racechoice = input(H, "What are we again?", "Race change") as null|anything in choosable_races
newrace = GLOB.species_list[racechoice]
if(!newrace)
return
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
H.set_species(newrace, icon_update=0)
if(H.dna.species.use_skintones)
var/new_s_tone = input(user, "Choose your skin tone:", "Race change") as null|anything in GLOB.skin_tones
if(new_s_tone)
H.skin_tone = new_s_tone
H.dna.update_ui_block(DNA_SKIN_TONE_BLOCK)
if(MUTCOLORS in H.dna.species.species_traits)
var/new_mutantcolor = input(user, "Choose your skin color:", "Race change","#"+H.dna.features["mcolor"]) as color|null
if(new_mutantcolor)
var/temp_hsv = RGBtoHSV(new_mutantcolor)
if(ReadHSV(temp_hsv)[3] >= ReadHSV("#7F7F7F")[3]) // mutantcolors must be bright
H.dna.features["mcolor"] = sanitize_hexcolor(new_mutantcolor)
else
to_chat(H, "<span class='notice'>Invalid color. Your color is not bright enough.</span>")
H.update_body()
H.update_hair()
H.update_body_parts()
H.update_mutations_overlay() // no hulk lizard
if("gender")
if(!(H.gender in list("male", "female"))) //blame the patriarchy
return
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
if(H.gender == "male")
if(alert(H, "Become a Witch?", "Confirmation", "Yes", "No") == "Yes")
H.gender = "female"
to_chat(H, "<span class='notice'>Man, you feel like a woman!</span>")
else
return
else
if(alert(H, "Become a Warlock?", "Confirmation", "Yes", "No") == "Yes")
H.gender = "male"
to_chat(H, "<span class='notice'>Whoa man, you feel like a man!</span>")
else
return
H.dna.update_ui_block(DNA_GENDER_BLOCK)
H.update_body()
H.update_mutations_overlay() //(hulk male/female)
if("hair")
var/hairchoice = alert(H, "Hair style or hair color?", "Change Hair", "Style", "Color")
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
if(hairchoice == "Style") //So you just want to use a mirror then?
..()
else
var/new_hair_color = input(H, "Choose your hair color", "Hair Color","#"+H.hair_color) as color|null
if(new_hair_color)
H.hair_color = sanitize_hexcolor(new_hair_color)
H.dna.update_ui_block(DNA_HAIR_COLOR_BLOCK)
if(H.gender == "male")
var/new_face_color = input(H, "Choose your facial hair color", "Hair Color","#"+H.facial_hair_color) as color|null
if(new_face_color)
H.facial_hair_color = sanitize_hexcolor(new_face_color)
H.dna.update_ui_block(DNA_FACIAL_HAIR_COLOR_BLOCK)
H.update_hair()
if(BODY_ZONE_PRECISE_EYES)
var/new_eye_color = input(H, "Choose your eye color", "Eye Color","#"+H.eye_color) as color|null
if(!user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
if(new_eye_color)
var/n_color = sanitize_hexcolor(new_eye_color)
var/obj/item/organ/eyes/eyes = H.getorganslot(ORGAN_SLOT_EYES)
if(eyes)
eyes.eye_color = n_color
H.eye_color = n_color
H.dna.update_ui_block(DNA_EYE_COLOR_BLOCK)
H.dna.species.handle_body()
if(choice)
curse(user)
/obj/structure/mirror/magic/proc/curse(mob/living/user)
return
+28 -28
View File
@@ -1,29 +1,29 @@
/obj/structure/mopbucket
name = "mop bucket"
desc = "Fill it with water, but don't forget a mop!"
icon = 'icons/obj/janitor.dmi'
icon_state = "mopbucket"
density = TRUE
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
/obj/structure/mopbucket/Initialize()
. = ..()
create_reagents(100, OPENCONTAINER)
/obj/structure/mopbucket/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/mop))
if(reagents.total_volume < 1)
to_chat(user, "[src] is out of water!</span>")
else
reagents.trans_to(I, 5)
to_chat(user, "<span class='notice'>You wet [I] in [src].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
update_icon()
else
return ..()
/obj/structure/mopbucket/update_icon()
cut_overlays()
if(reagents.total_volume > 0)
/obj/structure/mopbucket
name = "mop bucket"
desc = "Fill it with water, but don't forget a mop!"
icon = 'icons/obj/janitor.dmi'
icon_state = "mopbucket"
density = TRUE
var/amount_per_transfer_from_this = 5 //shit I dunno, adding this so syringes stop runtime erroring. --NeoFite
/obj/structure/mopbucket/Initialize()
. = ..()
create_reagents(100, OPENCONTAINER)
/obj/structure/mopbucket/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/mop))
if(reagents.total_volume < 1)
to_chat(user, "[src] is out of water!</span>")
else
reagents.trans_to(I, 5)
to_chat(user, "<span class='notice'>You wet [I] in [src].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
update_icon()
else
return ..()
/obj/structure/mopbucket/update_icon()
cut_overlays()
if(reagents.total_volume > 0)
add_overlay("mopbucket_water")
+386 -386
View File
@@ -1,386 +1,386 @@
/* 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
/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)
AM.forceMove(T)
update_icon()
/obj/structure/bodycontainer/proc/close()
playsound(src, 'sound/effects/roll.ogg', 5, 1)
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
for(var/atom/movable/AM in connected.loc)
if(!AM.anchored || AM == connected)
if(ismob(AM) && !isliving(AM))
continue
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
/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 == 1) // Empty
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/machines/beeping_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 = TRAY_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)
/* 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
/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)
AM.forceMove(T)
update_icon()
/obj/structure/bodycontainer/proc/close()
playsound(src, 'sound/effects/roll.ogg', 5, 1)
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
for(var/atom/movable/AM in connected.loc)
if(!AM.anchored || AM == connected)
if(ismob(AM) && !isliving(AM))
continue
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
/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 == 1) // Empty
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/machines/beeping_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 = TRAY_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)
+381 -381
View File
@@ -1,381 +1,381 @@
#define MUSICIAN_HEARCHECK_MINDELAY 4
#define MUSIC_MAXLINES 600
#define MUSIC_MAXLINECHARS 50
/datum/song
var/name = "Untitled"
var/list/lines = new()
var/tempo = 5 // delay between notes
var/playing = 0 // if we're playing
var/help = 0 // if help is open
var/edit = 1 // if we're in editing mode
var/repeat = 0 // number of times remaining to repeat
var/max_repeats = 10 // maximum times we can repeat
var/instrumentDir = "piano" // the folder with the sounds
var/instrumentExt = "ogg" // the file extension
var/obj/instrumentObj = null // the associated obj playing the sound
var/last_hearcheck = 0
var/list/hearing_mobs
/datum/song/New(dir, obj, ext = "ogg")
tempo = sanitize_tempo(tempo)
instrumentDir = dir
instrumentObj = obj
instrumentExt = ext
/datum/song/Destroy()
instrumentObj = null
return ..()
// note is a number from 1-7 for A-G
// acc is either "b", "n", or "#"
// oct is 1-8 (or 9 for C)
/datum/song/proc/playnote(note, acc as text, oct)
// handle accidental -> B<>C of E<>F
if(acc == "b" && (note == 3 || note == 6)) // C or F
if(note == 3)
oct--
note--
acc = "n"
else if(acc == "#" && (note == 2 || note == 5)) // B or E
if(note == 2)
oct++
note++
acc = "n"
else if(acc == "#" && (note == 7)) //G#
note = 1
acc = "b"
else if(acc == "#") // mass convert all sharps to flats, octave jump already handled
acc = "b"
note++
// check octave, C is allowed to go to 9
if(oct < 1 || (note == 3 ? oct > 9 : oct > 8))
return
// now generate name
var/soundfile = "sound/instruments/[instrumentDir]/[ascii2text(note+64)][acc][oct].[instrumentExt]"
soundfile = file(soundfile)
// make sure the note exists
if(!fexists(soundfile))
return
// and play
var/turf/source = get_turf(instrumentObj)
if((world.time - MUSICIAN_HEARCHECK_MINDELAY) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/M in get_hearers_in_view(15, source))
if(!M.client || !(M.client.prefs.toggles & SOUND_INSTRUMENTS))
continue
LAZYADD(hearing_mobs, M)
last_hearcheck = world.time
var/sound/music_played = sound(soundfile)
for(var/i in hearing_mobs)
var/mob/M = i
M.playsound_local(source, null, 100, falloff = 5, S = music_played)
/datum/song/proc/updateDialog(mob/user)
instrumentObj.updateDialog() // assumes it's an object in world, override if otherwise
/datum/song/proc/shouldStopPlaying(mob/user)
if(instrumentObj)
if(!user.canUseTopic(instrumentObj))
return TRUE
return !instrumentObj.anchored // add special cases to stop in subclasses
else
return TRUE
/datum/song/proc/playsong(mob/user)
while(repeat >= 0)
var/cur_oct[7]
var/cur_acc[7]
for(var/i = 1 to 7)
cur_oct[i] = 3
cur_acc[i] = "n"
for(var/line in lines)
for(var/beat in splittext(lowertext(line), ","))
var/list/notes = splittext(beat, "/")
for(var/note in splittext(notes[1], "-"))
if(!playing || shouldStopPlaying(user))//If the instrument is playing, or special case
playing = FALSE
hearing_mobs = null
return
if(!length(note))
continue
var/cur_note = text2ascii(note) - 96
if(cur_note < 1 || cur_note > 7)
continue
for(var/i=2 to length(note))
var/ni = copytext(note,i,i+1)
if(!text2num(ni))
if(ni == "#" || ni == "b" || ni == "n")
cur_acc[cur_note] = ni
else if(ni == "s")
cur_acc[cur_note] = "#" // so shift is never required
else
cur_oct[cur_note] = text2num(ni)
if(user.dizziness > 0 && prob(user.dizziness / 2))
cur_note = CLAMP(cur_note + rand(round(-user.dizziness / 10), round(user.dizziness / 10)), 1, 7)
if(user.dizziness > 0 && prob(user.dizziness / 5))
if(prob(30))
cur_acc[cur_note] = "#"
else if(prob(42))
cur_acc[cur_note] = "b"
else if(prob(75))
cur_acc[cur_note] = "n"
playnote(cur_note, cur_acc[cur_note], cur_oct[cur_note])
if(notes.len >= 2 && text2num(notes[2]))
sleep(sanitize_tempo(tempo / text2num(notes[2])))
else
sleep(tempo)
repeat--
hearing_mobs = null
playing = FALSE
repeat = 0
updateDialog(user)
/datum/song/proc/interact(mob/user)
var/dat = ""
if(lines.len > 0)
dat += "<H3>Playback</H3>"
if(!playing)
dat += "<A href='?src=[REF(src)];play=1'>Play</A> <SPAN CLASS='linkOn'>Stop</SPAN><BR><BR>"
dat += "Repeat Song: "
dat += repeat > 0 ? "<A href='?src=[REF(src)];repeat=-10'>-</A><A href='?src=[REF(src)];repeat=-1'>-</A>" : "<SPAN CLASS='linkOff'>-</SPAN><SPAN CLASS='linkOff'>-</SPAN>"
dat += " [repeat] times "
dat += repeat < max_repeats ? "<A href='?src=[REF(src)];repeat=1'>+</A><A href='?src=[REF(src)];repeat=10'>+</A>" : "<SPAN CLASS='linkOff'>+</SPAN><SPAN CLASS='linkOff'>+</SPAN>"
dat += "<BR>"
else
dat += "<SPAN CLASS='linkOn'>Play</SPAN> <A href='?src=[REF(src)];stop=1'>Stop</A><BR>"
dat += "Repeats left: <B>[repeat]</B><BR>"
if(!edit)
dat += "<BR><B><A href='?src=[REF(src)];edit=2'>Show Editor</A></B><BR>"
else
dat += "<H3>Editing</H3>"
dat += "<B><A href='?src=[REF(src)];edit=1'>Hide Editor</A></B>"
dat += " <A href='?src=[REF(src)];newsong=1'>Start a New Song</A>"
dat += " <A href='?src=[REF(src)];import=1'>Import a Song</A><BR><BR>"
var/bpm = round(600 / tempo)
dat += "Tempo: <A href='?src=[REF(src)];tempo=[world.tick_lag]'>-</A> [bpm] BPM <A href='?src=[REF(src)];tempo=-[world.tick_lag]'>+</A><BR><BR>"
var/linecount = 0
for(var/line in lines)
linecount += 1
dat += "Line [linecount]: <A href='?src=[REF(src)];modifyline=[linecount]'>Edit</A> <A href='?src=[REF(src)];deleteline=[linecount]'>X</A> [line]<BR>"
dat += "<A href='?src=[REF(src)];newline=1'>Add Line</A><BR><BR>"
if(help)
dat += "<B><A href='?src=[REF(src)];help=1'>Hide Help</A></B><BR>"
dat += {"
Lines are a series of chords, separated by commas (,), each with notes separated by hyphens (-).<br>
Every note in a chord will play together, with chord timed by the tempo.<br>
<br>
Notes are played by the names of the note, and optionally, the accidental, and/or the octave number.<br>
By default, every note is natural and in octave 3. Defining otherwise is remembered for each note.<br>
Example: <i>C,D,E,F,G,A,B</i> will play a C major scale.<br>
After a note has an accidental placed, it will be remembered: <i>C,C4,C,C3</i> is <i>C3,C4,C4,C3</i><br>
Chords can be played simply by seperating each note with a hyphon: <i>A-C#,Cn-E,E-G#,Gn-B</i><br>
A pause may be denoted by an empty chord: <i>C,E,,C,G</i><br>
To make a chord be a different time, end it with /x, where the chord length will be length<br>
defined by tempo / x: <i>C,G/2,E/4</i><br>
Combined, an example is: <i>E-E4/4,F#/2,G#/8,B/8,E3-E4/4</i>
<br>
Lines may be up to [MUSIC_MAXLINECHARS] characters.<br>
A song may only contain up to [MUSIC_MAXLINES] lines.<br>
"}
else
dat += "<B><A href='?src=[REF(src)];help=2'>Show Help</A></B><BR>"
var/datum/browser/popup = new(user, "instrument", instrumentObj.name, 700, 500)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(instrumentObj.icon, instrumentObj.icon_state))
popup.open()
/datum/song/proc/ParseSong(text)
set waitfor = FALSE
//split into lines
lines = splittext(text, "\n")
if(lines.len)
if(copytext(lines[1],1,6) == "BPM: ")
tempo = sanitize_tempo(600 / text2num(copytext(lines[1],6)))
lines.Cut(1,2)
else
tempo = sanitize_tempo(5) // default 120 BPM
if(lines.len > MUSIC_MAXLINES)
to_chat(usr, "Too many lines!")
lines.Cut(MUSIC_MAXLINES + 1)
var/linenum = 1
for(var/l in lines)
if(length(l) > MUSIC_MAXLINECHARS)
to_chat(usr, "Line [linenum] too long!")
lines.Remove(l)
else
linenum++
updateDialog(usr) // make sure updates when complete
/datum/song/Topic(href, href_list)
if(!usr.canUseTopic(instrumentObj))
usr << browse(null, "window=instrument")
usr.unset_machine()
return
instrumentObj.add_fingerprint(usr)
if(href_list["newsong"])
lines = new()
tempo = sanitize_tempo(5) // default 120 BPM
name = ""
else if(href_list["import"])
var/t = ""
do
t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message)
if(!in_range(instrumentObj, usr))
return
if(length(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS)
var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no")
if(cont == "no")
break
while(length(t) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS)
ParseSong(t)
else if(href_list["help"])
help = text2num(href_list["help"]) - 1
else if(href_list["edit"])
edit = text2num(href_list["edit"]) - 1
if(href_list["repeat"]) //Changing this from a toggle to a number of repeats to avoid infinite loops.
if(playing)
return //So that people cant keep adding to repeat. If the do it intentionally, it could result in the server crashing.
repeat += round(text2num(href_list["repeat"]))
if(repeat < 0)
repeat = 0
if(repeat > max_repeats)
repeat = max_repeats
else if(href_list["tempo"])
tempo = sanitize_tempo(tempo + text2num(href_list["tempo"]))
else if(href_list["play"])
playing = TRUE
spawn()
playsong(usr)
else if(href_list["newline"])
var/newline = html_encode(input("Enter your line: ", instrumentObj.name) as text|null)
if(!newline || !in_range(instrumentObj, usr))
return
if(lines.len > MUSIC_MAXLINES)
return
if(length(newline) > MUSIC_MAXLINECHARS)
newline = copytext(newline, 1, MUSIC_MAXLINECHARS)
lines.Add(newline)
else if(href_list["deleteline"])
var/num = round(text2num(href_list["deleteline"]))
if(num > lines.len || num < 1)
return
lines.Cut(num, num+1)
else if(href_list["modifyline"])
var/num = round(text2num(href_list["modifyline"]),1)
var/content = html_encode(input("Enter your line: ", instrumentObj.name, lines[num]) as text|null)
if(!content || !in_range(instrumentObj, usr))
return
if(length(content) > MUSIC_MAXLINECHARS)
content = copytext(content, 1, MUSIC_MAXLINECHARS)
if(num > lines.len || num < 1)
return
lines[num] = content
else if(href_list["stop"])
playing = FALSE
hearing_mobs = null
updateDialog(usr)
return
/datum/song/proc/sanitize_tempo(new_tempo)
new_tempo = abs(new_tempo)
return max(round(new_tempo, world.tick_lag), world.tick_lag)
// subclass for handheld instruments, like violin
/datum/song/handheld
/datum/song/handheld/updateDialog(mob/user)
instrumentObj.interact(user)
/datum/song/handheld/shouldStopPlaying()
if(instrumentObj)
return !isliving(instrumentObj.loc)
else
return TRUE
//////////////////////////////////////////////////////////////////////////
/obj/structure/piano
name = "space minimoog"
icon = 'icons/obj/musician.dmi'
icon_state = "minimoog"
anchored = TRUE
density = TRUE
var/datum/song/song
/obj/structure/piano/unanchored
anchored = FALSE
/obj/structure/piano/New()
..()
song = new("piano", src)
if(prob(50) && icon_state == initial(icon_state))
name = "space minimoog"
desc = "This is a minimoog, like a space piano, but more spacey!"
icon_state = "minimoog"
else
name = "space piano"
desc = "This is a space piano, like a regular piano, but always in tune! Even if the musician isn't."
icon_state = "piano"
/obj/structure/piano/Destroy()
qdel(song)
song = null
return ..()
/obj/structure/piano/Initialize(mapload)
. = ..()
if(mapload)
song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded
/obj/structure/piano/attack_hand(mob/user)
. = ..()
if(.)
return
interact(user)
/obj/structure/piano/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/piano/interact(mob/user)
ui_interact(user)
/obj/structure/piano/ui_interact(mob/user)
if(!user || !anchored)
return
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 1
user.set_machine(src)
song.interact(user)
/obj/structure/piano/wrench_act(mob/living/user, obj/item/I)
default_unfasten_wrench(user, I, 40)
return TRUE
#define MUSICIAN_HEARCHECK_MINDELAY 4
#define MUSIC_MAXLINES 600
#define MUSIC_MAXLINECHARS 50
/datum/song
var/name = "Untitled"
var/list/lines = new()
var/tempo = 5 // delay between notes
var/playing = 0 // if we're playing
var/help = 0 // if help is open
var/edit = 1 // if we're in editing mode
var/repeat = 0 // number of times remaining to repeat
var/max_repeats = 10 // maximum times we can repeat
var/instrumentDir = "piano" // the folder with the sounds
var/instrumentExt = "ogg" // the file extension
var/obj/instrumentObj = null // the associated obj playing the sound
var/last_hearcheck = 0
var/list/hearing_mobs
/datum/song/New(dir, obj, ext = "ogg")
tempo = sanitize_tempo(tempo)
instrumentDir = dir
instrumentObj = obj
instrumentExt = ext
/datum/song/Destroy()
instrumentObj = null
return ..()
// note is a number from 1-7 for A-G
// acc is either "b", "n", or "#"
// oct is 1-8 (or 9 for C)
/datum/song/proc/playnote(note, acc as text, oct)
// handle accidental -> B<>C of E<>F
if(acc == "b" && (note == 3 || note == 6)) // C or F
if(note == 3)
oct--
note--
acc = "n"
else if(acc == "#" && (note == 2 || note == 5)) // B or E
if(note == 2)
oct++
note++
acc = "n"
else if(acc == "#" && (note == 7)) //G#
note = 1
acc = "b"
else if(acc == "#") // mass convert all sharps to flats, octave jump already handled
acc = "b"
note++
// check octave, C is allowed to go to 9
if(oct < 1 || (note == 3 ? oct > 9 : oct > 8))
return
// now generate name
var/soundfile = "sound/instruments/[instrumentDir]/[ascii2text(note+64)][acc][oct].[instrumentExt]"
soundfile = file(soundfile)
// make sure the note exists
if(!fexists(soundfile))
return
// and play
var/turf/source = get_turf(instrumentObj)
if((world.time - MUSICIAN_HEARCHECK_MINDELAY) > last_hearcheck)
LAZYCLEARLIST(hearing_mobs)
for(var/mob/M in get_hearers_in_view(15, source))
if(!M.client || !(M.client.prefs.toggles & SOUND_INSTRUMENTS))
continue
LAZYADD(hearing_mobs, M)
last_hearcheck = world.time
var/sound/music_played = sound(soundfile)
for(var/i in hearing_mobs)
var/mob/M = i
M.playsound_local(source, null, 100, falloff = 5, S = music_played)
/datum/song/proc/updateDialog(mob/user)
instrumentObj.updateDialog() // assumes it's an object in world, override if otherwise
/datum/song/proc/shouldStopPlaying(mob/user)
if(instrumentObj)
if(!user.canUseTopic(instrumentObj))
return TRUE
return !instrumentObj.anchored // add special cases to stop in subclasses
else
return TRUE
/datum/song/proc/playsong(mob/user)
while(repeat >= 0)
var/cur_oct[7]
var/cur_acc[7]
for(var/i = 1 to 7)
cur_oct[i] = 3
cur_acc[i] = "n"
for(var/line in lines)
for(var/beat in splittext(lowertext(line), ","))
var/list/notes = splittext(beat, "/")
for(var/note in splittext(notes[1], "-"))
if(!playing || shouldStopPlaying(user))//If the instrument is playing, or special case
playing = FALSE
hearing_mobs = null
return
if(!length(note))
continue
var/cur_note = text2ascii(note) - 96
if(cur_note < 1 || cur_note > 7)
continue
for(var/i=2 to length(note))
var/ni = copytext(note,i,i+1)
if(!text2num(ni))
if(ni == "#" || ni == "b" || ni == "n")
cur_acc[cur_note] = ni
else if(ni == "s")
cur_acc[cur_note] = "#" // so shift is never required
else
cur_oct[cur_note] = text2num(ni)
if(user.dizziness > 0 && prob(user.dizziness / 2))
cur_note = CLAMP(cur_note + rand(round(-user.dizziness / 10), round(user.dizziness / 10)), 1, 7)
if(user.dizziness > 0 && prob(user.dizziness / 5))
if(prob(30))
cur_acc[cur_note] = "#"
else if(prob(42))
cur_acc[cur_note] = "b"
else if(prob(75))
cur_acc[cur_note] = "n"
playnote(cur_note, cur_acc[cur_note], cur_oct[cur_note])
if(notes.len >= 2 && text2num(notes[2]))
sleep(sanitize_tempo(tempo / text2num(notes[2])))
else
sleep(tempo)
repeat--
hearing_mobs = null
playing = FALSE
repeat = 0
updateDialog(user)
/datum/song/proc/interact(mob/user)
var/dat = ""
if(lines.len > 0)
dat += "<H3>Playback</H3>"
if(!playing)
dat += "<A href='?src=[REF(src)];play=1'>Play</A> <SPAN CLASS='linkOn'>Stop</SPAN><BR><BR>"
dat += "Repeat Song: "
dat += repeat > 0 ? "<A href='?src=[REF(src)];repeat=-10'>-</A><A href='?src=[REF(src)];repeat=-1'>-</A>" : "<SPAN CLASS='linkOff'>-</SPAN><SPAN CLASS='linkOff'>-</SPAN>"
dat += " [repeat] times "
dat += repeat < max_repeats ? "<A href='?src=[REF(src)];repeat=1'>+</A><A href='?src=[REF(src)];repeat=10'>+</A>" : "<SPAN CLASS='linkOff'>+</SPAN><SPAN CLASS='linkOff'>+</SPAN>"
dat += "<BR>"
else
dat += "<SPAN CLASS='linkOn'>Play</SPAN> <A href='?src=[REF(src)];stop=1'>Stop</A><BR>"
dat += "Repeats left: <B>[repeat]</B><BR>"
if(!edit)
dat += "<BR><B><A href='?src=[REF(src)];edit=2'>Show Editor</A></B><BR>"
else
dat += "<H3>Editing</H3>"
dat += "<B><A href='?src=[REF(src)];edit=1'>Hide Editor</A></B>"
dat += " <A href='?src=[REF(src)];newsong=1'>Start a New Song</A>"
dat += " <A href='?src=[REF(src)];import=1'>Import a Song</A><BR><BR>"
var/bpm = round(600 / tempo)
dat += "Tempo: <A href='?src=[REF(src)];tempo=[world.tick_lag]'>-</A> [bpm] BPM <A href='?src=[REF(src)];tempo=-[world.tick_lag]'>+</A><BR><BR>"
var/linecount = 0
for(var/line in lines)
linecount += 1
dat += "Line [linecount]: <A href='?src=[REF(src)];modifyline=[linecount]'>Edit</A> <A href='?src=[REF(src)];deleteline=[linecount]'>X</A> [line]<BR>"
dat += "<A href='?src=[REF(src)];newline=1'>Add Line</A><BR><BR>"
if(help)
dat += "<B><A href='?src=[REF(src)];help=1'>Hide Help</A></B><BR>"
dat += {"
Lines are a series of chords, separated by commas (,), each with notes separated by hyphens (-).<br>
Every note in a chord will play together, with chord timed by the tempo.<br>
<br>
Notes are played by the names of the note, and optionally, the accidental, and/or the octave number.<br>
By default, every note is natural and in octave 3. Defining otherwise is remembered for each note.<br>
Example: <i>C,D,E,F,G,A,B</i> will play a C major scale.<br>
After a note has an accidental placed, it will be remembered: <i>C,C4,C,C3</i> is <i>C3,C4,C4,C3</i><br>
Chords can be played simply by seperating each note with a hyphon: <i>A-C#,Cn-E,E-G#,Gn-B</i><br>
A pause may be denoted by an empty chord: <i>C,E,,C,G</i><br>
To make a chord be a different time, end it with /x, where the chord length will be length<br>
defined by tempo / x: <i>C,G/2,E/4</i><br>
Combined, an example is: <i>E-E4/4,F#/2,G#/8,B/8,E3-E4/4</i>
<br>
Lines may be up to [MUSIC_MAXLINECHARS] characters.<br>
A song may only contain up to [MUSIC_MAXLINES] lines.<br>
"}
else
dat += "<B><A href='?src=[REF(src)];help=2'>Show Help</A></B><BR>"
var/datum/browser/popup = new(user, "instrument", instrumentObj.name, 700, 500)
popup.set_content(dat)
popup.set_title_image(user.browse_rsc_icon(instrumentObj.icon, instrumentObj.icon_state))
popup.open()
/datum/song/proc/ParseSong(text)
set waitfor = FALSE
//split into lines
lines = splittext(text, "\n")
if(lines.len)
if(copytext(lines[1],1,6) == "BPM: ")
tempo = sanitize_tempo(600 / text2num(copytext(lines[1],6)))
lines.Cut(1,2)
else
tempo = sanitize_tempo(5) // default 120 BPM
if(lines.len > MUSIC_MAXLINES)
to_chat(usr, "Too many lines!")
lines.Cut(MUSIC_MAXLINES + 1)
var/linenum = 1
for(var/l in lines)
if(length(l) > MUSIC_MAXLINECHARS)
to_chat(usr, "Line [linenum] too long!")
lines.Remove(l)
else
linenum++
updateDialog(usr) // make sure updates when complete
/datum/song/Topic(href, href_list)
if(!usr.canUseTopic(instrumentObj))
usr << browse(null, "window=instrument")
usr.unset_machine()
return
instrumentObj.add_fingerprint(usr)
if(href_list["newsong"])
lines = new()
tempo = sanitize_tempo(5) // default 120 BPM
name = ""
else if(href_list["import"])
var/t = ""
do
t = html_encode(input(usr, "Please paste the entire song, formatted:", text("[]", name), t) as message)
if(!in_range(instrumentObj, usr))
return
if(length(t) >= MUSIC_MAXLINES * MUSIC_MAXLINECHARS)
var/cont = input(usr, "Your message is too long! Would you like to continue editing it?", "", "yes") in list("yes", "no")
if(cont == "no")
break
while(length(t) > MUSIC_MAXLINES * MUSIC_MAXLINECHARS)
ParseSong(t)
else if(href_list["help"])
help = text2num(href_list["help"]) - 1
else if(href_list["edit"])
edit = text2num(href_list["edit"]) - 1
if(href_list["repeat"]) //Changing this from a toggle to a number of repeats to avoid infinite loops.
if(playing)
return //So that people cant keep adding to repeat. If the do it intentionally, it could result in the server crashing.
repeat += round(text2num(href_list["repeat"]))
if(repeat < 0)
repeat = 0
if(repeat > max_repeats)
repeat = max_repeats
else if(href_list["tempo"])
tempo = sanitize_tempo(tempo + text2num(href_list["tempo"]))
else if(href_list["play"])
playing = TRUE
spawn()
playsong(usr)
else if(href_list["newline"])
var/newline = html_encode(input("Enter your line: ", instrumentObj.name) as text|null)
if(!newline || !in_range(instrumentObj, usr))
return
if(lines.len > MUSIC_MAXLINES)
return
if(length(newline) > MUSIC_MAXLINECHARS)
newline = copytext(newline, 1, MUSIC_MAXLINECHARS)
lines.Add(newline)
else if(href_list["deleteline"])
var/num = round(text2num(href_list["deleteline"]))
if(num > lines.len || num < 1)
return
lines.Cut(num, num+1)
else if(href_list["modifyline"])
var/num = round(text2num(href_list["modifyline"]),1)
var/content = html_encode(input("Enter your line: ", instrumentObj.name, lines[num]) as text|null)
if(!content || !in_range(instrumentObj, usr))
return
if(length(content) > MUSIC_MAXLINECHARS)
content = copytext(content, 1, MUSIC_MAXLINECHARS)
if(num > lines.len || num < 1)
return
lines[num] = content
else if(href_list["stop"])
playing = FALSE
hearing_mobs = null
updateDialog(usr)
return
/datum/song/proc/sanitize_tempo(new_tempo)
new_tempo = abs(new_tempo)
return max(round(new_tempo, world.tick_lag), world.tick_lag)
// subclass for handheld instruments, like violin
/datum/song/handheld
/datum/song/handheld/updateDialog(mob/user)
instrumentObj.interact(user)
/datum/song/handheld/shouldStopPlaying()
if(instrumentObj)
return !isliving(instrumentObj.loc)
else
return TRUE
//////////////////////////////////////////////////////////////////////////
/obj/structure/piano
name = "space minimoog"
icon = 'icons/obj/musician.dmi'
icon_state = "minimoog"
anchored = TRUE
density = TRUE
var/datum/song/song
/obj/structure/piano/unanchored
anchored = FALSE
/obj/structure/piano/New()
..()
song = new("piano", src)
if(prob(50) && icon_state == initial(icon_state))
name = "space minimoog"
desc = "This is a minimoog, like a space piano, but more spacey!"
icon_state = "minimoog"
else
name = "space piano"
desc = "This is a space piano, like a regular piano, but always in tune! Even if the musician isn't."
icon_state = "piano"
/obj/structure/piano/Destroy()
qdel(song)
song = null
return ..()
/obj/structure/piano/Initialize(mapload)
. = ..()
if(mapload)
song.tempo = song.sanitize_tempo(song.tempo) // tick_lag isn't set when the map is loaded
/obj/structure/piano/attack_hand(mob/user)
. = ..()
if(.)
return
interact(user)
/obj/structure/piano/attack_paw(mob/user)
return attack_hand(user)
/obj/structure/piano/interact(mob/user)
ui_interact(user)
/obj/structure/piano/ui_interact(mob/user)
if(!user || !anchored)
return
if(!user.IsAdvancedToolUser())
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 1
user.set_machine(src)
song.interact(user)
/obj/structure/piano/wrench_act(mob/living/user, obj/item/I)
default_unfasten_wrench(user, I, 40)
return TRUE
+132 -132
View File
@@ -1,132 +1,132 @@
/obj/structure/noticeboard
name = "notice board"
desc = "A board for pinning important notices upon."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "nboard00"
density = FALSE
anchored = TRUE
max_integrity = 150
var/notices = 0
/obj/structure/noticeboard/Initialize(mapload)
. = ..()
if(!mapload)
return
for(var/obj/item/I in loc)
if(notices > 4)
break
if(istype(I, /obj/item/paper))
I.forceMove(src)
notices++
icon_state = "nboard0[notices]"
//attaching papers!!
/obj/structure/noticeboard/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/paper) || istype(O, /obj/item/photo))
if(!allowed(user))
to_chat(user, "<span class='info'>You are not authorized to add notices</span>")
return
if(notices < 5)
if(!user.transferItemToLoc(O, src))
return
notices++
icon_state = "nboard0[notices]"
to_chat(user, "<span class='notice'>You pin the [O] to the noticeboard.</span>")
else
to_chat(user, "<span class='notice'>The notice board is full</span>")
else
return ..()
/obj/structure/noticeboard/interact(mob/user)
ui_interact(user)
/obj/structure/noticeboard/ui_interact(mob/user)
. = ..()
var/auth = allowed(user)
var/dat = "<B>[name]</B><BR>"
for(var/obj/item/P in src)
if(istype(P, /obj/item/paper))
dat += "<A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A> [auth ? "<A href='?src=[REF(src)];write=[REF(P)]'>Write</A> <A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A>" : ""]<BR>"
else
dat += "<A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A> [auth ? "<A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A>" : ""]<BR>"
user << browse("<HEAD><TITLE>Notices</TITLE></HEAD>[dat]","window=noticeboard")
onclose(user, "noticeboard")
/obj/structure/noticeboard/Topic(href, href_list)
..()
usr.set_machine(src)
if(href_list["remove"])
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
return
var/obj/item/I = locate(href_list["remove"]) in contents
if(istype(I) && I.loc == src)
I.forceMove(usr.loc)
usr.put_in_hands(I)
notices--
icon_state = "nboard0[notices]"
if(href_list["write"])
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
return
var/obj/item/P = locate(href_list["write"]) in contents
if(istype(P) && P.loc == src)
var/obj/item/I = usr.is_holding_item_of_type(/obj/item/pen)
if(I)
add_fingerprint(usr)
P.attackby(I, usr)
else
to_chat(usr, "<span class='notice'>You'll need something to write with!</span>")
if(href_list["read"])
var/obj/item/I = locate(href_list["read"]) in contents
if(istype(I) && I.loc == src)
usr.examinate(I)
/obj/structure/noticeboard/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
new /obj/item/stack/sheet/metal (loc, 1)
qdel(src)
// Notice boards for the heads of staff (plus the qm)
/obj/structure/noticeboard/captain
name = "Captain's Notice Board"
desc = "Important notices from the Captain."
req_access = list(ACCESS_CAPTAIN)
/obj/structure/noticeboard/hop
name = "Head of Personnel's Notice Board"
desc = "Important notices from the Head of Personnel."
req_access = list(ACCESS_HOP)
/obj/structure/noticeboard/ce
name = "Chief Engineer's Notice Board"
desc = "Important notices from the Chief Engineer."
req_access = list(ACCESS_CE)
/obj/structure/noticeboard/hos
name = "Head of Security's Notice Board"
desc = "Important notices from the Head of Security."
req_access = list(ACCESS_HOS)
/obj/structure/noticeboard/cmo
name = "Chief Medical Officer's Notice Board"
desc = "Important notices from the Chief Medical Officer."
req_access = list(ACCESS_CMO)
/obj/structure/noticeboard/rd
name = "Research Director's Notice Board"
desc = "Important notices from the Research Director."
req_access = list(ACCESS_RD)
/obj/structure/noticeboard/qm
name = "Quartermaster's Notice Board"
desc = "Important notices from the Quartermaster."
req_access = list(ACCESS_QM)
/obj/structure/noticeboard/staff
name = "Staff Notice Board"
desc = "Important notices from the heads of staff."
req_access = list(ACCESS_HEADS)
/obj/structure/noticeboard
name = "notice board"
desc = "A board for pinning important notices upon."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "nboard00"
density = FALSE
anchored = TRUE
max_integrity = 150
var/notices = 0
/obj/structure/noticeboard/Initialize(mapload)
. = ..()
if(!mapload)
return
for(var/obj/item/I in loc)
if(notices > 4)
break
if(istype(I, /obj/item/paper))
I.forceMove(src)
notices++
icon_state = "nboard0[notices]"
//attaching papers!!
/obj/structure/noticeboard/attackby(obj/item/O, mob/user, params)
if(istype(O, /obj/item/paper) || istype(O, /obj/item/photo))
if(!allowed(user))
to_chat(user, "<span class='info'>You are not authorized to add notices</span>")
return
if(notices < 5)
if(!user.transferItemToLoc(O, src))
return
notices++
icon_state = "nboard0[notices]"
to_chat(user, "<span class='notice'>You pin the [O] to the noticeboard.</span>")
else
to_chat(user, "<span class='notice'>The notice board is full</span>")
else
return ..()
/obj/structure/noticeboard/interact(mob/user)
ui_interact(user)
/obj/structure/noticeboard/ui_interact(mob/user)
. = ..()
var/auth = allowed(user)
var/dat = "<B>[name]</B><BR>"
for(var/obj/item/P in src)
if(istype(P, /obj/item/paper))
dat += "<A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A> [auth ? "<A href='?src=[REF(src)];write=[REF(P)]'>Write</A> <A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A>" : ""]<BR>"
else
dat += "<A href='?src=[REF(src)];read=[REF(P)]'>[P.name]</A> [auth ? "<A href='?src=[REF(src)];remove=[REF(P)]'>Remove</A>" : ""]<BR>"
user << browse("<HEAD><TITLE>Notices</TITLE></HEAD>[dat]","window=noticeboard")
onclose(user, "noticeboard")
/obj/structure/noticeboard/Topic(href, href_list)
..()
usr.set_machine(src)
if(href_list["remove"])
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
return
var/obj/item/I = locate(href_list["remove"]) in contents
if(istype(I) && I.loc == src)
I.forceMove(usr.loc)
usr.put_in_hands(I)
notices--
icon_state = "nboard0[notices]"
if(href_list["write"])
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
return
var/obj/item/P = locate(href_list["write"]) in contents
if(istype(P) && P.loc == src)
var/obj/item/I = usr.is_holding_item_of_type(/obj/item/pen)
if(I)
add_fingerprint(usr)
P.attackby(I, usr)
else
to_chat(usr, "<span class='notice'>You'll need something to write with!</span>")
if(href_list["read"])
var/obj/item/I = locate(href_list["read"]) in contents
if(istype(I) && I.loc == src)
usr.examinate(I)
/obj/structure/noticeboard/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
new /obj/item/stack/sheet/metal (loc, 1)
qdel(src)
// Notice boards for the heads of staff (plus the qm)
/obj/structure/noticeboard/captain
name = "Captain's Notice Board"
desc = "Important notices from the Captain."
req_access = list(ACCESS_CAPTAIN)
/obj/structure/noticeboard/hop
name = "Head of Personnel's Notice Board"
desc = "Important notices from the Head of Personnel."
req_access = list(ACCESS_HOP)
/obj/structure/noticeboard/ce
name = "Chief Engineer's Notice Board"
desc = "Important notices from the Chief Engineer."
req_access = list(ACCESS_CE)
/obj/structure/noticeboard/hos
name = "Head of Security's Notice Board"
desc = "Important notices from the Head of Security."
req_access = list(ACCESS_HOS)
/obj/structure/noticeboard/cmo
name = "Chief Medical Officer's Notice Board"
desc = "Important notices from the Chief Medical Officer."
req_access = list(ACCESS_CMO)
/obj/structure/noticeboard/rd
name = "Research Director's Notice Board"
desc = "Important notices from the Research Director."
req_access = list(ACCESS_RD)
/obj/structure/noticeboard/qm
name = "Quartermaster's Notice Board"
desc = "Important notices from the Quartermaster."
req_access = list(ACCESS_QM)
/obj/structure/noticeboard/staff
name = "Staff Notice Board"
desc = "Important notices from the heads of staff."
req_access = list(ACCESS_HEADS)
+211 -211
View File
@@ -1,211 +1,211 @@
/*
CONTAINS:
SAFES
FLOOR SAFES
*/
//SAFES
/obj/structure/safe
name = "safe"
desc = "A huge chunk of metal with a dial embedded in it. Fine print on the dial reads \"Scarborough Arms - 2 tumbler safe, guaranteed thermite resistant, explosion resistant, and assistant resistant.\""
icon = 'icons/obj/structures.dmi'
icon_state = "safe"
anchored = TRUE
density = TRUE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT
var/open = FALSE //is the safe open?
var/tumbler_1_pos //the tumbler position- from 0 to 72
var/tumbler_1_open //the tumbler position to open at- 0 to 72
var/tumbler_2_pos
var/tumbler_2_open
var/dial = 0 //where is the dial pointing?
var/space = 0 //the combined w_class of everything in the safe
var/maxspace = 24 //the maximum combined w_class of stuff in the safe
var/explosion_count = 0 //Tough, but breakable
/obj/structure/safe/New()
..()
tumbler_1_pos = rand(0, 71)
tumbler_1_open = rand(0, 71)
tumbler_2_pos = rand(0, 71)
tumbler_2_open = rand(0, 71)
/obj/structure/safe/Initialize(mapload)
. = ..()
if(!mapload)
return
for(var/obj/item/I in loc)
if(space >= maxspace)
return
if(I.w_class + space <= maxspace)
space += I.w_class
I.forceMove(src)
/obj/structure/safe/proc/check_unlocked(mob/user, canhear)
if(explosion_count > 2)
return 1
if(user && canhear)
if(tumbler_1_pos == tumbler_1_open)
to_chat(user, "<span class='italics'>You hear a [pick("tonk", "krunk", "plunk")] from [src].</span>")
if(tumbler_2_pos == tumbler_2_open)
to_chat(user, "<span class='italics'>You hear a [pick("tink", "krink", "plink")] from [src].</span>")
if(tumbler_1_pos == tumbler_1_open && tumbler_2_pos == tumbler_2_open)
if(user)
visible_message("<i><b>[pick("Spring", "Sprang", "Sproing", "Clunk", "Krunk")]!</b></i>")
return TRUE
return FALSE
/obj/structure/safe/proc/decrement(num)
num -= 1
if(num < 0)
num = 71
return num
/obj/structure/safe/proc/increment(num)
num += 1
if(num > 71)
num = 0
return num
/obj/structure/safe/update_icon()
if(open)
icon_state = "[initial(icon_state)]-open"
else
icon_state = initial(icon_state)
/obj/structure/safe/ui_interact(mob/user)
user.set_machine(src)
var/dat = "<center>"
dat += "<a href='?src=[REF(src)];open=1'>[open ? "Close" : "Open"] [src]</a> | <a href='?src=[REF(src)];decrement=1'>-</a> [dial] <a href='?src=[REF(src)];increment=1'>+</a>"
if(open)
dat += "<table>"
for(var/i = contents.len, i>=1, i--)
var/obj/item/P = contents[i]
dat += "<tr><td><a href='?src=[REF(src)];retrieve=[REF(P)]'>[P.name]</a></td></tr>"
dat += "</table></center>"
user << browse("<html><head><title>[name]</title></head><body>[dat]</body></html>", "window=safe;size=350x300")
/obj/structure/safe/Topic(href, href_list)
if(!ishuman(usr))
return
var/mob/living/carbon/human/user = usr
if(!user.canUseTopic(src))
return
var/canhear = FALSE
if(user.is_holding_item_of_type(/obj/item/clothing/neck/stethoscope))
canhear = TRUE
if(href_list["open"])
if(check_unlocked())
to_chat(user, "<span class='notice'>You [open ? "close" : "open"] [src].</span>")
open = !open
update_icon()
updateUsrDialog()
return
else
to_chat(user, "<span class='warning'>You can't [open ? "close" : "open"] [src], the lock is engaged!</span>")
return
if(href_list["decrement"])
dial = decrement(dial)
if(dial == tumbler_1_pos + 1 || dial == tumbler_1_pos - 71)
tumbler_1_pos = decrement(tumbler_1_pos)
if(canhear)
to_chat(user, "<span class='italics'>You hear a [pick("clack", "scrape", "clank")] from [src].</span>")
if(tumbler_1_pos == tumbler_2_pos + 37 || tumbler_1_pos == tumbler_2_pos - 35)
tumbler_2_pos = decrement(tumbler_2_pos)
if(canhear)
to_chat(user, "<span class='italics'>You hear a [pick("click", "chink", "clink")] from [src].</span>")
check_unlocked(user, canhear)
updateUsrDialog()
return
if(href_list["increment"])
dial = increment(dial)
if(dial == tumbler_1_pos - 1 || dial == tumbler_1_pos + 71)
tumbler_1_pos = increment(tumbler_1_pos)
if(canhear)
to_chat(user, "<span class='italics'>You hear a [pick("clack", "scrape", "clank")] from [src].</span>")
if(tumbler_1_pos == tumbler_2_pos - 37 || tumbler_1_pos == tumbler_2_pos + 35)
tumbler_2_pos = increment(tumbler_2_pos)
if(canhear)
to_chat(user, "<span class='italics'>You hear a [pick("click", "chink", "clink")] from [src].</span>")
check_unlocked(user, canhear)
updateUsrDialog()
return
if(href_list["retrieve"])
user << browse("", "window=safe") // Close the menu
var/obj/item/P = locate(href_list["retrieve"]) in src
if(open)
if(P && in_range(src, user))
user.put_in_hands(P)
space -= P.w_class
updateUsrDialog()
/obj/structure/safe/attackby(obj/item/I, mob/user, params)
if(open)
. = 1 //no afterattack
if(I.w_class + space <= maxspace)
space += I.w_class
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the safe!</span>")
return
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
updateUsrDialog()
return
else
to_chat(user, "<span class='notice'>[I] won't fit in [src].</span>")
return
else if(istype(I, /obj/item/clothing/neck/stethoscope))
to_chat(user, "<span class='warning'>Hold [I] in one of your hands while you manipulate the dial!</span>")
else
return ..()
/obj/structure/safe/handle_atom_del(atom/A)
updateUsrDialog()
/obj/structure/safe/blob_act(obj/structure/blob/B)
return
/obj/structure/safe/ex_act(severity, target)
if(((severity == 2 && target == src) || severity == 1) && explosion_count < 3)
explosion_count++
switch(explosion_count)
if(1)
desc = initial(desc) + "\nIt looks a little banged up."
if(2)
desc = initial(desc) + "\nIt's pretty heavily damaged."
if(3)
desc = initial(desc) + "\nThe lock seems to be broken."
//FLOOR SAFES
/obj/structure/safe/floor
name = "floor safe"
icon_state = "floorsafe"
density = FALSE
level = 1 //underfloor
layer = LOW_OBJ_LAYER
/obj/structure/safe/floor/Initialize(mapload)
. = ..()
if(mapload)
var/turf/T = loc
hide(T.intact)
/obj/structure/safe/floor/hide(var/intact)
invisibility = intact ? INVISIBILITY_MAXIMUM : 0
/*
CONTAINS:
SAFES
FLOOR SAFES
*/
//SAFES
/obj/structure/safe
name = "safe"
desc = "A huge chunk of metal with a dial embedded in it. Fine print on the dial reads \"Scarborough Arms - 2 tumbler safe, guaranteed thermite resistant, explosion resistant, and assistant resistant.\""
icon = 'icons/obj/structures.dmi'
icon_state = "safe"
anchored = TRUE
density = TRUE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF
interaction_flags_atom = INTERACT_ATOM_ATTACK_HAND | INTERACT_ATOM_UI_INTERACT
var/open = FALSE //is the safe open?
var/tumbler_1_pos //the tumbler position- from 0 to 72
var/tumbler_1_open //the tumbler position to open at- 0 to 72
var/tumbler_2_pos
var/tumbler_2_open
var/dial = 0 //where is the dial pointing?
var/space = 0 //the combined w_class of everything in the safe
var/maxspace = 24 //the maximum combined w_class of stuff in the safe
var/explosion_count = 0 //Tough, but breakable
/obj/structure/safe/New()
..()
tumbler_1_pos = rand(0, 71)
tumbler_1_open = rand(0, 71)
tumbler_2_pos = rand(0, 71)
tumbler_2_open = rand(0, 71)
/obj/structure/safe/Initialize(mapload)
. = ..()
if(!mapload)
return
for(var/obj/item/I in loc)
if(space >= maxspace)
return
if(I.w_class + space <= maxspace)
space += I.w_class
I.forceMove(src)
/obj/structure/safe/proc/check_unlocked(mob/user, canhear)
if(explosion_count > 2)
return 1
if(user && canhear)
if(tumbler_1_pos == tumbler_1_open)
to_chat(user, "<span class='italics'>You hear a [pick("tonk", "krunk", "plunk")] from [src].</span>")
if(tumbler_2_pos == tumbler_2_open)
to_chat(user, "<span class='italics'>You hear a [pick("tink", "krink", "plink")] from [src].</span>")
if(tumbler_1_pos == tumbler_1_open && tumbler_2_pos == tumbler_2_open)
if(user)
visible_message("<i><b>[pick("Spring", "Sprang", "Sproing", "Clunk", "Krunk")]!</b></i>")
return TRUE
return FALSE
/obj/structure/safe/proc/decrement(num)
num -= 1
if(num < 0)
num = 71
return num
/obj/structure/safe/proc/increment(num)
num += 1
if(num > 71)
num = 0
return num
/obj/structure/safe/update_icon()
if(open)
icon_state = "[initial(icon_state)]-open"
else
icon_state = initial(icon_state)
/obj/structure/safe/ui_interact(mob/user)
user.set_machine(src)
var/dat = "<center>"
dat += "<a href='?src=[REF(src)];open=1'>[open ? "Close" : "Open"] [src]</a> | <a href='?src=[REF(src)];decrement=1'>-</a> [dial] <a href='?src=[REF(src)];increment=1'>+</a>"
if(open)
dat += "<table>"
for(var/i = contents.len, i>=1, i--)
var/obj/item/P = contents[i]
dat += "<tr><td><a href='?src=[REF(src)];retrieve=[REF(P)]'>[P.name]</a></td></tr>"
dat += "</table></center>"
user << browse("<html><head><title>[name]</title></head><body>[dat]</body></html>", "window=safe;size=350x300")
/obj/structure/safe/Topic(href, href_list)
if(!ishuman(usr))
return
var/mob/living/carbon/human/user = usr
if(!user.canUseTopic(src))
return
var/canhear = FALSE
if(user.is_holding_item_of_type(/obj/item/clothing/neck/stethoscope))
canhear = TRUE
if(href_list["open"])
if(check_unlocked())
to_chat(user, "<span class='notice'>You [open ? "close" : "open"] [src].</span>")
open = !open
update_icon()
updateUsrDialog()
return
else
to_chat(user, "<span class='warning'>You can't [open ? "close" : "open"] [src], the lock is engaged!</span>")
return
if(href_list["decrement"])
dial = decrement(dial)
if(dial == tumbler_1_pos + 1 || dial == tumbler_1_pos - 71)
tumbler_1_pos = decrement(tumbler_1_pos)
if(canhear)
to_chat(user, "<span class='italics'>You hear a [pick("clack", "scrape", "clank")] from [src].</span>")
if(tumbler_1_pos == tumbler_2_pos + 37 || tumbler_1_pos == tumbler_2_pos - 35)
tumbler_2_pos = decrement(tumbler_2_pos)
if(canhear)
to_chat(user, "<span class='italics'>You hear a [pick("click", "chink", "clink")] from [src].</span>")
check_unlocked(user, canhear)
updateUsrDialog()
return
if(href_list["increment"])
dial = increment(dial)
if(dial == tumbler_1_pos - 1 || dial == tumbler_1_pos + 71)
tumbler_1_pos = increment(tumbler_1_pos)
if(canhear)
to_chat(user, "<span class='italics'>You hear a [pick("clack", "scrape", "clank")] from [src].</span>")
if(tumbler_1_pos == tumbler_2_pos - 37 || tumbler_1_pos == tumbler_2_pos + 35)
tumbler_2_pos = increment(tumbler_2_pos)
if(canhear)
to_chat(user, "<span class='italics'>You hear a [pick("click", "chink", "clink")] from [src].</span>")
check_unlocked(user, canhear)
updateUsrDialog()
return
if(href_list["retrieve"])
user << browse("", "window=safe") // Close the menu
var/obj/item/P = locate(href_list["retrieve"]) in src
if(open)
if(P && in_range(src, user))
user.put_in_hands(P)
space -= P.w_class
updateUsrDialog()
/obj/structure/safe/attackby(obj/item/I, mob/user, params)
if(open)
. = 1 //no afterattack
if(I.w_class + space <= maxspace)
space += I.w_class
if(!user.transferItemToLoc(I, src))
to_chat(user, "<span class='warning'>\The [I] is stuck to your hand, you cannot put it in the safe!</span>")
return
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
updateUsrDialog()
return
else
to_chat(user, "<span class='notice'>[I] won't fit in [src].</span>")
return
else if(istype(I, /obj/item/clothing/neck/stethoscope))
to_chat(user, "<span class='warning'>Hold [I] in one of your hands while you manipulate the dial!</span>")
else
return ..()
/obj/structure/safe/handle_atom_del(atom/A)
updateUsrDialog()
/obj/structure/safe/blob_act(obj/structure/blob/B)
return
/obj/structure/safe/ex_act(severity, target)
if(((severity == 2 && target == src) || severity == 1) && explosion_count < 3)
explosion_count++
switch(explosion_count)
if(1)
desc = initial(desc) + "\nIt looks a little banged up."
if(2)
desc = initial(desc) + "\nIt's pretty heavily damaged."
if(3)
desc = initial(desc) + "\nThe lock seems to be broken."
//FLOOR SAFES
/obj/structure/safe/floor
name = "floor safe"
icon_state = "floorsafe"
density = FALSE
level = 1 //underfloor
layer = LOW_OBJ_LAYER
/obj/structure/safe/floor/Initialize(mapload)
. = ..()
if(mapload)
var/turf/T = loc
hide(T.intact)
/obj/structure/safe/floor/hide(var/intact)
invisibility = intact ? INVISIBILITY_MAXIMUM : 0
File diff suppressed because it is too large Load Diff
+111 -111
View File
@@ -1,111 +1,111 @@
#define TANK_DISPENSER_CAPACITY 10
/obj/structure/tank_dispenser
name = "tank dispenser"
desc = "A simple yet bulky storage device for gas tanks. Holds up to 10 oxygen tanks and 10 plasma tanks."
icon = 'icons/obj/objects.dmi'
icon_state = "dispenser"
density = TRUE
anchored = TRUE
max_integrity = 300
var/oxygentanks = TANK_DISPENSER_CAPACITY
var/plasmatanks = TANK_DISPENSER_CAPACITY
/obj/structure/tank_dispenser/oxygen
plasmatanks = 0
/obj/structure/tank_dispenser/plasma
oxygentanks = 0
/obj/structure/tank_dispenser/Initialize()
. = ..()
for(var/i in 1 to oxygentanks)
new /obj/item/tank/internals/oxygen(src)
for(var/i in 1 to plasmatanks)
new /obj/item/tank/internals/plasma(src)
update_icon()
/obj/structure/tank_dispenser/update_icon()
cut_overlays()
switch(oxygentanks)
if(1 to 3)
add_overlay("oxygen-[oxygentanks]")
if(4 to TANK_DISPENSER_CAPACITY)
add_overlay("oxygen-4")
switch(plasmatanks)
if(1 to 4)
add_overlay("plasma-[plasmatanks]")
if(5 to TANK_DISPENSER_CAPACITY)
add_overlay("plasma-5")
/obj/structure/tank_dispenser/attackby(obj/item/I, mob/user, params)
var/full
if(istype(I, /obj/item/tank/internals/plasma))
if(plasmatanks < TANK_DISPENSER_CAPACITY)
plasmatanks++
else
full = TRUE
else if(istype(I, /obj/item/tank/internals/oxygen))
if(oxygentanks < TANK_DISPENSER_CAPACITY)
oxygentanks++
else
full = TRUE
else if(istype(I, /obj/item/wrench))
default_unfasten_wrench(user, I, time = 20)
return
else if(user.a_intent != INTENT_HARM)
to_chat(user, "<span class='notice'>[I] does not fit into [src].</span>")
return
else
return ..()
if(full)
to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>")
return
if(!user.transferItemToLoc(I, src))
return
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon()
/obj/structure/tank_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "tank_dispenser", name, 275, 100, master_ui, state)
ui.open()
/obj/structure/tank_dispenser/ui_data(mob/user)
var/list/data = list()
data["oxygen"] = oxygentanks
data["plasma"] = plasmatanks
return data
/obj/structure/tank_dispenser/ui_act(action, params)
if(..())
return
switch(action)
if("plasma")
var/obj/item/tank/internals/plasma/tank = locate() in src
if(tank && Adjacent(usr))
usr.put_in_hands(tank)
plasmatanks--
. = TRUE
if("oxygen")
var/obj/item/tank/internals/oxygen/tank = locate() in src
if(tank && Adjacent(usr))
usr.put_in_hands(tank)
oxygentanks--
. = TRUE
update_icon()
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
for(var/X in src)
var/obj/item/I = X
I.forceMove(loc)
new /obj/item/stack/sheet/metal (loc, 2)
qdel(src)
#undef TANK_DISPENSER_CAPACITY
#define TANK_DISPENSER_CAPACITY 10
/obj/structure/tank_dispenser
name = "tank dispenser"
desc = "A simple yet bulky storage device for gas tanks. Holds up to 10 oxygen tanks and 10 plasma tanks."
icon = 'icons/obj/objects.dmi'
icon_state = "dispenser"
density = TRUE
anchored = TRUE
max_integrity = 300
var/oxygentanks = TANK_DISPENSER_CAPACITY
var/plasmatanks = TANK_DISPENSER_CAPACITY
/obj/structure/tank_dispenser/oxygen
plasmatanks = 0
/obj/structure/tank_dispenser/plasma
oxygentanks = 0
/obj/structure/tank_dispenser/Initialize()
. = ..()
for(var/i in 1 to oxygentanks)
new /obj/item/tank/internals/oxygen(src)
for(var/i in 1 to plasmatanks)
new /obj/item/tank/internals/plasma(src)
update_icon()
/obj/structure/tank_dispenser/update_icon()
cut_overlays()
switch(oxygentanks)
if(1 to 3)
add_overlay("oxygen-[oxygentanks]")
if(4 to TANK_DISPENSER_CAPACITY)
add_overlay("oxygen-4")
switch(plasmatanks)
if(1 to 4)
add_overlay("plasma-[plasmatanks]")
if(5 to TANK_DISPENSER_CAPACITY)
add_overlay("plasma-5")
/obj/structure/tank_dispenser/attackby(obj/item/I, mob/user, params)
var/full
if(istype(I, /obj/item/tank/internals/plasma))
if(plasmatanks < TANK_DISPENSER_CAPACITY)
plasmatanks++
else
full = TRUE
else if(istype(I, /obj/item/tank/internals/oxygen))
if(oxygentanks < TANK_DISPENSER_CAPACITY)
oxygentanks++
else
full = TRUE
else if(istype(I, /obj/item/wrench))
default_unfasten_wrench(user, I, time = 20)
return
else if(user.a_intent != INTENT_HARM)
to_chat(user, "<span class='notice'>[I] does not fit into [src].</span>")
return
else
return ..()
if(full)
to_chat(user, "<span class='notice'>[src] can't hold any more of [I].</span>")
return
if(!user.transferItemToLoc(I, src))
return
to_chat(user, "<span class='notice'>You put [I] in [src].</span>")
update_icon()
/obj/structure/tank_dispenser/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "tank_dispenser", name, 275, 100, master_ui, state)
ui.open()
/obj/structure/tank_dispenser/ui_data(mob/user)
var/list/data = list()
data["oxygen"] = oxygentanks
data["plasma"] = plasmatanks
return data
/obj/structure/tank_dispenser/ui_act(action, params)
if(..())
return
switch(action)
if("plasma")
var/obj/item/tank/internals/plasma/tank = locate() in src
if(tank && Adjacent(usr))
usr.put_in_hands(tank)
plasmatanks--
. = TRUE
if("oxygen")
var/obj/item/tank/internals/oxygen/tank = locate() in src
if(tank && Adjacent(usr))
usr.put_in_hands(tank)
oxygentanks--
. = TRUE
update_icon()
/obj/structure/tank_dispenser/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
for(var/X in src)
var/obj/item/I = X
I.forceMove(loc)
new /obj/item/stack/sheet/metal (loc, 2)
qdel(src)
#undef TANK_DISPENSER_CAPACITY
+76 -76
View File
@@ -1,76 +1,76 @@
/obj/structure/target_stake
name = "target stake"
desc = "A thin platform with negatively-magnetized wheels."
icon = 'icons/obj/objects.dmi'
icon_state = "target_stake"
density = FALSE
flags_1 = CONDUCT_1
can_buckle = TRUE
max_buckled_mobs = 1
buckle_lying = FALSE
var/obj/item/target/pinned_target
/obj/structure/target_stake/Destroy()
if(pinned_target)
pinned_target.nullPinnedLoc()
return ..()
/obj/structure/target_stake/proc/handle_density()
if(length(buckled_mobs) || pinned_target)
density = TRUE
else
density = FALSE
/obj/structure/target_stake/post_buckle_mob()
handle_density()
return ..()
/obj/structure/target_stake/post_unbuckle_mob()
handle_density()
return ..()
/obj/structure/target_stake/proc/nullPinnedTarget()
pinned_target = null
/obj/structure/target_stake/Move()
. = ..()
if(pinned_target)
pinned_target.forceMove(loc)
/obj/structure/target_stake/attackby(obj/item/target/T, mob/user)
if(pinned_target)
return
if(istype(T) && user.transferItemToLoc(T, drop_location()))
pinned_target = T
T.pinnedLoc = src
T.density = TRUE
T.layer = OBJ_LAYER + 0.01
handle_density()
to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
/obj/structure/target_stake/attack_hand(mob/user)
. = ..()
if(.)
return
if(pinned_target)
removeTarget(user)
/obj/structure/target_stake/proc/removeTarget(mob/user)
pinned_target.layer = OBJ_LAYER
pinned_target.forceMove(user.loc)
pinned_target.nullPinnedLoc()
nullPinnedTarget()
handle_density()
if(ishuman(user))
if(!user.get_active_held_item())
user.put_in_hands(pinned_target)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
else
pinned_target.forceMove(user.drop_location())
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
/obj/structure/target_stake/bullet_act(obj/item/projectile/P)
if(pinned_target)
pinned_target.bullet_act(P)
else
..()
/obj/structure/target_stake
name = "target stake"
desc = "A thin platform with negatively-magnetized wheels."
icon = 'icons/obj/objects.dmi'
icon_state = "target_stake"
density = FALSE
flags_1 = CONDUCT_1
can_buckle = TRUE
max_buckled_mobs = 1
buckle_lying = FALSE
var/obj/item/target/pinned_target
/obj/structure/target_stake/Destroy()
if(pinned_target)
pinned_target.nullPinnedLoc()
return ..()
/obj/structure/target_stake/proc/handle_density()
if(length(buckled_mobs) || pinned_target)
density = TRUE
else
density = FALSE
/obj/structure/target_stake/post_buckle_mob()
handle_density()
return ..()
/obj/structure/target_stake/post_unbuckle_mob()
handle_density()
return ..()
/obj/structure/target_stake/proc/nullPinnedTarget()
pinned_target = null
/obj/structure/target_stake/Move()
. = ..()
if(pinned_target)
pinned_target.forceMove(loc)
/obj/structure/target_stake/attackby(obj/item/target/T, mob/user)
if(pinned_target)
return
if(istype(T) && user.transferItemToLoc(T, drop_location()))
pinned_target = T
T.pinnedLoc = src
T.density = TRUE
T.layer = OBJ_LAYER + 0.01
handle_density()
to_chat(user, "<span class='notice'>You slide the target into the stake.</span>")
/obj/structure/target_stake/attack_hand(mob/user)
. = ..()
if(.)
return
if(pinned_target)
removeTarget(user)
/obj/structure/target_stake/proc/removeTarget(mob/user)
pinned_target.layer = OBJ_LAYER
pinned_target.forceMove(user.loc)
pinned_target.nullPinnedLoc()
nullPinnedTarget()
handle_density()
if(ishuman(user))
if(!user.get_active_held_item())
user.put_in_hands(pinned_target)
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
else
pinned_target.forceMove(user.drop_location())
to_chat(user, "<span class='notice'>You take the target out of the stake.</span>")
/obj/structure/target_stake/bullet_act(obj/item/projectile/P)
if(pinned_target)
pinned_target.bullet_act(P)
else
..()
@@ -1,133 +1,133 @@
// transit tube construction
// normal transit tubes
/obj/structure/c_transit_tube
name = "unattached transit tube"
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
icon_state = "straight"
desc = "An unattached segment of transit tube."
density = FALSE
layer = LOW_ITEM_LAYER //same as the built tube
anchored = FALSE
var/const/time_to_unwrench = 2 SECONDS
var/flipped = 0
var/build_type = /obj/structure/transit_tube
var/flipped_build_type
var/base_icon
/obj/structure/c_transit_tube/proc/can_wrench_in_loc(mob/user)
var/turf/source_turf = get_turf(loc)
var/existing_tubes = 0
for(var/obj/structure/transit_tube/tube in source_turf)
existing_tubes++
if(existing_tubes >= 2)
to_chat(user, "<span class='warning'>You cannot wrench any more transit tubes!</span>")
return FALSE
return TRUE
/obj/structure/c_transit_tube/ComponentInitialize()
. = ..()
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_FLIP | ROTATION_VERBS,null,null,CALLBACK(src,.proc/after_rot))
/obj/structure/c_transit_tube/proc/after_rot(mob/user,rotation_type)
if(flipped_build_type && rotation_type == ROTATION_FLIP)
setDir(turn(dir,-180)) //Turn back we don't actually flip
flipped = !flipped
var/cur_flip = initial(flipped) ? !flipped : flipped
if(cur_flip)
build_type = flipped_build_type
else
build_type = initial(build_type)
icon_state = "[base_icon][flipped]"
/obj/structure/c_transit_tube/wrench_act(mob/living/user, obj/item/I)
if(!can_wrench_in_loc(user))
return
to_chat(user, "<span class='notice'>You start attaching the [name]...</span>")
add_fingerprint(user)
if(I.use_tool(src, user, time_to_unwrench, volume=50, extra_checks=CALLBACK(src, .proc/can_wrench_in_loc, user)))
to_chat(user, "<span class='notice'>You attach the [name].</span>")
var/obj/structure/transit_tube/R = new build_type(loc, dir)
transfer_fingerprints_to(R)
qdel(src)
return TRUE
// transit tube station
/obj/structure/c_transit_tube/station
name = "unattached through station"
icon_state = "closed_station0"
build_type = /obj/structure/transit_tube/station
flipped_build_type = /obj/structure/transit_tube/station/flipped
base_icon = "closed_station"
/obj/structure/c_transit_tube/station/flipped
icon_state = "closed_station1"
flipped = 1
build_type = /obj/structure/transit_tube/station/flipped
flipped_build_type = /obj/structure/transit_tube/station
// reverser station, used for the terminus
/obj/structure/c_transit_tube/station/reverse
name = "unattached terminus station"
icon_state = "closed_terminus0"
build_type = /obj/structure/transit_tube/station/reverse
flipped_build_type = /obj/structure/transit_tube/station/reverse/flipped
base_icon = "closed_terminus"
/obj/structure/c_transit_tube/station/reverse/flipped
icon_state = "closed_terminus1"
flipped = 1
build_type = /obj/structure/transit_tube/station/reverse/flipped
flipped_build_type = /obj/structure/transit_tube/station/reverse
/obj/structure/c_transit_tube/crossing
icon_state = "crossing"
build_type = /obj/structure/transit_tube/crossing
/obj/structure/c_transit_tube/diagonal
icon_state = "diagonal"
build_type = /obj/structure/transit_tube/diagonal
/obj/structure/c_transit_tube/diagonal/crossing
icon_state = "diagonal_crossing"
build_type = /obj/structure/transit_tube/diagonal/crossing
/obj/structure/c_transit_tube/curved
icon_state = "curved0"
build_type = /obj/structure/transit_tube/curved
flipped_build_type = /obj/structure/transit_tube/curved/flipped
base_icon = "curved"
/obj/structure/c_transit_tube/curved/flipped
icon_state = "curved1"
build_type = /obj/structure/transit_tube/curved/flipped
flipped_build_type = /obj/structure/transit_tube/curved
flipped = 1
/obj/structure/c_transit_tube/junction
icon_state = "junction0"
build_type = /obj/structure/transit_tube/junction
flipped_build_type = /obj/structure/transit_tube/junction/flipped
base_icon = "junction"
/obj/structure/c_transit_tube/junction/flipped
icon_state = "junction1"
flipped = 1
build_type = /obj/structure/transit_tube/junction/flipped
flipped_build_type = /obj/structure/transit_tube/junction
//transit tube pod
//see station.dm for the logic
/obj/structure/c_transit_tube_pod
name = "unattached transit tube pod"
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
icon_state = "pod"
anchored = FALSE
density = FALSE
// transit tube construction
// normal transit tubes
/obj/structure/c_transit_tube
name = "unattached transit tube"
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
icon_state = "straight"
desc = "An unattached segment of transit tube."
density = FALSE
layer = LOW_ITEM_LAYER //same as the built tube
anchored = FALSE
var/const/time_to_unwrench = 2 SECONDS
var/flipped = 0
var/build_type = /obj/structure/transit_tube
var/flipped_build_type
var/base_icon
/obj/structure/c_transit_tube/proc/can_wrench_in_loc(mob/user)
var/turf/source_turf = get_turf(loc)
var/existing_tubes = 0
for(var/obj/structure/transit_tube/tube in source_turf)
existing_tubes++
if(existing_tubes >= 2)
to_chat(user, "<span class='warning'>You cannot wrench any more transit tubes!</span>")
return FALSE
return TRUE
/obj/structure/c_transit_tube/ComponentInitialize()
. = ..()
AddComponent(/datum/component/simple_rotation,ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_FLIP | ROTATION_VERBS,null,null,CALLBACK(src,.proc/after_rot))
/obj/structure/c_transit_tube/proc/after_rot(mob/user,rotation_type)
if(flipped_build_type && rotation_type == ROTATION_FLIP)
setDir(turn(dir,-180)) //Turn back we don't actually flip
flipped = !flipped
var/cur_flip = initial(flipped) ? !flipped : flipped
if(cur_flip)
build_type = flipped_build_type
else
build_type = initial(build_type)
icon_state = "[base_icon][flipped]"
/obj/structure/c_transit_tube/wrench_act(mob/living/user, obj/item/I)
if(!can_wrench_in_loc(user))
return
to_chat(user, "<span class='notice'>You start attaching the [name]...</span>")
add_fingerprint(user)
if(I.use_tool(src, user, time_to_unwrench, volume=50, extra_checks=CALLBACK(src, .proc/can_wrench_in_loc, user)))
to_chat(user, "<span class='notice'>You attach the [name].</span>")
var/obj/structure/transit_tube/R = new build_type(loc, dir)
transfer_fingerprints_to(R)
qdel(src)
return TRUE
// transit tube station
/obj/structure/c_transit_tube/station
name = "unattached through station"
icon_state = "closed_station0"
build_type = /obj/structure/transit_tube/station
flipped_build_type = /obj/structure/transit_tube/station/flipped
base_icon = "closed_station"
/obj/structure/c_transit_tube/station/flipped
icon_state = "closed_station1"
flipped = 1
build_type = /obj/structure/transit_tube/station/flipped
flipped_build_type = /obj/structure/transit_tube/station
// reverser station, used for the terminus
/obj/structure/c_transit_tube/station/reverse
name = "unattached terminus station"
icon_state = "closed_terminus0"
build_type = /obj/structure/transit_tube/station/reverse
flipped_build_type = /obj/structure/transit_tube/station/reverse/flipped
base_icon = "closed_terminus"
/obj/structure/c_transit_tube/station/reverse/flipped
icon_state = "closed_terminus1"
flipped = 1
build_type = /obj/structure/transit_tube/station/reverse/flipped
flipped_build_type = /obj/structure/transit_tube/station/reverse
/obj/structure/c_transit_tube/crossing
icon_state = "crossing"
build_type = /obj/structure/transit_tube/crossing
/obj/structure/c_transit_tube/diagonal
icon_state = "diagonal"
build_type = /obj/structure/transit_tube/diagonal
/obj/structure/c_transit_tube/diagonal/crossing
icon_state = "diagonal_crossing"
build_type = /obj/structure/transit_tube/diagonal/crossing
/obj/structure/c_transit_tube/curved
icon_state = "curved0"
build_type = /obj/structure/transit_tube/curved
flipped_build_type = /obj/structure/transit_tube/curved/flipped
base_icon = "curved"
/obj/structure/c_transit_tube/curved/flipped
icon_state = "curved1"
build_type = /obj/structure/transit_tube/curved/flipped
flipped_build_type = /obj/structure/transit_tube/curved
flipped = 1
/obj/structure/c_transit_tube/junction
icon_state = "junction0"
build_type = /obj/structure/transit_tube/junction
flipped_build_type = /obj/structure/transit_tube/junction/flipped
base_icon = "junction"
/obj/structure/c_transit_tube/junction/flipped
icon_state = "junction1"
flipped = 1
build_type = /obj/structure/transit_tube/junction/flipped
flipped_build_type = /obj/structure/transit_tube/junction
//transit tube pod
//see station.dm for the logic
/obj/structure/c_transit_tube_pod
name = "unattached transit tube pod"
icon = 'icons/obj/atmospherics/pipes/transit_tube.dmi'
icon_state = "pod"
anchored = FALSE
density = FALSE
+4 -4
View File
@@ -103,7 +103,7 @@
if (!open)
return
var/obj/item/reagent_containers/RG = I
RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
RG.reagents.add_reagent(/datum/reagent/water, min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
to_chat(user, "<span class='notice'>You fill [RG] from [src]. Gross.</span>")
else
return ..()
@@ -201,7 +201,7 @@
icon = 'icons/obj/items_and_weapons.dmi'
icon_state = "urinalcake"
w_class = WEIGHT_CLASS_TINY
list_reagents = list("chlorine" = 3, "ammonia" = 1)
list_reagents = list(/datum/reagent/chlorine = 3, /datum/reagent/ammonia = 1)
/obj/item/reagent_containers/food/urinalcake/attack_self(mob/living/user)
user.visible_message("<span class='notice'>[user] squishes [src]!</span>", "<span class='notice'>You squish [src].</span>", "<i>You hear a squish.</i>")
@@ -463,7 +463,7 @@
desc = "A sink used for washing one's hands and face."
anchored = TRUE
var/busy = FALSE //Something's being washed at the moment
var/dispensedreagent = "water" // for whenever plumbing happens
var/dispensedreagent = /datum/reagent/water // for whenever plumbing happens
/obj/structure/sink/attack_hand(mob/living/user)
@@ -538,7 +538,7 @@
return
if(istype(O, /obj/item/mop))
O.reagents.add_reagent("[dispensedreagent]", 5)
O.reagents.add_reagent(dispensedreagent, 5)
to_chat(user, "<span class='notice'>You wet [O] in [src].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return
+357 -357
View File
@@ -1,357 +1,357 @@
/* Windoor (window door) assembly -Nodrak
* Step 1: Create a windoor out of rglass
* Step 2: Add r-glass to the assembly to make a secure windoor (Optional)
* Step 3: Rotate or Flip the assembly to face and open the way you want
* Step 4: Wrench the assembly in place
* Step 5: Add cables to the assembly
* Step 6: Set access for the door.
* Step 7: Screwdriver the door to complete
*/
/obj/structure/windoor_assembly
icon = 'icons/obj/doors/windoor.dmi'
name = "windoor Assembly"
icon_state = "l_windoor_assembly01"
desc = "A small glass and wire assembly for windoors."
anchored = FALSE
density = FALSE
dir = NORTH
var/ini_dir
var/obj/item/electronics/airlock/electronics = null
var/created_name = null
//Vars to help with the icon's name
var/facing = "l" //Does the windoor open to the left or right?
var/secure = FALSE //Whether or not this creates a secure windoor
var/state = "01" //How far the door assembly has progressed
CanAtmosPass = ATMOS_PASS_PROC
/obj/structure/windoor_assembly/New(loc, set_dir)
..()
if(set_dir)
setDir(set_dir)
ini_dir = dir
air_update_turf(1)
/obj/structure/windoor_assembly/Destroy()
density = FALSE
air_update_turf(1)
return ..()
/obj/structure/windoor_assembly/Move()
var/turf/T = loc
. = ..()
setDir(ini_dir)
move_update_air(T)
/obj/structure/windoor_assembly/update_icon()
icon_state = "[facing]_[secure ? "secure_" : ""]windoor_assembly[state]"
/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && (mover.pass_flags & PASSGLASS))
return 1
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
return !density
if(istype(mover, /obj/structure/window))
var/obj/structure/window/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/structure/windoor_assembly))
var/obj/structure/windoor_assembly/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
return FALSE
return 1
/obj/structure/windoor_assembly/CanAtmosPass(turf/T)
if(get_dir(loc, T) == dir)
return !density
else
return 1
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover as mob|obj, turf/target)
if(istype(mover) && (mover.pass_flags & PASSGLASS))
return 1
if(get_dir(loc, target) == dir)
return !density
else
return 1
/obj/structure/windoor_assembly/attackby(obj/item/W, mob/user, params)
//I really should have spread this out across more states but thin little windoors are hard to sprite.
add_fingerprint(user)
switch(state)
if("01")
if(istype(W, /obj/item/weldingtool) && !anchored)
if(!W.tool_start_check(user, amount=0))
return
user.visible_message("[user] disassembles the windoor assembly.",
"<span class='notice'>You start to disassemble the windoor assembly...</span>")
if(W.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You disassemble the windoor assembly.</span>")
var/obj/item/stack/sheet/rglass/RG = new (get_turf(src), 5)
RG.add_fingerprint(user)
if(secure)
var/obj/item/stack/rods/R = new (get_turf(src), 4)
R.add_fingerprint(user)
qdel(src)
return
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
if(istype(W, /obj/item/wrench) && !anchored)
for(var/obj/machinery/door/window/WD in loc)
if(WD.dir == dir)
to_chat(user, "<span class='warning'>There is already a windoor in that location!</span>")
return
user.visible_message("[user] secures the windoor assembly to the floor.",
"<span class='notice'>You start to secure the windoor assembly to the floor...</span>")
if(W.use_tool(src, user, 40, volume=100))
if(anchored)
return
for(var/obj/machinery/door/window/WD in loc)
if(WD.dir == dir)
to_chat(user, "<span class='warning'>There is already a windoor in that location!</span>")
return
to_chat(user, "<span class='notice'>You secure the windoor assembly.</span>")
setAnchored(TRUE)
if(secure)
name = "secure anchored windoor assembly"
else
name = "anchored windoor assembly"
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
else if(istype(W, /obj/item/wrench) && anchored)
user.visible_message("[user] unsecures the windoor assembly to the floor.",
"<span class='notice'>You start to unsecure the windoor assembly to the floor...</span>")
if(W.use_tool(src, user, 40, volume=100))
if(!anchored)
return
to_chat(user, "<span class='notice'>You unsecure the windoor assembly.</span>")
setAnchored(FALSE)
if(secure)
name = "secure windoor assembly"
else
name = "windoor assembly"
//Adding plasteel makes the assembly a secure windoor assembly. Step 2 (optional) complete.
else if(istype(W, /obj/item/stack/sheet/plasteel) && !secure)
var/obj/item/stack/sheet/plasteel/P = W
if(P.get_amount() < 2)
to_chat(user, "<span class='warning'>You need more plasteel to do this!</span>")
return
to_chat(user, "<span class='notice'>You start to reinforce the windoor with plasteel...</span>")
if(do_after(user,40, target = src))
if(!src || secure || P.get_amount() < 2)
return
P.use(2)
to_chat(user, "<span class='notice'>You reinforce the windoor.</span>")
secure = TRUE
if(anchored)
name = "secure anchored windoor assembly"
else
name = "secure windoor assembly"
//Adding cable to the assembly. Step 5 complete.
else if(istype(W, /obj/item/stack/cable_coil) && anchored)
user.visible_message("[user] wires the windoor assembly.", "<span class='notice'>You start to wire the windoor assembly...</span>")
if(do_after(user, 40, target = src))
if(!src || !anchored || src.state != "01")
return
var/obj/item/stack/cable_coil/CC = W
if(!CC.use(1))
to_chat(user, "<span class='warning'>You need more cable to do this!</span>")
return
to_chat(user, "<span class='notice'>You wire the windoor.</span>")
state = "02"
if(secure)
name = "secure wired windoor assembly"
else
name = "wired windoor assembly"
else
return ..()
if("02")
//Removing wire from the assembly. Step 5 undone.
if(istype(W, /obj/item/wirecutters))
user.visible_message("[user] cuts the wires from the airlock assembly.", "<span class='notice'>You start to cut the wires from airlock assembly...</span>")
if(W.use_tool(src, user, 40, volume=100))
if(state != "02")
return
to_chat(user, "<span class='notice'>You cut the windoor wires.</span>")
new/obj/item/stack/cable_coil(get_turf(user), 1)
state = "01"
if(secure)
name = "secure anchored windoor assembly"
else
name = "anchored windoor assembly"
//Adding airlock electronics for access. Step 6 complete.
else if(istype(W, /obj/item/electronics/airlock))
if(!user.transferItemToLoc(W, src))
return
W.play_tool_sound(src, 100)
user.visible_message("[user] installs the electronics into the airlock assembly.",
"<span class='notice'>You start to install electronics into the airlock assembly...</span>")
if(do_after(user, 40, target = src))
if(!src || electronics)
W.forceMove(drop_location())
return
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
name = "near finished windoor assembly"
electronics = W
else
W.forceMove(drop_location())
//Screwdriver to remove airlock electronics. Step 6 undone.
else if(istype(W, /obj/item/screwdriver))
if(!electronics)
return
user.visible_message("[user] removes the electronics from the airlock assembly.",
"<span class='notice'>You start to uninstall electronics from the airlock assembly...</span>")
if(W.use_tool(src, user, 40, volume=100) && electronics)
to_chat(user, "<span class='notice'>You remove the airlock electronics.</span>")
name = "wired windoor assembly"
var/obj/item/electronics/airlock/ae
ae = electronics
electronics = null
ae.forceMove(drop_location())
else if(istype(W, /obj/item/pen))
var/t = stripped_input(user, "Enter the name for the door.", name, created_name,MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && loc != usr)
return
created_name = t
return
//Crowbar to complete the assembly, Step 7 complete.
else if(istype(W, /obj/item/crowbar))
if(!electronics)
to_chat(usr, "<span class='warning'>The assembly is missing electronics!</span>")
return
user << browse(null, "window=windoor_access")
user.visible_message("[user] pries the windoor into the frame.",
"<span class='notice'>You start prying the windoor into the frame...</span>")
if(W.use_tool(src, user, 40, volume=100) && electronics)
density = TRUE //Shouldn't matter but just incase
to_chat(user, "<span class='notice'>You finish the windoor.</span>")
if(secure)
var/obj/machinery/door/window/brigdoor/windoor = new /obj/machinery/door/window/brigdoor(loc)
if(facing == "l")
windoor.icon_state = "leftsecureopen"
windoor.base_state = "leftsecure"
else
windoor.icon_state = "rightsecureopen"
windoor.base_state = "rightsecure"
windoor.setDir(dir)
windoor.density = FALSE
if(electronics.one_access)
windoor.req_one_access = electronics.accesses
else
windoor.req_access = electronics.accesses
windoor.electronics = electronics
electronics.forceMove(windoor)
if(created_name)
windoor.name = created_name
qdel(src)
windoor.close()
else
var/obj/machinery/door/window/windoor = new /obj/machinery/door/window(loc)
if(facing == "l")
windoor.icon_state = "leftopen"
windoor.base_state = "left"
else
windoor.icon_state = "rightopen"
windoor.base_state = "right"
windoor.setDir(dir)
windoor.density = FALSE
if(electronics.one_access)
windoor.req_one_access = electronics.accesses
else
windoor.req_access = electronics.accesses
windoor.electronics = electronics
electronics.loc = windoor
if(created_name)
windoor.name = created_name
qdel(src)
windoor.close()
else
return ..()
//Update to reflect changes(if applicable)
update_icon()
/obj/structure/windoor_assembly/ComponentInitialize()
. = ..()
AddComponent(
/datum/component/simple_rotation,
ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS,
null,
CALLBACK(src, .proc/can_be_rotated),
CALLBACK(src,.proc/after_rotation)
)
/obj/structure/windoor_assembly/proc/can_be_rotated(mob/user,rotation_type)
if(anchored)
to_chat(user, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
return FALSE
var/target_dir = turn(dir, rotation_type == ROTATION_CLOCKWISE ? -90 : 90)
if(!valid_window_location(loc, target_dir))
to_chat(user, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
return FALSE
return TRUE
/obj/structure/windoor_assembly/proc/after_rotation(mob/user)
ini_dir = dir
update_icon()
//Flips the windoor assembly, determines whather the door opens to the left or the right
/obj/structure/windoor_assembly/verb/flip()
set name = "Flip Windoor Assembly"
set category = "Object"
set src in oview(1)
var/mob/living/L = usr
if(!CHECK_BITFIELD(L, MOBILITY_PULL))
return
if(facing == "l")
to_chat(usr, "<span class='notice'>The windoor will now slide to the right.</span>")
facing = "r"
else
facing = "l"
to_chat(usr, "<span class='notice'>The windoor will now slide to the left.</span>")
update_icon()
/* Windoor (window door) assembly -Nodrak
* Step 1: Create a windoor out of rglass
* Step 2: Add r-glass to the assembly to make a secure windoor (Optional)
* Step 3: Rotate or Flip the assembly to face and open the way you want
* Step 4: Wrench the assembly in place
* Step 5: Add cables to the assembly
* Step 6: Set access for the door.
* Step 7: Screwdriver the door to complete
*/
/obj/structure/windoor_assembly
icon = 'icons/obj/doors/windoor.dmi'
name = "windoor Assembly"
icon_state = "l_windoor_assembly01"
desc = "A small glass and wire assembly for windoors."
anchored = FALSE
density = FALSE
dir = NORTH
var/ini_dir
var/obj/item/electronics/airlock/electronics = null
var/created_name = null
//Vars to help with the icon's name
var/facing = "l" //Does the windoor open to the left or right?
var/secure = FALSE //Whether or not this creates a secure windoor
var/state = "01" //How far the door assembly has progressed
CanAtmosPass = ATMOS_PASS_PROC
/obj/structure/windoor_assembly/New(loc, set_dir)
..()
if(set_dir)
setDir(set_dir)
ini_dir = dir
air_update_turf(1)
/obj/structure/windoor_assembly/Destroy()
density = FALSE
air_update_turf(1)
return ..()
/obj/structure/windoor_assembly/Move()
var/turf/T = loc
. = ..()
setDir(ini_dir)
move_update_air(T)
/obj/structure/windoor_assembly/update_icon()
icon_state = "[facing]_[secure ? "secure_" : ""]windoor_assembly[state]"
/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target)
if(istype(mover) && (mover.pass_flags & PASSGLASS))
return 1
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
return !density
if(istype(mover, /obj/structure/window))
var/obj/structure/window/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/structure/windoor_assembly))
var/obj/structure/windoor_assembly/W = mover
if(!valid_window_location(loc, W.ini_dir))
return FALSE
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
return FALSE
return 1
/obj/structure/windoor_assembly/CanAtmosPass(turf/T)
if(get_dir(loc, T) == dir)
return !density
else
return 1
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover as mob|obj, turf/target)
if(istype(mover) && (mover.pass_flags & PASSGLASS))
return 1
if(get_dir(loc, target) == dir)
return !density
else
return 1
/obj/structure/windoor_assembly/attackby(obj/item/W, mob/user, params)
//I really should have spread this out across more states but thin little windoors are hard to sprite.
add_fingerprint(user)
switch(state)
if("01")
if(istype(W, /obj/item/weldingtool) && !anchored)
if(!W.tool_start_check(user, amount=0))
return
user.visible_message("[user] disassembles the windoor assembly.",
"<span class='notice'>You start to disassemble the windoor assembly...</span>")
if(W.use_tool(src, user, 40, volume=50))
to_chat(user, "<span class='notice'>You disassemble the windoor assembly.</span>")
var/obj/item/stack/sheet/rglass/RG = new (get_turf(src), 5)
RG.add_fingerprint(user)
if(secure)
var/obj/item/stack/rods/R = new (get_turf(src), 4)
R.add_fingerprint(user)
qdel(src)
return
//Wrenching an unsecure assembly anchors it in place. Step 4 complete
if(istype(W, /obj/item/wrench) && !anchored)
for(var/obj/machinery/door/window/WD in loc)
if(WD.dir == dir)
to_chat(user, "<span class='warning'>There is already a windoor in that location!</span>")
return
user.visible_message("[user] secures the windoor assembly to the floor.",
"<span class='notice'>You start to secure the windoor assembly to the floor...</span>")
if(W.use_tool(src, user, 40, volume=100))
if(anchored)
return
for(var/obj/machinery/door/window/WD in loc)
if(WD.dir == dir)
to_chat(user, "<span class='warning'>There is already a windoor in that location!</span>")
return
to_chat(user, "<span class='notice'>You secure the windoor assembly.</span>")
setAnchored(TRUE)
if(secure)
name = "secure anchored windoor assembly"
else
name = "anchored windoor assembly"
//Unwrenching an unsecure assembly un-anchors it. Step 4 undone
else if(istype(W, /obj/item/wrench) && anchored)
user.visible_message("[user] unsecures the windoor assembly to the floor.",
"<span class='notice'>You start to unsecure the windoor assembly to the floor...</span>")
if(W.use_tool(src, user, 40, volume=100))
if(!anchored)
return
to_chat(user, "<span class='notice'>You unsecure the windoor assembly.</span>")
setAnchored(FALSE)
if(secure)
name = "secure windoor assembly"
else
name = "windoor assembly"
//Adding plasteel makes the assembly a secure windoor assembly. Step 2 (optional) complete.
else if(istype(W, /obj/item/stack/sheet/plasteel) && !secure)
var/obj/item/stack/sheet/plasteel/P = W
if(P.get_amount() < 2)
to_chat(user, "<span class='warning'>You need more plasteel to do this!</span>")
return
to_chat(user, "<span class='notice'>You start to reinforce the windoor with plasteel...</span>")
if(do_after(user,40, target = src))
if(!src || secure || P.get_amount() < 2)
return
P.use(2)
to_chat(user, "<span class='notice'>You reinforce the windoor.</span>")
secure = TRUE
if(anchored)
name = "secure anchored windoor assembly"
else
name = "secure windoor assembly"
//Adding cable to the assembly. Step 5 complete.
else if(istype(W, /obj/item/stack/cable_coil) && anchored)
user.visible_message("[user] wires the windoor assembly.", "<span class='notice'>You start to wire the windoor assembly...</span>")
if(do_after(user, 40, target = src))
if(!src || !anchored || src.state != "01")
return
var/obj/item/stack/cable_coil/CC = W
if(!CC.use(1))
to_chat(user, "<span class='warning'>You need more cable to do this!</span>")
return
to_chat(user, "<span class='notice'>You wire the windoor.</span>")
state = "02"
if(secure)
name = "secure wired windoor assembly"
else
name = "wired windoor assembly"
else
return ..()
if("02")
//Removing wire from the assembly. Step 5 undone.
if(istype(W, /obj/item/wirecutters))
user.visible_message("[user] cuts the wires from the airlock assembly.", "<span class='notice'>You start to cut the wires from airlock assembly...</span>")
if(W.use_tool(src, user, 40, volume=100))
if(state != "02")
return
to_chat(user, "<span class='notice'>You cut the windoor wires.</span>")
new/obj/item/stack/cable_coil(get_turf(user), 1)
state = "01"
if(secure)
name = "secure anchored windoor assembly"
else
name = "anchored windoor assembly"
//Adding airlock electronics for access. Step 6 complete.
else if(istype(W, /obj/item/electronics/airlock))
if(!user.transferItemToLoc(W, src))
return
W.play_tool_sound(src, 100)
user.visible_message("[user] installs the electronics into the airlock assembly.",
"<span class='notice'>You start to install electronics into the airlock assembly...</span>")
if(do_after(user, 40, target = src))
if(!src || electronics)
W.forceMove(drop_location())
return
to_chat(user, "<span class='notice'>You install the airlock electronics.</span>")
name = "near finished windoor assembly"
electronics = W
else
W.forceMove(drop_location())
//Screwdriver to remove airlock electronics. Step 6 undone.
else if(istype(W, /obj/item/screwdriver))
if(!electronics)
return
user.visible_message("[user] removes the electronics from the airlock assembly.",
"<span class='notice'>You start to uninstall electronics from the airlock assembly...</span>")
if(W.use_tool(src, user, 40, volume=100) && electronics)
to_chat(user, "<span class='notice'>You remove the airlock electronics.</span>")
name = "wired windoor assembly"
var/obj/item/electronics/airlock/ae
ae = electronics
electronics = null
ae.forceMove(drop_location())
else if(istype(W, /obj/item/pen))
var/t = stripped_input(user, "Enter the name for the door.", name, created_name,MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && loc != usr)
return
created_name = t
return
//Crowbar to complete the assembly, Step 7 complete.
else if(istype(W, /obj/item/crowbar))
if(!electronics)
to_chat(usr, "<span class='warning'>The assembly is missing electronics!</span>")
return
user << browse(null, "window=windoor_access")
user.visible_message("[user] pries the windoor into the frame.",
"<span class='notice'>You start prying the windoor into the frame...</span>")
if(W.use_tool(src, user, 40, volume=100) && electronics)
density = TRUE //Shouldn't matter but just incase
to_chat(user, "<span class='notice'>You finish the windoor.</span>")
if(secure)
var/obj/machinery/door/window/brigdoor/windoor = new /obj/machinery/door/window/brigdoor(loc)
if(facing == "l")
windoor.icon_state = "leftsecureopen"
windoor.base_state = "leftsecure"
else
windoor.icon_state = "rightsecureopen"
windoor.base_state = "rightsecure"
windoor.setDir(dir)
windoor.density = FALSE
if(electronics.one_access)
windoor.req_one_access = electronics.accesses
else
windoor.req_access = electronics.accesses
windoor.electronics = electronics
electronics.forceMove(windoor)
if(created_name)
windoor.name = created_name
qdel(src)
windoor.close()
else
var/obj/machinery/door/window/windoor = new /obj/machinery/door/window(loc)
if(facing == "l")
windoor.icon_state = "leftopen"
windoor.base_state = "left"
else
windoor.icon_state = "rightopen"
windoor.base_state = "right"
windoor.setDir(dir)
windoor.density = FALSE
if(electronics.one_access)
windoor.req_one_access = electronics.accesses
else
windoor.req_access = electronics.accesses
windoor.electronics = electronics
electronics.loc = windoor
if(created_name)
windoor.name = created_name
qdel(src)
windoor.close()
else
return ..()
//Update to reflect changes(if applicable)
update_icon()
/obj/structure/windoor_assembly/ComponentInitialize()
. = ..()
AddComponent(
/datum/component/simple_rotation,
ROTATION_ALTCLICK | ROTATION_CLOCKWISE | ROTATION_COUNTERCLOCKWISE | ROTATION_VERBS,
null,
CALLBACK(src, .proc/can_be_rotated),
CALLBACK(src,.proc/after_rotation)
)
/obj/structure/windoor_assembly/proc/can_be_rotated(mob/user,rotation_type)
if(anchored)
to_chat(user, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
return FALSE
var/target_dir = turn(dir, rotation_type == ROTATION_CLOCKWISE ? -90 : 90)
if(!valid_window_location(loc, target_dir))
to_chat(user, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
return FALSE
return TRUE
/obj/structure/windoor_assembly/proc/after_rotation(mob/user)
ini_dir = dir
update_icon()
//Flips the windoor assembly, determines whather the door opens to the left or the right
/obj/structure/windoor_assembly/verb/flip()
set name = "Flip Windoor Assembly"
set category = "Object"
set src in oview(1)
var/mob/living/L = usr
if(!CHECK_BITFIELD(L, MOBILITY_PULL))
return
if(facing == "l")
to_chat(usr, "<span class='notice'>The windoor will now slide to the right.</span>")
facing = "r"
else
facing = "l"
to_chat(usr, "<span class='notice'>The windoor will now slide to the left.</span>")
update_icon()