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

Commit

Permalink
ref + fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
AyIong committed Jun 23, 2023
1 parent fbe90b8 commit 7e65282
Show file tree
Hide file tree
Showing 18 changed files with 110 additions and 71 deletions.
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 = 1
var/useGrille = 1
var/windowtospawn = /obj/structure/window/full/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/full/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/full/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/full/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/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/full/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
62 changes: 35 additions & 27 deletions code/game/objects/structures/window.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
var/decon_speed = null
var/fulltile = FALSE
var/shardtype = /obj/item/shard
var/glass_decal = /obj/effect/decal/cleanable/glass
var/glass_type = /obj/item/stack/sheet/glass
var/glass_amount = 1
var/cancolor = FALSE
Expand Down Expand Up @@ -149,7 +150,7 @@

/obj/structure/window/attack_tk(mob/user)
user.changeNext_move(CLICK_CD_MELEE)
user.visible_message("<span class='notice'>Something knocks on [src].</span>")
user.visible_message("<span class='notice'>Кто-то стучит по [src].</span>")
add_fingerprint(user)
playsound(src, 'sound/effects/glassknock.ogg', 50, 1)

Expand All @@ -161,17 +162,17 @@
if(ishuman(user) && user.dna.species.obj_damage)
attack_generic(user, user.dna.species.obj_damage)
else
playsound(src, 'sound/effects/glassknock.ogg', 80, 1)
user.visible_message("<span class='warning'>[user] bangs against [src]!</span>", \
"<span class='warning'>You bang against [src]!</span>", \
"You hear a banging sound.")
playsound(src, 'sound/effects/glassbang.ogg', 100, 1)
user.visible_message("<span class='warning'>[user] снова бьёт по [src]!</span>", \
"<span class='warning'>Вы бьёте по [src]!</span>", \
"Вы слышите стук.")
add_fingerprint(user)
else
user.changeNext_move(CLICK_CD_MELEE)
playsound(src, 'sound/effects/glassknock.ogg', 80, 1)
user.visible_message("[user] knocks on [src].", \
"You knock on [src].", \
"You hear a knocking sound.")
playsound(src, 'sound/effects/glassknock.ogg', 50, 1)
user.visible_message("[user] стучит по [src].", \
"Вы стучите по [src].", \
"Вы слышите стук.")
add_fingerprint(user)

/obj/structure/window/attack_generic(mob/user, damage_amount = 0, damage_type = BRUTE, damage_flag = 0, sound_effect = 1) //used by attack_alien, attack_animal, and attack_slime
Expand Down Expand Up @@ -353,6 +354,15 @@
qdel(src)
update_nearby_icons()

/obj/structure/window/proc/spawnDebris(location)
. = list()
. += new shardtype(location)
. += new glass_decal(location)
if(reinf)
. += new /obj/item/stack/rods(location, (fulltile ? 2 : 1))
if(fulltile)
. += new shardtype(location)

/obj/structure/window/rcd_deconstruct_act(mob/user, obj/item/rcd/our_rcd)
. = ..()
var/obj/structure/grille/our_grille = locate(/obj/structure/grille) in get_turf(src)
Expand Down Expand Up @@ -525,12 +535,12 @@
/obj/structure/window/full/proc/toggle_full_polarization()
if(opacity)
if(!old_icon)
old_icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
old_icon = 'icons/obj/smooth_structures/windows/reinforced_window.dmi'
animate(src, icon = old_icon, time = 0.5 SECONDS)
set_opacity(FALSE)
else
old_icon = icon
animate(src, icon = 'icons/obj/smooth_structures/tinted_window.dmi', time = 0.5 SECONDS)
animate(src, icon = 'icons/obj/smooth_structures/windows/tinted_window.dmi', time = 0.5 SECONDS)
set_opacity(TRUE)

/obj/structure/window/full/reinforced/polarized
Expand Down Expand Up @@ -609,6 +619,7 @@
name = "plasma window"
desc = "A window made out of a plasma-silicate alloy. It looks insanely tough to break and burn through."
icon_state = "plasmawindow"
glass_decal = /obj/effect/decal/cleanable/glass/plasma
shardtype = /obj/item/shard/plasma
glass_type = /obj/item/stack/sheet/plasmaglass
heat_resistance = 32000
Expand All @@ -623,6 +634,7 @@
name = "reinforced plasma window"
desc = "A plasma-glass alloy window, with rods supporting it. It looks hopelessly tough to break. It also looks completely fireproof, considering how basic plasma windows are insanely fireproof."
icon_state = "plasmarwindow"
glass_decal = /obj/effect/decal/cleanable/glass/plasma
shardtype = /obj/item/shard/plasma
glass_type = /obj/item/stack/sheet/plasmarglass
reinf = TRUE
Expand All @@ -647,7 +659,7 @@

