mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-26 14:31:59 +01:00
Radial Floodlight (#11120)
This commit is contained in:
@@ -2407,6 +2407,7 @@
|
||||
#include "code\modules\power\port_gen.dm"
|
||||
#include "code\modules\power\power.dm"
|
||||
#include "code\modules\power\powernet.dm"
|
||||
#include "code\modules\power\radial_floodlight.dm"
|
||||
#include "code\modules\power\rtg.dm"
|
||||
#include "code\modules\power\smes.dm"
|
||||
#include "code\modules\power\smes_construction.dm"
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/obj/machinery/power/radial_floodlight
|
||||
name = "radial floodlight"
|
||||
desc = "A floodlight that illuminates a wide area around it. It has to be wrenched down on top of a knot to work."
|
||||
icon = 'icons/obj/machines/floodlight.dmi'
|
||||
icon_state = "radial_floodlight"
|
||||
anchored = FALSE
|
||||
density = TRUE
|
||||
active_power_usage = 800
|
||||
light_color = LIGHT_COLOR_TUNGSTEN
|
||||
|
||||
var/on = FALSE
|
||||
var/brightness_on = 12
|
||||
|
||||
/obj/machinery/power/radial_floodlight/proc/toggle_active(var/force_state)
|
||||
if(!isnull(force_state))
|
||||
if(force_state == on)
|
||||
return
|
||||
on = force_state
|
||||
else
|
||||
on = !on
|
||||
if(on)
|
||||
set_light(brightness_on, 1)
|
||||
START_PROCESSING(SSprocessing, src)
|
||||
else
|
||||
set_light(0)
|
||||
STOP_PROCESSING(SSprocessing, src)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/power/radial_floodlight/machinery_process()
|
||||
var/actual_load = draw_power(active_power_usage)
|
||||
if(!on || !anchored || (stat & BROKEN) || !powernet || actual_load < active_power_usage)
|
||||
toggle_active(FALSE)
|
||||
return
|
||||
|
||||
/obj/machinery/power/radial_floodlight/attackby(obj/item/W, mob/user)
|
||||
if(W.iswrench())
|
||||
anchored = !anchored
|
||||
user.visible_message(SPAN_NOTICE("\The [user] [anchored ? "" : "un"]secures \the [src] [anchored ? "to" : "from"] the floor."), SPAN_NOTICE("You [anchored ? "" : "un"]secure \the [src] [anchored ? "to" : "from"] the floor."), SPAN_WARNING("You hear a ratcheting noise."))
|
||||
if(!anchored)
|
||||
toggle_active(FALSE)
|
||||
else
|
||||
connect_to_network()
|
||||
playsound(get_turf(src), W.usesound, 75, TRUE)
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/radial_floodlight/attack_hand(mob/user)
|
||||
if(!anchored)
|
||||
to_chat(user, SPAN_WARNING("\The [src] isn't anchored."))
|
||||
return
|
||||
if(!powernet)
|
||||
to_chat(user, SPAN_WARNING("\The [src] isn't connected to a power network."))
|
||||
return
|
||||
if(avail() < active_power_usage)
|
||||
to_chat(user, SPAN_WARNING("\The [src]'s power network doesn't have enough power."))
|
||||
return
|
||||
toggle_active()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/power/radial_floodlight/update_icon()
|
||||
cut_overlays()
|
||||
if(on)
|
||||
add_overlay(image(icon, src, "[icon_state]-light", EFFECTS_ABOVE_LIGHTING_LAYER))
|
||||
@@ -0,0 +1,6 @@
|
||||
author: Geeves
|
||||
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- rscadd: "Added radial floodlights, 360 degree floodlights. Needs to be placed on a knot to work. Mapped two into engineering hard storage."
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 5.2 KiB |
@@ -6853,7 +6853,6 @@
|
||||
/obj/machinery/light{
|
||||
dir = 4
|
||||
},
|
||||
/obj/machinery/power/port_gen/pacman,
|
||||
/turf/simulated/floor/plating,
|
||||
/area/engineering/storage_hard)
|
||||
"anI" = (
|
||||
@@ -8202,6 +8201,7 @@
|
||||
d2 = 8;
|
||||
icon_state = "1-8"
|
||||
},
|
||||
/obj/machinery/power/radial_floodlight,
|
||||
/turf/simulated/floor/plating,
|
||||
/area/engineering/storage_hard)
|
||||
"apZ" = (
|
||||
@@ -65594,6 +65594,10 @@
|
||||
},
|
||||
/turf/simulated/floor/wood,
|
||||
/area/maintenance/bar)
|
||||
"pam" = (
|
||||
/obj/machinery/power/port_gen/pacman,
|
||||
/turf/simulated/floor/plating,
|
||||
/area/engineering/storage_hard)
|
||||
"pch" = (
|
||||
/turf/simulated/floor/plating,
|
||||
/area/maintenance/workshop)
|
||||
@@ -69873,6 +69877,15 @@
|
||||
},
|
||||
/turf/simulated/floor/plating,
|
||||
/area/maintenance/vault)
|
||||
"wdB" = (
|
||||
/obj/structure/cable/green{
|
||||
d1 = 1;
|
||||
d2 = 2;
|
||||
icon_state = "1-2"
|
||||
},
|
||||
/obj/machinery/power/radial_floodlight,
|
||||
/turf/simulated/floor/plating,
|
||||
/area/engineering/storage_hard)
|
||||
"wee" = (
|
||||
/obj/machinery/atmospherics/pipe/simple/hidden/scrubbers{
|
||||
dir = 4
|
||||
@@ -87470,7 +87483,7 @@ akz
|
||||
akz
|
||||
amu
|
||||
anF
|
||||
anF
|
||||
wdB
|
||||
apY
|
||||
anE
|
||||
asA
|
||||
@@ -87726,7 +87739,7 @@ ajL
|
||||
akz
|
||||
akz
|
||||
amv
|
||||
anE
|
||||
pam
|
||||
gaR
|
||||
apZ
|
||||
arm
|
||||
|
||||
Reference in New Issue
Block a user