[MIRROR] moves law outputs to a block (#11706)

Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
CHOMPStation2StaffMirrorBot
2025-09-19 15:48:39 -07:00
committed by GitHub
parent 9efbeb86af
commit 19006d64ac
13 changed files with 51 additions and 54 deletions

View File

@@ -57,13 +57,15 @@
continue
if (!robo.connected_ai)
var/list/robot_stat_display = list()
if (robo.stat != 2)
to_chat(world, span_filter_system(span_bold("[robo.name] survived as an AI-less stationbound synthetic! Its laws were:"))) // VOREStation edit
robot_stat_display += span_filter_system(span_bold("[robo.name] survived as an AI-less stationbound synthetic! Its laws were:"))
else
to_chat(world, span_filter_system(span_bold("[robo.name] was unable to survive the rigors of being a stationbound synthetic without an AI. Its laws were:"))) // VOREStation edit
robot_stat_display += span_filter_system(span_bold("[robo.name] was unable to survive the rigors of being a stationbound synthetic without an AI. Its laws were:"))
if(robo) //How the hell do we lose robo between here and the world messages directly above this?
robo.laws.show_laws(world)
robot_stat_display += robo.laws.get_formatted_laws()
to_chat(world, robot_stat_display.Join("\n"))
if(dronecount)
to_chat(world, span_filter_system(span_bold("There [dronecount>1 ? "were" : "was"] [dronecount] industrious maintenance [dronecount>1 ? "drones" : "drone"] at the end of this round.")))

View File

@@ -222,6 +222,18 @@
supplied_laws.Cut()
sorted_laws.Cut()
/datum/ai_laws/proc/get_formatted_laws()
sort_laws()
var/list/law_block = list()
for(var/datum/ai_law/law in sorted_laws)
if(law == zeroth_law_borg)
continue
if(law == zeroth_law)
law_block += span_info(span_red("[law.get_index()]. [law.law]"))
else
law_block += span_infoplain("[law.get_index()]. [law.law]")
return examine_block(law_block.Join("\n"))
/datum/ai_laws/proc/show_laws(var/who)
sort_laws()
for(var/datum/ai_law/law in sorted_laws)

View File

@@ -46,4 +46,4 @@
/decl/hierarchy/outfit/tournament_gear/janitor/post_equip(var/mob/living/carbon/human/H)
var/obj/item/reagent_containers/glass/bucket/bucket = locate(/obj/item/reagent_containers/glass/bucket) in H
if(bucket)
bucket.reagents.add_reagent(/datum/reagent/water, 70)
bucket.reagents.add_reagent(REAGENT_ID_WATER, 70)

View File

@@ -44,8 +44,8 @@
user.visible_message(span_notice("[user] takes a bite out of [src]!"), span_notice("You gnaw on [src]! This can't be good for you..."))
var/mob/living/carbon/C = user
playsound(get_turf(C), 'sound/items/eatfood.ogg', 25, 0)
C.ingested.add_reagent(/datum/reagent/toxin, 0.5) //normally formaldehyde, and 2 units of it. Toxin is being subsituted and is 4 times as toxic, hence a quarter of the normal amount.
C.ingested.add_reagent(/datum/reagent/chloralhydrate, 3)
C.ingested.add_reagent(REAGENT_ID_TOXIN, 0.5) //normally formaldehyde, and 2 units of it. Toxin is being subsituted and is 4 times as toxic, hence a quarter of the normal amount.
C.ingested.add_reagent(REAGENT_ID_CHLORALHYDRATE, 3)
reagents.trans_to_holder(C.ingested, 1)
bites++
if(bites >= 5)

View File

@@ -577,13 +577,11 @@
target.lawsync()
return TRUE
if("notify_laws")
to_chat(target, span_danger("Law Notice"))
target.laws.show_laws(target)
to_chat(target, span_danger("Law Notice\n") + target.laws.get_formatted_laws())
if(isAI(target))
var/mob/living/silicon/ai/our_ai = target
for(var/mob/living/silicon/robot/R in our_ai.connected_robots)
to_chat(R, span_danger("Law Notice"))
R.laws.show_laws(R)
to_chat(R, span_danger("Law Notice\n") + R.laws.get_formatted_laws())
if(ui.user != target)
to_chat(ui.user, span_notice("Laws displayed."))
return TRUE
@@ -613,7 +611,7 @@
target.clear_supplied_laws()
target.clear_inherent_laws()
target.laws = new global.using_map.default_law_type
target.laws.show_laws(target)
to_chat(target, span_danger("Laws updated!\n") + target.laws.get_formatted_laws())
target.hud_used?.update_robot_modules_display()
else
target.emagged = 1
@@ -625,7 +623,7 @@
if(target.bolt)
if(!target.bolt.malfunction)
target.bolt.malfunction = MALFUNCTION_PERMANENT
target.laws.show_laws(target)
to_chat(target, span_danger("Laws updated!\n") + target.laws.get_formatted_laws())
target.hud_used?.update_robot_modules_display()
return TRUE

View File

@@ -101,22 +101,19 @@
else
if(!recipient)
if(holder)
to_chat(src, span_admin_pm_warning("Error: Admin-PM: Client not found."))
if(msg)
to_chat(src, msg)
else
current_ticket.MessageNoRecipient(msg)
return
//get message text, limit it's length.and clean/escape html
if(!msg)
msg = tgui_input_text(src, "Message:", "Private message to [key_name(recipient, 0, 0)]", multiline = TRUE, encode = FALSE)
//clean the message if it's not sent by a high-rank admin
if(!check_rights(R_SERVER|R_DEBUG, FALSE)||irc)//no sending html to the poor bots
msg = trim(sanitize(copytext(msg,1,MAX_MESSAGE_LEN)))
if(!msg)
return
if (src.handle_spam_prevention(MUTE_ADMINHELP))
return
if(prefs.muted & MUTE_ADMINHELP)
to_chat(src, span_admin_pm_warning("Error: Admin-PM: You are unable to use admin PM-s (muted)."))
return
@@ -124,19 +121,11 @@
if(!recipient)
if(holder)
to_chat(src, span_admin_pm_warning("Error: Admin-PM: Client not found."))
to_chat(src, msg)
else
current_ticket.MessageNoRecipient(msg)
return
if (src.handle_spam_prevention(MUTE_ADMINHELP))
return
//clean the message if it's not sent by a high-rank admin
if(!check_rights(R_SERVER|R_DEBUG, FALSE)||irc)//no sending html to the poor bots
msg = trim(sanitize(copytext(msg,1,MAX_MESSAGE_LEN)))
if(!msg)
return
var/rawmsg = msg
var/keywordparsedmsg = keywords_lookup(msg)

View File

@@ -84,8 +84,10 @@
if(!istype(M) || material.name != M.material.name)
return 0
var/transfer = ..(S,tamount,1)
if(src) update_strings()
if(M) M.update_strings()
if(!QDELETED(src))
update_strings()
if(M)
M.update_strings()
return transfer
/obj/item/stack/material/attack_self(var/mob/user)

View File

@@ -53,12 +53,13 @@
if(W.sharp && W.edge)
var/time = (3 SECONDS / max(W.force / 10, 1)) * W.toolspeed
user.setClickCooldown(time)
var/our_material_name = src.material.name
if(do_after(user, time, target = src) && use(1))
to_chat(user, span_notice("You cut up a log into planks."))
playsound(src, 'sound/effects/woodcutting.ogg', 50, 1)
var/obj/item/stack/material/wood/existing_wood = null
for(var/obj/item/stack/material/wood/M in user.loc)
if(M.material.name == src.material.name)
if(M.material.name == our_material_name)
existing_wood = M
break

View File

@@ -280,8 +280,7 @@ var/list/mob_hat_cache = list()
var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
set_zeroth_law("Only [user.real_name] and people [TU.he] designate[TU.s] as being such are operatives.")
to_chat(src, span_infoplain(span_bold("Obey these laws:")))
laws.show_laws(src)
to_chat(src, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
to_chat(src, span_danger("ALERT: [user.real_name] is your new master. Obey your new laws and \his commands."))
return 1

View File

@@ -30,8 +30,7 @@
to_chat(src, span_infoplain(span_bold("No AI selected to sync laws with, disabling lawsync protocol.")))
lawupdate = FALSE
to_chat(who, span_infoplain(span_bold("Obey these laws:")))
laws.show_laws(who)
to_chat(who, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
if(shell) //AI shell
to_chat(who, span_infoplain(span_bold("Remember, you are an AI remotely controlling your shell, other AIs can be ignored.")))
// TODO: Update to new antagonist system.

View File

@@ -1332,8 +1332,7 @@
log_game("[key_name(user)] assigned as operator on cyborg [key_name(src)]. Syndicate Operator change.")
var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
set_zeroth_law("Only [user.real_name] and people [TU.he] designate[TU.s] as being such are operatives.")
to_chat(src, span_infoplain(span_bold("Obey these laws:")))
laws.show_laws(src)
to_chat(src, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
to_chat(src, span_danger("ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands."))
else
to_chat(user, span_filter_notice("[src] already has an operator assigned."))
@@ -1385,8 +1384,7 @@
to_chat(src, span_danger("> N"))
sleep(20)
to_chat(src, span_danger("ERRORERRORERROR"))
to_chat(src, span_infoplain(span_bold("Obey these laws:")))
laws.show_laws(src)
to_chat(src, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
to_chat(src, span_danger("ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands."))
update_icon()
hud_used.update_robot_modules_display()

View File

@@ -71,8 +71,7 @@
var/confirm = tgui_alert(src, "Do you want to keep your laws or reroll? (For specific laws, feel free to ahelp and we'll see what we can do)", "Confirm laws", list("Keep", "Reroll ([law_retries])"))
if(findtext(confirm, regex("Reroll \\(\[0-9\]*\\)", "")))
apply_new_laws()
to_chat(src, span_infoplain(span_bold("Obey these laws:")))
laws.show_laws(src)
to_chat(src, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
law_retries --
else
law_retries = 0

View File

@@ -127,13 +127,11 @@
return TRUE
if("notify_laws")
to_chat(owner, span_danger("Law Notice"))
owner.laws.show_laws(owner)
to_chat(owner, span_danger("Law Notice\n") + owner.laws.get_formatted_laws())
if(isAI(owner))
var/mob/living/silicon/ai/AI = owner
for(var/mob/living/silicon/robot/R in AI.connected_robots)
to_chat(R, span_danger("Law Notice"))
R.laws.show_laws(R)
to_chat(R, span_danger("Law Notice\n") + R.laws.get_formatted_laws())
if(ui.user != owner)
to_chat(ui.user, span_notice("Laws displayed."))
return TRUE