Files
Matt Atlas 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

75 lines
2.3 KiB
Plaintext

/datum/technomancer/spell/phase_shift
name = "Phase Shift"
desc = "Hides you in the safest possible place, where no harm can come to you. Unfortunately, a prolonged stay inside the \
rift you create will afflict you with instability."
cost = 50
obj_path = /obj/item/spell/phase_shift
ability_icon_state = "tech_phaseshift"
category = DEFENSIVE_SPELLS
/obj/item/spell/phase_shift
name = "phase shift"
desc = "Allows you to dodge your untimely fate by shifting your location somewhere else, so long as you can survive inside the \
rift."
icon_state = "blink"
cast_methods = CAST_USE
aspect = ASPECT_TELE
/obj/item/spell/phase_shift/Initialize()
. = ..()
set_light_range_power_color(3, 2, "#FA58F4")
set_light_on(TRUE)
/obj/effect/phase_shift
name = "rift"
desc = "There was a maniac here a moment ago..."
icon = 'icons/obj/wizard.dmi'
icon_state = "rift"
/obj/effect/phase_shift/ex_act()
return
/obj/effect/phase_shift/Initialize(mapload, ...)
. = ..()
set_light_range_power_color(3, 5, "#FA58F4")
set_light_on(TRUE)
START_PROCESSING(SSprocessing, src)
/obj/effect/phase_shift/Destroy()
for(var/atom/movable/AM in contents) //Eject everything out.
AM.forceMove(get_turf(src))
STOP_PROCESSING(SSprocessing, src)
return ..()
/obj/effect/phase_shift/process()
for(var/mob/living/L in contents)
L.adjust_instability(2)
if(L.stat == DEAD || L.stat == UNCONSCIOUS)
L.forceMove(get_turf(src))
L.visible_message(SPAN_WARNING("\The [src] ejects [L]!"))
/obj/effect/phase_shift/relaymove(mob/living/user, direction)
. = ..()
if(user.stat)
return
to_chat(user, SPAN_NOTICE("You step out of the rift."))
user.forceMove(get_turf(src))
qdel(src)
/obj/item/spell/phase_shift/on_use_cast(mob/user)
. = ..()
if(isturf(user.loc)) //Check if we're not already in a rift.
if(pay_energy(2000))
var/obj/effect/phase_shift/PS = new(get_turf(user))
visible_message(SPAN_WARNING("[user] vanishes into a pink rift!"))
to_chat(user, "<span class='info'>You create an unstable rift, and go through it. Be sure to not stay too long.</span>")
user.forceMove(PS)
adjust_instability(10)
qdel(src)
else
to_chat(user, SPAN_WARNING("You don't have enough energy to make a rift!"))
else //We're already in a rift or something like a closet.
to_chat(user, SPAN_WARNING("Making a rift here would probably be a bad idea."))