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

Feat: Beautifull windows and walls #150

Merged
merged 8 commits into from
Jun 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions _maps/map_files/cerestation/Lavaland.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@
/obj/item/reagent_containers/iv_bag/bloodsynthetic/nitrogenis,
/obj/structure/window/reinforced/polarized{
dir = 4;
ispolzovano = "inf"
id = "inf"
},
/obj/machinery/atmospherics/pipe/simple/hidden/supply{
dir = 4
Expand Down Expand Up @@ -4520,10 +4520,10 @@
/obj/machinery/iv_drip,
/obj/structure/window/reinforced/polarized{
dir = 4;
ispolzovano = "inf"
id = "inf"
},
/obj/structure/window/reinforced/polarized{
ispolzovano = "inf"
id = "inf"
},
/obj/effect/decal/cleanable/dirt,
/turf/simulated/floor/plasteel{
Expand Down Expand Up @@ -5366,7 +5366,7 @@
/area/mine/necropolis)
"GA" = (
/obj/structure/window/reinforced/polarized{
ispolzovano = "inf"
id = "inf"
},
/obj/structure/disposalpipe/segment{
dir = 4
Expand Down Expand Up @@ -6771,7 +6771,7 @@
/area/mine/necropolis)
"Te" = (
/obj/structure/window/reinforced/polarized{
ispolzovano = "inf"
id = "inf"
},
/obj/structure/window/reinforced/polarized{
dir = 8;
Expand Down
17 changes: 11 additions & 6 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 Expand Up @@ -204,12 +202,19 @@

/obj/machinery/door/window/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT) && !disassembled)
for(var/obj/fragment in debris)
fragment.forceMove(get_turf(src))
transfer_fingerprints_to(fragment)
debris -= fragment
for(var/obj/item/shard/debris in spawnDebris(drop_location()))
transfer_fingerprints_to(debris) // transfer fingerprints to shards only
qdel(src)

/obj/machinery/door/window/proc/spawnDebris(location)
. = list()
for(var/i in 1 to shards)
. += new /obj/item/shard(location)
if(rods)
. += new /obj/item/stack/rods(location, rods)
if(cable)
. += new /obj/item/stack/cable_coil(location, cable)

/obj/machinery/door/window/narsie_act()
color = NARSIE_WINDOW_COLOUR

Expand Down
17 changes: 17 additions & 0 deletions code/game/objects/effects/decals/Cleanable/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,23 @@
scoop_reagents = list("ash" = 10)
mergeable_decal = FALSE

/obj/effect/decal/cleanable/glass
name = "tiny shards"
desc = "Back to sand."
icon = 'icons/obj/shards.dmi'
icon_state = "tiny"
plane = GAME_PLANE

/obj/effect/decal/cleanable/glass/Initialize(mapload)
. = ..()
setDir(pick(GLOB.cardinal))

/obj/effect/decal/cleanable/glass/ex_act()
qdel(src)

/obj/effect/decal/cleanable/glass/plasma
icon_state = "plasmatiny"

/obj/effect/decal/cleanable/dirt
name = "dirt"
desc = "Someone should clean that up."
Expand Down
8 changes: 8 additions & 0 deletions code/game/objects/effects/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,14 @@
/obj/effect/list_container
name = "list container"

/**
* Used when we want to pass vars from a spawner to a spawned object
*
* a - The spawned object we want to pass a var to
*/
/obj/effect/spawner/proc/synchronize_variables(atom/a)
return

/obj/effect/list_container/mobl
name = "mobl"
var/master = null
Expand Down
94 changes: 50 additions & 44 deletions code/game/objects/effects/spawners/windowspawner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,82 +2,88 @@
name = "window spawner"
icon = 'icons/obj/structures.dmi'
icon_state = "window_spawner"
var/useFull = 0
var/useGrille = 1
var/windowtospawn = /obj/structure/window/basic
anchored = 1 // No sliding out while you prime
var/useFull = TRUE
var/useGrille = TRUE
var/window_to_spawn_regular = /obj/structure/window/basic
var/window_to_spawn_full = /obj/structure/window/full/basic

/obj/effect/spawner/window/Initialize()
/obj/effect/spawner/window/Initialize(mapload)
. = ..()
var/turf/T = get_turf(src)
var/obj/structure/window/WI
for(var/obj/structure/grille/G in get_turf(src))
// Complain noisily
log_runtime(EXCEPTION("Extra grille on turf: ([T.x],[T.y],[T.z])"), src)
stack_trace("Extra grille on turf: ([T.x],[T.y],[T.z])")
qdel(G) //just in case mappers don't know what they are doing

if(!useFull)
for(var/cdir in GLOB.cardinal)
for(var/obj/effect/spawner/window/WS in get_step(src,cdir))
cdir = null
break
if(!cdir) continue
var/obj/structure/window/WI = new windowtospawn(get_turf(src))
sync_id(WI)
if(!cdir)
continue
WI = new window_to_spawn_regular(get_turf(src))
WI.dir = cdir
else
var/obj/structure/window/W = new windowtospawn(get_turf(src))
W.dir = SOUTHWEST
WI = new window_to_spawn_full(get_turf(src))
synchronize_variables(WI)

if(useGrille)
new /obj/structure/grille(get_turf(src))

air_update_turf(1) //atmos can pass otherwise
// Give some time for nearby window spawners to initialize
spawn(10)
qdel(src)
// why is this line a no-op
// QDEL_IN(src, 10)

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

air_update_turf(TRUE) //atmos can pass otherwise
return INITIALIZE_HINT_QDEL

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

/obj/effect/spawner/window/plasma
name = "plasma window spawner"
icon_state = "pwindow_spawner"
window_to_spawn_regular = /obj/structure/window/plasmabasic
window_to_spawn_full = /obj/structure/window/full/plasmabasic

/obj/effect/spawner/window/reinforced/plasma
name = "reinforced plasma window spawner"
icon_state = "rpwindow_spawner"
window_to_spawn_regular = /obj/structure/window/plasmareinforced
window_to_spawn_full = /obj/structure/window/full/plasmareinforced

/obj/effect/spawner/window/reinforced/tinted
name = "tinted reinforced window spawner"
icon_state = "twindow_spawner"
window_to_spawn_regular = /obj/structure/window/reinforced/tinted
window_to_spawn_full = /obj/structure/window/full/reinforced/tinted

/obj/effect/spawner/window/reinforced/polarized
name = "polarized reinforced window spawner"
name = "electrochromic reinforced window spawner"
icon_state = "ewindow_spawner"
windowtospawn = /obj/structure/window/reinforced/polarized
window_to_spawn_regular = /obj/structure/window/reinforced/polarized
window_to_spawn_full = /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)
W.id = id

/obj/effect/spawner/window/reinforced/plasma
name = "reinforced plasma window spawner"
icon_state = "pwindow_spawner"
windowtospawn = /obj/structure/window/plasmareinforced
/obj/effect/spawner/window/reinforced/polarized/synchronize_variables(atom/a)
if(useFull)
var/obj/structure/window/full/reinforced/polarized/p = a
p.id = id
else
var/obj/structure/window/reinforced/polarized/p = a
p.id = id

// Хоть я и сделала ниже рабочие спавнеры окон шаттлов, но по неясной мне причине,
// атмос пропускает воздух через заспавненные им окна...
// Поэтому воздержитесь от их использования, либо найдите и почините баг это вызывающий :)
/obj/effect/spawner/window/shuttle
name = "shuttle window spawner"
icon = 'icons/obj/smooth_structures/shuttle_window.dmi'
icon_state = "shuttle_window"
useFull = TRUE
windowtospawn = /obj/structure/window/full/shuttle
icon_state = "swindow_spawner"
window_to_spawn_full = /obj/structure/window/full/shuttle

/obj/effect/spawner/window/shuttle/gray
icon = 'icons/obj/smooth_structures/shuttle_window_gray.dmi'
icon_state = "shuttle_window_gray"
windowtospawn = /obj/structure/window/full/shuttle/gray
icon_state = "swindow_gray_spawner"
window_to_spawn_full = /obj/structure/window/full/shuttle/gray

/obj/effect/spawner/window/shuttle/ninja
icon = 'icons/obj/smooth_structures/shuttle_window_ninja.dmi'
icon_state = "shuttle_window_ninja"
windowtospawn = /obj/structure/window/full/shuttle/ninja
icon_state = "swindow_ninja_spawner"
window_to_spawn_full = /obj/structure/window/full/shuttle/ninja
4 changes: 2 additions & 2 deletions code/game/objects/items/weapons/RCD.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
var/region_min = REGION_GENERAL
var/region_max = REGION_COMMAND

var/fulltile_window = FALSE // Do we place fulltile windows?
var/window_type = /obj/structure/window/reinforced
var/fulltile_window = TRUE // Do we place fulltile windows?
var/window_type = /obj/structure/window/full/reinforced
var/floor_type = /turf/simulated/floor/plating
var/wall_type = /turf/simulated/wall
var/firelock_type = /obj/machinery/door/firedoor
Expand Down
Loading