Skip to content
32 changes: 16 additions & 16 deletions _maps/map_files/Vampire/runtimetown.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@
/obj/effect/turf_decal/bordur{
dir = 1
},
/obj/structure/lamppost/one{
/obj/machinery/light/floor/lamppost/one{
dir = 1
},
/turf/open/floor/plating/sidewalk/rich,
Expand All @@ -307,7 +307,7 @@
/obj/effect/turf_decal/bordur{
dir = 8
},
/obj/structure/lamppost/four,
/obj/machinery/light/floor/lamppost/four,
/turf/open/floor/plating/sidewalk,
/area/vtm/outside/pacificheights)
"hi" = (
Expand Down Expand Up @@ -715,7 +715,7 @@
/turf/open/floor/plating/rough,
/area/vtm/interior/anarch)
"nq" = (
/obj/structure/lamppost/three{
/obj/machinery/light/floor/lamppost/three{
dir = 8
},
/turf/open/floor/plating/sidewalk,
Expand Down Expand Up @@ -884,7 +884,7 @@
/turf/open/floor/plating/concrete,
/area/vtm/interior/shop)
"qz" = (
/obj/structure/lamppost/one,
/obj/machinery/light/floor/lamppost/one,
/turf/open/floor/plating/sidewalk,
/area/vtm/outside/pacificheights)
"qC" = (
Expand Down Expand Up @@ -1093,7 +1093,7 @@
/obj/effect/turf_decal/bordur{
dir = 10
},
/obj/structure/lamppost/four,
/obj/machinery/light/floor/lamppost/four,
/turf/open/floor/plating/sidewalk,
/area/vtm/outside/pacificheights)
"tg" = (
Expand Down Expand Up @@ -1190,7 +1190,7 @@
/obj/effect/turf_decal/bordur{
dir = 4
},
/obj/structure/lamppost/one{
/obj/machinery/light/floor/lamppost/one{
dir = 4
},
/turf/open/floor/plating/sidewalk/rich,
Expand Down Expand Up @@ -1239,7 +1239,7 @@
/obj/effect/turf_decal/bordur{
dir = 8
},
/obj/structure/lamppost/one{
/obj/machinery/light/floor/lamppost/one{
dir = 8
},
/turf/open/floor/plating/sidewalk/rich,
Expand Down Expand Up @@ -1527,7 +1527,7 @@
/obj/effect/turf_decal/bordur{
dir = 4
},
/obj/structure/lamppost/three{
/obj/machinery/light/floor/lamppost/three{
dir = 4
},
/turf/open/floor/plating/sidewalk,
Expand All @@ -1551,7 +1551,7 @@
/area/vtm/interior/shop)
"Bq" = (
/obj/effect/turf_decal/bordur,
/obj/structure/lamppost/one,
/obj/machinery/light/floor/lamppost/one,
/turf/open/floor/plating/sidewalk/poor,
/area/vtm/outside/pacificheights)
"Bs" = (
Expand Down Expand Up @@ -1609,7 +1609,7 @@
/turf/open/floor/plating/asphalt,
/area/vtm/outside/pacificheights)
"Ct" = (
/obj/structure/lamppost/one{
/obj/machinery/light/floor/lamppost/one{
dir = 1
},
/turf/open/floor/plating/sidewalk,
Expand Down Expand Up @@ -1761,7 +1761,7 @@
/turf/open/misc/grass,
/area/vtm/outside/pacificheights)
"DY" = (
/obj/structure/lamppost/one,
/obj/machinery/light/floor/lamppost/one,
/turf/open/floor/plating/sidewalk/rich,
/area/vtm/outside/pacificheights)
"Eb" = (
Expand Down Expand Up @@ -2545,7 +2545,7 @@
/area/vtm/interior/graveyard)
"OA" = (
/obj/effect/turf_decal/bordur,
/obj/structure/lamppost/one,
/obj/machinery/light/floor/lamppost/one,
/turf/open/floor/plating/sidewalk/poor,
/area/vtm/outside/baywalk)
"OB" = (
Expand Down Expand Up @@ -2730,7 +2730,7 @@
/area/vtm/outside/pacificheights)
"QU" = (
/obj/effect/turf_decal/bordur,
/obj/structure/lamppost/one,
/obj/machinery/light/floor/lamppost/one,
/turf/open/floor/plating/sidewalk/poor,
/area/vtm/outside/financialdistrict)
"QW" = (
Expand Down Expand Up @@ -3073,14 +3073,14 @@
/turf/open/floor/plating/elevatorshaft,
/area/vtm/outside/pacificheights)
"WR" = (
/obj/structure/lamppost/one,
/obj/machinery/light/floor/lamppost/one,
/turf/open/misc/beach/vamp,
/area/vtm/outside/pacificheights)
"WW" = (
/turf/open/floor/plating/canal,
/area/vtm/interior/techshop)
"WZ" = (
/obj/structure/lamppost/one{
/obj/machinery/light/floor/lamppost/one{
dir = 8
},
/turf/open/floor/plating/sidewalk,
Expand Down Expand Up @@ -3173,7 +3173,7 @@
/turf/open/floor/plating/rough,
/area/vtm/interior/graveyard)
"XY" = (
/obj/structure/lamppost/three,
/obj/machinery/light/floor/lamppost/three,
/turf/open/floor/plating/sidewalk,
/area/vtm/outside/pacificheights)
"XZ" = (
Expand Down
14 changes: 7 additions & 7 deletions _maps/map_files/Vampire/westfield_mall/westfield_mall.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@
/turf/open/misc/dirt/rails,
/area/vtm/westfield_mall/interior/supply)
"aaW" = (
/obj/structure/lamppost/four{
/obj/machinery/light/floor/lamppost/four{
pixel_y = 8
},
/turf/open/floor/plating/sidewalk/old,
Expand Down Expand Up @@ -1990,7 +1990,7 @@
/obj/effect/turf_decal/bordur{
dir = 1
},
/obj/structure/lamppost/sidewalk,
/obj/machinery/light/floor/lamppost/sidewalk,
/turf/open/floor/plating/sidewalk/old,
/area/vtm/westfield_mall)
"agU" = (
Expand Down Expand Up @@ -3253,7 +3253,7 @@
/obj/effect/turf_decal/bordur/corner{
dir = 4
},
/obj/structure/lamppost/sidewalk,
/obj/machinery/light/floor/lamppost/sidewalk,
/turf/open/floor/plating/sidewalk/old,
/area/vtm/westfield_mall)
"akV" = (
Expand Down Expand Up @@ -10115,7 +10115,7 @@
/turf/open/floor/city/plating,
/area/vtm/interior/bianchiBank)
"aHl" = (
/obj/structure/lamppost/four{
/obj/machinery/light/floor/lamppost/four{
pixel_y = 8
},
/obj/structure/platform/lowwall/brick_old,
Expand Down Expand Up @@ -10518,7 +10518,7 @@
/obj/effect/turf_decal/bordur/corner{
dir = 8
},
/obj/structure/lamppost/sidewalk,
/obj/machinery/light/floor/lamppost/sidewalk,
/turf/open/floor/plating/sidewalk/old,
/area/vtm/westfield_mall)
"aID" = (
Expand Down Expand Up @@ -13829,7 +13829,7 @@
/obj/effect/turf_decal/bordur/corner{
dir = 1
},
/obj/structure/lamppost/sidewalk,
/obj/machinery/light/floor/lamppost/sidewalk,
/turf/open/floor/plating/sidewalk/old,
/area/vtm/westfield_mall)
"aTE" = (
Expand Down Expand Up @@ -14218,7 +14218,7 @@
/area/vtm/westfield_mall)
"aUX" = (
/obj/effect/turf_decal/bordur/corner,
/obj/structure/lamppost/sidewalk,
/obj/machinery/light/floor/lamppost/sidewalk,
/turf/open/floor/plating/sidewalk/old,
/area/vtm/westfield_mall)
"aUY" = (
Expand Down
6 changes: 3 additions & 3 deletions _maps/map_files/Vampire/westfield_mall/westfield_umbra.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@
/turf/open/misc/dirt,
/area/vtm/outside/penumbra)
"cm" = (
/obj/structure/lamppost/sidewalk,
/obj/machinery/light/floor/lamppost/sidewalk,
/turf/open/umbra,
/area/vtm/outside/penumbra)
"cr" = (
Expand Down Expand Up @@ -577,7 +577,7 @@
/turf/open/misc/grass,
/area/vtm/outside/penumbra)
"hO" = (
/obj/structure/lamppost/sidewalk/chinese{
/obj/machinery/light/floor/lamppost/sidewalk/chinese{
dir = 8
},
/turf/open/umbra,
Expand Down Expand Up @@ -2611,7 +2611,7 @@
/turf/open/floor/plating/sidewalk/rich,
/area/vtm/outside/penumbra)
"KB" = (
/obj/structure/lamppost/sidewalk/chinese{
/obj/machinery/light/floor/lamppost/sidewalk/chinese{
dir = 4
},
/turf/open/floor/plating/sidewalkalt,
Expand Down
88 changes: 18 additions & 70 deletions modular_darkpack/modules/decor/code/decor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -33,101 +33,49 @@
layer = ABOVE_ALL_MOB_LAYER
anchored = TRUE

/obj/structure/lamppost
/obj/machinery/light/floor/lamppost
name = "lamppost"
desc = "Gives some light to the streets."
icon = 'modular_darkpack/modules/decor/icons/lamppost.dmi'
base_icon_state = "base"
layer = SPACEVINE_LAYER // Cant even with flav bro - Fallcon
icon_state = "base"
bulb_colour = "#ffde9b"
allow_break_on_init = FALSE
plane = GAME_PLANE
pixel_w = -32
layer = SPACEVINE_LAYER
anchored = TRUE
density = TRUE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF | FREEZE_PROOF
var/number_of_lamps
var/list/my_lights = list()

/obj/structure/lamppost/Initialize(mapload)
/obj/machinery/light/floor/lamppost/Initialize(mapload)
. = ..()
var/area/vtm/my_area = get_area(src)
if(check_holidays(FESTIVE_SEASON))
if(istype(my_area) && my_area.outdoors)
icon_state = "[initial(icon_state)]-snow"
RegisterSignal(my_area, COMSIG_AREA_POWER_CHANGE, PROC_REF(on_power_change))
// DARKPACK TODO - fuseboxes and areas aren't meaningfully connected to each other, and thusly aren't meaningfully connected to lights/devices that may need poer.
// TLDR we need to basically re-evaluate how we approach power... the current system is flavcode spaghetti shit.
if(my_area.powered(AREA_USAGE_LIGHT))
create_lights()

/obj/structure/lamppost/proc/on_power_change(area/A)
SIGNAL_HANDLER
update_appearance()

// note - change this when we get more robust lamppost sprites - for now we only have one for each lamppost type
/obj/machinery/light/floor/lamppost/update_icon_state()
.=..()
icon_state = initial(icon_state)

if(A.power_light)
create_lights()
else
QDEL_LIST(my_lights)

/obj/structure/lamppost/proc/create_lights()
QDEL_LIST(my_lights)
switch(number_of_lamps)
if(1)
new_light(get_step(loc, dir))
if(2)
new_light(get_step(loc, dir))
new_light(get_step(loc, turn(dir, 180)))
if(3)
new_light(get_step(loc, dir))
new_light(get_step(loc, turn(dir, -90)))
new_light(get_step(loc, turn(dir, 90)))
if(4)
new_light(get_step(loc, NORTH))
new_light(get_step(loc, SOUTH))
new_light(get_step(loc, EAST))
new_light(get_step(loc, WEST))
else
new_light(loc)

/obj/structure/lamppost/proc/new_light(location)
my_lights += new /obj/effect/decal/lamplight(location)

/obj/structure/lamppost/Destroy(force)
UnregisterSignal(get_area(src), COMSIG_AREA_POWER_CHANGE)
QDEL_LIST(my_lights)
. = ..()


/obj/effect/decal/lamplight
alpha = 0

// DARKPACK TODO - Fix lol.
/obj/effect/decal/lamplight/NeverShouldHaveComeHere(turf/here_turf)
return FALSE

/obj/effect/decal/lamplight/Initialize(mapload)
. = ..()
set_light(4, 3, "#ffde9b")

/obj/structure/lamppost/one
/obj/machinery/light/floor/lamppost/one
icon_state = "one"
number_of_lamps = 1

/obj/structure/lamppost/two
/obj/machinery/light/floor/lamppost/two
icon_state = "two"
number_of_lamps = 2

/obj/structure/lamppost/three
/obj/machinery/light/floor/lamppost/three
icon_state = "three"
number_of_lamps = 3

/obj/structure/lamppost/four
/obj/machinery/light/floor/lamppost/four
icon_state = "four"
number_of_lamps = 4

/obj/structure/lamppost/sidewalk
/obj/machinery/light/floor/lamppost/sidewalk
icon_state = "civ"
number_of_lamps = 5

/obj/structure/lamppost/sidewalk/chinese
/obj/machinery/light/floor/lamppost/sidewalk/chinese
icon_state = "chinese"

/obj/structure/trafficlight
Expand Down
2 changes: 2 additions & 0 deletions tools/UpdatePaths/Scripts/DarkPack/1373_lamppost_refactor.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/obj/structure/lamppost : /obj/machinery/light/floor/lamppost{@OLD}
/obj/structure/lamppost/@SUBTYPES : /obj/machinery/light/floor/lamppost/@SUBTYPES {@OLD}
Loading