Adds SSD for Silicons (#31205)

* Silicon SSD

* Tied everything with a bow

* Update code/modules/mob/living/silicon/robot/robot_logout.dm

Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>

* Update robot_mob.dm

* Apply suggestions from code review

Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>

---------

Signed-off-by: CRUNCH <143041327+CRUNCH-Borg@users.noreply.github.com>
Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com>
Co-authored-by: PollardTheDragon <144391971+PollardTheDragon@users.noreply.github.com>
This commit is contained in:
CRUNCH
2025-12-26 20:35:14 +00:00
committed by GitHub
co-authored by Luc PollardTheDragon
parent 670202be06
commit 8703edf492
16 changed files with 59 additions and 12 deletions
+2 -2
View File
@@ -52,7 +52,7 @@ SUBSYSTEM_DEF(afk)
toRemove += H.ckey
warn(H, SPAN_DANGER("You have been despawned after being AFK for [mins_afk] minutes. You have been despawned instantly due to you being in a secure area."))
log_afk_action(H, mins_afk, T, "despawned", "AFK in a fast despawn area")
force_cryo_human(H)
force_cryo(H)
else
if(!(H.mind.special_role in non_cryo_antags))
if(cryo_ssd(H))
@@ -71,7 +71,7 @@ SUBSYSTEM_DEF(afk)
log_afk_action(H, mins_afk, T, "despawned")
warn(H, SPAN_DANGER("You have been despawned after being AFK for [mins_afk] minutes."))
toRemove += H.ckey
force_cryo_human(H)
force_cryo(H)
removeFromWatchList(toRemove)
+7 -3
View File
@@ -713,10 +713,11 @@
return ..()
/// Teleport an SSD human inside a cryopod, or a robot to a robot storage unit, but do not despawn them.
/proc/cryo_ssd(mob/living/person_to_cryo)
if(istype(person_to_cryo.loc, /obj/machinery/cryopod))
return FALSE
if(isobj(person_to_cryo.loc))
var/obj/O = person_to_cryo.loc
O.force_eject_occupant(person_to_cryo)
@@ -735,11 +736,14 @@
SP.name = "NT SSD Teleportation Portal"
target_cryopod.take_occupant(person_to_cryo, 1)
return TRUE
return FALSE
/proc/force_cryo_human(mob/living/carbon/person_to_cryo)
if(!istype(person_to_cryo))
/// Immeditely teleport a human or robot to cryo and then despawn them.
/proc/force_cryo(mob/living/person_to_cryo)
if(!ishuman(person_to_cryo) && !isrobot(person_to_cryo))
return
if(!istype(person_to_cryo.loc, /obj/machinery/cryopod))
cryo_ssd(person_to_cryo)
if(istype(person_to_cryo.loc, /obj/machinery/cryopod))
@@ -62,7 +62,7 @@
else
player_ghosted++
if(player_ghosted % 150 == 0)
force_cryo_human(src)
force_cryo(src)
/mob/living/carbon/human/proc/handle_ssd()
player_logged++
@@ -75,7 +75,7 @@
var/area/A = get_area(src)
cryo_ssd(src)
if(A.fast_despawn)
force_cryo_human(src)
force_cryo(src)
/mob/living/carbon/human/calculate_affecting_pressure(pressure)
..()
@@ -48,8 +48,10 @@
else
adjustOxyLoss(-1)
var/area/my_area = get_area(src)
if(player_logged > 0 && stat != DEAD && job)
handle_ssd()
var/area/my_area = get_area(src)
if(!lacks_power())
if(aiRestorePowerRoutine > 1)
update_blind_effects()
@@ -139,6 +141,9 @@
sleep(50)
theAPC = null
/mob/living/silicon/ai/proc/handle_ssd()
player_logged++ // No auto cryo, but this will give the AI SSD protection after the value of `SSD_WARNING_TIMER` is reached.
/mob/living/silicon/ai/updatehealth(reason = "none given")
if(status_flags & GODMODE)
health = 100
@@ -1,4 +1,6 @@
/mob/living/silicon/ai/Login() //ThisIsDumb(TM) TODO: tidy this up _ ~Carn
if(player_logged)
overlays -= image('icons/effects/effects.dmi', icon_state = "zzz_glow_silicon")
..()
if(stat != DEAD)
@@ -1,5 +1,7 @@
/mob/living/silicon/ai/Logout()
..()
if(mind && mind.active && stat != DEAD)
overlays += image('icons/effects/effects.dmi', icon_state = "zzz_glow_silicon")
for(var/obj/machinery/ai_status_display/O as anything in GLOB.ai_displays) //change status
O.mode = AI_DISPLAY_MODE_BLANK
@@ -467,6 +467,8 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
/mob/living/silicon/ai/update_icons()
. = ..()
update_hat_icons()
if(player_logged) // make sure the SSD overlay stays
overlays += image('icons/effects/effects.dmi', icon_state = "zzz_glow_silicon")
/mob/living/silicon/ai/proc/do_research()
last_research_time = world.time
@@ -47,6 +47,10 @@
setStaminaLoss(0, FALSE)
update_stamina_hud()
// Keep SSD robots eepy.
if(player_logged)
Sleeping(4 SECONDS)
/mob/living/silicon/robot/proc/get_damaged_components(get_brute, get_burn, get_borked = FALSE, get_missing = FALSE)
var/list/datum/robot_component/parts = list()
for(var/V in components)
@@ -7,11 +7,28 @@
handle_equipment()
if(player_logged > 0 && stat != DEAD && job)
handle_ssd()
// if Alive
if(.)
handle_robot_hud_updates()
handle_robot_cell()
/mob/living/silicon/robot/proc/handle_ssd()
player_logged++
if(istype(loc, /obj/machinery/cryopod/robot))
return
if(GLOB.configuration.afk.ssd_auto_cryo_minutes && (player_logged >= (GLOB.configuration.afk.ssd_auto_cryo_minutes * 30)) && player_logged % 30 == 0)
var/turf/T = get_turf(src)
if(!is_station_level(T.z))
return
cryo_ssd(src)
var/area/A = get_area(src)
if(A.fast_despawn)
force_cryo(src)
/mob/living/silicon/robot/proc/handle_robot_cell()
if(stat == DEAD)
@@ -1,7 +1,11 @@
/mob/living/silicon/robot/Login()
if(player_logged)
overlays -= image('icons/effects/effects.dmi', icon_state = "zzz_glow_silicon")
..()
regenerate_icons()
show_laws(0)
if(connected_ai)
if(connected_ai.mind.special_role == SPECIAL_ROLE_TRAITOR && connected_ai.malf_picker)
make_malf_robot()
regenerate_icons()
update_icons()
@@ -0,0 +1,4 @@
/mob/living/silicon/robot/Logout()
..()
if(mind?.active && stat != DEAD)
overlays += image('icons/effects/effects.dmi', icon_state = "zzz_glow_silicon")
@@ -1301,7 +1301,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
update_rolling_icon()
// Dead or incapacitated.
if(stat == DEAD || (IsParalyzed() || IsStunned() || IsWeakened() || low_power_mode))
if(stat == DEAD || (IsParalyzed() || IsStunned() || IsSleeping() || IsWeakened() || low_power_mode))
overlays -= "eyes"
else if((base_icon_state in grouped_eye_names) || (base_icon_state in sprites_with_variants))
overlays += "eyes-[base_icon_state]"
@@ -1324,6 +1324,8 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
robot_module_hat_offset()
update_hat_icons()
update_fire()
if(player_logged) // make sure the SSD overlay stays
overlays += image('icons/effects/effects.dmi', icon_state = "zzz_glow_silicon")
// Exists so that robot/destroyer can override it.
/mob/living/silicon/robot/proc/update_rolling_icon()
@@ -14,7 +14,7 @@
death()
create_debug_log("died of damage, trigger reason: [reason]")
return
if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || IsStunned() || IsWeakened() || getOxyLoss() > maxHealth * 0.5) // Borgs need to be able to sleep for adminfreeze
if(HAS_TRAIT(src, TRAIT_KNOCKEDOUT) || IsStunned() || IsSleeping() || IsWeakened() || getOxyLoss() > maxHealth * 0.5) // Borgs need to be able to sleep for adminfreeze
if(stat == CONSCIOUS)
KnockOut()
create_debug_log("fell unconscious, trigger reason: [reason]")
+1 -1
View File
@@ -160,7 +160,7 @@
var/has_limbs = 1 //Whether this mob have any limbs he can move with
//SSD var, changed it up some so people can have special things happen for different mobs when SSD.
// Counts how many `Life()` ticks have occured on an SSD mob, for SSD handling. There isn't a `/mob`-level proc for SSD handling, so you must define one for any mob that you want to give SSD effects to.
var/player_logged = 0
//Ghosted var, set only if a player has manually ghosted out of this mob.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 480 KiB

After

Width:  |  Height:  |  Size: 499 KiB

+1
View File
@@ -2726,6 +2726,7 @@
#include "code\modules\mob\living\silicon\robot\robot_laws.dm"
#include "code\modules\mob\living\silicon\robot\robot_life.dm"
#include "code\modules\mob\living\silicon\robot\robot_login.dm"
#include "code\modules\mob\living\silicon\robot\robot_logout.dm"
#include "code\modules\mob\living\silicon\robot\robot_mob.dm"
#include "code\modules\mob\living\silicon\robot\robot_module_actions.dm"
#include "code\modules\mob\living\silicon\robot\robot_modules.dm"