Fixes #6567, tidying up glass code and #6575, #6577 (#6576)

This commit is contained in:
alsoandanswer
2019-06-25 17:39:04 +02:00
committed by Werner
parent cede754944
commit 53c5ff67a5
18 changed files with 160 additions and 105 deletions
-1
View File
@@ -812,7 +812,6 @@
#include "code\game\objects\items\stacks\wrap.dm"
#include "code\game\objects\items\stacks\sheets\glass.dm"
#include "code\game\objects\items\stacks\sheets\leather.dm"
#include "code\game\objects\items\stacks\sheets\light.dm"
#include "code\game\objects\items\stacks\tiles\light.dm"
#include "code\game\objects\items\stacks\tiles\tile_types.dm"
#include "code\game\objects\items\weapons\AI_modules.dm"
+1 -2
View File
@@ -43,6 +43,7 @@
toggle_filter()
/obj/machinery/sleeper/update_icon()
flick("[initial(icon_state)]-anim", src)
if(occupant)
icon_state = "[initial(icon_state)]-closed"
return
@@ -246,7 +247,6 @@
M.forceMove(src)
update_use_power(2)
occupant = M
flick("[initial(icon_state)]-anim", src)
update_icon()
/obj/machinery/sleeper/proc/go_out()
@@ -262,7 +262,6 @@
continue
A.forceMove(loc)
update_use_power(1)
flick("[initial(icon_state)]-anim", src)
update_icon()
toggle_filter()
+1 -4
View File
@@ -41,6 +41,7 @@
return ..()
/obj/machinery/bodyscanner/update_icon()
flick("[initial(icon_state)]-anim", src)
if(occupant)
icon_state = "[initial(icon_state)]-closed"
return
@@ -83,7 +84,6 @@
usr.forceMove(src)
src.occupant = usr
update_use_power(2)
flick("[initial(icon_state)]-anim", src)
update_icon()
for(var/obj/O in src)
//O = null
@@ -106,7 +106,6 @@
src.occupant.forceMove(src.loc)
src.occupant = null
update_use_power(1)
flick("[initial(icon_state)]-anim", src)
update_icon()
return
@@ -137,7 +136,6 @@
M.forceMove(src)
src.occupant = M
update_use_power(2)
flick("[initial(icon_state)]-anim", src)
update_icon()
for(var/obj/O in src)
O.forceMove(loc)
@@ -181,7 +179,6 @@
M.forceMove(src)
src.occupant = M
update_use_power(2)
flick("[initial(icon_state)]-anim", src)
update_icon()
playsound(src.loc, 'sound/machines/medbayscanner1.ogg', 50)
for(var/obj/Obj in src)
+13 -14
View File
@@ -160,6 +160,8 @@
anchored = 1
dir = WEST
var/base_icon_state = "body_scanner"
var/occupied_icon_state = "body_scanner-closed"
var/on_store_message = "has entered long-term storage."
var/on_store_name = "Cryogenic Oversight"
var/on_enter_occupant_message = "You feel cool air surround you. You go numb as your senses turn inward."
@@ -190,17 +192,13 @@
/obj/item/weapon/storage/internal
)
/obj/machinery/cryopod/update_icon()
if (occupant)
icon_state = "[initial(icon_state)]-closed"
else
icon_state = initial(icon_state)
/obj/machinery/cryopod/robot
name = "robotic storage unit"
desc = "A storage unit for robots."
icon = 'icons/obj/robot_storage.dmi'
icon_state = "pod_0"
icon_state = "pod"
base_icon_state = "pod"
occupied_icon_state = "pod-closed"
on_store_message = "has entered robotic storage."
on_store_name = "Robotic Storage Oversight"
on_enter_occupant_message = "The storage unit broadcasts a sleep signal to you. Your systems start to shut down, and you enter low-power mode."
@@ -216,7 +214,7 @@
/obj/machinery/cryopod/Initialize()
. = ..()
update_icon()
icon_state = base_icon_state
find_control_computer()
/obj/machinery/cryopod/proc/find_control_computer(urgent=0)
@@ -319,7 +317,8 @@
else
W.forceMove(src.loc)
update_icon()
flick("[initial(icon_state)]-anim", src)
icon_state = base_icon_state
global_announcer.autosay("[occupant.real_name], [occupant.mind.role_alt_title], [on_store_message]", "[on_store_name]")
visible_message("<span class='notice'>\The [initial(name)] hums and hisses as it moves [occupant.real_name] into storage.</span>")
@@ -368,7 +367,7 @@
M.client.eye = src
flick("[initial(icon_state)]-anim", src)
update_icon()
icon_state = occupied_icon_state
to_chat(M, "<span class='notice'>[on_enter_occupant_message]</span>")
to_chat(M, "<span class='notice'><b>If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.</b></span>")
@@ -430,7 +429,7 @@
return
flick("[initial(icon_state)]-anim", src)
update_icon()
icon_state = occupied_icon_state
to_chat(L, "<span class='notice'>You feel cool air surround you. You go numb as your senses turn inward.</span>")
to_chat(L, "<span class='notice'><b>If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.</b></span>")
@@ -455,7 +454,7 @@
return
flick("[initial(icon_state)]-anim", src)
update_icon()
icon_state = base_icon_state
//Eject any items that aren't meant to be in the pod.
var/list/items = src.contents
@@ -506,7 +505,7 @@
set_occupant(usr)
flick("[initial(icon_state)]-anim", src)
update_icon()
icon_state = occupied_icon_state
to_chat(usr, "<span class='notice'>[on_enter_occupant_message]</span>")
to_chat(usr, "<span class='notice'><b>If you ghost, log out or close your client now, your character will shortly be permanently removed from the round.</b></span>")
@@ -530,7 +529,7 @@
set_occupant(null)
flick("[initial(icon_state)]-anim", src)
update_icon()
icon_state = base_icon_state
return
+20
View File
@@ -27,6 +27,7 @@ var/list/floor_light_cache = list()
if(W.isscrewdriver())
anchored = !anchored
visible_message("<span class='notice'>\The [user] has [anchored ? "attached" : "detached"] \the [src].</span>")
playsound(src.loc, 'sound/items/Screwdriver.ogg', 100, 1)
else if(W.iswelder() && (damaged || (stat & BROKEN)))
var/obj/item/weapon/weldingtool/WT = W
if(!WT.remove_fuel(0, user))
@@ -38,11 +39,25 @@ var/list/floor_light_cache = list()
if(!src || !WT.isOn())
return
visible_message("<span class='notice'>\The [user] has repaired \the [src].</span>")
update_icon()
stat &= ~BROKEN
damaged = null
update_brightness()
else if(W.force && user.a_intent == "hurt")
attack_hand(user)
else if(istype(W, /obj/item/weapon/crowbar))
if(anchored)
to_chat(user, "<span class='warning'>\The [src] must be unfastened from the [loc] first!</span>")
return
else
to_chat(user, "<span class='notice'>You lever off the [name].</span>")
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
if(stat & BROKEN)
qdel(src)
return
else
new /obj/item/stack/tile/light(user.loc)
qdel(src)
return
/obj/machinery/floor_light/attack_hand(var/mob/user)
@@ -51,6 +66,7 @@ var/list/floor_light_cache = list()
if(!isnull(damaged) && !(stat & BROKEN))
visible_message("<span class='danger'>\The [user] smashes \the [src]!</span>")
playsound(src, "shatter", 70, 1)
update_icon()
stat |= BROKEN
else
visible_message("<span class='danger'>\The [user] attacks \the [src]!</span>")
@@ -125,6 +141,10 @@ var/list/floor_light_cache = list()
I.layer = layer+0.001
floor_light_cache[cache_key] = I
add_overlay(floor_light_cache[cache_key])
if(stat & BROKEN)
icon_state = "broken"
else
icon_state = "base"
/obj/machinery/floor_light/proc/broken()
return (stat & (BROKEN|NOPOWER))
+35 -47
View File
@@ -2,6 +2,7 @@
* Contains:
* Glass sheets
* Reinforced glass sheets
* Wired glass sheets
* Phoron Glass Sheets
* Reinforced Phoron Glass Sheets (AKA Holy fuck strong windows)
* Glass shards - TODO: Move this into code/game/object/item/weapons
@@ -24,36 +25,6 @@
/obj/item/stack/material/glass/attack_self(mob/user as mob)
construct_window(user)
/obj/item/stack/material/glass/attackby(obj/item/W, mob/user)
..()
if(!is_reinforced)
if(W.iscoil())
var/obj/item/stack/cable_coil/CC = W
if (get_amount() < 1 || CC.get_amount() < 5)
to_chat(user, "<span class='warning'>You need five lengths of coil and one sheet of glass to make wired glass.</span>")
return
CC.use(5)
use(1)
to_chat(user, "<span class='notice'>You attach wire to the [name].</span>")
new /obj/item/stack/light_w(user.loc)
else if(istype(W, /obj/item/stack/rods))
var/obj/item/stack/rods/V = W
if (V.get_amount() < 1 || get_amount() < 1)
to_chat(user, "<span class='warning'>You need one rod and one sheet of glass to make reinforced glass.</span>")
return
var/obj/item/stack/material/glass/reinforced/RG = new (user.loc)
RG.add_fingerprint(user)
RG.add_to_stacks(user)
var/obj/item/stack/material/glass/G = src
src = null
var/replace = (user.get_inactive_hand()==G)
V.use(1)
G.use(1)
if (!G && replace)
user.put_in_hands(RG)
/obj/item/stack/material/glass/proc/construct_window(mob/user as mob)
if(!user || !src) return 0
if(!istype(user.loc,/turf)) return 0
@@ -137,6 +108,40 @@
is_reinforced = 1
construction_options = list("One Direction", "Full Window", "Windoor")
/*
* Wired glass sheets
*/
/obj/item/stack/material/glass/wired
name = "wired glass tile"
singular_name = "wired glass floor tile"
desc = "A glass tile, which is wired, somehow."
icon = 'icons/obj/stacks/tiles.dmi'
icon_state = "glass_wire"
created_window = null
default_type = "wired glass"
construction_options = list()
/obj/item/stack/material/glass/wired/attackby(var/obj/O, mob/user as mob)
if(istype(O, /obj/item/stack/material/steel))
var/obj/item/stack/material/steel/M = O
if (M.use(1))
var/obj/item/L = new /obj/item/stack/tile/light
user.drop_from_inventory(L,get_turf(src))
to_chat(user, "<span class='notice'>You make a light tile.</span>")
use(1)
else
to_chat(user, "<span class='warning'>You need one metal sheet to finish the light tile!</span>")
else if(istype(O, /obj/item/weapon/wirecutters))
user.drop_from_inventory(O,get_turf(src))
to_chat(user, "<span class='notice'>You detach the wire from the [name].</span>")
playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
new /obj/item/stack/cable_coil(user.loc, 5)
new /obj/item/stack/material/glass(user.loc)
use(1)
else
return ..()
/*
* Phoron Glass sheets
*/
@@ -148,23 +153,6 @@
default_type = "phoron glass"
icon_has_variants = FALSE
/obj/item/stack/material/glass/phoronglass/attackby(obj/item/W, mob/user)
..()
if( istype(W, /obj/item/stack/rods) )
var/obj/item/stack/rods/V = W
var/obj/item/stack/material/glass/phoronrglass/RG = new (user.loc)
RG.add_fingerprint(user)
RG.add_to_stacks(user)
V.use(1)
var/obj/item/stack/material/glass/G = src
src = null
var/replace = (user.get_inactive_hand()==G)
G.use(1)
if (!G && !RG && replace)
user.put_in_hands(RG)
else
return ..()
/*
* Reinforced phoron glass sheets
*/
@@ -1,31 +0,0 @@
/obj/item/stack/light_w
name = "wired glass tile"
singular_name = "wired glass floor tile"
desc = "A glass tile, which is wired, somehow."
icon = 'icons/obj/stacks/tiles.dmi'
icon_state = "glass_wire"
force = 3
throwforce = 5
throw_speed = 3
throw_range = 7
max_amount = 60
/obj/item/stack/light_w/attackby(var/obj/O, mob/user as mob)
if(istype(O, /obj/item/stack/material/steel))
var/obj/item/stack/material/steel/M = O
if (M.use(1))
var/obj/item/L = new /obj/item/stack/tile/light
user.drop_from_inventory(L,get_turf(src))
to_chat(user, "<span class='notice'>You make a light tile.</span>")
use(1)
else
to_chat(user, "<span class='warning'>You need one metal sheet to finish the light tile!</span>")
else if(istype(O, /obj/item/weapon/wirecutters))
user.drop_from_inventory(O,get_turf(src))
to_chat(user, "<span class='notice'>You detach the wire from the [name].</span>")
new /obj/item/stack/cable_coil(user.loc)
new /obj/item/stack/material/glass(user.loc)
use(1)
else
return ..()
+11 -1
View File
@@ -20,8 +20,18 @@
/obj/item/stack/tile/light/attackby(var/obj/item/O, var/mob/user)
if(istype(O, /obj/item/weapon/crowbar))
amount--
new /obj/item/stack/light_w(user.loc)
to_chat(user, "<span class='notice'>You pry off the steel sheet from the [name].</span>")
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
new /obj/item/stack/material/glass/wired(user.loc)
new /obj/item/stack/material/steel(user.loc)
if(amount <= 0)
qdel(src)
else
return ..()
/obj/item/stack/tile/light/attack_self(mob/user)
amount--
playsound(src.loc, 'sound/items/Deconstruct.ogg', 80, 1)
new /obj/machinery/floor_light(user.loc)
if(amount <= 0)
qdel(src)
@@ -3,6 +3,8 @@
desc = "It's a small container with dice inside."
icon = 'icons/obj/dice.dmi'
icon_state = "dicebag"
use_sound = "rustle"
drop_sound = 'sound/items/drop/hat.ogg'
/obj/item/weapon/storage/pill_bottle/dice/fill()
..()
+7 -1
View File
@@ -211,6 +211,12 @@
icon_has_variants = TRUE
drop_sound = 'sound/items/drop/glass.ogg'
/obj/item/stack/material/glass/wired
name = "wired glass"
icon = 'icons/obj/stacks/tiles.dmi'
icon_state = "glass_wire"
default_type = "wired glass"
/obj/item/stack/material/glass/reinforced
name = "reinforced glass"
icon_state = "sheet-rglass"
@@ -240,4 +246,4 @@
name = "titanium"
icon_state = "sheet-titanium"
default_type = "titanium"
icon_has_variants = TRUE
icon_has_variants = TRUE
+23 -3
View File
@@ -124,7 +124,6 @@ var/list/name_to_material
//What golem species is created with this material
var/golem = null
// Placeholders for light tiles and rglass.
/material/proc/build_rod_product(var/mob/user, var/obj/item/stack/used_stack, var/obj/item/stack/target_stack)
if(!rod_product)
to_chat(user, "<span class='warning'>You cannot make anything out of \the [target_stack]</span>")
@@ -134,6 +133,7 @@ var/list/name_to_material
return
used_stack.use(1)
target_stack.use(1)
to_chat(user, "<span class='notice'>You attach a rod to the [display_name].</span>")
var/obj/item/stack/S = new rod_product(get_turf(user))
S.add_fingerprint(user)
S.add_to_stacks(user)
@@ -148,7 +148,7 @@ var/list/name_to_material
used_stack.use(5)
target_stack.use(1)
to_chat(user, "<span class='notice'>You attach wire to the [name].</span>")
to_chat(user, "<span class='notice'>You attach wires to the [display_name].</span>")
var/obj/item/product = new wire_product(get_turf(user))
if(!(user.l_hand && user.r_hand))
user.put_in_hands(product)
@@ -457,6 +457,7 @@ var/list/name_to_material
destruction_desc = "shatters"
window_options = list("One Direction" = 1, "Full Window" = 4)
created_window = /obj/structure/window/basic
wire_product = /obj/item/stack/material/glass/wired
rod_product = /obj/item/stack/material/glass/reinforced
golem = "Glass Golem"
@@ -532,6 +533,25 @@ var/list/name_to_material
/material/glass/proc/is_reinforced()
return (hardness > 35) //todo
/material/glass/wired
name = "wired glass"
display_name = "wired glass"
stack_type = /obj/item/stack/material/glass/wired
flags = MATERIAL_BRITTLE
icon_colour = "#00E1FF"
opacity = 0.3
integrity = 100
shard_type = SHARD_SHARD
tableslam_noise = 'sound/effects/Glasshit.ogg'
hardness = 40
weight = 30
stack_origin_tech = list(TECH_MATERIAL = 2)
composite_material = list(DEFAULT_WALL_MATERIAL = 1875,"glass" = 3750)
window_options = list()
created_window = null
wire_product = null
rod_product = null
/material/glass/reinforced
name = "rglass"
display_name = "reinforced glass"
@@ -960,4 +980,4 @@ var/list/name_to_material
hardness = 80
weight = 23
protectiveness = 20 // 50%
conductivity = 10
conductivity = 10
+44
View File
@@ -0,0 +1,44 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# wip (For works in progress)
# tweak
# soundadd
# sounddel
# rscadd (general adding of nice things)
# rscdel (general deleting of nice things)
# imageadd
# imagedel
# maptweak
# spellcheck (typo fixes)
# experiment
# balance
# admin
# backend
# security
# refactor
#################################
# Your name.
author: Wowzewow, ferner
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
changes:
- bugfix: "Fixes immediately closing sleepers and scanners, as well as infinite cable coil glitch."
- rscadd: "You can make light tiles in hand now. Combining 5 cable coil and a glass sheet followed by a steel sheet will give you a light tile. (Click on it in-hand to deploy.)"
- maptweak: "Makes the therapy pod face the right way."
- tweak: "Makes the racks look more like the tables."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 94 KiB

After

Width:  |  Height:  |  Size: 94 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

+3 -1
View File
@@ -5657,7 +5657,9 @@
/area/medical/psych)
"kc" = (
/obj/effect/floor_decal/industrial/warning/full,
/obj/machinery/chakrapod,
/obj/machinery/chakrapod{
dir = 8
},
/turf/simulated/floor/plating,
/area/medical/psych)
"kd" = (