Skip to content

Commit

Permalink
Light fix (#1589)
Browse files Browse the repository at this point in the history
Фикс ламп
  • Loading branch information
SpaghettiTerrible authored Nov 29, 2024
1 parent 4b301e9 commit 20aa81c
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
14 changes: 14 additions & 0 deletions code/modules/power/lighting/light.dm
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
var/power_consumption_rate = 20
///break if moved, if false also makes it ignore if the wall its on breaks
var/break_if_moved = TRUE
//ARK STATION
var/pixel_shift = 32

/obj/machinery/light/Move()
if(status != LIGHT_BROKEN && break_if_moved)
Expand Down Expand Up @@ -457,6 +459,18 @@
new_light.icon_state = "bulb-construct-stage[current_stage]"
new_light.setDir(dir)
new_light.stage = current_stage
// ARK STATION ADD START
if(pixel_shift)
switch(dir)
if(NORTH)
new_light.pixel_y = pixel_shift
if(SOUTH)
new_light.pixel_y = -pixel_shift
if(EAST)
new_light.pixel_x = pixel_shift
if(WEST)
new_light.pixel_x = -pixel_shift
// ARK STATION ADD END
if(!disassembled)
new_light.take_damage(new_light.max_integrity * 0.5, sound_effect=FALSE)
if(status != LIGHT_BROKEN)
Expand Down
14 changes: 14 additions & 0 deletions code/modules/power/lighting/light_construct.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
var/obj/item/stock_parts/power_store/cell
///Can we support a cell?
var/cell_connectors = TRUE
///ARK STATION
var/pixel_shift = 32

/datum/armor/structure_light_construct
melee = 50
Expand Down Expand Up @@ -148,6 +150,18 @@
if("bulb")
new_light = new /obj/machinery/light/small/built(loc)
new_light.setDir(dir)
// ARK STATION ADD START
if(pixel_shift)
switch(dir)
if(NORTH)
new_light.pixel_y = pixel_shift
if(SOUTH)
new_light.pixel_y = -pixel_shift
if(EAST)
new_light.pixel_x = pixel_shift
if(WEST)
new_light.pixel_x = -pixel_shift
// ARK STATION ADD END
transfer_fingerprints_to(new_light)
if(!QDELETED(cell))
new_light.cell = cell
Expand Down
27 changes: 27 additions & 0 deletions modularz_arkstation/modules/light-change/code.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,33 @@
/obj/machinery/light/warm
bulb_colour = "#fae5c1"

/obj/item/wallframe/light_fixture/attach(turf/on_wall, mob/user)
if(result_path)
playsound(src.loc, 'sound/machines/click.ogg', 75, TRUE)
user.visible_message(span_notice("[user.name] attaches [src] to the wall."),
span_notice("You attach [src] to the wall."),
span_hear("You hear clicking."))
var/floor_to_wall = get_dir(user, on_wall)

var/obj/hanging_object = new result_path(get_turf(user), floor_to_wall, TRUE)
hanging_object.setDir(floor_to_wall)
pixel_shift = 32
if(pixel_shift)
switch(floor_to_wall)
if(NORTH)
hanging_object.pixel_y = pixel_shift
if(SOUTH)
hanging_object.pixel_y = -pixel_shift
if(EAST)
hanging_object.pixel_x = pixel_shift
if(WEST)
hanging_object.pixel_x = -pixel_shift
after_attach(hanging_object)

qdel(src)



#define MAPPING_DIRECTIONAL_HELPERS_LIGHT(path, dop_offset) ##path/directional/north {\
dir = NORTH; \
pixel_y = 32 + dop_offset; \
Expand Down

0 comments on commit 20aa81c

Please sign in to comment.