mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
[MIRROR] moves law outputs to a block (#11706)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
9efbeb86af
commit
19006d64ac
@@ -57,13 +57,15 @@
|
|||||||
continue
|
continue
|
||||||
|
|
||||||
if (!robo.connected_ai)
|
if (!robo.connected_ai)
|
||||||
|
var/list/robot_stat_display = list()
|
||||||
if (robo.stat != 2)
|
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
|
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?
|
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)
|
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.")))
|
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.")))
|
||||||
|
|||||||
@@ -222,6 +222,18 @@
|
|||||||
supplied_laws.Cut()
|
supplied_laws.Cut()
|
||||||
sorted_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)
|
/datum/ai_laws/proc/show_laws(var/who)
|
||||||
sort_laws()
|
sort_laws()
|
||||||
for(var/datum/ai_law/law in sorted_laws)
|
for(var/datum/ai_law/law in sorted_laws)
|
||||||
|
|||||||
@@ -46,4 +46,4 @@
|
|||||||
/decl/hierarchy/outfit/tournament_gear/janitor/post_equip(var/mob/living/carbon/human/H)
|
/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
|
var/obj/item/reagent_containers/glass/bucket/bucket = locate(/obj/item/reagent_containers/glass/bucket) in H
|
||||||
if(bucket)
|
if(bucket)
|
||||||
bucket.reagents.add_reagent(/datum/reagent/water, 70)
|
bucket.reagents.add_reagent(REAGENT_ID_WATER, 70)
|
||||||
|
|||||||
@@ -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..."))
|
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
|
var/mob/living/carbon/C = user
|
||||||
playsound(get_turf(C), 'sound/items/eatfood.ogg', 25, 0)
|
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(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(/datum/reagent/chloralhydrate, 3)
|
C.ingested.add_reagent(REAGENT_ID_CHLORALHYDRATE, 3)
|
||||||
reagents.trans_to_holder(C.ingested, 1)
|
reagents.trans_to_holder(C.ingested, 1)
|
||||||
bites++
|
bites++
|
||||||
if(bites >= 5)
|
if(bites >= 5)
|
||||||
|
|||||||
@@ -577,13 +577,11 @@
|
|||||||
target.lawsync()
|
target.lawsync()
|
||||||
return TRUE
|
return TRUE
|
||||||
if("notify_laws")
|
if("notify_laws")
|
||||||
to_chat(target, span_danger("Law Notice"))
|
to_chat(target, span_danger("Law Notice\n") + target.laws.get_formatted_laws())
|
||||||
target.laws.show_laws(target)
|
|
||||||
if(isAI(target))
|
if(isAI(target))
|
||||||
var/mob/living/silicon/ai/our_ai = target
|
var/mob/living/silicon/ai/our_ai = target
|
||||||
for(var/mob/living/silicon/robot/R in our_ai.connected_robots)
|
for(var/mob/living/silicon/robot/R in our_ai.connected_robots)
|
||||||
to_chat(R, span_danger("Law Notice"))
|
to_chat(R, span_danger("Law Notice\n") + R.laws.get_formatted_laws())
|
||||||
R.laws.show_laws(R)
|
|
||||||
if(ui.user != target)
|
if(ui.user != target)
|
||||||
to_chat(ui.user, span_notice("Laws displayed."))
|
to_chat(ui.user, span_notice("Laws displayed."))
|
||||||
return TRUE
|
return TRUE
|
||||||
@@ -613,7 +611,7 @@
|
|||||||
target.clear_supplied_laws()
|
target.clear_supplied_laws()
|
||||||
target.clear_inherent_laws()
|
target.clear_inherent_laws()
|
||||||
target.laws = new global.using_map.default_law_type
|
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()
|
target.hud_used?.update_robot_modules_display()
|
||||||
else
|
else
|
||||||
target.emagged = 1
|
target.emagged = 1
|
||||||
@@ -625,7 +623,7 @@
|
|||||||
if(target.bolt)
|
if(target.bolt)
|
||||||
if(!target.bolt.malfunction)
|
if(!target.bolt.malfunction)
|
||||||
target.bolt.malfunction = MALFUNCTION_PERMANENT
|
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()
|
target.hud_used?.update_robot_modules_display()
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
|
|||||||
@@ -101,40 +101,29 @@
|
|||||||
|
|
||||||
|
|
||||||
else
|
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
|
//get message text, limit it's length.and clean/escape html
|
||||||
if(!msg)
|
if(!msg)
|
||||||
msg = tgui_input_text(src, "Message:", "Private message to [key_name(recipient, 0, 0)]", multiline = TRUE, encode = FALSE)
|
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)
|
if(!msg)
|
||||||
return
|
return
|
||||||
|
|
||||||
if(prefs.muted & MUTE_ADMINHELP)
|
if (src.handle_spam_prevention(MUTE_ADMINHELP))
|
||||||
to_chat(src, span_admin_pm_warning("Error: Admin-PM: You are unable to use admin PM-s (muted)."))
|
return
|
||||||
return
|
|
||||||
|
|
||||||
if(!recipient)
|
if(prefs.muted & MUTE_ADMINHELP)
|
||||||
if(holder)
|
to_chat(src, span_admin_pm_warning("Error: Admin-PM: You are unable to use admin PM-s (muted)."))
|
||||||
to_chat(src, span_admin_pm_warning("Error: Admin-PM: Client not found."))
|
return
|
||||||
else
|
|
||||||
current_ticket.MessageNoRecipient(msg)
|
|
||||||
return
|
|
||||||
|
|
||||||
if (src.handle_spam_prevention(MUTE_ADMINHELP))
|
if(!recipient)
|
||||||
return
|
if(holder)
|
||||||
|
to_chat(src, span_admin_pm_warning("Error: Admin-PM: Client not found."))
|
||||||
//clean the message if it's not sent by a high-rank admin
|
to_chat(src, msg)
|
||||||
if(!check_rights(R_SERVER|R_DEBUG, FALSE)||irc)//no sending html to the poor bots
|
else
|
||||||
msg = trim(sanitize(copytext(msg,1,MAX_MESSAGE_LEN)))
|
current_ticket.MessageNoRecipient(msg)
|
||||||
if(!msg)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
var/rawmsg = msg
|
var/rawmsg = msg
|
||||||
|
|||||||
@@ -84,8 +84,10 @@
|
|||||||
if(!istype(M) || material.name != M.material.name)
|
if(!istype(M) || material.name != M.material.name)
|
||||||
return 0
|
return 0
|
||||||
var/transfer = ..(S,tamount,1)
|
var/transfer = ..(S,tamount,1)
|
||||||
if(src) update_strings()
|
if(!QDELETED(src))
|
||||||
if(M) M.update_strings()
|
update_strings()
|
||||||
|
if(M)
|
||||||
|
M.update_strings()
|
||||||
return transfer
|
return transfer
|
||||||
|
|
||||||
/obj/item/stack/material/attack_self(var/mob/user)
|
/obj/item/stack/material/attack_self(var/mob/user)
|
||||||
|
|||||||
@@ -53,12 +53,13 @@
|
|||||||
if(W.sharp && W.edge)
|
if(W.sharp && W.edge)
|
||||||
var/time = (3 SECONDS / max(W.force / 10, 1)) * W.toolspeed
|
var/time = (3 SECONDS / max(W.force / 10, 1)) * W.toolspeed
|
||||||
user.setClickCooldown(time)
|
user.setClickCooldown(time)
|
||||||
|
var/our_material_name = src.material.name
|
||||||
if(do_after(user, time, target = src) && use(1))
|
if(do_after(user, time, target = src) && use(1))
|
||||||
to_chat(user, span_notice("You cut up a log into planks."))
|
to_chat(user, span_notice("You cut up a log into planks."))
|
||||||
playsound(src, 'sound/effects/woodcutting.ogg', 50, 1)
|
playsound(src, 'sound/effects/woodcutting.ogg', 50, 1)
|
||||||
var/obj/item/stack/material/wood/existing_wood = null
|
var/obj/item/stack/material/wood/existing_wood = null
|
||||||
for(var/obj/item/stack/material/wood/M in user.loc)
|
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
|
existing_wood = M
|
||||||
break
|
break
|
||||||
|
|
||||||
|
|||||||
@@ -280,8 +280,7 @@ var/list/mob_hat_cache = list()
|
|||||||
var/datum/gender/TU = GLOB.gender_datums[user.get_visible_gender()]
|
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.")
|
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:")))
|
to_chat(src, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
|
||||||
laws.show_laws(src)
|
|
||||||
to_chat(src, span_danger("ALERT: [user.real_name] is your new master. Obey your new laws and \his commands."))
|
to_chat(src, span_danger("ALERT: [user.real_name] is your new master. Obey your new laws and \his commands."))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
|
|||||||
@@ -30,8 +30,7 @@
|
|||||||
to_chat(src, span_infoplain(span_bold("No AI selected to sync laws with, disabling lawsync protocol.")))
|
to_chat(src, span_infoplain(span_bold("No AI selected to sync laws with, disabling lawsync protocol.")))
|
||||||
lawupdate = FALSE
|
lawupdate = FALSE
|
||||||
|
|
||||||
to_chat(who, span_infoplain(span_bold("Obey these laws:")))
|
to_chat(who, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
|
||||||
laws.show_laws(who)
|
|
||||||
if(shell) //AI shell
|
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.")))
|
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.
|
// TODO: Update to new antagonist system.
|
||||||
|
|||||||
@@ -1332,8 +1332,7 @@
|
|||||||
log_game("[key_name(user)] assigned as operator on cyborg [key_name(src)]. Syndicate Operator change.")
|
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()]
|
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.")
|
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:")))
|
to_chat(src, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
|
||||||
laws.show_laws(src)
|
|
||||||
to_chat(src, span_danger("ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands."))
|
to_chat(src, span_danger("ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands."))
|
||||||
else
|
else
|
||||||
to_chat(user, span_filter_notice("[src] already has an operator assigned."))
|
to_chat(user, span_filter_notice("[src] already has an operator assigned."))
|
||||||
@@ -1385,8 +1384,7 @@
|
|||||||
to_chat(src, span_danger("> N"))
|
to_chat(src, span_danger("> N"))
|
||||||
sleep(20)
|
sleep(20)
|
||||||
to_chat(src, span_danger("ERRORERRORERROR"))
|
to_chat(src, span_danger("ERRORERRORERROR"))
|
||||||
to_chat(src, span_infoplain(span_bold("Obey these laws:")))
|
to_chat(src, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
|
||||||
laws.show_laws(src)
|
|
||||||
to_chat(src, span_danger("ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands."))
|
to_chat(src, span_danger("ALERT: [user.real_name] is your new master. Obey your new laws and [TU.his] commands."))
|
||||||
update_icon()
|
update_icon()
|
||||||
hud_used.update_robot_modules_display()
|
hud_used.update_robot_modules_display()
|
||||||
|
|||||||
@@ -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])"))
|
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\]*\\)", "")))
|
if(findtext(confirm, regex("Reroll \\(\[0-9\]*\\)", "")))
|
||||||
apply_new_laws()
|
apply_new_laws()
|
||||||
to_chat(src, span_infoplain(span_bold("Obey these laws:")))
|
to_chat(src, span_infoplain(span_bold("Obey these laws:\n") + laws.get_formatted_laws()))
|
||||||
laws.show_laws(src)
|
|
||||||
law_retries --
|
law_retries --
|
||||||
else
|
else
|
||||||
law_retries = 0
|
law_retries = 0
|
||||||
|
|||||||
@@ -127,13 +127,11 @@
|
|||||||
return TRUE
|
return TRUE
|
||||||
|
|
||||||
if("notify_laws")
|
if("notify_laws")
|
||||||
to_chat(owner, span_danger("Law Notice"))
|
to_chat(owner, span_danger("Law Notice\n") + owner.laws.get_formatted_laws())
|
||||||
owner.laws.show_laws(owner)
|
|
||||||
if(isAI(owner))
|
if(isAI(owner))
|
||||||
var/mob/living/silicon/ai/AI = owner
|
var/mob/living/silicon/ai/AI = owner
|
||||||
for(var/mob/living/silicon/robot/R in AI.connected_robots)
|
for(var/mob/living/silicon/robot/R in AI.connected_robots)
|
||||||
to_chat(R, span_danger("Law Notice"))
|
to_chat(R, span_danger("Law Notice\n") + R.laws.get_formatted_laws())
|
||||||
R.laws.show_laws(R)
|
|
||||||
if(ui.user != owner)
|
if(ui.user != owner)
|
||||||
to_chat(ui.user, span_notice("Laws displayed."))
|
to_chat(ui.user, span_notice("Laws displayed."))
|
||||||
return TRUE
|
return TRUE
|
||||||
|
|||||||
Reference in New Issue
Block a user