IPC Lights (#1846)

changes:

IPCs now emit a weak light based on the color of their screen.
The system for making species emit light is modular, and Shells+HKs have been excluded from light emission.
This commit is contained in:
Lohikar
2017-03-04 18:02:03 -06:00
committed by skull132
parent 97856e8735
commit 5320d6af3e
5 changed files with 84 additions and 0 deletions
@@ -40,6 +40,8 @@
var/virus_immune
var/short_sighted
var/bald = 0
var/light_range
var/light_power
// Language/culture vars.
var/default_language = "Ceti Basic" // Default language is used when 'say' is used without modifiers.
@@ -438,3 +440,6 @@
return 0
H.hud_used.move_intent.update_move_icon(H)
return 1
/datum/species/proc/get_light_color(hair_style)
return
@@ -17,6 +17,9 @@
icobase = 'icons/mob/human_races/r_human.dmi'
deform = 'icons/mob/human_races/robotic.dmi'
light_range = 0
light_power = 0
eyes = "eyes_s"
show_ssd = "completely quiescent"
@@ -48,6 +51,8 @@
"r_foot" = list("path" = /obj/item/organ/external/foot/right/shell)
)
/datum/species/machine/shell/get_light_color(hair_style)
return
/datum/species/machine/shell/handle_post_spawn(var/mob/living/carbon/human/H)
add_inherent_verbs(H)
@@ -128,6 +133,9 @@
sprint_speed_factor = 1.4
/datum/species/machine/industrial/get_light_color(hair_style)
return LIGHT_COLOR_TUNGSTEN
/datum/species/machine/industrial/handle_sprint_cost(var/mob/living/carbon/human/H, var/cost)
if (H.stat == CONSCIOUS)
H.bodytemperature += cost*0.9
@@ -156,6 +164,9 @@
icobase = 'icons/mob/human_races/r_terminator.dmi'
deform = 'icons/mob/human_races/r_terminator.dmi'
light_range = 0
light_power = 0
unarmed_types = list(/datum/unarmed_attack/terminator)
rarity_value = 20
@@ -231,6 +242,8 @@
sprint_speed_factor = 1.25
slowdown = 1
/datum/species/machine/terminator/get_light_color(hair_style)
return
/datum/species/machine/terminator/handle_sprint_cost(var/mob/living/carbon/human/H, var/cost)
if (H.stat == CONSCIOUS)
@@ -355,6 +355,9 @@
icobase = 'icons/mob/human_races/r_machine.dmi'
deform = 'icons/mob/human_races/r_machine.dmi'
light_range = 2
light_power = 0.5
unarmed_types = list(/datum/unarmed_attack/punch)
rarity_value = 2
@@ -503,6 +506,55 @@ datum/species/machine/handle_post_spawn(var/mob/living/carbon/human/H)
var/DBQuery/update_query = dbcon.NewQuery("UPDATE ss13_ipc_tracking SET tag_status = :status WHERE player_ckey = :ckey AND character_name = :character_name")
update_query.Execute(query_details)
/datum/species/machine/get_light_color(hair_style)
// I hate this, but I can't think of a better way that doesn't involve
// rewriting hair.
switch (hair_style)
if ("pink IPC screen")
return LIGHT_COLOR_PINK
if ("red IPC screen")
return LIGHT_COLOR_RED
if ("green IPC screen")
return LIGHT_COLOR_GREEN
if ("blue IPC screen")
return LIGHT_COLOR_BLUE
if ("breakout IPC screen")
return LIGHT_COLOR_CYAN
if ("eight IPC screen")
return LIGHT_COLOR_CYAN
if ("goggles IPC screen")
return LIGHT_COLOR_RED
if ("heart IPC screen")
return LIGHT_COLOR_PINK
if ("monoeye IPC screen")
return LIGHT_COLOR_ORANGE
if ("nature IPC screen")
return LIGHT_COLOR_CYAN
if ("orange IPC screen")
return LIGHT_COLOR_ORANGE
if ("purple IPC screen")
return LIGHT_COLOR_PURPLE
if ("shower IPC screen")
return "#FFFFFF"
if ("static IPC screen")
return "#FFFFFF"
if ("yellow IPC screen")
return LIGHT_COLOR_YELLOW
/datum/species/bug
name = "Vaurca Worker"
short_name = "vau"
@@ -389,6 +389,16 @@ var/global/list/damage_icon_parts = list()
face_standing.Blend(hair_s, ICON_OVERLAY)
if (species.light_range)
var/col = species.get_light_color(h_style)
if (!col)
col = "#FFFFFF"
set_light(species.light_range, species.light_power, col, uv = 0, angle = LIGHT_WIDE)
else if (species.light_range)
set_light(FALSE)
overlays_standing[HAIR_LAYER] = image(face_standing)
if(update_icons) update_icons()