Skip to content
This repository has been archived by the owner on Oct 15, 2023. It is now read-only.

Commit

Permalink
windows and walls now beautifull
Browse files Browse the repository at this point in the history
  • Loading branch information
AyIong committed Jun 23, 2023
1 parent efc0b70 commit fbe90b8
Show file tree
Hide file tree
Showing 11 changed files with 115 additions and 47 deletions.
2 changes: 0 additions & 2 deletions code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
if(req_access && req_access.len)
icon_state = "[icon_state]"
base_state = icon_state
if(!color && cancolor)
color = color_windows(src)
for(var/i in 1 to shards)
debris += new /obj/item/shard(src)
if(rods)
Expand Down
14 changes: 7 additions & 7 deletions code/game/objects/effects/spawners/windowspawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
name = "window spawner"
icon = 'icons/obj/structures.dmi'
icon_state = "window_spawner"
var/useFull = 0
var/useFull = 1
var/useGrille = 1
var/windowtospawn = /obj/structure/window/basic
var/windowtospawn = /obj/structure/window/full/basic
anchored = 1 // No sliding out while you prime

/obj/effect/spawner/window/Initialize()
Expand Down Expand Up @@ -38,29 +38,29 @@
// why is this line a no-op
// QDEL_IN(src, 10)

/obj/effect/spawner/window/proc/sync_id(obj/structure/window/reinforced/polarized/W)
/obj/effect/spawner/window/proc/sync_id(obj/structure/window/full/reinforced/polarized/W)
return


/obj/effect/spawner/window/reinforced
name = "reinforced window spawner"
icon_state = "rwindow_spawner"
windowtospawn = /obj/structure/window/reinforced
windowtospawn = /obj/structure/window/full/reinforced

/obj/effect/spawner/window/reinforced/polarized
name = "polarized reinforced window spawner"
icon_state = "ewindow_spawner"
windowtospawn = /obj/structure/window/reinforced/polarized
windowtospawn = /obj/structure/window/full/reinforced/polarized
/// Used to link electrochromic windows to buttons
var/id

/obj/effect/spawner/window/reinforced/polarized/sync_id(obj/structure/window/reinforced/polarized/W)
/obj/effect/spawner/window/reinforced/polarized/sync_id(obj/structure/window/full/reinforced/polarized/W)
W.id = id

/obj/effect/spawner/window/reinforced/plasma
name = "reinforced plasma window spawner"
icon_state = "pwindow_spawner"
windowtospawn = /obj/structure/window/plasmareinforced
windowtospawn = /obj/structure/window/full/plasmareinforced

// Хоть я и сделала ниже рабочие спавнеры окон шаттлов, но по неясной мне причине,
// атмос пропускает воздух через заспавненные им окна...
Expand Down
140 changes: 102 additions & 38 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
GLOBAL_LIST_INIT(wcBar, pick(list("#0d8395", "#58b5c3", "#58c366", "#90d79a", "#ffffff")))
GLOBAL_LIST_INIT(wcBrig, pick(list("#aa0808", "#7f0606", "#ff0000")))
GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8fcf44", "#ffffff")))

/obj/proc/color_windows(obj/W)
var/list/wcBarAreas = list(/area/crew_quarters/bar)
var/list/wcBrigAreas = list(/area/security, /area/shuttle/gamma)

var/newcolor
var/turf/T = get_turf(W)
if(!istype(T))
return
var/area/A = T.loc

if(is_type_in_list(A,wcBarAreas))
newcolor = GLOB.wcBar
else if(is_type_in_list(A,wcBrigAreas))
newcolor = GLOB.wcBrig
else
newcolor = GLOB.wcCommon

return newcolor

/obj/structure/window
name = "window"
Expand Down Expand Up @@ -49,6 +28,8 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
var/real_explosion_block //ignore this, just use explosion_block
var/breaksound = "shatter"
var/hitsound = 'sound/effects/glasshit.ogg'
var/old_color
var/old_icon

/obj/structure/window/examine(mob/user)
. = ..()
Expand Down Expand Up @@ -79,9 +60,6 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",

ini_dir = dir

if(!color && cancolor)
color = color_windows(src)

// Precreate our own debris

var/shards = 1
Expand Down Expand Up @@ -532,19 +510,33 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
name = "electrochromic window"
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
var/id
var/original_color
var/ispolzovano

/obj/structure/window/reinforced/polarized/proc/toggle()
if(!ispolzovano)
ispolzovano++
original_color = color
/obj/structure/window/proc/toggle_polarization()
if(opacity)
if(!old_color)
old_color = "#FFFFFF"
animate(src, color = old_color, time = 0.5 SECONDS)
set_opacity(FALSE)
else
old_color = color
animate(src, icon = "#222222", time = 0.5 SECONDS)
set_opacity(TRUE)

/obj/structure/window/full/proc/toggle_full_polarization()
if(opacity)
animate(src, color="[original_color]", time=5)
set_opacity(0)
if(!old_icon)
old_icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
animate(src, icon = old_icon, time = 0.5 SECONDS)
set_opacity(FALSE)
else
animate(src, color="#222222", time=5)
set_opacity(1)
old_icon = icon
animate(src, icon = 'icons/obj/smooth_structures/tinted_window.dmi', time = 0.5 SECONDS)
set_opacity(TRUE)

/obj/structure/window/full/reinforced/polarized
name = "electrochromic window"
desc = "Adjusts its tint with voltage. Might take a few good hits to shatter it."
var/id

