Research and Lathes resprite emissives + tcomms emmisives (#20398)

Title. 'nuff seid.

Also fixes the fucked up material insertion animations to use
flick_overlay_view so it isn't laggy as fuck.

And adds emissives to machines that have lights so they glow in the dark
epically.

<img width="138" alt="dreamseeker_N6egRW6Yz3"
src="https://github.com/user-attachments/assets/a17f12ba-b768-4ad6-a35f-baf33aaae658"
/>
This commit is contained in:
Wowzewow (Wezzy)
2025-01-30 23:23:16 +08:00
committed by GitHub
parent c76a3de037
commit edba6021b9
22 changed files with 179 additions and 87 deletions
+25 -9
View File
@@ -47,6 +47,7 @@
..()
wires = new(src)
print_loc = src
update_icon()
return INITIALIZE_HINT_LATELOAD
/obj/machinery/autolathe/LateInitialize()
@@ -269,7 +270,8 @@
/obj/machinery/autolathe/proc/start_processing_queue_item()
if(does_flick)
//Fancy autolathe animation.
AddOverlays("process")
AddOverlays(emissive_appearance(icon, "[icon_state]_lights_working"))
AddOverlays("[icon_state]_lights_working")
autolathe_flags |= AUTOLATHE_STARTED|AUTOLATHE_BUSY
/obj/machinery/autolathe/proc/process_queue_item()
@@ -292,14 +294,23 @@
print_queue -= currently_printing
QDEL_NULL(currently_printing)
CutOverlays("process")
CutOverlays(emissive_appearance(icon, "[icon_state]_lights_working"))
CutOverlays("[icon_state]_lights_working")
I.update_icon()
flick_overlay_view(mutable_appearance(icon, "[icon_state]_print"), 1 SECONDS)
update_use_power(POWER_USE_IDLE)
return TRUE
/obj/machinery/autolathe/update_icon()
icon_state = (panel_open ? "autolathe_panel" : "autolathe")
CutOverlays("[icon_state]_panel")
CutOverlays(emissive_appearance(icon, "[icon_state]_lights"))
CutOverlays("[icon_state]_lights")
if(panel_open)
AddOverlays("[icon_state]_panel")
if(!(stat & (NOPOWER|BROKEN)))
AddOverlays(emissive_appearance(icon, "[icon_state]_lights"))
AddOverlays("[icon_state]_lights")
//Updates overall lathe storage size.
/obj/machinery/autolathe/RefreshParts()
@@ -384,15 +395,20 @@
// Plays metal insertion animation.
if(istype(eating, /obj/item/stack/material))
var/obj/item/stack/material/sheet = eating
var/icon/load = icon(icon, "load")
load.Blend(sheet.material.icon_colour,ICON_MULTIPLY)
AddOverlays(load)
CUT_OVERLAY_IN(load, 6)
var/obj/item/stack/material/stack = eating
var/mutable_appearance/M = mutable_appearance(icon, "material_insertion")
M.color = stack.material.icon_colour
//first play the insertion animation
flick_overlay_view(M, 1 SECONDS)
//now play the progress bar animation
flick_overlay_view(mutable_appearance(icon, "autolathe_progress"), 1 SECONDS)
if(istype(eating, /obj/item/stack))
var/obj/item/stack/stack = eating
var/amount_needed = total_used / mass_per_sheet
var/amount_needed
if(total_used && mass_per_sheet)
amount_needed = total_used / mass_per_sheet
stack.use(min(stack.get_amount(), (round(amount_needed) == amount_needed)? amount_needed : round(amount_needed) + 1)) // Prevent maths imprecision from leading to infinite resources
else
user.remove_from_mob(O)
+3 -4
View File
@@ -20,16 +20,15 @@
)
/obj/machinery/bluespacerelay/process()
update_power()
update_icon()
/obj/machinery/bluespacerelay/update_icon()
ClearOverlays()
if(on)
icon_state = initial(icon_state)
else
icon_state = "[initial(icon_state)]_off"
AddOverlays(emissive_appearance(icon, "[icon_state]_lights"))
AddOverlays("[icon_state]_lights")
/obj/machinery/bluespacerelay/proc/update_power()
+17 -10
View File
@@ -1,8 +1,8 @@
/obj/machinery/mecha_part_fabricator
name = "mechatronic fabricator"
desc = "A general purpose fabricator that can be used to fabricate robotic equipment."
icon = 'icons/obj/machinery/robotics.dmi'
icon_state = "fab-base"
icon = 'icons/obj/machinery/robotics_fabricator.dmi'
icon_state = "fab"
density = TRUE
anchored = TRUE
idle_power_usage = 20
@@ -53,11 +53,15 @@
/obj/machinery/mecha_part_fabricator/update_icon()
ClearOverlays()
icon_state = "fab-base"
if(build_callback_timer)
AddOverlays("fab-active")
if(panel_open)
AddOverlays("fab-panel")
AddOverlays("[icon_state]_panel")
if(!(stat & (NOPOWER|BROKEN)))
AddOverlays(emissive_appearance(icon, "[icon_state]_lights"))
AddOverlays("[icon_state]_lights")
if(build_callback_timer)
AddOverlays("[icon_state]_working")
AddOverlays(emissive_appearance(icon, "[icon_state]_lights_working"))
AddOverlays("[icon_state]_lights_working")
/obj/machinery/mecha_part_fabricator/dismantle()
for(var/f in materials)
@@ -184,10 +188,13 @@
if(materials[M.material.name] + M.perunit <= res_max_amount)
if(M.amount >= 1)
var/count = 0
var/icon/load = icon(icon, "load")
load.Blend(M.material.icon_colour,ICON_MULTIPLY)
AddOverlays(load)
CUT_OVERLAY_IN(load, 6)
var/mutable_appearance/MA = mutable_appearance(icon, "material_insertion")
MA.color = M.material.icon_colour
//first play the insertion animation
flick_overlay_view(MA, 1 SECONDS)
//now play the progress bar animation
flick_overlay_view(mutable_appearance(icon, "fab_progress"), 1 SECONDS)
while(materials[M.material.name] + M.perunit <= res_max_amount && M.amount >= 1)
materials[M.material.name] += M.perunit
@@ -67,9 +67,9 @@
priority = "Undetermined"
/obj/machinery/telecomms/message_server
icon_state = "server"
name = "messaging server"
desc = "A machine that processes and routes request console messages."
icon_state = "message_server"
telecomms_type = /obj/machinery/telecomms/message_server
idle_power_usage = 10
active_power_usage = 100
@@ -164,14 +164,6 @@
else
..()
/obj/machinery/telecomms/message_server/update_icon()
icon_state = initial(icon_state)
ClearOverlays()
if(panel_open)
icon_state += "_o"
if(!operable())
icon_state += "_off"
/datum/signal/subspace/pda
frequency = PUB_FREQ
server_type = /obj/machinery/telecomms/message_server
@@ -71,6 +71,8 @@
if(T != src && (T.z in GetConnectedZlevels(z)))
add_automatic_link(T)
update_icon()
/obj/machinery/telecomms/Destroy()
// QDEL_NULL(soundloop)
SSmachinery.all_telecomms -= src
@@ -106,13 +108,15 @@
return
/obj/machinery/telecomms/update_icon()
var/state = construct_op ? "[initial(icon_state)]_o" : initial(icon_state)
if(!use_power)
state += "_off"
icon_state = state
ClearOverlays()
if(operable())
AddOverlays(emissive_appearance(icon, "[icon_state]_lights"))
AddOverlays("[icon_state]_lights")
if(panel_open)
AddOverlays("[icon_state]_panel")
/obj/machinery/telecomms/process()
update_icon()
if(!use_power) return PROCESS_KILL
if(!operable(EMPED))
toggle_power(additional_flags = EMPED)
@@ -176,7 +176,7 @@
/obj/item/circuitboard/weapons_analyzer
name = T_BOARD("Weapons Analyzer")
desc = "The circuitboard for a weapons analyzer."
build_path = /obj/machinery/weapons_analyzer
build_path = /obj/machinery/r_n_d/weapons_analyzer
origin_tech = list(TECH_DATA = 3, TECH_ENGINEERING = 4, TECH_COMBAT = 3)
board_type = BOARD_MACHINE
req_components = list(
@@ -35,16 +35,18 @@
return TRUE
/obj/machinery/ntnet_relay/update_icon()
icon_state = initial(icon_state)
ClearOverlays()
if(operable())
AddOverlays(emissive_appearance(icon, "[icon_state]_lights"))
AddOverlays("[icon_state]_lights")
if(dos_failure)
AddOverlays(emissive_appearance(icon, "[icon_state]_failure"))
AddOverlays("[icon_state]_failure")
if(!enabled)
AddOverlays(emissive_appearance(icon, "[icon_state]_lights_failure"))
AddOverlays("[icon_state]_lights_failure")
if(panel_open)
icon_state += "_o"
if(!operable())
icon_state += "_off"
else if(dos_failure)
AddOverlays("relay_traitor")
else if(!enabled)
AddOverlays("relay_traitor_activate")
AddOverlays("[icon_state]_panel")
/obj/machinery/ntnet_relay/process()
if(operable())
@@ -219,7 +219,7 @@
/obj/item/device/laser_assembly/proc/finish()
var/obj/machinery/weapons_analyzer/an = analyzer.resolve()
var/obj/machinery/r_n_d/weapons_analyzer/an = analyzer.resolve()
if(!an)
return FALSE
+26 -8
View File
@@ -63,6 +63,7 @@
T += M.rating
mat_efficiency = 1 - (T - 2) / 8
production_speed = T / 2
update_icon()
/obj/machinery/r_n_d/protolathe/dismantle()
for(var/obj/I in component_parts)
@@ -76,13 +77,21 @@
S.amount = round(materials[f] / SHEET_MATERIAL_AMOUNT)
..()
/obj/machinery/r_n_d/protolathe/power_change()
. = ..()
update_icon()
/obj/machinery/r_n_d/protolathe/update_icon()
ClearOverlays()
if(panel_open)
icon_state = "protolathe_t"
else if(build_callback_timer)
icon_state = "protolathe_n"
else
icon_state = "protolathe"
AddOverlays("[icon_state]_panel")
if(!(stat & (NOPOWER|BROKEN)))
AddOverlays(emissive_appearance(icon, "[icon_state]_lights"))
AddOverlays("[icon_state]_lights")
if(build_callback_timer)
AddOverlays("[icon_state]_working")
AddOverlays(emissive_appearance(icon, "[icon_state]_lights_working"))
AddOverlays("[icon_state]_lights_working")
/obj/machinery/r_n_d/protolathe/attackby(obj/item/attacking_item, mob/user)
if(build_callback_timer)
@@ -131,14 +140,22 @@
if(amount <= 0)//No negative numbers, no nulls
return
AddOverlays("protolathe_[stack.default_type]")
CUT_OVERLAY_IN("protolathe_[stack.default_type]", 10)
var/mutable_appearance/M = mutable_appearance(icon, "material_insertion")
M.color = stack.material.icon_colour
//first play the insertion animation
flick_overlay_view(M, 1 SECONDS)
//now play the progress bar animation
flick_overlay_view(mutable_appearance(icon, "protolathe_progress"), 1 SECONDS)
//Use some power and add the materials
use_power_oneoff(max(1000, (SHEET_MATERIAL_AMOUNT * amount / 10)))
if(do_after(user, 1.6 SECONDS))
if(stack.use(amount))
to_chat(user, SPAN_NOTICE("You add [amount] sheets to \the [src]."))
if(amount>1)
to_chat(user, SPAN_NOTICE("You add [amount] [stack.material.sheet_plural_name] of [stack.material.name] to \the [src]."))
else
to_chat(user, SPAN_NOTICE("You add [amount] [stack.material.sheet_singular_name] of [stack.material.name] to \the [src]."))
materials[stack.default_type] += amount * SHEET_MATERIAL_AMOUNT
//In case there's things queued up, we run the queue handler
@@ -184,6 +201,7 @@
//If there's no power, there's no building
if(stat & NOPOWER)
queue = list()
update_icon()
return
//Get the first design in the queue
+2 -2
View File
@@ -5,8 +5,8 @@
/obj/machinery/r_n_d
name = "R&D device"
icon = 'icons/obj/machinery/research.dmi'
density = 1
anchored = 1
density = TRUE
anchored = TRUE
var/busy = 0
var/obj/machinery/computer/rdconsole/linked_console
+1 -2
View File
@@ -1,8 +1,7 @@
/obj/machinery/r_n_d/server
name = "\improper R&D server"
desc = "A server which houses a back-up of all station research. It can be used to restore lost data, or to act as another point of retrieval."
icon = 'icons/obj/machinery/research.dmi'
icon_state = "server"
icon_state = "RD-server"
var/datum/research/files
var/health = 100
var/list/id_with_upload = list() //List of R&D consoles with upload to server access.
+4 -4
View File
@@ -1,7 +1,7 @@
/obj/machinery/r_n_d/tech_processor
name = "\improper R&D tech processor"
desc = "A highly advanced analytical computation engine, when connected to an R&D server with a multitool, it will start processing known technology and add research points to it."
icon_state = "tech_processor"
icon_state = "RD-server"
component_types = list(
/obj/item/circuitboard/rdtechprocessor,
@@ -76,10 +76,10 @@
/obj/machinery/r_n_d/tech_processor/update_icon()
ClearOverlays()
if(stat & (NOPOWER|BROKEN))
icon_state = "[initial(icon_state)]_off"
icon_state = "[initial(icon_state)]-off"
else if(!linked_server)
icon_state = "[initial(icon_state)]_unlinked"
icon_state = "[initial(icon_state)]-halt"
else
icon_state = initial(icon_state)
icon_state = "[initial(icon_state)]-on"
if(panel_open)
AddOverlays("[initial(icon_state)]_open")
+15 -19
View File
@@ -1,13 +1,9 @@
/obj/machinery/weapons_analyzer
/obj/machinery/r_n_d/weapons_analyzer
name = "weapons analyzer"
desc = "A research device which can be used to put together modular energy weapons, or to gain knowledge about the effectiveness of various objects as weaponry."
icon = 'icons/obj/machinery/research.dmi'
icon_state = "weapon_analyzer"
density = TRUE
anchored = TRUE
idle_power_usage = 60
active_power_usage = 2000
var/obj/item/item = null
var/process = FALSE
@@ -17,11 +13,11 @@
/obj/item/stock_parts/console_screen = 1
)
/obj/machinery/weapons_analyzer/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
/obj/machinery/r_n_d/weapons_analyzer/get_examine_text(mob/user, distance, is_adjacent, infix, suffix)
. = ..()
. += SPAN_NOTICE("It has [item ? "[item.name]" : "nothing"] attached.")
/obj/machinery/weapons_analyzer/attackby(obj/item/attacking_item, mob/user)
/obj/machinery/r_n_d/weapons_analyzer/attackby(obj/item/attacking_item, mob/user)
if(!attacking_item || !user || !ishuman(user))
return
@@ -66,15 +62,15 @@
attacking_item.forceMove(src)
update_icon()
/obj/machinery/weapons_analyzer/attack_hand(mob/user)
/obj/machinery/r_n_d/weapons_analyzer/attack_hand(mob/user)
user.set_machine(src)
ui_interact(user)
/obj/machinery/weapons_analyzer/proc/reset()
/obj/machinery/r_n_d/weapons_analyzer/proc/reset()
process = FALSE
update_icon()
/obj/machinery/weapons_analyzer/proc/check_swap(var/mob/user, var/obj/I)
/obj/machinery/r_n_d/weapons_analyzer/proc/check_swap(var/mob/user, var/obj/I)
if(item)
to_chat(user, SPAN_NOTICE("You swap \the [item] out for \the [I]."))
if(istype(item, /obj/item/device/laser_assembly))
@@ -86,7 +82,7 @@
item = null
update_icon()
/obj/machinery/weapons_analyzer/verb/eject()
/obj/machinery/r_n_d/weapons_analyzer/verb/eject()
set name = "Eject Inserted Item"
set category = "Object"
set src in view(1)
@@ -110,7 +106,7 @@
else
to_chat(usr, SPAN_WARNING("There is nothing in \the [src]."))
/obj/machinery/weapons_analyzer/update_icon()
/obj/machinery/r_n_d/weapons_analyzer/update_icon()
icon_state = initial(icon_state)
ClearOverlays()
@@ -129,11 +125,11 @@
// Making gun sprite smaller and centering it where we want, cause dang they are thicc
Icon_used.Scale(round(Icon_used.Width() * 0.75), round(Icon_used.Height() * 0.75))
var/image/gun_overlay = image(Icon_used)
gun_overlay.pixel_x += 7
gun_overlay.pixel_y += 8
gun_overlay.pixel_x += 4
gun_overlay.pixel_y += 12
AddOverlays(gun_overlay)
/obj/machinery/weapons_analyzer/ui_data(mob/user)
/obj/machinery/r_n_d/weapons_analyzer/ui_data(mob/user)
var/list/data = list()
if(istype(item, /obj/item/device/laser_assembly))
@@ -253,7 +249,7 @@
data["item"]["shield_power"] = E_item.shield_power
return data
/obj/machinery/weapons_analyzer/ui_interact(mob/user, var/datum/tgui/ui)
/obj/machinery/r_n_d/weapons_analyzer/ui_interact(mob/user, var/datum/tgui/ui)
var/height = item ? 600: 300
var/width = item ? 500 : 300
if(istype(item, /obj/item/gun/energy/laser/prototype) || istype(item, /obj/item/device/laser_assembly))
@@ -266,7 +262,7 @@
ui.open()
/obj/machinery/weapons_analyzer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
/obj/machinery/r_n_d/weapons_analyzer/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
. = ..()
if(.)
return
@@ -275,13 +271,13 @@
do_print()
. = TRUE
/obj/machinery/weapons_analyzer/proc/do_print()
/obj/machinery/r_n_d/weapons_analyzer/proc/do_print()
var/obj/item/paper/R = new /obj/item/paper(get_turf(src))
R.color = "#fef8ff"
R.set_content_unsafe("Weapon Analysis ([item.name])", get_print_info(item))
print(R, message = "\The [src] beeps, printing \the [R] after a moment.", user = usr)
/obj/machinery/weapons_analyzer/proc/get_print_info(var/obj/item/device)
/obj/machinery/r_n_d/weapons_analyzer/proc/get_print_info(var/obj/item/device)
var/dat = "<span class='notice'><b>Analysis performed at [worldtime2text()]</b></span><br>"
dat += "<span class='notice'><b>Analyzer Item: [device.name]</b></span><br><br>"
dat += device.get_print_info()
@@ -0,0 +1,59 @@
################################
# Example Changelog File
#
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
#
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
# When it is, any changes listed below will disappear.
#
# Valid Prefixes:
# bugfix
# - (fixes bugs)
# wip
# - (work in progress)
# qol
# - (quality of life)
# soundadd
# - (adds a sound)
# sounddel
# - (removes a sound)
# rscadd
# - (adds a feature)
# rscdel
# - (removes a feature)
# imageadd
# - (adds an image or sprite)
# imagedel
# - (removes an image or sprite)
# spellcheck
# - (fixes spelling or grammar)
# experiment
# - (experimental change)
# balance
# - (balance changes)
# code_imp
# - (misc internal code change)
# refactor
# - (refactors code)
# config
# - (makes a change to the config files)
# admin
# - (makes changes to administrator tools)
# server
# - (miscellaneous changes to server)
#################################
# Your name.
author: Wowzewow (Wezzy)
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
delete-after: True
# Any changes you've made. See valid prefix list above.
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
# SCREW THIS UP AND IT WON'T WORK.
# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit.
# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog.
changes:
- imageadd: "Resprites lathes and research machines."
- imageadd: "Adds new emmisives and animations for lathes, research machines and telecomms."
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 19 KiB

+2 -2
View File
@@ -879,8 +879,8 @@
"cCh" = (
/obj/effect/decal/fake_object{
desc = "A general purpose fabricator that can be used to fabricate robotic equipment. This one is in need of some maintenance.";
icon = 'icons/obj/robotics.dmi';
icon_state = "fab-o";
icon = 'icons/obj/robotics_fabricator.dmi';
icon_state = "fab";
name = "mechatronic fabricator";
pixel_y = 16
},
+1 -1
View File
@@ -1468,7 +1468,7 @@
name = "Private AI Channel";
pixel_y = 22
},
/obj/machinery/weapons_analyzer,
/obj/machinery/r_n_d/weapons_analyzer,
/turf/simulated/floor/tiled,
/area/construction/storage)
"eE" = (
+2 -2
View File
@@ -4621,7 +4621,7 @@
},
/area/centcom/holding)
"aHc" = (
/obj/machinery/weapons_analyzer,
/obj/machinery/r_n_d/weapons_analyzer,
/obj/effect/floor_decal/industrial/hatch/yellow,
/turf/simulated/floor/tiled/dark/full,
/area/rnd/lab)
@@ -113233,7 +113233,7 @@
/turf/unsimulated/floor,
/area/centcom/legion)
"qxT" = (
/obj/machinery/weapons_analyzer,
/obj/machinery/r_n_d/weapons_analyzer,
/obj/effect/floor_decal/corner_wide/purple{
dir = 5
},