mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 12:35:33 +01:00
Debugging Cyborgs during Construction
-Using a multitool on a completed cyborg body before inserting the MMI will allow you to set various settings to be transferred to the new cyborg mob -Removed naming via pens. Naming is now done via debugging. -Allows roboticists to force a module to load -Allows roboticists to block ai syncinc and law syncing -Allows roboticists to toggle the initial lockdown and panel lock state I also rewrote NEO's note on cyborg objectives since he's never going to fix it now. IT'S A FEATURE.
This commit is contained in:
@@ -66,7 +66,13 @@
|
||||
var/obj/item/robot_parts/r_leg/r_leg = null
|
||||
var/obj/item/robot_parts/chest/chest = null
|
||||
var/obj/item/robot_parts/head/head = null
|
||||
|
||||
var/created_name = ""
|
||||
var/forced_module = ""
|
||||
var/locomotion = 1
|
||||
var/lawsync = 1
|
||||
var/aisync = 1
|
||||
var/panel_locked = 1
|
||||
|
||||
/obj/item/robot_parts/robot_suit/New()
|
||||
..()
|
||||
@@ -156,6 +162,12 @@
|
||||
else
|
||||
user << "\blue You need to attach a flash to it first!"
|
||||
|
||||
if (istype(W, /obj/item/device/multitool))
|
||||
if(check_completion())
|
||||
Interact(user)
|
||||
else
|
||||
user << "<span class='notice'>The endoskeleton must be assembled before debugging can begin.</span>"
|
||||
|
||||
if(istype(W, /obj/item/device/mmi))
|
||||
var/obj/item/device/mmi/M = W
|
||||
if(check_completion())
|
||||
@@ -194,13 +206,22 @@
|
||||
user.drop_item()
|
||||
|
||||
O.invisibility = 0
|
||||
//Transfer debug settings to new mob
|
||||
O.custom_name = created_name
|
||||
O.updatename("Default")
|
||||
O.locked = panel_locked
|
||||
if(!aisync)
|
||||
O.connected_ai = null
|
||||
O.lawupdate = 0
|
||||
O.make_laws()
|
||||
else if(!lawsync)
|
||||
O.lawupdate = 0
|
||||
O.make_laws()
|
||||
|
||||
M.brainmob.mind.transfer_to(O)
|
||||
|
||||
if(O.mind && O.mind.special_role)
|
||||
O.mind.store_memory("In case you look at this after being borged, the objectives are only here until I find a way to make them not show up for you, as I can't simply delete them without screwing up round-end reporting. --NeoFite")
|
||||
O.mind.store_memory("As a cyborg, any objectives listed here are null and void, and will be marked as failed. They are simply here for memory purposes.")
|
||||
|
||||
O.job = "Cyborg"
|
||||
|
||||
@@ -214,20 +235,72 @@
|
||||
|
||||
src.loc = O
|
||||
O.robot_suit = src
|
||||
|
||||
if(forced_module)
|
||||
O << "<span class='warning'>SYSTEM: Forcing [forced_module] module.</span>"
|
||||
O.pick_module(forced_module)
|
||||
if(!locomotion)
|
||||
O.lockcharge = 1
|
||||
O.update_canmove()
|
||||
O << "<span class='warning'>Error: Servo motors unresponsive.</span>"
|
||||
|
||||
else
|
||||
user << "\blue The MMI must go in after everything else!"
|
||||
|
||||
if (istype(W, /obj/item/weapon/pen))
|
||||
var/t = stripped_input(user, "Enter new robot name", src.name, src.created_name, MAX_NAME_LEN)
|
||||
if (!t)
|
||||
return
|
||||
if (!in_range(src, usr) && src.loc != usr)
|
||||
return
|
||||
|
||||
src.created_name = t
|
||||
|
||||
return
|
||||
|
||||
/obj/item/robot_parts/robot_suit/proc/Interact(mob/user)
|
||||
var/t1 = text("Designation: <A href='?src=\ref[];Name=1'>[(created_name ? "[created_name]" : "Default Cyborg")]</a><br>\n",src)
|
||||
t1 += text("Module Load Method: <A href='?src=\ref[];Module=1'>[(forced_module ? "Forced [forced_module]" : "Default")]</a><br><br>\n",src)
|
||||
|
||||
t1 += text("LawSync Port: <A href='?src=\ref[];Law=1'>[(lawsync ? "Open" : "Closed")]</a><br>\n",src)
|
||||
t1 += text("AI Connection Port: <A href='?src=\ref[];AI=1'>[(aisync ? "Open" : "Closed")]</a><br>\n",src)
|
||||
t1 += text("Servo Motor Functions: <A href='?src=\ref[];Loco=1'>[(locomotion ? "Unlocked" : "Locked")]</a><br>\n",src)
|
||||
t1 += text("Panel Lock: <A href='?src=\ref[];Panel=1'>[(panel_locked ? "Engaged" : "Disengaged")]</a><br>\n",src)
|
||||
var/datum/browser/popup = new(user, "robotdebug", "Cyborg Boot Debug", 310, 220)
|
||||
popup.set_content(t1)
|
||||
popup.open()
|
||||
|
||||
/obj/item/robot_parts/robot_suit/Topic(href, href_list)
|
||||
if(usr.lying || usr.stat || !in_range(src, usr))
|
||||
return 1
|
||||
if(!(ishuman(usr)))
|
||||
usr << "<span class='notice'>You don't have the dexterity to do this!</span>"
|
||||
return 1
|
||||
|
||||
var/mob/living/living_user = usr
|
||||
var/obj/item/item_in_hand = living_user.get_active_hand()
|
||||
if(!istype(item_in_hand, /obj/item/device/multitool))
|
||||
living_user << "<span class='error'>You need a multitool!</span>"
|
||||
return 1
|
||||
|
||||
if(href_list["Name"])
|
||||
var/new_name = reject_bad_name(input(usr, "Enter new designation. Set to blank to reset to default.", "Cyborg Debug", src.created_name))
|
||||
if(!in_range(src, usr) && src.loc != usr)
|
||||
return
|
||||
if(new_name)
|
||||
created_name = new_name
|
||||
else
|
||||
created_name = ""
|
||||
|
||||
else if(href_list["Module"])
|
||||
forced_module = input("Force a module to load on boot", "Cyborg Debug", null, null) in list("Default", "Standard", "Engineering", "Medical", "Miner", "Janitor","Service", "Security")
|
||||
if(forced_module == "Default")
|
||||
forced_module = ""
|
||||
|
||||
else if(href_list["Law"])
|
||||
lawsync = !lawsync
|
||||
else if(href_list["AI"])
|
||||
aisync = !aisync
|
||||
else if(href_list["Loco"])
|
||||
locomotion = !locomotion
|
||||
else if(href_list["Panel"])
|
||||
panel_locked = !panel_locked
|
||||
|
||||
add_fingerprint(usr)
|
||||
Interact(usr)
|
||||
return 0
|
||||
|
||||
/obj/item/robot_parts/chest/attackby(obj/item/W as obj, mob/user as mob)
|
||||
..()
|
||||
if(istype(W, /obj/item/weapon/stock_parts/cell))
|
||||
|
||||
@@ -124,10 +124,14 @@
|
||||
mmi = null
|
||||
..()
|
||||
|
||||
/mob/living/silicon/robot/proc/pick_module()
|
||||
/mob/living/silicon/robot/proc/pick_module(var/forced = "")
|
||||
if(module)
|
||||
return
|
||||
var/mod = input("Please, select a module!", "Robot", null, null) in list("Standard", "Engineering", "Medical", "Miner", "Janitor","Service", "Security")
|
||||
var/mod
|
||||
if(forced)
|
||||
mod = forced
|
||||
else
|
||||
mod = input("Please, select a module!", "Robot", null, null) in list("Standard", "Engineering", "Medical", "Miner", "Janitor","Service", "Security")
|
||||
var/animation_length=0
|
||||
if(module)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user