Skip to content

Commit

Permalink
initial (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
Blundir authored May 26, 2024
1 parent 405c499 commit 4103c1d
Show file tree
Hide file tree
Showing 85 changed files with 455 additions and 95 deletions.
2 changes: 1 addition & 1 deletion code/game/area/areas.dm
Original file line number Diff line number Diff line change
Expand Up @@ -694,7 +694,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
/**
* Called when the area power status changes
*
* Updates the area icon and calls power change on all machinees in the area
* Updates the area icon, calls power change on all machinees in the area, and sends the `COMSIG_AREA_POWER_CHANGE` signal.
*/
/area/proc/power_change()
SEND_SIGNAL(src, COMSIG_AREA_POWER_CHANGE)
Expand Down
3 changes: 3 additions & 0 deletions code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,9 @@ Class Procs:
///Boolean on whether this machines interact with atmos
var/atmos_processing = FALSE

///Animation for material insertion
var/material_insertion_animation

/obj/machinery/Initialize(mapload)
if(!armor)
armor = list(MELEE = 25, BULLET = 10, LASER = 10, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 70)
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/airlock_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@
else
icon_state = "airlock_sensor_off"

/obj/machinery/airlock_sensor/update_overlays()
. = ..()
if(!(stat & BROKEN) && powered())
. += emissive_appearance(icon, "airlock_sensor_lightmask", src)

/obj/machinery/airlock_sensor/attack_hand(mob/user)
. = ..()
if(.)
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,11 @@
to_chat(user, span_notice("You use the cryptographic sequencer on [src]."))
return TRUE

/obj/machinery/autolathe/update_overlays()
. = ..()
if(!(stat & BROKEN) && powered())
. += emissive_appearance(icon, "autolathe_lightmask", src)

//Called when the object is constructed by an autolathe
//Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes
/obj/item/proc/autolathe_crafted(obj/machinery/autolathe/A)
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/cloning.dm
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,11 @@ GLOBAL_VAR_INIT(clones, 0)
log_cloning("[key_name(mob_occupant)] destroyed within [src] at [AREACOORD(src)] due to malfunction.")
QDEL_IN(mob_occupant, 40)

/obj/machinery/clonepod/update_overlays()
. = ..()
if(!(stat & BROKEN) && powered())
. += emissive_appearance(icon, "[icon_state]_lightmask", src, src)

/obj/machinery/clonepod/relaymove(mob/user)
container_resist(user)

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
. += "[icon_keyboard]_off"
else
. += icon_keyboard
. += emissive_appearance(icon, icon_keyboard, src) //Dripstation edit
. += emissive_appearance(icon, "[icon_keyboard]_lightmask", src) //Dripstation edit
if(stat & BROKEN)
. += mutable_appearance(icon, "[icon_state]_broken")
return // If we don't do this broken computers glow in the dark.
Expand Down
19 changes: 19 additions & 0 deletions code/game/machinery/dna_scanner.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@
active_power_usage = 300
occupant_typecache = list(/mob/living, /obj/item/bodypart/head, /obj/item/organ/brain)
circuit = /obj/item/circuitboard/machine/clonescanner
light_color = LIGHT_COLOR_CYAN
light_power = 1.3
light_range = MINIMUM_USEFUL_LIGHT_RANGE
var/locked = FALSE
var/damage_coeff
var/scan_level
var/precision_coeff
var/message_cooldown
var/breakout_time = 1200
var/light_mask = "scanner_lightmask"
var/obj/machinery/computer/scan_consolenew/linked_console = null

/obj/machinery/dna_scannernew/RefreshParts()
Expand Down Expand Up @@ -55,6 +59,21 @@
//running
icon_state = initial(icon_state)+ (state_open ? "_open" : "")


/obj/machinery/dna_scannernew/update_overlays()
. = ..()
if(!(stat & BROKEN) && powered())
if((stat & MAINT) || panel_open)
. += emissive_appearance(icon, initial(light_mask)+ (state_open ? "_open" : "") + "_maintenance", src)
return

if(occupant)
. += emissive_appearance(icon, initial(light_mask)+ "_occupied", src)
return

. += emissive_appearance(icon, initial(light_mask)+ (state_open ? "_open" : ""), src, src)


/obj/machinery/dna_scannernew/proc/toggle_open(mob/user)
if(panel_open)
to_chat(user, span_notice("Close the maintenance panel first."))
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/doppler_array.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ GLOBAL_LIST_EMPTY(doppler_arrays)
/obj/machinery/doppler_array/process()
return PROCESS_KILL

/obj/machinery/doppler_array/update_overlays()
. = ..()
if(!(stat & BROKEN) && powered())
. += emissive_appearance(icon, "tdoppler_lightmask", src)

/obj/machinery/doppler_array/attackby(obj/item/I, mob/user, params)
if(I.tool_behaviour == TOOL_WRENCH)
if(!anchored && !isinspace())
Expand Down
10 changes: 10 additions & 0 deletions code/game/machinery/embedded_controller/access_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@
else
icon_state = "access_button_standby"

/obj/machinery/doorButtons/access_button/update_overlays()
. = ..()
if(!(stat & BROKEN) && powered())
. += emissive_appearance(icon, "access_button_lightmask", src)

/obj/machinery/doorButtons/access_button/removeMe(obj/O)
if(O == door)
door = null
Expand Down Expand Up @@ -255,6 +260,11 @@
else
icon_state = "access_control_standby"

/obj/machinery/doorButtons/airlock_controller/update_overlays()
. = ..()
if(!(stat & BROKEN) && powered())
. += emissive_appearance(icon, "access_control_lightmask", src)

/obj/machinery/doorButtons/airlock_controller/ui_interact(mob/user)
var/datum/browser/popup = new(user, "computer", name)
popup.set_content(returnText())
Expand Down
4 changes: 4 additions & 0 deletions code/game/machinery/embedded_controller/airlock_controller.dm
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@
else
icon_state = "airlock_control_off"

/obj/machinery/embedded_controller/radio/airlock_controller/update_overlays()
. = ..()
if(!(stat & BROKEN) && powered())
. += emissive_appearance(icon, "airlock_control_lightmask", src)

/obj/machinery/embedded_controller/radio/airlock_controller/return_text()
var/state_options = null
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/firealarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
/obj/machinery/firealarm/update_overlays()
. = ..()
if(stat & (NOPOWER|BROKEN))
set_light(0)
return

if(is_station_level(z))
Expand Down
12 changes: 12 additions & 0 deletions code/game/machinery/gulag_processor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ GLOBAL_VAR_INIT(gulag_required_items, typecacheof(list(
icon_state += "_occupied"
return

/obj/machinery/gulag_processor/update_overlays()
. = ..()
var/light_mask
if(!(stat & BROKEN) && powered())
if(occupant)
light_mask = "implantchair_occupied_lightmask"
if(state_open)
light_mask = "implantchair_open_lightmask"
else
light_mask = "implantchair_lightmask"
. += emissive_appearance(icon, light_mask, src, src)


/obj/machinery/gulag_processor/proc/locate_reclaimer()
linked_reclaimer = locate(/obj/machinery/gulag_item_reclaimer)
Expand Down
5 changes: 5 additions & 0 deletions code/game/machinery/porta_turret/portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -955,6 +955,11 @@
else
icon_state = "control_stun"

/obj/machinery/turretid/update_overlays()
. = ..()
if(!(stat & BROKEN) && powered())
. += emissive_appearance(icon, "control_lightmask", src)

/obj/item/wallframe/turret_control
name = "turret control frame"
desc = "Used for building turret control panels."
Expand Down
10 changes: 10 additions & 0 deletions code/game/machinery/rechargestation.dm
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,16 @@
else
icon_state = (state_open ? "borgcharger-u0" : "borgcharger-u1")

/obj/machinery/recharge_station/update_overlays()
. = ..()
var/light_mask
if(is_operational())
if(state_open)
light_mask = "borgcharger0_lightmask"
else
light_mask = (occupant ? "borgcharger1_lightmask" : "borgcharger2_lightmask")
. += emissive_appearance(icon, light_mask, src, BELOW_OBJ_LAYER)

/obj/machinery/recharge_station/proc/process_occupant(delta_time)
if(!occupant)
return
Expand Down
28 changes: 24 additions & 4 deletions code/game/mecha/mech_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
use_power = IDLE_POWER_USE
idle_power_usage = 20
active_power_usage = 5000

material_insertion_animation = "fab-load-"

req_access = list(ACCESS_ROBO_CONTROL)
///Whether the access is hacked or not
Expand Down Expand Up @@ -36,6 +38,8 @@
var/list/build_materials
/// Part currently stored in the Exofab.
var/obj/item/stored_part
/// If fabricator is currently working on something, used for sprites and overlays.
var/working

/// Coefficient for the speed of item building. Based on the installed parts.
var/time_coeff = 1
Expand Down Expand Up @@ -138,6 +142,10 @@
to_chat(user, span_notice("You reengage the safety protocols on the [src], restoring access restrictions to this terminal."))
update_static_data(user)
return
if(istype(I, /obj/item/stack/sheet))
var/datum/material/M = I
var/image/material_animation = image(icon, src, "[material_insertion_animation][M.name]")
flick_overlay_global(material_animation, GLOB.clients, 20)
return ..()
/**
* All the negative wire effects
Expand All @@ -149,6 +157,17 @@
return
return ..()

/obj/machinery/mecha_part_fabricator/update_overlays()
. = ..()
var/emissive_icon
if(!(stat & BROKEN) && powered())
if(!working)
emissive_icon = "fab-light_mask"
if(working)
. += mutable_appearance(icon, "fab-active")
emissive_icon = "fab-active"
. += emissive_appearance(icon, emissive_icon, src)

/obj/machinery/mecha_part_fabricator/proc/wire_break(mob/user)
if(stat & (BROKEN|NOPOWER))
return FALSE
Expand Down Expand Up @@ -306,19 +325,21 @@
* Adds the overlay to show the fab working and sets active power usage settings.
*/
/obj/machinery/mecha_part_fabricator/proc/on_start_printing()
add_overlay("fab-active")
use_power = ACTIVE_POWER_USE
working = TRUE
update_appearance(UPDATE_OVERLAYS)

/**
* Intended to be called when the exofab has stopped working and is no longer printing items.
*
* Removes the overlay to show the fab working and sets idle power usage settings. Additionally resets the description and turns off queue processing.
*/
/obj/machinery/mecha_part_fabricator/proc/on_finish_printing()
cut_overlay("fab-active")
working = FALSE
use_power = IDLE_POWER_USE
desc = initial(desc)
process_queue = FALSE
update_appearance(UPDATE_OVERLAYS)

/**
* Calculates resource/material costs for printing an item based on the machine's resource coefficient.
Expand Down Expand Up @@ -736,8 +757,7 @@

/obj/machinery/mecha_part_fabricator/proc/AfterMaterialInsert(item_inserted, id_inserted, amount_inserted)
var/datum/material/M = id_inserted
add_overlay("fab-load-[M.name]")
addtimer(CALLBACK(src, /atom/proc/cut_overlay, "fab-load-[M.name]"), 10)
. += mutable_appearance(icon, "fab-load-[M.name]")

/obj/machinery/mecha_part_fabricator/screwdriver_act(mob/living/user, obj/item/I)
if(..())
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/devices/flashlight.dm
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,8 @@
lefthand_file = 'icons/mob/inhands/items_lefthand.dmi'
righthand_file = 'icons/mob/inhands/items_righthand.dmi'
force = 10
light_range = 5
light_range = 3
light_system = MOVABLE_LIGHT
w_class = WEIGHT_CLASS_BULKY
flags_1 = CONDUCT_1
materials = list()
Expand Down
Loading

0 comments on commit 4103c1d

Please sign in to comment.