keep shells in sync with AI (#9145)

This commit is contained in:
Kashargul
2024-10-04 15:13:45 +02:00
committed by GitHub
parent ab154b48b2
commit abb09dcb0e
2 changed files with 27 additions and 5 deletions

View File

@@ -50,17 +50,32 @@
if(!(target.z in affecting_z))
continue
var/law = target.generate_ion_law()
to_chat(target, span_danger("You have detected a change in your laws information:"))
to_chat(target, law)
target.add_ion_law(law)
target.show_laws()
ionBorgs = FALSE // CHOMPEdit
//CHOMPEdit Start - Outpost 21 upport: shells don't get ion laws, and sync to AI instead
if(target.deployed_shell)
var/mob/living/silicon/robot/shell = target.deployed_shell
if(!shell.emagged) // emagged ignores law updates
to_chat(shell, span_danger("You have detected a change in your laws information:"))
to_chat(shell, law)
var/org_lu = shell.lawupdate // force a law update due to controlling AI being changed
shell.lawupdate = TRUE
shell.lawsync()
shell.lawupdate = org_lu
shell.show_laws()
else
to_chat(target, span_danger("You have detected a change in your laws information:"))
to_chat(target, law)
target.show_laws()
ionBorgs = FALSE
// CHOMPEdit Start
if(ionBorgs) // Making sure an AI hasn't been given an Ion law...
for (var/mob/living/silicon/target in silicon_mob_list)
if(!(target.z in affecting_z) || prob(33))
continue
if(istype(target,/mob/living/silicon/robot))
var/mob/living/silicon/robot/R = target
if(R.shell && !R.emagged) // unless emagged shell
continue
var/law = target.generate_ion_law()
to_chat(target, "<span class='danger'>You have detected a change in your laws information:</span>")
to_chat(target, law)