mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-17 18:09:26 +01:00
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>
52 lines
1.6 KiB
Plaintext
52 lines
1.6 KiB
Plaintext
/obj/item/spell/modifier
|
|
name = "modifier template"
|
|
desc = "Tell a coder if you can read this in-game."
|
|
icon_state = "purify"
|
|
cast_methods = CAST_MELEE
|
|
var/modifier_type = null
|
|
var/modifier_duration = null // Will last forever by default. Final duration may differ due to 'spell power'
|
|
// var/spell_color = "#03A728"
|
|
var/spell_light_intensity = 2
|
|
var/spell_light_range = 3
|
|
|
|
/obj/item/spell/modifier/Initialize()
|
|
. = ..()
|
|
set_light_range_power_color(spell_light_range, spell_light_intensity, light_color)
|
|
set_light_on(TRUE)
|
|
|
|
/obj/item/spell/modifier/on_melee_cast(atom/hit_atom, mob/user)
|
|
. = ..()
|
|
if(isliving(hit_atom))
|
|
return on_add_modifier(hit_atom)
|
|
return FALSE
|
|
|
|
/obj/item/spell/modifier/on_ranged_cast(atom/hit_atom, mob/user)
|
|
. = ..()
|
|
if(isliving(hit_atom))
|
|
return on_add_modifier(hit_atom)
|
|
return FALSE
|
|
|
|
|
|
/obj/item/spell/modifier/proc/on_add_modifier(var/mob/living/L)
|
|
var/duration = modifier_duration
|
|
if(duration)
|
|
duration = round(duration * calculate_spell_power(1.0), 1)
|
|
var/str = calculate_spell_power(1)
|
|
L.add_modifier(modifier_type, 4, owner, 0, str, duration, 4) //the 4s here are MODIFIER_TIMED and MODIFIER_OVERRIDE_STRENGTHEN respectively, but apparently they are "undefined"
|
|
log_and_message_admins("has casted [src] on [L].")
|
|
qdel(src)
|
|
return TRUE
|
|
|
|
// Technomancer specific subtype which keeps track of spell power and gets targeted specifically by Dispel.
|
|
/datum/modifier/technomancer
|
|
var/on_created_text
|
|
var/on_expired_text
|
|
|
|
/datum/modifier/technomancer/activate()
|
|
..()
|
|
to_chat(target, SPAN_WARNING(on_created_text))
|
|
|
|
/datum/modifier/technomancer/stop()
|
|
..()
|
|
to_chat(target, SPAN_WARNING(on_expired_text))
|