mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-07-11 07:58:57 +01:00
Simpler lighting process, bug fixes, & modular computer tweaks (#1809)
Fixes #1806 Fixes #1730 Fixes #1747 Partially addresses #1763 Addresses #1283 Fixes #1799 Fixes #1816 Fixes #1813
This commit is contained in:
@@ -83,15 +83,21 @@
|
||||
|
||||
overlays.Cut()
|
||||
if(!enabled)
|
||||
if(icon_state_screensaver)
|
||||
var/probably_working = hard_drive && processor_unit && damage < broken_damage && (apc_power(0) || battery_power(0))
|
||||
if(icon_state_screensaver && probably_working)
|
||||
overlays.Add(icon_state_screensaver)
|
||||
set_light(0)
|
||||
|
||||
if (screensaver_light_range && probably_working)
|
||||
set_light(screensaver_light_range, 1, screensaver_light_color ? screensaver_light_color : "#FFFFFF")
|
||||
else
|
||||
set_light(0)
|
||||
return
|
||||
set_light(light_strength)
|
||||
if(active_program)
|
||||
overlays.Add(active_program.program_icon_state ? active_program.program_icon_state : icon_state_menu)
|
||||
set_light(light_strength, l_color = active_program.color)
|
||||
else
|
||||
overlays.Add(icon_state_menu)
|
||||
set_light(light_strength, l_color = menu_light_color)
|
||||
|
||||
/obj/item/modular_computer/proc/turn_on(var/mob/user)
|
||||
if(tesla_link)
|
||||
|
||||
@@ -63,6 +63,7 @@
|
||||
H.holder2 = src
|
||||
user.drop_from_inventory(H)
|
||||
H.forceMove(src)
|
||||
update_icon()
|
||||
|
||||
// Uninstalls component. Found and Critical vars may be passed by parent types, if they have additional hardware.
|
||||
/obj/item/modular_computer/proc/uninstall_component(var/mob/living/user, var/obj/item/weapon/computer_hardware/H, var/found = 0, var/critical = 0)
|
||||
@@ -101,10 +102,10 @@
|
||||
to_chat(user, "You remove \the [H] from \the [src].")
|
||||
H.forceMove(get_turf(src))
|
||||
H.holder2 = null
|
||||
update_icon()
|
||||
if(critical && enabled)
|
||||
to_chat(user, "<span class='danger'>\The [src]'s screen freezes for few seconds and then displays an \"HARDWARE ERROR: Critical component disconnected. Please verify component connection and reboot the device. If the problem persists contact technical support for assistance.\" warning.</span>")
|
||||
shutdown_computer()
|
||||
update_icon()
|
||||
|
||||
|
||||
// Checks all hardware pieces to determine if name matches, if yes, returns the hardware piece, otherwise returns null
|
||||
|
||||
@@ -153,10 +153,14 @@
|
||||
if(components.len)
|
||||
to_chat(user, "Remove all components from \the [src] before disassembling it.")
|
||||
return
|
||||
new /obj/item/stack/material/steel( get_turf(src.loc), steel_sheet_cost )
|
||||
src.visible_message("\The [src] has been disassembled by [user].")
|
||||
//relay_qdel()
|
||||
qdel(src)
|
||||
to_chat(user, span("notice", "You begin to disassemble \the [src]."))
|
||||
playsound(user, 'sound/items/Ratchet.ogg', 100, 1)
|
||||
if (do_after(user, 20))
|
||||
new /obj/item/stack/material/steel(get_turf(src.loc), steel_sheet_cost)
|
||||
src.visible_message("\The [user] disassembles \the [src].",
|
||||
"You disassemble \the [src].",
|
||||
"You hear a ratchet.")
|
||||
qdel(src)
|
||||
return
|
||||
if(istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
@@ -169,6 +173,7 @@
|
||||
return
|
||||
|
||||
to_chat(user, "You begin repairing damage to \the [src]...")
|
||||
playsound(src, 'sound/items/Welder.ogg', 100, 1)
|
||||
if(WT.remove_fuel(round(damage/75)) && do_after(usr, damage/10))
|
||||
damage = 0
|
||||
to_chat(user, "You repair \the [src].")
|
||||
|
||||
@@ -28,6 +28,9 @@
|
||||
var/icon_state_unpowered = null // Icon state when the computer is turned off
|
||||
var/icon_state_menu = "menu" // Icon state overlay when the computer is turned on, but no program is loaded that would override the screen.
|
||||
var/icon_state_screensaver = null
|
||||
var/screensaver_light_range = 0
|
||||
var/screensaver_light_color = null
|
||||
var/menu_light_color = null
|
||||
var/max_hardware_size = 0 // Maximal hardware size. Currently, tablets have 1, laptops 2 and consoles 3. Limits what hardware types can be installed.
|
||||
var/steel_sheet_cost = 5 // Amount of steel sheets refunded when disassembling an empty frame of this computer.
|
||||
var/light_strength = 0 // Intensity of light this computer emits. Comparable to numbers light fixtures use.
|
||||
|
||||
Reference in New Issue
Block a user