/obj/machinery/button/windowtint
name = "window tint control"
Expand Down Expand Up @@ -580,8 +572,15 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
for(var/obj/structure/window/reinforced/polarized/W in range(src,range))
if(W.id == src.id || !W.id)
spawn(0)
W.toggle()
W.toggle_polarization()
return

for(var/obj/structure/window/full/reinforced/polarized/W in range(src,range))
if(W.id == src.id || !W.id)
spawn(0)
W.toggle_full_polarization()
return

for(var/obj/machinery/door/airlock/G in range(src,range))
if(G.id == src.id)
spawn(0)
Expand Down Expand Up @@ -653,7 +652,23 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
max_integrity = 50
smooth = SMOOTH_TRUE
cancolor = TRUE
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced)
canSmoothWith = list(
/obj/structure/window/full/basic,
/obj/structure/window/full/reinforced,
/obj/structure/window/full/reinforced/tinted,
/obj/structure/window/full/reinforced/polarized,
/obj/structure/window/full/plasmabasic,
/obj/structure/window/full/plasmareinforced,
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
/obj/structure/falsewall,
/obj/structure/falsewall/reinforced,
/obj/structure/falsewall/clockwork,
/turf/simulated/wall/rust,
/turf/simulated/wall/r_wall/rust,
/turf/simulated/wall/r_wall/coated,
/turf/simulated/wall/indestructible/metal,
/turf/simulated/wall/indestructible/reinforced)

/obj/structure/window/full/plasmabasic
name = "plasma window"
Expand All @@ -665,7 +680,23 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
heat_resistance = 32000
max_integrity = 300
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced)
canSmoothWith = list(
/obj/structure/window/full/basic,
/obj/structure/window/full/reinforced,
/obj/structure/window/full/reinforced/tinted,
/obj/structure/window/full/reinforced/polarized,
/obj/structure/window/full/plasmabasic,
/obj/structure/window/full/plasmareinforced,
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
/obj/structure/falsewall,
/obj/structure/falsewall/reinforced,
/obj/structure/falsewall/clockwork,
/turf/simulated/wall/rust,
/turf/simulated/wall/r_wall/rust,
/turf/simulated/wall/r_wall/coated,
/turf/simulated/wall/indestructible/metal,
/turf/simulated/wall/indestructible/reinforced)
explosion_block = 1
armor = list("melee" = 75, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)

Expand All @@ -687,6 +718,23 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
shardtype = /obj/item/shard/plasma
glass_type = /obj/item/stack/sheet/plasmarglass
smooth = SMOOTH_TRUE
canSmoothWith = list(
/obj/structure/window/full/basic,
/obj/structure/window/full/reinforced,
/obj/structure/window/full/reinforced/tinted,
/obj/structure/window/full/reinforced/polarized,
/obj/structure/window/full/plasmabasic,
/obj/structure/window/full/plasmareinforced,
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
/obj/structure/falsewall,
/obj/structure/falsewall/reinforced,
/obj/structure/falsewall/clockwork,
/turf/simulated/wall/rust,
/turf/simulated/wall/r_wall/rust,
/turf/simulated/wall/r_wall/coated,
/turf/simulated/wall/indestructible/metal,
/turf/simulated/wall/indestructible/reinforced)
reinf = TRUE
max_integrity = 1000
explosion_block = 2
Expand All @@ -701,7 +749,23 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
icon_state = "r_window"
smooth = SMOOTH_TRUE
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced)
canSmoothWith = list(
/obj/structure/window/full/basic,
/obj/structure/window/full/reinforced,
/obj/structure/window/full/reinforced/tinted,
/obj/structure/window/full/reinforced/polarized,
/obj/structure/window/full/plasmabasic,
/obj/structure/window/full/plasmareinforced,
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
/obj/structure/falsewall,
/obj/structure/falsewall/reinforced,
/obj/structure/falsewall/clockwork,
/turf/simulated/wall/rust,
/turf/simulated/wall/r_wall/rust,
/turf/simulated/wall/r_wall/coated,
/turf/simulated/wall/indestructible/metal,
/turf/simulated/wall/indestructible/reinforced)
max_integrity = 100
reinf = TRUE
heat_resistance = 1600
Expand Down
6 changes: 6 additions & 0 deletions code/game/turfs/simulated/walls.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@
var/girder_type = /obj/structure/girder

canSmoothWith = list(
/obj/structure/window/full/basic,
/obj/structure/window/full/reinforced,
/obj/structure/window/full/reinforced/tinted,
/obj/structure/window/full/reinforced/polarized,
/obj/structure/window/full/plasmabasic,
/obj/structure/window/full/plasmareinforced,
/turf/simulated/wall,
/turf/simulated/wall/r_wall,
/obj/structure/falsewall,
Expand Down
Binary file modified icons/obj/smooth_structures/plasma_window.dmi
Binary file not shown.
Binary file modified icons/obj/smooth_structures/reinforced_window.dmi
Binary file not shown.
Binary file modified icons/obj/smooth_structures/rplasma_window.dmi
Binary file not shown.
Binary file modified icons/obj/smooth_structures/tinted_window.dmi
Binary file not shown.
Binary file modified icons/obj/smooth_structures/window.dmi
Binary file not shown.
Binary file modified icons/turf/walls/reinforced_wall.dmi
Binary file not shown.
Binary file modified icons/turf/walls/wall.dmi
Binary file not shown.

0 comments on commit fbe90b8

Please sign in to comment.