Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emissive APCs #7000

Merged
merged 2 commits into from
Aug 23, 2024
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
2 changes: 2 additions & 0 deletions code/__DEFINES/colours.dm
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
#define LIGHT_COLOR_HOLY_MAGIC "#FFF743"
/// deep crimson
#define LIGHT_COLOR_BLOOD_MAGIC "#D00000"
/// Warm red color rgb(250, 66, 66)
#define LIGHT_COLOR_RED "#ff3b3b"

/* These ones aren't a direct color like the ones above, because nothing would fit */
/// Warm orange color, leaning strongly towards yellow. rgb(250, 160, 25)
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
mouse_drag_pointer = MOUSE_ACTIVE_POINTER
layer = ITEM_LAYER
light_system = MOVABLE_LIGHT
blocks_emissive = EMISSIVE_BLOCK_GENERIC
/// this saves our blood splatter overlay, which will be processed not to go over the edges of the sprite
var/image/blood_overlay = null
var/randpixel = 6
Expand Down
1 change: 1 addition & 0 deletions code/game/objects/structures/crates_lockers/closets.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
icon_state = "closed"
density = TRUE
layer = BELOW_OBJ_LAYER
blocks_emissive = EMISSIVE_BLOCK_GENERIC
var/icon_closed = "closed"
var/icon_opened = "open"
var/opened = 0
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/living/carbon/human/human_defines.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/mob/living/carbon/human
light_system = MOVABLE_LIGHT
rotate_on_lying = TRUE
blocks_emissive = EMISSIVE_BLOCK_UNIQUE
//Hair color and style
var/r_hair = 0
var/g_hair = 0
Expand Down
1 change: 1 addition & 0 deletions code/modules/mob/mob_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
layer = MOB_LAYER
animate_movement = 2
rebounds = TRUE
blocks_emissive = EMISSIVE_BLOCK_GENERIC
var/mob_flags = NO_FLAGS
var/datum/mind/mind

Expand Down
34 changes: 29 additions & 5 deletions code/modules/power/apc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list(

var/printout = FALSE
power_machine = TRUE
light_range = 1
light_power = 0.5

appearance_flags = TILE_BOUND

Expand Down Expand Up @@ -426,6 +428,8 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list(
//2 if we need to update the overlays
if(!update)
return

set_light(0)

if(update & 1) //Updating the icon state
if(update_state & UPSTATE_ALLGOOD)
Expand Down Expand Up @@ -457,12 +461,32 @@ GLOBAL_LIST_INIT(apc_wire_descriptions, list(
overlays = 0

if(!(stat & (BROKEN|MAINT)) && update_state & UPSTATE_ALLGOOD)
overlays += status_overlays_lock[locked + 1]
overlays += status_overlays_charging[charging + 1]
var/image/_lock = status_overlays_lock[locked + 1]
var/image/_charging = status_overlays_charging[charging + 1]
var/image/_equipment = status_overlays_equipment[equipment + 1]
var/image/_lighting = status_overlays_lighting[lighting + 1]
var/image/_environ = status_overlays_environ[environ + 1]
harryob marked this conversation as resolved.
Show resolved Hide resolved

overlays += emissive_appearance(_lock.icon, _lock.icon_state)
overlays += mutable_appearance(_lock.icon, _lock.icon_state)
overlays += emissive_appearance(_charging.icon, _charging.icon_state)
overlays += mutable_appearance(_charging.icon, _charging.icon_state)
if(operating)
overlays += status_overlays_equipment[equipment + 1]
overlays += status_overlays_lighting[lighting + 1]
overlays += status_overlays_environ[environ + 1]
overlays += emissive_appearance(_equipment.icon, _equipment.icon_state)
overlays += mutable_appearance(_equipment.icon, _equipment.icon_state)
overlays += emissive_appearance(_lighting.icon, _lighting.icon_state)
overlays += mutable_appearance(_lighting.icon, _lighting.icon_state)
overlays += emissive_appearance(_environ.icon, _environ.icon_state)
overlays += mutable_appearance(_environ.icon, _environ.icon_state)

switch(charging)
if(APC_NOT_CHARGING)
set_light_color(LIGHT_COLOR_RED)
if(APC_CHARGING)
set_light_color(LIGHT_COLOR_BLUE)
if(APC_FULLY_CHARGED)
set_light_color(LIGHT_COLOR_GREEN)
set_light(initial(light_range))

/obj/structure/machinery/power/apc/proc/check_updates()

Expand Down
1 change: 1 addition & 0 deletions code/modules/vehicles/vehicle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
anchored = TRUE
animate_movement = 1
can_buckle = TRUE
blocks_emissive = EMISSIVE_BLOCK_GENERIC

// The mobs that are in each position/seat of the vehicle
var/list/mob/seats = list(
Expand Down
Loading