From 4113b23985d6c921688a1b5af3671af9610b76f9 Mon Sep 17 00:00:00 2001 From: Kyep Date: Fri, 12 Apr 2019 14:56:18 -0700 Subject: [PATCH 1/7] ssd cryo timer option --- code/controllers/configuration.dm | 13 +++++++++---- code/modules/mob/living/carbon/human/life.dm | 7 +++++++ config/example/config.txt | 3 +++ 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 01cf57aad9e..30e99027523 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -69,6 +69,8 @@ var/assistantlimit = 0 //enables assistant limiting var/assistantratio = 2 //how many assistants to security members + var/auto_cryo_ssd_mins = 0 + var/prob_free_golems = 75 //chance for free golems spawners to appear roundstart var/unrestricted_free_golems = FALSE //if true, free golems can appear on all roundtypes @@ -213,7 +215,7 @@ // Automatic localhost admin disable var/disable_localhost_admin = 0 - + //Start now warning var/start_now_confirmation = 0 @@ -293,6 +295,9 @@ if("shadowling_max_age") config.shadowling_max_age = text2num(value) + if("auto_cryo_ssd_mins") + config.auto_cryo_ssd_mins = text2num(value) + if("log_ooc") config.log_ooc = 1 @@ -358,10 +363,10 @@ if("no_dead_vote") config.vote_no_dead = 1 - + if("vote_autotransfer_initial") config.vote_autotransfer_initial = text2num(value) - + if("vote_autotransfer_interval") config.vote_autotransfer_interval = text2num(value) @@ -645,7 +650,7 @@ if("disable_karma") config.disable_karma = 1 - + if("start_now_confirmation") config.start_now_confirmation = 1 diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index c50457c0bf6..8fc6228f734 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -38,6 +38,7 @@ regenerate_icons() // Make sure the inventory updates handle_ghosted() + handle_ssd() /mob/living/carbon/human/proc/handle_ghosted() if(player_ghosted > 0 && stat == CONSCIOUS && job && !restrained()) @@ -48,6 +49,12 @@ if(player_ghosted % 150 == 0) force_cryo_human(src) +/mob/living/carbon/human/proc/handle_ssd() + if(player_logged > 0 && config.auto_cryo_ssd_mins && stat != DEAD && job) + player_logged++ + if((player_logged >= (config.auto_cryo_ssd_mins * 30)) && player_logged % 30 == 0) + cryo_ssd(src) + /mob/living/carbon/human/calculate_affecting_pressure(var/pressure) ..() var/pressure_difference = abs( pressure - ONE_ATMOSPHERE ) diff --git a/config/example/config.txt b/config/example/config.txt index d93809c32cd..161d953f9d7 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -250,6 +250,9 @@ ASSISTANT_LIMIT ## If you enabled assistant limiting set the ratio of assistants to security members default is 2 assistants to 1 officer ASSISTANT_RATIO 2 +# Mins before SSD crew are cryoed. +AUTO_CRYO_SSD_MINS 15 + ## Remove the # to make rounds which end instantly (Rev, Wizard, Malf) to continue until the shuttle is called or the station is nuked. ## Malf and Rev will let the shuttle be called when the antags/protags are dead. #CONTINUOUS_ROUNDS From 77992d92922e9ae0c69f344424ce2912d8e7c074 Mon Sep 17 00:00:00 2001 From: Kyep Date: Sat, 13 Apr 2019 14:30:19 -0700 Subject: [PATCH 2/7] ignore offstation, fast despawn for perma/solitary/brigcells --- code/game/area/Space Station 13 areas.dm | 5 +++++ code/modules/mob/living/carbon/human/life.dm | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/code/game/area/Space Station 13 areas.dm b/code/game/area/Space Station 13 areas.dm index 067223c0285..dcf5223e29c 100644 --- a/code/game/area/Space Station 13 areas.dm +++ b/code/game/area/Space Station 13 areas.dm @@ -63,6 +63,8 @@ NOTE: there are two lists of areas in the end of this file: centcom and station var/xenobiology_compatible = FALSE //Can the Xenobio management console transverse this area by default? var/nad_allowed = FALSE //is the station NAD allowed on this area? + var/fast_despawn = FALSE + /*Adding a wizard area teleport list because motherfucking lag -- Urist*/ /*I am far too lazy to make it a proper list of areas so I'll just make it run the usual telepot routine at the start of the game*/ var/list/teleportlocs = list() @@ -855,10 +857,12 @@ var/list/ghostteleportlocs = list() /area/prison/solitary name = "\improper Solitary Confinement" icon_state = "brig" + fast_despawn = TRUE /area/prison/cell_block name = "\improper Prison Cell Block" icon_state = "brig" + fast_despawn = TRUE /area/prison/cell_block/A name = "\improper Prison Cell Block A" @@ -1676,6 +1680,7 @@ var/list/ghostteleportlocs = list() /area/security/permabrig name = "\improper Prison Wing" icon_state = "sec_prison_perma" + fast_despawn = TRUE /area/security/prison name = "\improper Prison Wing" diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 8fc6228f734..6fb52044a79 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -52,8 +52,16 @@ /mob/living/carbon/human/proc/handle_ssd() if(player_logged > 0 && config.auto_cryo_ssd_mins && stat != DEAD && job) player_logged++ + if(istype(loc, /obj/machinery/cryopod)) + return if((player_logged >= (config.auto_cryo_ssd_mins * 30)) && player_logged % 30 == 0) + var/turf/T = get_turf(src) + if(!is_station_level(T.z)) + return + var/area/A = get_area(src) cryo_ssd(src) + if(A.fast_despawn) + force_cryo_human(src) /mob/living/carbon/human/calculate_affecting_pressure(var/pressure) ..() From d8d8a641d3b804a797834147cdbdd22e44e835f2 Mon Sep 17 00:00:00 2001 From: Kyep Date: Sun, 14 Apr 2019 20:14:44 -0700 Subject: [PATCH 3/7] adds portal effect, neca request --- code/modules/mob/living/carbon/human/life.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 6fb52044a79..8664b850b24 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -59,7 +59,9 @@ if(!is_station_level(T.z)) return var/area/A = get_area(src) - cryo_ssd(src) + if(cryo_ssd(src)) + var/obj/effect/portal/P = new /obj/effect/portal(T, null, null, 100) + P.name = "NT SSD Teleportation Portal" if(A.fast_despawn) force_cryo_human(src) From 98d3e310b4d05ff30eb8b5d1be5cc51991bc4653 Mon Sep 17 00:00:00 2001 From: Kyep Date: Tue, 16 Apr 2019 15:53:40 -0700 Subject: [PATCH 4/7] reduces portal effect from 10s to 4s --- code/modules/mob/living/carbon/human/life.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 8664b850b24..aaeaba94a2c 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -60,7 +60,7 @@ return var/area/A = get_area(src) if(cryo_ssd(src)) - var/obj/effect/portal/P = new /obj/effect/portal(T, null, null, 100) + var/obj/effect/portal/P = new /obj/effect/portal(T, null, null, 40) P.name = "NT SSD Teleportation Portal" if(A.fast_despawn) force_cryo_human(src) From 7ff835749995cf5deb5eb479db03d558559b5841 Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 22 Apr 2019 21:29:11 -0700 Subject: [PATCH 5/7] counter support --- code/modules/mob/living/carbon/human/life.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index aaeaba94a2c..578c5967181 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -50,11 +50,11 @@ force_cryo_human(src) /mob/living/carbon/human/proc/handle_ssd() - if(player_logged > 0 && config.auto_cryo_ssd_mins && stat != DEAD && job) + if(player_logged > 0 && stat != DEAD && job) player_logged++ if(istype(loc, /obj/machinery/cryopod)) return - if((player_logged >= (config.auto_cryo_ssd_mins * 30)) && player_logged % 30 == 0) + if(config.auto_cryo_ssd_mins && (player_logged >= (config.auto_cryo_ssd_mins * 30)) && player_logged % 30 == 0) var/turf/T = get_turf(src) if(!is_station_level(T.z)) return From d61d8a3dc1d4920d3713d583740b7cdd57c0eab0 Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 22 Apr 2019 21:38:47 -0700 Subject: [PATCH 6/7] new feature: ssd warning system --- code/_onclick/click.dm | 4 ++++ code/controllers/configuration.dm | 4 ++++ code/modules/client/client defines.dm | 2 +- code/modules/client/client procs.dm | 15 +++++++++++++++ code/modules/mob/mob.dm | 13 +++++++++---- config/example/config.txt | 5 ++++- 6 files changed, 37 insertions(+), 6 deletions(-) diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm index 24e58b502ad..286f8ce7095 100644 --- a/code/_onclick/click.dm +++ b/code/_onclick/click.dm @@ -122,6 +122,10 @@ throw_item(A) return + if(isLivingSSD(A)) + if(client && client.send_ssd_warning(A)) + return + var/obj/item/W = get_active_hand() if(W == A) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 30e99027523..c5d8b79cb30 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -70,6 +70,7 @@ var/assistantratio = 2 //how many assistants to security members var/auto_cryo_ssd_mins = 0 + var/ssd_warning = 0 var/prob_free_golems = 75 //chance for free golems spawners to appear roundstart var/unrestricted_free_golems = FALSE //if true, free golems can appear on all roundtypes @@ -298,6 +299,9 @@ if("auto_cryo_ssd_mins") config.auto_cryo_ssd_mins = text2num(value) + if("ssd_warning") + config.ssd_warning = 1 + if("log_ooc") config.log_ooc = 1 diff --git a/code/modules/client/client defines.dm b/code/modules/client/client defines.dm index 00900fe5fd1..1d26a013986 100644 --- a/code/modules/client/client defines.dm +++ b/code/modules/client/client defines.dm @@ -46,7 +46,7 @@ var/received_irc_pm = -99999 var/irc_admin //IRC admin that spoke with them last. var/mute_irc = 0 - + var/ssd_warning_acknowledged = FALSE //////////////////////////////////// //things that require the database// diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index ac9a88aaa08..175a41fa196 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -225,6 +225,9 @@ vote_on_poll(pollid, optionid, 1) src << browse(null, "window=playerpoll") handle_player_polling() + if(href_list["ssdwarning"]) + ssd_warning_acknowledged = TRUE + to_chat(src, "SSD warning acknowledged.") switch(href_list["action"]) if("openLink") @@ -770,3 +773,15 @@ winset(src, "rpane.changelog", "background-color=#40628a;text-color=#FFFFFF") else winset(src, "rpane.changelog", "background-color=none;text-color=#000000") + + +/client/proc/send_ssd_warning(mob/M) + if(!config.ssd_warning) + return FALSE + if(ssd_warning_acknowledged) + return FALSE + if(M && M.player_logged < 30) // Give it ~60 seconds, just in case they drop SSD during combat. + return FALSE + to_chat(src, "Interacting with SSD players is against server rules unless you've ahelped first for permission. If you have, confirm that and proceed.") + return TRUE + diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ee04e624f02..15ab31f8f92 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -901,13 +901,18 @@ var/list/slot_equipment_priority = list( \ /mob/MouseDrop(mob/M as mob) ..() if(M != usr) return - if(isliving(M)) // Ewww + if(isliving(M)) var/mob/living/L = M if(L.mob_size <= MOB_SIZE_SMALL) return // Stops pAI drones and small mobs (borers, parrots, crabs) from stripping people. --DZD - if(!M.can_strip) return - if(usr == src) return - if(!Adjacent(usr)) return + if(!M.can_strip) + return + if(usr == src) + return + if(!Adjacent(usr)) + return + if(isLivingSSD(src) && M.client && M.client.send_ssd_warning(src)) + return show_inv(usr) /mob/proc/can_use_hands() diff --git a/config/example/config.txt b/config/example/config.txt index 161d953f9d7..50f8c0f1333 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -253,6 +253,9 @@ ASSISTANT_RATIO 2 # Mins before SSD crew are cryoed. AUTO_CRYO_SSD_MINS 15 +# If enabled, prevents people interacting with SSD players unless they acknowledge they have read the server rules. +SSD_WARNING + ## Remove the # to make rounds which end instantly (Rev, Wizard, Malf) to continue until the shuttle is called or the station is nuked. ## Malf and Rev will let the shuttle be called when the antags/protags are dead. #CONTINUOUS_ROUNDS @@ -405,4 +408,4 @@ DISABLE_HIGH_POP_MC_MODE_AMOUNT 60 #DISABLE_LOCALHOST_ADMIN ## Uncomment to give a confirmation before hitting start now -#START_NOW_CONFIRMATION \ No newline at end of file +#START_NOW_CONFIRMATION From de29dbcc94fd4d9fde6b7ffb72a531cb7f8d5430 Mon Sep 17 00:00:00 2001 From: Kyep Date: Mon, 29 Apr 2019 20:16:28 -0700 Subject: [PATCH 7/7] Ansari request #define SSD_WARNING_TIMER --- code/modules/client/client procs.dm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 175a41fa196..77d7cca6601 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -9,6 +9,7 @@ #define MIN_CLIENT_VERSION 0 //Just an ambiguously low version for now, I don't want to suddenly stop people playing. //I would just like the code ready should it ever need to be used. #define SUGGESTED_CLIENT_VERSION 511 // only integers (e.g: 510, 511) useful here. Does not properly handle minor versions (e.g: 510.58, 511.848) +#define SSD_WARNING_TIMER 30 // cycles, not seconds, so 30=60s /* When somebody clicks a link in game, this Topic is called first. @@ -780,8 +781,9 @@ return FALSE if(ssd_warning_acknowledged) return FALSE - if(M && M.player_logged < 30) // Give it ~60 seconds, just in case they drop SSD during combat. + if(M && M.player_logged < SSD_WARNING_TIMER) return FALSE to_chat(src, "Interacting with SSD players is against server rules unless you've ahelped first for permission. If you have, confirm that and proceed.") return TRUE +#undef SSD_WARNING_TIMER \ No newline at end of file