mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 11:05:03 +01:00
Merge pull request #13799 from farie82/robot-sync-fix
Makes borgs (dis)connect properly to the AI. Fixing invisible borgs for the AI and a runtime or more
This commit is contained in:
@@ -83,7 +83,7 @@
|
||||
scanner.Grant(src)
|
||||
update_icons()
|
||||
|
||||
/mob/living/silicon/robot/drone/init()
|
||||
/mob/living/silicon/robot/drone/init(alien = FALSE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
laws = new /datum/ai_laws/drone()
|
||||
connected_ai = null
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
/mob/living/silicon/robot/get_cell()
|
||||
return cell
|
||||
|
||||
/mob/living/silicon/robot/New(loc,var/syndie = 0,var/unfinished = 0, var/alien = 0)
|
||||
/mob/living/silicon/robot/New(loc, syndie = FALSE, unfinished = FALSE, alien = FALSE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
spark_system = new /datum/effect_system/spark_spread()
|
||||
spark_system.set_up(5, 0, src)
|
||||
spark_system.attach(src)
|
||||
@@ -134,7 +134,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
radio = new /obj/item/radio/borg(src)
|
||||
common_radio = radio
|
||||
|
||||
init()
|
||||
init(ai_to_sync_to = ai_to_sync_to)
|
||||
|
||||
if(has_camera && !camera)
|
||||
camera = new /obj/machinery/camera(src)
|
||||
@@ -172,14 +172,16 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
scanner = new(src)
|
||||
scanner.Grant(src)
|
||||
|
||||
/mob/living/silicon/robot/proc/init(var/alien=0)
|
||||
/mob/living/silicon/robot/proc/init(alien = FALSE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
aiCamera = new/obj/item/camera/siliconcam/robot_camera(src)
|
||||
make_laws()
|
||||
additional_law_channels["Binary"] = ":b "
|
||||
var/new_ai = select_active_ai_with_fewest_borgs()
|
||||
if(new_ai)
|
||||
var/found_ai = ai_to_sync_to
|
||||
if(!found_ai)
|
||||
found_ai = select_active_ai_with_fewest_borgs()
|
||||
if(found_ai)
|
||||
lawupdate = 1
|
||||
connect_to_ai(new_ai)
|
||||
connect_to_ai(found_ai)
|
||||
else
|
||||
lawupdate = 0
|
||||
|
||||
@@ -1348,7 +1350,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
is_emaggable = FALSE
|
||||
default_cell_type = /obj/item/stock_parts/cell/bluespace
|
||||
|
||||
/mob/living/silicon/robot/deathsquad/init()
|
||||
/mob/living/silicon/robot/deathsquad/init(alien = FALSE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
laws = new /datum/ai_laws/deathsquad
|
||||
module = new /obj/item/robot_module/deathsquad(src)
|
||||
aiCamera = new/obj/item/camera/siliconcam/robot_camera(src)
|
||||
@@ -1378,7 +1380,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
var/eprefix = "Amber"
|
||||
|
||||
|
||||
/mob/living/silicon/robot/ert/init()
|
||||
/mob/living/silicon/robot/ert/init(alien = FALSE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
laws = new /datum/ai_laws/ert_override
|
||||
radio = new /obj/item/radio/borg/ert(src)
|
||||
radio.recalculateChannels()
|
||||
@@ -1434,7 +1436,7 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
|
||||
xeno_disarm_chance = 10
|
||||
default_cell_type = /obj/item/stock_parts/cell/bluespace
|
||||
|
||||
/mob/living/silicon/robot/destroyer/init()
|
||||
/mob/living/silicon/robot/destroyer/init(alien = FALSE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
..()
|
||||
module = new /obj/item/robot_module/destroyer(src)
|
||||
module.add_languages(src)
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
..()
|
||||
cell = new /obj/item/stock_parts/cell/hyper(src)
|
||||
|
||||
/mob/living/silicon/robot/syndicate/init()
|
||||
/mob/living/silicon/robot/syndicate/init(alien = FALSE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
laws = new /datum/ai_laws/syndicate_override
|
||||
module = new /obj/item/robot_module/syndicate(src)
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
Your energy saw functions as a circular saw, but can be activated to deal more damage, and your operative pinpointer will find and locate fellow nuclear operatives. \
|
||||
<i>Help the operatives secure the disk at all costs!</i></b>"
|
||||
|
||||
/mob/living/silicon/robot/syndicate/medical/init()
|
||||
/mob/living/silicon/robot/syndicate/medical/init(alien = FALSE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
..()
|
||||
module = new /obj/item/robot_module/syndicate_medical(src)
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
Be aware that physical contact or taking damage will break your disguise. \
|
||||
<i>Help the operatives secure the disk at all costs!</i></b>"
|
||||
|
||||
/mob/living/silicon/robot/syndicate/saboteur/init()
|
||||
/mob/living/silicon/robot/syndicate/saboteur/init(alien = FALSE, mob/living/silicon/ai/ai_to_sync_to = null)
|
||||
..()
|
||||
module = new /obj/item/robot_module/syndicate_saboteur(src)
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
var/mob/living/silicon/robot/Robot = new_mob
|
||||
Robot.mmi = new /obj/item/mmi(new_mob)
|
||||
Robot.lawupdate = FALSE
|
||||
Robot.connected_ai = null
|
||||
Robot.disconnect_from_ai()
|
||||
Robot.clear_inherent_laws()
|
||||
Robot.clear_zeroth_law()
|
||||
if(ishuman(M))
|
||||
|
||||
Reference in New Issue
Block a user