Skip to content

Commit

Permalink
admin: Две новые кнопки для контроля раунда (#6535)
Browse files Browse the repository at this point in the history
* admin: Две новые кнопки для контроля раунда

* Update code/modules/admin/topic.dm

Co-authored-by: BeebBeebBoob <[email protected]>

---------

Co-authored-by: BeebBeebBoob <[email protected]>
  • Loading branch information
dageavtobusnick and BeebBeebBoob authored Feb 8, 2025
1 parent d21a8be commit 16bd52b
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 8 deletions.
2 changes: 2 additions & 0 deletions code/_globalvars/misc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ GLOBAL_VAR(genname) //Nanotrasen officer name for fax send via fax panel, random

GLOBAL_VAR_INIT(pacifism_after_gt, FALSE)

GLOBAL_VAR_INIT(full_lockdown, FALSE)

GLOBAL_VAR_INIT(communications_blackout, FALSE)

///All currently running polls held as datums
Expand Down
4 changes: 2 additions & 2 deletions code/game/gamemodes/blob/blob_report.dm
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
Любой ценой необходимо активировать систему самоуничтожения станции, код[(off_auto_nuke_codes)? " будет направлен Центральным Коммандованием в скором времени" : ": [nukecode]"]."
aiPlayer.set_zeroth_law(law)
SSticker?.score?.save_silicon_laws(aiPlayer, additional_info = "вспышка блоба, добавлен новый нулевой закон'[law]'")
to_chat(aiPlayer, "Законы обновлены: [law]")
to_chat(aiPlayer, span_warning("Законы обновлены: [law]"))

if(BLOB_THIRD_REPORT)
interceptname = "Секретное постановление [command_name()]"
Expand All @@ -65,7 +65,7 @@
if(aiPlayer.client)
aiPlayer.laws.clear_zeroth_laws()
SSticker?.score?.save_silicon_laws(aiPlayer, additional_info = "блоб уничтожен, нулевой закон удален")
to_chat(aiPlayer, "Законы обновлены")
to_chat(aiPlayer, span_warning("Законы обновлены"))

print_command_report(intercepttext, interceptname, FALSE)
GLOB.event_announcement.Announce("Отчёт был загружен и распечатан на всех консолях связи.", "Входящее засекреченное сообщение.", 'sound/AI/commandreport.ogg', from = "[command_name()] обновление")
Expand Down
42 changes: 40 additions & 2 deletions code/game/machinery/computer/communications.dm
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,18 @@
if(!ADMIN_CHECK(ui.user))
to_chat(ui.user, span_warning("Вашего уровня доступа не хватает для отправки кодов аутентификации."))
return
print_nuke_codes()
var/response = tgui_alert(ui.user, "Вы хотите просто отправить коды на консоль или объявить директиву 7-12? \
Директива предпочтительнее в случае, если коды даются на биоугрозу. \
Директива 7-12 дополнительно сменит коды на боеголовке, выдаст ИИ нулевой закон на предотвращение побега экипажа \
и взведение боеголовки, с указанием кодов в законе. \
В остальных случаях лучше просто отправить коды на консоль.", "Тип отправки кодов", list("Отправить коды", "Директива 7-12"))
switch(response)
if("Отправить коды")
print_nuke_codes()
if("Директива 7-12")
directive_7_12()
else
return

if("move_gamma_armory")
if(!FULL_ADMIN_CHECK(ui.user))
Expand Down Expand Up @@ -397,7 +408,34 @@

P.info += "<br><hr><font size=\"1\">Несоблюдение нормативных требований компании по конфиденциальности может привести к немедленному увольнению по приказу сотрудников Центрального Командования.</font>"


/proc/directive_7_12()
var/nukecode = rand(10000, 99999)
for(var/obj/machinery/nuclearbomb/bomb in GLOB.machines)
if(bomb && bomb.r_code)
if(is_station_level(bomb.z))
bomb.r_code = nukecode
var/intercepttext
var/interceptname
interceptname = "Секретное постановление [command_name()]"
intercepttext += "<FONT size = 3><B>Постановление Nanotrasen</B>: Предупреждение о биологической угрозе.</FONT><HR>"
intercepttext += "Для [station_name()] была издана директива 7-12.<BR>"
intercepttext += "Биологическая угроза вышла из-под контроля.<BR>"
intercepttext += "Вам приказано следующее:<BR>"
intercepttext += " 1. Защищать диск ядерной аутентификации.<BR>"
intercepttext += " 2. Взорвать ядерную боеголовку, находящуюся в хранилище станции.<BR>"
intercepttext += "Код ядерной аутентификации: [nukecode]<BR>"
intercepttext += "Конец сообщения."

for(var/mob/living/silicon/ai/aiPlayer in GLOB.player_list)
if(aiPlayer.client)
var/law = "Станция находится на карантине. Не позволяйте никому покидать ее.\
При необходимости игнорируйте законы 1-3, чтобы любыми средствами предотвратить чей-либо побег со станции. \
Любой ценой необходимо активировать систему самоуничтожения, код [nukecode]."
aiPlayer.set_zeroth_law(law)
SSticker?.score?.save_silicon_laws(aiPlayer, additional_info = "вспышка биоугрозы, добавлен новый нулевой закон'[law]'")
to_chat(aiPlayer, span_warning("Законы обновлены: [law]"))
print_command_report(intercepttext, interceptname, FALSE)
GLOB.event_announcement.Announce("Отчёт был загружен и распечатан на всех консолях связи.", "Входящее засекреченное сообщение.", 'sound/AI/commandreport.ogg', from = "[command_name()] обновление")

/obj/machinery/computer/communications/emag_act(user as mob)
if(!emagged)
Expand Down
7 changes: 6 additions & 1 deletion code/game/machinery/teleporter.dm
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,8 @@
/obj/machinery/computer/teleporter/proc/targets_teleport()
var/list/L = list()
var/list/areaindex = list()

var/turf/teleporter_turf = get_turf(src)
var/is_station_teleport = is_station_level(teleporter_turf.z)
for(var/obj/item/radio/beacon/R in GLOB.beacons)
var/turf/T = get_turf(R)
if(!T)
Expand All @@ -221,6 +222,8 @@
continue
if(R.syndicate && !emagged)
continue
if(GLOB.full_lockdown && is_station_teleport && !is_station_level(T.z))
continue
var/tmpname = T.loc.name
if(areaindex[tmpname])
tmpname = "[tmpname] ([++areaindex[tmpname]])"
Expand All @@ -243,6 +246,8 @@
var/turf/T = get_turf(M)
if(!T) continue
if(!is_teleport_allowed(T.z)) continue
if(GLOB.full_lockdown && is_station_teleport && !is_station_level(T.z))
continue
var/tmpname = M.real_name
if(areaindex[tmpname])
tmpname = "[tmpname] ([++areaindex[tmpname]])"
Expand Down
1 change: 1 addition & 0 deletions code/modules/admin/check_antagonists.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
else
dat += span_danger("<B>Emergency shuttle lockdowned</B>")
dat += "<BR><a href='byond://?src=[UID()];stop_lockdown=1'>Stop lockdown</a><br>"
dat += "<a href='byond://?src=[UID()];full_lockdown=1'>Full Lockdown</a>Now: [GLOB.full_lockdown? "ON" : "OFF"]<br>"
dat += "<a href='byond://?src=[UID()];delay_round_end=1'>[SSticker.delay_end ? "End Round Normally" : "Delay Round End"]</a><br>"
var/connected_players = GLOB.clients.len
var/lobby_players = 0
Expand Down
11 changes: 11 additions & 0 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,17 @@
log_and_message_admins(span_adminnotice("[key_name_admin(usr)] lockdowned the Emergency Shuttle"))
href_list["secrets"] = "check_antagonist"

else if(href_list["full_lockdown"])
if(!check_rights(R_ADMIN))
return

if(!you_realy_want_do_this())
return

GLOB.full_lockdown = !GLOB.full_lockdown
log_and_message_admins("[GLOB.full_lockdown? "enabled" : "disabled"] Full Lockdown")
href_list["secrets"] = "check_antagonist"

else if(href_list["delay_round_end"])
if(!check_rights(R_SERVER)) return

Expand Down
1 change: 1 addition & 0 deletions code/modules/mining/laborcamp/laborshuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
circuit = /obj/item/circuitboard/labor_shuttle
shuttleId = "laborcamp"
possible_destinations = "laborcamp_home;laborcamp_away"
lockdown_affected = TRUE
req_access = list(ACCESS_BRIG)


Expand Down
1 change: 1 addition & 0 deletions code/modules/mining/mine_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
circuit = /obj/item/circuitboard/mining_shuttle
shuttleId = "mining"
possible_destinations = "mining_home;mining_away"
lockdown_affected = TRUE

/******************************Lantern*******************************/

Expand Down
6 changes: 5 additions & 1 deletion code/modules/shuttle/shuttle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -779,6 +779,7 @@
var/shuttleId
var/possible_destinations = ""
var/admin_controlled
var/lockdown_affected = FALSE
var/max_connect_range = 7
var/moved = FALSE //workaround for nukie shuttle, hope I find a better way to do this...

Expand Down Expand Up @@ -837,13 +838,16 @@
/obj/machinery/computer/shuttle/ui_data(mob/user)
var/list/data = list()
var/obj/docking_port/mobile/mobile_docking_port = SSshuttle.getShuttle(shuttleId)
var/lockdown_check = lockdown_affected && GLOB.full_lockdown
data["docked_location"] = mobile_docking_port ? mobile_docking_port.getStatusText() : "Unknown"
data["timer_str"] = mobile_docking_port ? mobile_docking_port.getTimerStr() : "00:00"
if(!mobile_docking_port)
data["status"] = "Missing"
return data
if(admin_controlled)
data["status"] = "Unauthorized Access"
else if(lockdown_check)
data["status"] = "Lockdown"
else
switch(mobile_docking_port.mode)
if(SHUTTLE_IGNITING)
Expand Down Expand Up @@ -875,7 +879,7 @@
data["locked"] = TRUE
data["status"] = "Locked"
data["docking_ports_len"] = docking_ports.len
data["admin_controlled"] = admin_controlled
data["admin_controlled"] = admin_controlled || lockdown_check
return data

/obj/machinery/computer/shuttle/ui_act(action, params)
Expand Down
3 changes: 2 additions & 1 deletion tgui/packages/tgui/interfaces/AlertModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export const AlertModal = (props, context) => {
{message}
</Box>
</Stack.Item>
<Stack.Item>
<Stack.Item grow>
{!!autofocus && <Autofocus />}
{isVerbose ? (
<VerticalButtons selected={selected} />
Expand Down Expand Up @@ -158,6 +158,7 @@ const VerticalButtons = (props: ButtonDisplayProps, context) => {
width={large_buttons ? '100%' : undefined}
key={index}
m={0}
mb={large_buttons ? 2.5 : 0}
>
<Button
fluid
Expand Down
2 changes: 1 addition & 1 deletion tgui/public/tgui.bundle.js

Large diffs are not rendered by default.

0 comments on commit 16bd52b

Please sign in to comment.