Adds floor lamp, benches, new tank sprites, and cup dispenser on water coolers.
338
code/game/objects/structures/stool_bed_chair_nest/bench.dm
Normal file
@@ -0,0 +1,338 @@
|
|||||||
|
/obj/structure/bench
|
||||||
|
name = "bench frame"
|
||||||
|
icon = 'icons/obj/bench.dmi'
|
||||||
|
icon_state = "frame"
|
||||||
|
desc = "It's a bench, for putting things on. Or standing on, if you really want to."
|
||||||
|
anchored = 1
|
||||||
|
layer = 2.8
|
||||||
|
throwpass = 1
|
||||||
|
var/maxhealth = 10
|
||||||
|
var/health = 10
|
||||||
|
|
||||||
|
// For racks.
|
||||||
|
var/can_plate = 1
|
||||||
|
|
||||||
|
var/manipulating = 0
|
||||||
|
var/material/material = null
|
||||||
|
|
||||||
|
// I'd prefer reinforced with carpet/felt/cloth/whatever, but AFAIK it's either harder or impossible to get /obj/item/stack/material of those.
|
||||||
|
// Convert if/when you can easily get stacks of these.
|
||||||
|
var/carpeted = 0
|
||||||
|
|
||||||
|
var/list/connections = list("nw0", "ne0", "sw0", "se0")
|
||||||
|
|
||||||
|
standard
|
||||||
|
icon_state = "plain_preview"
|
||||||
|
color = "#EEEEEE"
|
||||||
|
New()
|
||||||
|
material = get_material_by_name(DEFAULT_TABLE_MATERIAL)
|
||||||
|
..()
|
||||||
|
|
||||||
|
padded
|
||||||
|
icon_state = "padded_preview"
|
||||||
|
New()
|
||||||
|
material = get_material_by_name(DEFAULT_TABLE_MATERIAL)
|
||||||
|
carpeted = 1
|
||||||
|
..()
|
||||||
|
|
||||||
|
/*
|
||||||
|
/obj/structure/bench/padded
|
||||||
|
icon_state = "bench_padded_preview" //set for the map
|
||||||
|
|
||||||
|
/obj/structure/bench/New(var/newloc, var/new_material, var/new_padding_material)
|
||||||
|
..(newloc)
|
||||||
|
if(!new_material)
|
||||||
|
new_material = DEFAULT_WALL_MATERIAL
|
||||||
|
material = get_material_by_name(new_material)
|
||||||
|
if(new_padding_material)
|
||||||
|
padding_material = get_material_by_name(new_padding_material)
|
||||||
|
if(!istype(material))
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
update_icon()
|
||||||
|
|
||||||
|
/obj/structure/bench/padded/New(var/newloc, var/new_material)
|
||||||
|
..(newloc, "steel", "carpet")*/
|
||||||
|
|
||||||
|
/obj/structure/bench/proc/update_material()
|
||||||
|
var/old_maxhealth = maxhealth
|
||||||
|
if(!material)
|
||||||
|
maxhealth = 10
|
||||||
|
else
|
||||||
|
maxhealth = material.integrity / 2
|
||||||
|
|
||||||
|
health += maxhealth - old_maxhealth
|
||||||
|
|
||||||
|
/obj/structure/bench/proc/take_damage(amount)
|
||||||
|
// If the bench is made of a brittle material, and is *not* reinforced with a non-brittle material, damage is multiplied by TABLE_BRITTLE_MATERIAL_MULTIPLIER
|
||||||
|
if(material && material.is_brittle())
|
||||||
|
amount *= TABLE_BRITTLE_MATERIAL_MULTIPLIER
|
||||||
|
health -= amount
|
||||||
|
if(health <= 0)
|
||||||
|
visible_message("<span class='warning'>\The [src] breaks down!</span>")
|
||||||
|
return break_to_parts() // if we break and form shards, return them to the caller to do !FUN! things with
|
||||||
|
|
||||||
|
/obj/structure/bench/initialize()
|
||||||
|
..()
|
||||||
|
|
||||||
|
// One bench per turf.
|
||||||
|
for(var/obj/structure/bench/T in loc)
|
||||||
|
if(T != src)
|
||||||
|
// There's another bench here that's not us, break to metal.
|
||||||
|
// break_to_parts calls qdel(src)
|
||||||
|
break_to_parts(full_return = 1)
|
||||||
|
return
|
||||||
|
|
||||||
|
// reset color/alpha, since they're set for nice map previews
|
||||||
|
color = "#ffffff"
|
||||||
|
alpha = 255
|
||||||
|
update_connections(1)
|
||||||
|
update_icon()
|
||||||
|
update_desc()
|
||||||
|
update_material()
|
||||||
|
|
||||||
|
/obj/structure/bench/Destroy()
|
||||||
|
material = null
|
||||||
|
update_connections(1) // Update benchs around us to ignore us (material=null forces no connections)
|
||||||
|
for(var/obj/structure/bench/T in oview(src, 1))
|
||||||
|
T.update_icon()
|
||||||
|
..()
|
||||||
|
|
||||||
|
/obj/structure/bench/examine(mob/user)
|
||||||
|
. = ..()
|
||||||
|
if(health < maxhealth)
|
||||||
|
switch(health / maxhealth)
|
||||||
|
if(0.0 to 0.5)
|
||||||
|
user << "<span class='warning'>It looks severely damaged!</span>"
|
||||||
|
if(0.25 to 0.5)
|
||||||
|
user << "<span class='warning'>It looks damaged!</span>"
|
||||||
|
if(0.5 to 1.0)
|
||||||
|
user << "<span class='notice'>It has a few scrapes and dents.</span>"
|
||||||
|
|
||||||
|
/obj/structure/bench/attackby(obj/item/weapon/W, mob/user)
|
||||||
|
|
||||||
|
if(carpeted && istype(W, /obj/item/weapon/crowbar))
|
||||||
|
user.visible_message("<span class='notice'>\The [user] removes the carpet from \the [src].</span>",
|
||||||
|
"<span class='notice'>You remove the carpet from \the [src].</span>")
|
||||||
|
new /obj/item/stack/tile/carpet(loc)
|
||||||
|
carpeted = 0
|
||||||
|
update_icon()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
if(!carpeted && material && istype(W, /obj/item/stack/tile/carpet))
|
||||||
|
var/obj/item/stack/tile/carpet/C = W
|
||||||
|
if(C.use(1))
|
||||||
|
user.visible_message("<span class='notice'>\The [user] adds \the [C] to \the [src].</span>",
|
||||||
|
"<span class='notice'>You add \the [C] to \the [src].</span>")
|
||||||
|
carpeted = 1
|
||||||
|
update_icon()
|
||||||
|
return 1
|
||||||
|
else
|
||||||
|
user << "<span class='warning'>You don't have enough carpet!</span>"
|
||||||
|
|
||||||
|
if(!carpeted && material && istype(W, /obj/item/weapon/wrench))
|
||||||
|
remove_material(W, user)
|
||||||
|
if(!material)
|
||||||
|
update_connections(1)
|
||||||
|
update_icon()
|
||||||
|
for(var/obj/structure/bench/T in oview(src, 1))
|
||||||
|
T.update_icon()
|
||||||
|
update_desc()
|
||||||
|
update_material()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
if(!carpeted && !material && istype(W, /obj/item/weapon/wrench))
|
||||||
|
dismantle(W, user)
|
||||||
|
return 1
|
||||||
|
|
||||||
|
if(health < maxhealth && istype(W, /obj/item/weapon/weldingtool))
|
||||||
|
var/obj/item/weapon/weldingtool/F = W
|
||||||
|
if(F.welding)
|
||||||
|
user << "<span class='notice'>You begin reparing damage to \the [src].</span>"
|
||||||
|
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||||
|
if(!do_after(user, 20) || !F.remove_fuel(1, user))
|
||||||
|
return
|
||||||
|
user.visible_message("<span class='notice'>\The [user] repairs some damage to \the [src].</span>",
|
||||||
|
"<span class='notice'>You repair some damage to \the [src].</span>")
|
||||||
|
health = max(health+(maxhealth/5), maxhealth) // 20% repair per application
|
||||||
|
return 1
|
||||||
|
|
||||||
|
if(!material && can_plate && istype(W, /obj/item/stack/material))
|
||||||
|
material = common_material_add(W, user, "plat")
|
||||||
|
if(material)
|
||||||
|
update_connections(1)
|
||||||
|
update_icon()
|
||||||
|
update_desc()
|
||||||
|
update_material()
|
||||||
|
return 1
|
||||||
|
|
||||||
|
return ..()
|
||||||
|
|
||||||
|
/obj/structure/bench/proc/update_desc()
|
||||||
|
if(material)
|
||||||
|
name = "[material.display_name] bench"
|
||||||
|
else
|
||||||
|
name = "bench frame"
|
||||||
|
|
||||||
|
// Returns the material to set the bench to.
|
||||||
|
/obj/structure/bench/proc/common_material_add(obj/item/stack/material/S, mob/user, verb) // Verb is actually verb without 'e' or 'ing', which is added. Works for 'plate'/'plating' and 'reinforce'/'reinforcing'.
|
||||||
|
var/material/M = S.get_material()
|
||||||
|
if(!istype(M))
|
||||||
|
user << "<span class='warning'>You cannot [verb]e \the [src] with \the [S].</span>"
|
||||||
|
return null
|
||||||
|
|
||||||
|
if(manipulating) return M
|
||||||
|
manipulating = 1
|
||||||
|
user << "<span class='notice'>You begin [verb]ing \the [src] with [M.display_name].</span>"
|
||||||
|
if(!do_after(user, 20) || !S.use(1))
|
||||||
|
manipulating = 0
|
||||||
|
return null
|
||||||
|
user.visible_message("<span class='notice'>\The [user] [verb]es \the [src] with [M.display_name].</span>", "<span class='notice'>You finish [verb]ing \the [src].</span>")
|
||||||
|
manipulating = 0
|
||||||
|
return M
|
||||||
|
|
||||||
|
// Returns the material to set the bench to.
|
||||||
|
/obj/structure/bench/proc/common_material_remove(mob/user, material/M, delay, what, type_holding, sound)
|
||||||
|
if(!M.stack_type)
|
||||||
|
user << "<span class='warning'>You are unable to remove the [what] from this bench!</span>"
|
||||||
|
return M
|
||||||
|
|
||||||
|
if(manipulating) return M
|
||||||
|
manipulating = 1
|
||||||
|
user.visible_message("<span class='notice'>\The [user] begins removing the [type_holding] holding \the [src]'s [M.display_name] [what] in place.</span>",
|
||||||
|
"<span class='notice'>You begin removing the [type_holding] holding \the [src]'s [M.display_name] [what] in place.</span>")
|
||||||
|
if(sound)
|
||||||
|
playsound(src.loc, sound, 50, 1)
|
||||||
|
if(!do_after(user, 40))
|
||||||
|
manipulating = 0
|
||||||
|
return M
|
||||||
|
user.visible_message("<span class='notice'>\The [user] removes the [M.display_name] [what] from \the [src].</span>",
|
||||||
|
"<span class='notice'>You remove the [M.display_name] [what] from \the [src].</span>")
|
||||||
|
new M.stack_type(src.loc)
|
||||||
|
manipulating = 0
|
||||||
|
return null
|
||||||
|
|
||||||
|
/obj/structure/bench/proc/remove_material(obj/item/weapon/wrench/W, mob/user)
|
||||||
|
material = common_material_remove(user, material, 20, "plating", "bolts", 'sound/items/Ratchet.ogg')
|
||||||
|
|
||||||
|
/obj/structure/bench/proc/dismantle(obj/item/weapon/wrench/W, mob/user)
|
||||||
|
if(manipulating) return
|
||||||
|
manipulating = 1
|
||||||
|
user.visible_message("<span class='notice'>\The [user] begins dismantling \the [src].</span>",
|
||||||
|
"<span class='notice'>You begin dismantling \the [src].</span>")
|
||||||
|
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||||
|
if(!do_after(user, 20))
|
||||||
|
manipulating = 0
|
||||||
|
return
|
||||||
|
user.visible_message("<span class='notice'>\The [user] dismantles \the [src].</span>",
|
||||||
|
"<span class='notice'>You dismantle \the [src].</span>")
|
||||||
|
new /obj/item/stack/material/steel(src.loc)
|
||||||
|
qdel(src)
|
||||||
|
return
|
||||||
|
|
||||||
|
// Returns a list of /obj/item/weapon/material/shard objects that were created as a result of this bench's breakage.
|
||||||
|
// Used for !fun! things such as embedding shards in the faces of tableslammed people.
|
||||||
|
|
||||||
|
// The repeated
|
||||||
|
// S = [x].place_shard(loc)
|
||||||
|
// if(S) shards += S
|
||||||
|
// is to avoid filling the list with nulls, as place_shard won't place shards of certain materials (holo-wood, holo-steel)
|
||||||
|
|
||||||
|
/obj/structure/bench/proc/break_to_parts(full_return = 0)
|
||||||
|
var/list/shards = list()
|
||||||
|
var/obj/item/weapon/material/shard/S = null
|
||||||
|
if(material)
|
||||||
|
if(material.stack_type && (full_return || prob(20)))
|
||||||
|
material.place_sheet(loc)
|
||||||
|
else
|
||||||
|
S = material.place_shard(loc)
|
||||||
|
if(S) shards += S
|
||||||
|
if(carpeted && (full_return || prob(50))) // Higher chance to get the carpet back intact, since there's no non-intact option
|
||||||
|
new /obj/item/stack/tile/carpet(src.loc)
|
||||||
|
if(full_return || prob(20))
|
||||||
|
new /obj/item/stack/material/steel(src.loc)
|
||||||
|
else
|
||||||
|
var/material/M = get_material_by_name(DEFAULT_WALL_MATERIAL)
|
||||||
|
S = M.place_shard(loc)
|
||||||
|
if(S) shards += S
|
||||||
|
qdel(src)
|
||||||
|
return shards
|
||||||
|
|
||||||
|
/obj/structure/bench/update_icon()
|
||||||
|
icon_state = "blank"
|
||||||
|
overlays.Cut()
|
||||||
|
|
||||||
|
var/image/I
|
||||||
|
|
||||||
|
// Base frame shape. Mostly done for glass/diamond benchs, where this is visible.
|
||||||
|
for(var/i = 1 to 4)
|
||||||
|
I = image(icon, dir = 1<<(i-1), icon_state = connections[i])
|
||||||
|
overlays += I
|
||||||
|
|
||||||
|
// Standard bench image
|
||||||
|
if(material)
|
||||||
|
for(var/i = 1 to 4)
|
||||||
|
I = image(icon, "[material.icon_base]_[connections[i]]", dir = 1<<(i-1))
|
||||||
|
if(material.icon_colour) I.color = material.icon_colour
|
||||||
|
I.alpha = 255 * material.opacity
|
||||||
|
overlays += I
|
||||||
|
|
||||||
|
if(carpeted)
|
||||||
|
for(var/i = 1 to 4)
|
||||||
|
I = image(icon, "carpet_[connections[i]]", dir = 1<<(i-1))
|
||||||
|
overlays += I
|
||||||
|
|
||||||
|
// set propagate if you're updating a bench that should update benches around it too, for example if it's a new bench or something important has changed (like material).
|
||||||
|
/obj/structure/bench/proc/update_connections(propagate=0)
|
||||||
|
if(!material)
|
||||||
|
connections = list("0", "0", "0", "0")
|
||||||
|
|
||||||
|
if(propagate)
|
||||||
|
for(var/obj/structure/bench/T in oview(src, 1))
|
||||||
|
T.update_connections()
|
||||||
|
return
|
||||||
|
|
||||||
|
var/list/blocked_dirs = list()
|
||||||
|
for(var/obj/structure/window/W in get_turf(src))
|
||||||
|
if(W.is_fulltile())
|
||||||
|
connections = list("0", "0", "0", "0")
|
||||||
|
return
|
||||||
|
blocked_dirs |= W.dir
|
||||||
|
|
||||||
|
for(var/D in list(NORTH, SOUTH, EAST, WEST) - blocked_dirs)
|
||||||
|
var/turf/T = get_step(src, D)
|
||||||
|
for(var/obj/structure/window/W in T)
|
||||||
|
if(W.is_fulltile() || W.dir == reverse_dir[D])
|
||||||
|
blocked_dirs |= D
|
||||||
|
break
|
||||||
|
else
|
||||||
|
if(W.dir != D) // it's off to the side
|
||||||
|
blocked_dirs |= W.dir|D // blocks the diagonal
|
||||||
|
|
||||||
|
for(var/D in list(NORTHEAST, NORTHWEST, SOUTHEAST, SOUTHWEST) - blocked_dirs)
|
||||||
|
var/turf/T = get_step(src, D)
|
||||||
|
|
||||||
|
for(var/obj/structure/window/W in T)
|
||||||
|
if(W.is_fulltile() || W.dir & reverse_dir[D])
|
||||||
|
blocked_dirs |= D
|
||||||
|
break
|
||||||
|
|
||||||
|
// Blocked cardinals block the adjacent diagonals too. Prevents weirdness with benchs.
|
||||||
|
for(var/x in list(NORTH, SOUTH))
|
||||||
|
for(var/y in list(EAST, WEST))
|
||||||
|
if((x in blocked_dirs) || (y in blocked_dirs))
|
||||||
|
blocked_dirs |= x|y
|
||||||
|
|
||||||
|
var/list/connection_dirs = list()
|
||||||
|
|
||||||
|
for(var/obj/structure/bench/T in orange(src, 1))
|
||||||
|
var/T_dir = get_dir(src, T)
|
||||||
|
if(T_dir in blocked_dirs) continue
|
||||||
|
if(material && T.material && material.name == T.material.name)
|
||||||
|
connection_dirs |= T_dir
|
||||||
|
if(propagate)
|
||||||
|
spawn(0)
|
||||||
|
T.update_connections()
|
||||||
|
T.update_icon()
|
||||||
|
|
||||||
|
connections = dirs_to_corner_states(connection_dirs)
|
||||||
@@ -26,6 +26,8 @@
|
|||||||
..()
|
..()
|
||||||
if (fixture_type == "bulb")
|
if (fixture_type == "bulb")
|
||||||
icon_state = "bulb-construct-stage1"
|
icon_state = "bulb-construct-stage1"
|
||||||
|
if (fixture_type == "flamp")
|
||||||
|
icon_state = "flamp-construct-stage1"
|
||||||
|
|
||||||
/obj/machinery/light_construct/examine(mob/user)
|
/obj/machinery/light_construct/examine(mob/user)
|
||||||
if(!..(user, 2))
|
if(!..(user, 2))
|
||||||
@@ -71,6 +73,8 @@
|
|||||||
src.icon_state = "tube-construct-stage1"
|
src.icon_state = "tube-construct-stage1"
|
||||||
if("bulb")
|
if("bulb")
|
||||||
src.icon_state = "bulb-construct-stage1"
|
src.icon_state = "bulb-construct-stage1"
|
||||||
|
if("flamp")
|
||||||
|
src.icon_state = "flamp-construct-stage1"
|
||||||
new /obj/item/stack/cable_coil(get_turf(src.loc), 1, "red")
|
new /obj/item/stack/cable_coil(get_turf(src.loc), 1, "red")
|
||||||
user.visible_message("[user.name] removes the wiring from [src].", \
|
user.visible_message("[user.name] removes the wiring from [src].", \
|
||||||
"You remove the wiring from [src].", "You hear a noise.")
|
"You remove the wiring from [src].", "You hear a noise.")
|
||||||
@@ -86,6 +90,8 @@
|
|||||||
src.icon_state = "tube-construct-stage2"
|
src.icon_state = "tube-construct-stage2"
|
||||||
if("bulb")
|
if("bulb")
|
||||||
src.icon_state = "bulb-construct-stage2"
|
src.icon_state = "bulb-construct-stage2"
|
||||||
|
if("flamp")
|
||||||
|
src.icon_state = "flamp-construct-stage2"
|
||||||
src.stage = 2
|
src.stage = 2
|
||||||
user.visible_message("[user.name] adds wires to [src].", \
|
user.visible_message("[user.name] adds wires to [src].", \
|
||||||
"You add wires to [src].")
|
"You add wires to [src].")
|
||||||
@@ -98,6 +104,8 @@
|
|||||||
src.icon_state = "tube-empty"
|
src.icon_state = "tube-empty"
|
||||||
if("bulb")
|
if("bulb")
|
||||||
src.icon_state = "bulb-empty"
|
src.icon_state = "bulb-empty"
|
||||||
|
if("flamp")
|
||||||
|
src.icon_state = "flamp-empty"
|
||||||
src.stage = 3
|
src.stage = 3
|
||||||
user.visible_message("[user.name] closes [src]'s casing.", \
|
user.visible_message("[user.name] closes [src]'s casing.", \
|
||||||
"You close [src]'s casing.", "You hear a noise.")
|
"You close [src]'s casing.", "You hear a noise.")
|
||||||
@@ -109,6 +117,8 @@
|
|||||||
newlight = new /obj/machinery/light/built(src.loc)
|
newlight = new /obj/machinery/light/built(src.loc)
|
||||||
if ("bulb")
|
if ("bulb")
|
||||||
newlight = new /obj/machinery/light/small/built(src.loc)
|
newlight = new /obj/machinery/light/small/built(src.loc)
|
||||||
|
if ("flamp")
|
||||||
|
newlight = new /obj/machinery/light/flamp/built(src.loc)
|
||||||
|
|
||||||
newlight.dir = src.dir
|
newlight.dir = src.dir
|
||||||
src.transfer_fingerprints_to(newlight)
|
src.transfer_fingerprints_to(newlight)
|
||||||
@@ -127,6 +137,17 @@
|
|||||||
fixture_type = "bulb"
|
fixture_type = "bulb"
|
||||||
sheets_refunded = 1
|
sheets_refunded = 1
|
||||||
|
|
||||||
|
/obj/machinery/light_construct/flamp
|
||||||
|
name = "floor light fixture frame"
|
||||||
|
desc = "A floor light fixture under construction."
|
||||||
|
icon = 'icons/obj/lighting.dmi'
|
||||||
|
icon_state = "flamp-construct-stage1"
|
||||||
|
anchored = 0
|
||||||
|
layer = OBJ_LAYER
|
||||||
|
stage = 1
|
||||||
|
fixture_type = "flamp"
|
||||||
|
sheets_refunded = 2
|
||||||
|
|
||||||
// the standard tube light fixture
|
// the standard tube light fixture
|
||||||
/obj/machinery/light
|
/obj/machinery/light
|
||||||
name = "light fixture"
|
name = "light fixture"
|
||||||
@@ -141,7 +162,6 @@
|
|||||||
active_power_usage = 20
|
active_power_usage = 20
|
||||||
power_channel = LIGHT //Lights are calc'd via area so they dont need to be in the machine list
|
power_channel = LIGHT //Lights are calc'd via area so they dont need to be in the machine list
|
||||||
var/on = 0 // 1 if on, 0 if off
|
var/on = 0 // 1 if on, 0 if off
|
||||||
var/on_gs = 0
|
|
||||||
var/brightness_range = 10 // luminosity when on, also used in power calculation
|
var/brightness_range = 10 // luminosity when on, also used in power calculation
|
||||||
var/brightness_power = 3
|
var/brightness_power = 3
|
||||||
var/brightness_color = null
|
var/brightness_color = null
|
||||||
@@ -166,6 +186,18 @@
|
|||||||
desc = "A small lighting fixture."
|
desc = "A small lighting fixture."
|
||||||
light_type = /obj/item/weapon/light/bulb
|
light_type = /obj/item/weapon/light/bulb
|
||||||
|
|
||||||
|
/obj/machinery/light/flamp
|
||||||
|
icon_state = "flamp1"
|
||||||
|
base_state = "flamp"
|
||||||
|
fitting = "bulb"
|
||||||
|
brightness_range = 5
|
||||||
|
brightness_power = 2
|
||||||
|
layer = OBJ_LAYER
|
||||||
|
brightness_color = "#FFF4E5"
|
||||||
|
desc = "A floor lamp."
|
||||||
|
light_type = /obj/item/weapon/light/bulb
|
||||||
|
var/lamp_shade = 1
|
||||||
|
|
||||||
/obj/machinery/light/small/emergency
|
/obj/machinery/light/small/emergency
|
||||||
brightness_range = 6
|
brightness_range = 6
|
||||||
brightness_power = 2
|
brightness_power = 2
|
||||||
@@ -188,6 +220,12 @@
|
|||||||
update(0)
|
update(0)
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
/obj/machinery/light/flamp/built/New()
|
||||||
|
status = LIGHT_EMPTY
|
||||||
|
lamp_shade = 0
|
||||||
|
update(0)
|
||||||
|
..()
|
||||||
|
|
||||||
// create a new lighting fixture
|
// create a new lighting fixture
|
||||||
/obj/machinery/light/New()
|
/obj/machinery/light/New()
|
||||||
..()
|
..()
|
||||||
@@ -228,9 +266,29 @@
|
|||||||
on = 0
|
on = 0
|
||||||
return
|
return
|
||||||
|
|
||||||
|
/obj/machinery/light/flamp/update_icon()
|
||||||
|
if(lamp_shade)
|
||||||
|
base_state = "flampshade"
|
||||||
|
switch(status) // set icon_states
|
||||||
|
if(LIGHT_OK)
|
||||||
|
icon_state = "[base_state][on]"
|
||||||
|
if(LIGHT_EMPTY)
|
||||||
|
on = 0
|
||||||
|
icon_state = "[base_state][on]"
|
||||||
|
if(LIGHT_BURNED)
|
||||||
|
on = 0
|
||||||
|
icon_state = "[base_state][on]"
|
||||||
|
if(LIGHT_BROKEN)
|
||||||
|
on = 0
|
||||||
|
icon_state = "[base_state][on]"
|
||||||
|
return
|
||||||
|
else
|
||||||
|
base_state = "flamp"
|
||||||
|
..()
|
||||||
|
|
||||||
|
|
||||||
// update the icon_state and luminosity of the light depending on its state
|
// update the icon_state and luminosity of the light depending on its state
|
||||||
/obj/machinery/light/proc/update(var/trigger = 1)
|
/obj/machinery/light/proc/update(var/trigger = 1)
|
||||||
|
|
||||||
update_icon()
|
update_icon()
|
||||||
if(on)
|
if(on)
|
||||||
if(light_range != brightness_range || light_power != brightness_power || light_color != brightness_color)
|
if(light_range != brightness_range || light_power != brightness_power || light_color != brightness_color)
|
||||||
@@ -245,7 +303,7 @@
|
|||||||
else if( prob( min(60, switchcount*switchcount*0.01) ) )
|
else if( prob( min(60, switchcount*switchcount*0.01) ) )
|
||||||
if(status == LIGHT_OK && trigger)
|
if(status == LIGHT_OK && trigger)
|
||||||
status = LIGHT_BURNED
|
status = LIGHT_BURNED
|
||||||
icon_state = "[base_state]-burned"
|
update_icon()
|
||||||
on = 0
|
on = 0
|
||||||
set_light(0)
|
set_light(0)
|
||||||
else
|
else
|
||||||
@@ -256,8 +314,7 @@
|
|||||||
set_light(0)
|
set_light(0)
|
||||||
|
|
||||||
active_power_usage = light_range * light_power
|
active_power_usage = light_range * light_power
|
||||||
if(on != on_gs)
|
|
||||||
on_gs = on
|
|
||||||
|
|
||||||
/obj/machinery/light/attack_generic(var/mob/user, var/damage)
|
/obj/machinery/light/attack_generic(var/mob/user, var/damage)
|
||||||
if(!damage)
|
if(!damage)
|
||||||
@@ -373,6 +430,11 @@
|
|||||||
if("bulb")
|
if("bulb")
|
||||||
newlight = new /obj/machinery/light_construct/small(src.loc)
|
newlight = new /obj/machinery/light_construct/small(src.loc)
|
||||||
newlight.icon_state = "bulb-construct-stage2"
|
newlight.icon_state = "bulb-construct-stage2"
|
||||||
|
|
||||||
|
if("flamp")
|
||||||
|
newlight = new /obj/machinery/light_construct/flamp(src.loc)
|
||||||
|
newlight.icon_state = "flamp-construct-stage2"
|
||||||
|
|
||||||
newlight.dir = src.dir
|
newlight.dir = src.dir
|
||||||
newlight.stage = 2
|
newlight.stage = 2
|
||||||
newlight.fingerprints = src.fingerprints
|
newlight.fingerprints = src.fingerprints
|
||||||
@@ -390,6 +452,25 @@
|
|||||||
if (prob(75))
|
if (prob(75))
|
||||||
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
|
electrocute_mob(user, get_area(src), src, rand(0.7,1.0))
|
||||||
|
|
||||||
|
/obj/machinery/light/flamp/attackby(obj/item/W, mob/user)
|
||||||
|
if(!lamp_shade)
|
||||||
|
if(istype(W, /obj/item/weapon/lampshade))
|
||||||
|
lamp_shade = 1
|
||||||
|
qdel(W)
|
||||||
|
update_icon()
|
||||||
|
return
|
||||||
|
|
||||||
|
else
|
||||||
|
if(istype(W, /obj/item/weapon/screwdriver))
|
||||||
|
playsound(src.loc, 'sound/items/Screwdriver.ogg', 75, 1)
|
||||||
|
user.visible_message("[user.name] removes [src]'s lamp shade.", \
|
||||||
|
"You remove [src]'s lamp shade.", "You hear a noise.")
|
||||||
|
lamp_shade = 0
|
||||||
|
new /obj/item/weapon/lampshade(src.loc)
|
||||||
|
update_icon()
|
||||||
|
return
|
||||||
|
|
||||||
|
..()
|
||||||
|
|
||||||
// returns whether this light has power
|
// returns whether this light has power
|
||||||
// true if area has power and lightswitch is on
|
// true if area has power and lightswitch is on
|
||||||
@@ -397,6 +478,13 @@
|
|||||||
var/area/A = get_area(src)
|
var/area/A = get_area(src)
|
||||||
return A && A.lightswitch && (!A.requires_power || A.power_light)
|
return A && A.lightswitch && (!A.requires_power || A.power_light)
|
||||||
|
|
||||||
|
/obj/machinery/light/flamp/has_power()
|
||||||
|
var/area/A = get_area(src)
|
||||||
|
if(lamp_shade)
|
||||||
|
return A && (!A.requires_power || A.power_light)
|
||||||
|
else
|
||||||
|
return A && A.lightswitch && (!A.requires_power || A.power_light)
|
||||||
|
|
||||||
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
|
/obj/machinery/light/proc/flicker(var/amount = rand(10, 20))
|
||||||
if(flickering) return
|
if(flickering) return
|
||||||
flickering = 1
|
flickering = 1
|
||||||
@@ -417,6 +505,10 @@
|
|||||||
src.flicker(1)
|
src.flicker(1)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
/obj/machinery/light/flamp/attack_ai(mob/user)
|
||||||
|
attack_hand()
|
||||||
|
return
|
||||||
|
|
||||||
// attack with hand - remove tube/bulb
|
// attack with hand - remove tube/bulb
|
||||||
// if hands aren't protected and the light is on, burn the player
|
// if hands aren't protected and the light is on, burn the player
|
||||||
/obj/machinery/light/attack_hand(mob/user)
|
/obj/machinery/light/attack_hand(mob/user)
|
||||||
@@ -481,6 +573,21 @@
|
|||||||
status = LIGHT_EMPTY
|
status = LIGHT_EMPTY
|
||||||
update()
|
update()
|
||||||
|
|
||||||
|
/obj/machinery/light/flamp/attack_hand(mob/user)
|
||||||
|
if(lamp_shade)
|
||||||
|
if(status == LIGHT_EMPTY)
|
||||||
|
user << "There is no [fitting] in this light."
|
||||||
|
return
|
||||||
|
|
||||||
|
if(on)
|
||||||
|
on = 0
|
||||||
|
update()
|
||||||
|
else
|
||||||
|
on = has_power()
|
||||||
|
update()
|
||||||
|
else
|
||||||
|
..()
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/light/attack_tk(mob/user)
|
/obj/machinery/light/attack_tk(mob/user)
|
||||||
if(status == LIGHT_EMPTY)
|
if(status == LIGHT_EMPTY)
|
||||||
@@ -708,3 +815,11 @@
|
|||||||
sharp = 1
|
sharp = 1
|
||||||
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
playsound(src.loc, 'sound/effects/Glasshit.ogg', 75, 1)
|
||||||
update()
|
update()
|
||||||
|
|
||||||
|
//Lamp Shade
|
||||||
|
/obj/item/weapon/lampshade
|
||||||
|
name = "lamp shade"
|
||||||
|
desc = "A lamp shade for a lamp."
|
||||||
|
icon = 'icons/obj/lighting.dmi'
|
||||||
|
icon_state = "lampshade"
|
||||||
|
w_class = 1
|
||||||
@@ -195,6 +195,7 @@
|
|||||||
possible_transfer_amounts = null
|
possible_transfer_amounts = null
|
||||||
volume = 10
|
volume = 10
|
||||||
center_of_mass = list("x"=16, "y"=12)
|
center_of_mass = list("x"=16, "y"=12)
|
||||||
|
|
||||||
/obj/item/weapon/reagent_containers/food/drinks/sillycup/New()
|
/obj/item/weapon/reagent_containers/food/drinks/sillycup/New()
|
||||||
..()
|
..()
|
||||||
|
|
||||||
@@ -204,6 +205,16 @@
|
|||||||
else
|
else
|
||||||
icon_state = "water_cup_e"
|
icon_state = "water_cup_e"
|
||||||
|
|
||||||
|
/obj/item/weapon/reagent_containers/food/drinks/sillycup/MouseDrop(obj/over_object as obj)
|
||||||
|
if(!reagents.total_volume)
|
||||||
|
if(istype(over_object, /obj/structure/reagent_dispensers/water_cooler))
|
||||||
|
var/obj/structure/reagent_dispensers/water_cooler/W = over_object
|
||||||
|
if(W.cupholder && W.cups < 10)
|
||||||
|
W.cups++
|
||||||
|
qdel(src)
|
||||||
|
W.update_icon()
|
||||||
|
else
|
||||||
|
return ..()
|
||||||
|
|
||||||
//////////////////////////drinkingglass and shaker//
|
//////////////////////////drinkingglass and shaker//
|
||||||
//Note by Darem: This code handles the mixing of drinks. New drinks go in three places: In Chemistry-Reagents.dm (for the drink
|
//Note by Darem: This code handles the mixing of drinks. New drinks go in three places: In Chemistry-Reagents.dm (for the drink
|
||||||
|
|||||||
@@ -203,13 +203,19 @@
|
|||||||
possible_transfer_amounts = null
|
possible_transfer_amounts = null
|
||||||
anchored = 1
|
anchored = 1
|
||||||
var/bottle = 0
|
var/bottle = 0
|
||||||
|
var/cups = 0
|
||||||
|
var/cupholder = 0
|
||||||
|
|
||||||
|
/obj/structure/reagent_dispensers/water_cooler/full
|
||||||
|
bottle = 1
|
||||||
|
cupholder = 1
|
||||||
|
cups = 10
|
||||||
|
|
||||||
/obj/structure/reagent_dispensers/water_cooler/New()
|
/obj/structure/reagent_dispensers/water_cooler/New()
|
||||||
if(bottle == 1)
|
if(bottle)
|
||||||
..()
|
..()
|
||||||
reagents.add_reagent("water",120)
|
reagents.add_reagent("water",120)
|
||||||
else
|
update_icon()
|
||||||
icon_state = "water_cooler_0"
|
|
||||||
|
|
||||||
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/I as obj, mob/user as mob)
|
/obj/structure/reagent_dispensers/water_cooler/attackby(obj/item/I as obj, mob/user as mob)
|
||||||
if(istype(I, /obj/item/weapon/wrench))
|
if(istype(I, /obj/item/weapon/wrench))
|
||||||
@@ -224,7 +230,7 @@
|
|||||||
G.reagents.add_reagent(R.id, total_reagent)
|
G.reagents.add_reagent(R.id, total_reagent)
|
||||||
reagents.clear_reagents()
|
reagents.clear_reagents()
|
||||||
bottle = 0
|
bottle = 0
|
||||||
icon_state = "water_cooler_0"
|
update_icon()
|
||||||
else
|
else
|
||||||
if(anchored)
|
if(anchored)
|
||||||
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
user.visible_message("\The [user] begins unsecuring \the [src] from the floor.", "You start unsecuring \the [src] from the floor.")
|
||||||
@@ -237,11 +243,24 @@
|
|||||||
return
|
return
|
||||||
|
|
||||||
if(istype(I, /obj/item/weapon/screwdriver))
|
if(istype(I, /obj/item/weapon/screwdriver))
|
||||||
if(!bottle)
|
if(cupholder)
|
||||||
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||||
user << "<span class='notice'>You take the water-cooler apart.</span>"
|
user << "<span class='notice'>You take the cup dispenser off.</span>"
|
||||||
new /obj/item/stack/material/plastic( src.loc, 4 )
|
new /obj/item/stack/material/plastic( src.loc )
|
||||||
qdel(src)
|
if(cups)
|
||||||
|
for(var/i = 0 to cups)
|
||||||
|
new /obj/item/weapon/reagent_containers/food/drinks/sillycup(src.loc)
|
||||||
|
cups = 0
|
||||||
|
cupholder = 0
|
||||||
|
update_icon()
|
||||||
|
return
|
||||||
|
if(!bottle && !cupholder)
|
||||||
|
playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1)
|
||||||
|
user << "<span class='notice'>You start taking the water-cooler apart.</span>"
|
||||||
|
if(do_after(user, 20))
|
||||||
|
user << "<span class='notice'>You take the water-cooler apart.</span>"
|
||||||
|
new /obj/item/stack/material/plastic( src.loc, 4 )
|
||||||
|
qdel(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
if(istype(I, /obj/item/weapon/reagent_containers/glass/cooler_bottle))
|
if(istype(I, /obj/item/weapon/reagent_containers/glass/cooler_bottle))
|
||||||
@@ -252,7 +271,7 @@
|
|||||||
user << "<span class='notice'>You start to screw the bottle onto the water-cooler.</span>"
|
user << "<span class='notice'>You start to screw the bottle onto the water-cooler.</span>"
|
||||||
if(do_after(user, 20))
|
if(do_after(user, 20))
|
||||||
bottle = 1
|
bottle = 1
|
||||||
icon_state = "water_cooler"
|
update_icon()
|
||||||
user << "<span class='notice'>You screw the bottle onto the water-cooler but accidently spill some!</span>" //you spill some because it for somereason transfers 5 units to the bottle after it gets attached but before it's deleted...
|
user << "<span class='notice'>You screw the bottle onto the water-cooler but accidently spill some!</span>" //you spill some because it for somereason transfers 5 units to the bottle after it gets attached but before it's deleted...
|
||||||
for(var/datum/reagent/R in G.reagents.reagent_list)
|
for(var/datum/reagent/R in G.reagents.reagent_list)
|
||||||
var/total_reagent = G.reagents.get_reagent_amount(R.id)
|
var/total_reagent = G.reagents.get_reagent_amount(R.id)
|
||||||
@@ -263,8 +282,46 @@
|
|||||||
else
|
else
|
||||||
user << "<span class='warning'>There is already a bottle there!</span>"
|
user << "<span class='warning'>There is already a bottle there!</span>"
|
||||||
return
|
return
|
||||||
else
|
|
||||||
return ..()
|
if(istype(I, /obj/item/stack/material/plastic))
|
||||||
|
if(!cupholder)
|
||||||
|
if(anchored)
|
||||||
|
var/obj/item/stack/material/plastic/P = I
|
||||||
|
src.add_fingerprint(user)
|
||||||
|
user << "<span class='notice'>You start to attach a cup dispenser onto the water-cooler.</span>"
|
||||||
|
playsound(src.loc, 'sound/items/Deconstruct.ogg', 50, 1)
|
||||||
|
if(do_after(user, 20))
|
||||||
|
if (P.use(1))
|
||||||
|
user << "<span class='notice'>You attach a cup dispenser onto the water-cooler.</span>"
|
||||||
|
cupholder = 1
|
||||||
|
update_icon()
|
||||||
|
else
|
||||||
|
user << "<span class='warning'>You need to wrench down the cooler first.</span>"
|
||||||
|
else
|
||||||
|
user << "<span class='warning'>There is already a cup dispenser there!</span>"
|
||||||
|
return
|
||||||
|
|
||||||
|
/obj/structure/reagent_dispensers/water_cooler/attack_hand(mob/user)
|
||||||
|
if(cups)
|
||||||
|
new /obj/item/weapon/reagent_containers/food/drinks/sillycup(src.loc)
|
||||||
|
cups--
|
||||||
|
update_icon()
|
||||||
|
return
|
||||||
|
|
||||||
|
/obj/structure/reagent_dispensers/water_cooler/update_icon()
|
||||||
|
icon_state = "water_cooler"
|
||||||
|
overlays.Cut()
|
||||||
|
var/image/I
|
||||||
|
if(bottle)
|
||||||
|
I = image(icon, "water_cooler_bottle")
|
||||||
|
overlays += I
|
||||||
|
if(cupholder)
|
||||||
|
I = image(icon, "water_cooler_cupholder")
|
||||||
|
overlays += I
|
||||||
|
if(cups)
|
||||||
|
I = image(icon, "water_cooler_cups")
|
||||||
|
overlays += I
|
||||||
|
return
|
||||||
|
|
||||||
/obj/structure/reagent_dispensers/beerkeg
|
/obj/structure/reagent_dispensers/beerkeg
|
||||||
name = "beer keg"
|
name = "beer keg"
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
for(var/obj/structure/table/T in view(src, 1))
|
for(var/obj/structure/table/T in view(src, 1))
|
||||||
T.update_connections()
|
T.update_connections()
|
||||||
T.update_icon()
|
T.update_icon()
|
||||||
|
for(var/obj/structure/bench/T in view(src, 1))
|
||||||
|
T.update_connections()
|
||||||
|
T.update_icon()
|
||||||
|
|
||||||
/obj/structure/window/Destroy()
|
/obj/structure/window/Destroy()
|
||||||
var/oldloc = loc
|
var/oldloc = loc
|
||||||
@@ -10,6 +13,9 @@
|
|||||||
for(var/obj/structure/table/T in view(oldloc, 1))
|
for(var/obj/structure/table/T in view(oldloc, 1))
|
||||||
T.update_connections()
|
T.update_connections()
|
||||||
T.update_icon()
|
T.update_icon()
|
||||||
|
for(var/obj/structure/bench/T in view(oldloc, 1))
|
||||||
|
T.update_connections()
|
||||||
|
T.update_icon()
|
||||||
loc=oldloc
|
loc=oldloc
|
||||||
..()
|
..()
|
||||||
|
|
||||||
@@ -18,5 +24,8 @@
|
|||||||
. = ..()
|
. = ..()
|
||||||
if(loc != oldloc)
|
if(loc != oldloc)
|
||||||
for(var/obj/structure/table/T in view(oldloc, 1) | view(loc, 1))
|
for(var/obj/structure/table/T in view(oldloc, 1) | view(loc, 1))
|
||||||
|
T.update_connections()
|
||||||
|
T.update_icon()
|
||||||
|
for(var/obj/structure/bench/T in view(oldloc, 1) | view(loc, 1))
|
||||||
T.update_connections()
|
T.update_connections()
|
||||||
T.update_icon()
|
T.update_icon()
|
||||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 2.8 KiB |
BIN
icons/obj/bench.dmi
Normal file
|
After Width: | Height: | Size: 5.3 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 72 KiB After Width: | Height: | Size: 73 KiB |
@@ -856,6 +856,7 @@
|
|||||||
#include "code\game\objects\structures\crates_lockers\closets\secure\secure_closets.dm"
|
#include "code\game\objects\structures\crates_lockers\closets\secure\secure_closets.dm"
|
||||||
#include "code\game\objects\structures\crates_lockers\closets\secure\security.dm"
|
#include "code\game\objects\structures\crates_lockers\closets\secure\security.dm"
|
||||||
#include "code\game\objects\structures\stool_bed_chair_nest\bed.dm"
|
#include "code\game\objects\structures\stool_bed_chair_nest\bed.dm"
|
||||||
|
#include "code\game\objects\structures\stool_bed_chair_nest\bench.dm"
|
||||||
#include "code\game\objects\structures\stool_bed_chair_nest\chairs.dm"
|
#include "code\game\objects\structures\stool_bed_chair_nest\chairs.dm"
|
||||||
#include "code\game\objects\structures\stool_bed_chair_nest\stools.dm"
|
#include "code\game\objects\structures\stool_bed_chair_nest\stools.dm"
|
||||||
#include "code\game\objects\structures\stool_bed_chair_nest\wheelchair.dm"
|
#include "code\game\objects\structures\stool_bed_chair_nest\wheelchair.dm"
|
||||||
|
|||||||