Files
Matt Atlas e0aa218843 Shell May Cry: A comprehensive rework of synthetics. (#20721)
https://www.youtube.com/watch?v=9mPvZ96pHJI

A pull request commissioned by the Synthetic Lore Team to
comprehensively rework synthetics (read: IPCs) and how they work in
Aurora. The objective is to make IPCs as unique as possible from humans,
upgrading the robotic feel and atmosphere, while also preserving a good
sense of balance in-game.

Key features:

- A comprehensive expansion of synthetic organs, all of which now
fulfill a purpose: hydraulics, cooling units, power systems, actuators,
diagnostics units.
- Customizable organs with benefits and drawbacks, such as with cooling
units and power systems.
- Unique ways to repair the organs and more involved steps.
- Unique damage mechanics - every organ has wiring and electronics which
affect its functioning, and they are defended by plating which provides
natural armour.
- Improved and immersive diagnostics.
- Unique features, benefits, and drawbacks for every IPC frame.
- A rework of the positronic brain, which can be either destroyed or
shut down, alongside effects caused by low integrity.
- A rework of how EMPs affect IPC organs.
- Non-binary damage states for each organ.

To-do:

- [x] Finish the unique features for each frame.
- [x] Look into if mechanical synthskin is possible.
- [x] Power system.
- [x] Posibrain mechanics.
- [ ] Passive cooling expansion.
- [x] EMP mechanics.
- [x] Repair mechanics.
- [x] Mob weight mechanics.
- [ ] Gurney for heavy mobs.
- [x] New augments.
- [ ] IPC tag scanning and flashing.

---------

Signed-off-by: Werner <1331699+Arrow768@users.noreply.github.com>
Co-authored-by: Matt Atlas <liermattia@gmail.com>
Co-authored-by: Geeves <22774890+Geevies@users.noreply.github.com>
Co-authored-by: Werner <1331699+Arrow768@users.noreply.github.com>
2025-12-21 16:26:23 +00:00

131 lines
4.0 KiB
Plaintext

/*
* These are ported from TGMC and are hopefully more flexible than text blurbs
*/
/**
* proc for playing a screen_text on a mob.
* enqueues it if a screen text is running and plays i otherwise
* Arguments:
* * text: text we want to be displayed
* * alert_type: typepath for screen text type we want to play here
* * override_color: the color of the text to use
*/
/mob/proc/play_screen_text(text, alert_type = /atom/movable/screen/text/screen_text, override_color = "#FFFFFF")
var/atom/movable/screen/text/screen_text/text_box = new alert_type()
text_box.text_to_play = text
text_box.player = client
if(override_color)
text_box.color = override_color
LAZYADD(client.screen_texts, text_box)
if(LAZYLEN(client.screen_texts) == 1) //lets only play one at a time, for thematic effect and prevent overlap
INVOKE_ASYNC(text_box, TYPE_PROC_REF(/atom/movable/screen/text/screen_text, play_to_client))
/atom/movable/screen/text/screen_text
icon = null
icon_state = null
alpha = 255
maptext_height = 64
maptext_width = 480
maptext_x = 0
maptext_y = 0
screen_loc = "LEFT,TOP-3"
///Time taken to fade in as we start printing text
var/fade_in_time = 0
///Time before fade out after printing is finished
var/fade_out_delay = 2 SECONDS
///Time taken when fading out after fade_out_delay
var/fade_out_time = 0.5 SECONDS
///delay between playing each letter. in general use 1 for fluff and 0.5 for time sensitive messsages
var/play_delay = 0.5
///letters to update by per text to per play_delay
var/letters_per_update = 1
///opening styling for the message
var/style_open = "<span class='langchat' style=text-align:center valign='top'>"
///closing styling for the message
var/style_close = "</span>"
///var for the text we are going to play
var/text_to_play
///The client that this text is for
var/client/player
/atom/movable/screen/text/screen_text/command_order
maptext_height = 64
maptext_width = 480
maptext_x = 0
maptext_y = 0
screen_loc = "LEFT,TOP-3"
letters_per_update = 2
fade_out_delay = 4.5 SECONDS
style_open = "<span class='langchat' style=font-size:16pt;text-align:center valign='top'>"
style_close = "</span>"
/atom/movable/screen/text/screen_text/low_integrity_message
maptext_height = 64
maptext_width = 480
maptext_x = 0
maptext_y = 0
screen_loc = "LEFT,TOP-3"
letters_per_update = 1
fade_out_delay = 6 SECONDS
style_open = "<span class='langchat' style=font-size:20pt;text-align:center valign='top'>"
style_close = "</span>"
///proc for actually playing this screen_text on a mob.
/atom/movable/screen/text/screen_text/proc/play_to_client()
player?.add_to_screen(src)
if(fade_in_time)
animate(src, alpha = 255)
var/list/lines_to_skip = list()
var/static/html_locate_regex = regex("<.*>")
var/tag_position = findtext(text_to_play, html_locate_regex)
var/reading_tag = TRUE
while(tag_position)
if(reading_tag)
if(text_to_play[tag_position] == ">")
reading_tag = FALSE
lines_to_skip += tag_position
tag_position++
else
tag_position = findtext(text_to_play, html_locate_regex, tag_position)
reading_tag = TRUE
for(var/letter = 2 to length(text_to_play) + letters_per_update step letters_per_update)
if(letter in lines_to_skip)
continue
maptext = "[style_open][copytext_char(text_to_play, 1, letter)][style_close]"
sleep(play_delay)
addtimer(CALLBACK(src, PROC_REF(after_play)), fade_out_delay)
///handles post-play effects like fade out after the fade out delay
/atom/movable/screen/text/screen_text/proc/after_play()
if(!fade_out_time)
end_play()
return
animate(src, alpha = 0, time = fade_out_time)
addtimer(CALLBACK(src, PROC_REF(end_play)), fade_out_time)
///ends the play then deletes this screen object and plays the next one in queue if it exists
/atom/movable/screen/text/screen_text/proc/end_play()
if(!player)
qdel(src)
return
player.remove_from_screen(src)
LAZYREMOVE(player.screen_texts, src)
qdel(src)
if(QDELETED(player))
QDEL_NULL_LIST(player.screen_texts)
return
if(LAZYLEN(player.screen_texts))
player.screen_texts[1].play_to_client() // Theres more?