/obj/structure/window/full/basic
desc = "It looks thin and flimsy. A few knocks with... anything, really should shatter it."
icon = 'icons/obj/smooth_structures/window.dmi'
icon = 'icons/obj/smooth_structures/windows/window.dmi'
icon_state = "window"
max_integrity = 50
smooth = SMOOTH_TRUE
Expand All @@ -673,8 +685,9 @@
/obj/structure/window/full/plasmabasic
name = "plasma window"
desc = "A plasma-glass alloy window. It looks insanely tough to break. It appears it's also insanely tough to burn through."
icon = 'icons/obj/smooth_structures/plasma_window.dmi'
icon = 'icons/obj/smooth_structures/windows/plasma_window.dmi'
icon_state = "plasmawindow"
glass_decal = /obj/effect/decal/cleanable/glass/plasma
shardtype = /obj/item/shard/plasma
glass_type = /obj/item/stack/sheet/plasmaglass
heat_resistance = 32000
Expand Down Expand Up @@ -713,8 +726,9 @@
/obj/structure/window/full/plasmareinforced
name = "reinforced plasma window"
desc = "A plasma-glass alloy window, with rods supporting it. It looks hopelessly tough to break. It also looks completely fireproof, considering how basic plasma windows are insanely fireproof."
icon = 'icons/obj/smooth_structures/rplasma_window.dmi'
icon = 'icons/obj/smooth_structures/windows/rplasma_window.dmi'
icon_state = "rplasmawindow"
glass_decal = /obj/effect/decal/cleanable/glass/plasma
shardtype = /obj/item/shard/plasma
glass_type = /obj/item/stack/sheet/plasmarglass
smooth = SMOOTH_TRUE
Expand Down Expand Up @@ -746,7 +760,7 @@
/obj/structure/window/full/reinforced
name = "reinforced window"
desc = "It looks rather strong. Might take a few good hits to shatter it."
icon = 'icons/obj/smooth_structures/reinforced_window.dmi'
icon = 'icons/obj/smooth_structures/windows/reinforced_window.dmi'
icon_state = "r_window"
smooth = SMOOTH_TRUE
canSmoothWith = list(
Expand Down Expand Up @@ -777,20 +791,14 @@
/obj/structure/window/full/reinforced/tinted
name = "tinted window"
desc = "It looks rather strong and opaque. Might take a few good hits to shatter it."
icon = 'icons/obj/smooth_structures/tinted_window.dmi'
icon = 'icons/obj/smooth_structures/windows/tinted_window.dmi'
icon_state = "tinted_window"
opacity = 1

/obj/structure/window/full/reinforced/ice
icon = 'icons/obj/smooth_structures/rice_window.dmi'
icon_state = "ice_window"
max_integrity = 150
cancolor = FALSE

/obj/structure/window/full/shuttle
name = "shuttle window"
desc = "A reinforced, air-locked pod window."
icon = 'icons/obj/smooth_structures/shuttle_window.dmi'
icon = 'icons/obj/smooth_structures/windows/shuttle_window.dmi'
icon_state = "shuttle_window"
max_integrity = 100
reinf = TRUE
Expand All @@ -810,7 +818,7 @@
/obj/structure/window/full/shuttle/gray
name = "shuttle window"
desc = "A reinforced, air-locked shuttle window."
icon = 'icons/obj/smooth_structures/shuttle_window_gray.dmi'
icon = 'icons/obj/smooth_structures/windows/shuttle_window_gray.dmi'
icon_state = "shuttle_window_gray"

/obj/structure/window/full/shuttle/gray/tinted
Expand All @@ -819,7 +827,7 @@
/obj/structure/window/full/shuttle/ninja
name = "High-Tech shuttle window"
desc = "A reinforced, air-locked shuttle window."
icon = 'icons/obj/smooth_structures/shuttle_window_ninja.dmi'
icon = 'icons/obj/smooth_structures/windows/shuttle_window_ninja.dmi'
icon_state = "shuttle_window_ninja"
armor = list("melee" = 50, "bullet" = 30, "laser" = 0, "energy" = 0, "bomb" = 50, "bio" = 100, "rad" = 100, "fire" = 100, "acid" = 100)

Expand All @@ -829,7 +837,7 @@
/obj/structure/window/plastitanium
name = "plastitanium window"
desc = "An evil looking window of plasma and titanium."
icon = 'icons/obj/smooth_structures/plastitanium_window.dmi'
icon = 'icons/obj/smooth_structures/windows/plastitanium_window.dmi'
icon_state = "plastitanium_window"
dir = FULLTILE_WINDOW_DIR
max_integrity = 100
Expand All @@ -848,7 +856,7 @@
/obj/structure/window/reinforced/clockwork
name = "brass window"
desc = "A paper-thin pane of translucent yet reinforced brass."
icon = 'icons/obj/smooth_structures/clockwork_window.dmi'
icon = 'icons/obj/smooth_structures/windows/clockwork_window.dmi'
icon_state = "clockwork_window_single"
resistance_flags = FIRE_PROOF | ACID_PROOF
max_integrity = 80
Expand Down
Binary file modified icons/obj/shards.dmi
Binary file not shown.
Binary file removed icons/obj/smooth_structures/rice_window.dmi
Binary file not shown.
Binary file not shown.
Binary file modified icons/obj/structures.dmi
Binary file not shown.
Binary file added sound/effects/glassbang.ogg
Binary file not shown.

0 comments on commit 7e65282

Please sign in to comment.