Files
94d92803b4 Replaces our lighting system with CM's. (#21465)
Depends on #21458.

Ports https://github.com/cmss13-devs/cmss13/pull/4229, with the original
authors as:

- https://github.com/tgstation/TerraGov-Marine-Corps/pull/1964 for the
lighting controller (A-lexa)
- https://github.com/tgstation/TerraGov-Marine-Corps/pull/4747 and
https://github.com/tgstation/TerraGov-Marine-Corps/pull/7263 for the
lighting (TiviPlus)
- https://github.com/tgstation/tgstation/pull/54520 for the dir lighting
component
- https://github.com/tgstation/tgstation/pull/75018 for the out of
bounds fix in lighting
- https://github.com/tgstation/TerraGov-Marine-Corps/pull/6678 for the
emissives (TiviPlus)

The main driving reason behind this is that current lighting consumes
way too much processing power, especially for things like odysseys/away
sites where a billion light sources are processing/moving at once and
the game slows down to a crawl. Hopefully this improves the situation by
a good margin, but we will need some testmerging to confirm that.
<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/1059ba2b-c0c5-495a-9c76-2d75d0c42bf2"
/>
<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/9704b0f6-4cf6-4dfd-a6cb-5702ad07d677"
/>


- [x] Resolve todos
- [x] Look into open space fuckery (border objects)

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: JohnWildkins <john.wildkins@gmail.com>
2025-11-04 21:27:42 +00:00

115 lines
3.8 KiB
Plaintext

/datum/technomancer/spell/mark
name = "Mark"
desc = "This function places a specific 'mark' beacon under you, which is used by the Recall function as a destination. \
Note that using Mark again will move the destination instead of creating a second destination, and only one destination \
can exist, regardless of who casted Mark."
cost = 25
obj_path = /obj/item/spell/mark
ability_icon_state = "tech_mark"
category = UTILITY_SPELLS
//The object to teleport to when Recall is used.
/obj/effect/mark_spell
name = "mark"
desc = "This is a strange looking disturbance."
opacity = 0
density = 0
anchored = 1
//This is global, to avoid looping through a list of all objects, or god forbid, looping through world.
GLOBAL_DATUM(mark_spell_ref, /obj/effect/mark_spell)
/obj/item/spell/mark
name = "mark"
icon_state = "mark"
desc = "Marks a specific location to be used by Recall."
cast_methods = CAST_USE
aspect = ASPECT_TELE
/obj/item/spell/mark/on_use_cast(mob/living/user)
. = ..()
if(!allowed_to_teleport()) // Otherwise you could teleport back to the admin Z-level.
to_chat(user, SPAN_WARNING("You can't teleport here!"))
return 0
if(pay_energy(1000))
if(!GLOB.mark_spell_ref)
GLOB.mark_spell_ref = new(get_turf(user))
to_chat(user, SPAN_NOTICE("You mark \the [get_turf(user)] under you."))
else
GLOB.mark_spell_ref.forceMove(get_turf(user))
to_chat(user, SPAN_NOTICE("Your mark is moved from its old position to \the [get_turf(user)] under you."))
adjust_instability(5)
return 1
else
to_chat(user, SPAN_WARNING("You can't afford the energy cost!"))
return 0
//Recall
/datum/technomancer/spell/recall
name = "Recall"
desc = "This function teleports you to where you placed a mark using the Mark function. Without the Mark function, this \
function is useless. Note that teleporting takes three seconds. Being incapacitated while teleporting will cancel it."
enhancement_desc = "Recall takes two seconds instead of three."
cost = 25
obj_path = /obj/item/spell/recall
ability_icon_state = "tech_recall"
category = UTILITY_SPELLS
/obj/item/spell/recall
name = "recall"
icon_state = "recall"
desc = "This will bring you to your Mark."
cast_methods = CAST_USE
aspect = ASPECT_TELE
/obj/item/spell/recall/on_use_cast(mob/living/user)
. = ..()
if(pay_energy(3000))
if(!GLOB.mark_spell_ref)
to_chat(user, SPAN_DANGER("There's no Mark!"))
return 0
else
if(!allowed_to_teleport())
to_chat(user, SPAN_WARNING("Teleportation doesn't seem to work here."))
return
visible_message(SPAN_WARNING("\The [user] starts glowing!"))
var/light_intensity = 2
var/time_left = 3
if(check_for_scepter())
time_left = 2
set_light_on(TRUE)
while(time_left)
if(user.incapacitated())
visible_message(SPAN_NOTICE("\The [user]'s glow fades."))
to_chat(user, SPAN_DANGER("You cannot Recall while incapacitated!"))
return 0
light_intensity++
set_light_range_power_color(light_intensity, light_intensity, "#006AFF")
time_left--
sleep(1 SECOND)
var/turf/target_turf = get_turf(GLOB.mark_spell_ref)
var/turf/old_turf = get_turf(user)
for(var/obj/item/grab/G in user.contents) // People the Technomancer is grabbing come along for the ride.
if(G.affecting)
G.affecting.forceMove(locate( target_turf.x+rand(-1,1), target_turf.y+rand(-1,1), target_turf.z))
to_chat(G.affecting, SPAN_WARNING("You are teleported along with [user]!"))
user.forceMove(target_turf)
to_chat(user, SPAN_NOTICE("You are teleported to your Mark."))
playsound(target_turf, 'sound/effects/phasein.ogg', 25, 1)
playsound(target_turf, 'sound/effects/sparks2.ogg', 50, 1)
playsound(old_turf, 'sound/effects/sparks2.ogg', 50, 1)
adjust_instability(25)
qdel(src)
return 1
else
to_chat(user, SPAN_WARNING("You can't afford the energy cost!"))
return 0