Skip to content

Commit

Permalink
Emissive APCs (#7000)
Browse files Browse the repository at this point in the history
# About the pull request
Adds emissive lights to APCs, Hopefully this PR shows people how easy it
is to add emissives so we can make the game prettier

![image](https://github.com/user-attachments/assets/e0f3c9ad-1a1e-47be-9fd9-e26851dfa34a)

![image](https://github.com/user-attachments/assets/8707353b-beab-4a1b-98d2-4fa956bd84c3)

![image](https://github.com/user-attachments/assets/3a7f65f2-aed0-42aa-8b7a-ffa9bd14f6b1)
Takes inspiration from
tgstation/TerraGov-Marine-Corps#14257 and
tgstation/TerraGov-Marine-Corps#6739 and
#5405
<!-- Remove this text and explain what the purpose of your PR is.

Mention if you have tested your changes. If you changed a map, make sure
you used the mapmerge tool.
If this is an Issue Correction, you can type "Fixes Issue #169420" to
link the PR to the corresponding Issue number #169420.

Remember: something that is self-evident to you might not be to others.
Explain your rationale fully, even if you feel it goes without saying.
-->

# Explain why it's good for the game
Makes it prettier
# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
qol: APCs are now emissive
code: Added emissive blockers to a bunch of stuff
/:cl:
  • Loading branch information
Git-Nivrak authored Aug 23, 2024
1 parent 5b2c396 commit 10e1785
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 5 deletions.
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]

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

0 comments on commit 10e1785

Please sign in to comment.