mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-20 07:12:55 +00:00
Fixes: - Lighting system bandaid: Lighting overlays can't go below 0 lum ever - -tg- shuttles now use changeTurf() and forceMove() appropriately - forceMove() actually bothers to update lighting now - Fixed teleportlocs including prohibited areas. Sorry wizards, no more area teleporting to Central Command. Misc changes: - Moved the emergency shuttle stuff to the modules/shuttles/ folder - Moved the cargo shuttle stuff to the modules/shuttles/ folder Features: - Added nukeops assault-pod. Nuke ops may purchase a destination setter for 30 telecrystals. The assault pod is a shuttle, equipped with 8 turrets that use weakbullet3. When an area is selected, a destination will be randomly placed in one of the turfs in that area. The pod will gib anyone standing in the area where it lands, and overwrite any turfs.
82 lines
1.5 KiB
Plaintext
82 lines
1.5 KiB
Plaintext
/atom
|
|
var/light_power = 1 // intensity of the light
|
|
var/light_range = 0 // range in tiles of the light
|
|
var/light_color // RGB string representing the colour of the light
|
|
|
|
var/datum/light_source/light
|
|
var/list/light_sources
|
|
|
|
/atom/proc/set_light(l_range, l_power, l_color)
|
|
if(l_power != null) light_power = l_power
|
|
if(l_range != null) light_range = l_range
|
|
if(l_color != null) light_color = l_color
|
|
|
|
update_light()
|
|
|
|
/atom/proc/update_light()
|
|
if(!light_power || !light_range)
|
|
if(light)
|
|
light.destroy()
|
|
light = null
|
|
else
|
|
if(!istype(loc, /atom/movable))
|
|
. = src
|
|
else
|
|
. = loc
|
|
|
|
if(light)
|
|
light.update(.)
|
|
else
|
|
light = new /datum/light_source(src, .)
|
|
|
|
/atom/New()
|
|
. = ..()
|
|
if(light_power && light_range)
|
|
update_light()
|
|
|
|
/atom/Destroy()
|
|
if(light)
|
|
light.destroy()
|
|
light = null
|
|
return ..()
|
|
|
|
/atom/movable/Destroy()
|
|
var/turf/T = loc
|
|
if(opacity && istype(T))
|
|
T.reconsider_lights()
|
|
return ..()
|
|
|
|
/atom/movable/Move()
|
|
var/turf/old_loc = loc
|
|
. = ..()
|
|
|
|
if(loc != old_loc)
|
|
for(var/datum/light_source/L in light_sources)
|
|
L.source_atom.update_light()
|
|
|
|
var/turf/new_loc = loc
|
|
if(istype(old_loc) && opacity)
|
|
old_loc.reconsider_lights()
|
|
|
|
if(istype(new_loc) && opacity)
|
|
new_loc.reconsider_lights()
|
|
|
|
/atom/proc/set_opacity(new_opacity)
|
|
var/old_opacity = opacity
|
|
opacity = new_opacity
|
|
var/turf/T = loc
|
|
if(old_opacity != new_opacity && istype(T))
|
|
T.reconsider_lights()
|
|
|
|
/obj/item/equipped()
|
|
. = ..()
|
|
update_light()
|
|
|
|
/obj/item/pickup()
|
|
. = ..()
|
|
update_light()
|
|
|
|
/obj/item/dropped()
|
|
. = ..()
|
|
update_light()
|