From 1758f521232cbe89c0e25cda5a768552095aa876 Mon Sep 17 00:00:00 2001 From: Zuhayr Date: Sun, 12 Apr 2015 13:09:03 +0930 Subject: [PATCH] Fixes errors in previous commit, makes some tweaks. --- .../mob/living/silicon/robot/drone/drone.dm | 55 ++++++++++--------- .../silicon/robot/drone/drone_manufacturer.dm | 1 - .../mob/living/silicon/robot/robot_modules.dm | 8 +-- 3 files changed, 29 insertions(+), 35 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index e51dd093a8..8fd20e1368 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -14,7 +14,7 @@ lawupdate = 0 density = 1 req_access = list(access_engine, access_robotics) - integrated_light_power = 2 + integrated_light_power = 3 local_transmit = 1 mob_bump_flag = SIMPLE_ANIMAL @@ -26,6 +26,7 @@ var/mail_destination = "" var/obj/machinery/drone_fabricator/master_fabricator var/law_type = /datum/ai_laws/drone + var/module_type = /obj/item/weapon/robot_module/drone var/can_pull_size = 2 var/can_pull_mobs @@ -56,13 +57,15 @@ updateicon() /mob/living/silicon/robot/drone/init() - laws = new law_type + if(!laws) laws = new law_type + if(!module) module = new module_type(src) + aiCamera = new/obj/item/device/camera/siliconcam/drone_camera(src) - if(camera && "Robots" in camera.network) - camera.add_network("Engineering") - module = new /obj/item/weapon/robot_module/drone(src) flavor_text = "It's a tiny little repair drone. The casing is stamped with an NT logo and the subscript: 'NanoTrasen Recursive Repair Systems: Fixing Tomorrow's Problem, Today!'" playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0) + spawn(1) + if(camera && ("Robots" in camera.network)) + camera.add_network("Engineering") //Redefining some robot procs... /mob/living/silicon/robot/drone/SetName(pickedName as text) @@ -92,26 +95,26 @@ /mob/living/silicon/robot/drone/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W, /obj/item/borg/upgrade/)) - user << "\red The maintenance drone chassis not compatible with \the [W]." + user << "\The [src] is not compatible with \the [W]." return else if (istype(W, /obj/item/weapon/crowbar)) - user << "The machine is hermetically sealed. You can't open the case." + user << "\The [src] is hermetically sealed. You can't open the case." return else if (istype(W, /obj/item/weapon/card/emag)) if(!client || stat == 2) - user << "\red There's not much point subverting this heap of junk." + user << "There's not much point subverting this heap of junk." return if(emagged) - src << "\red [user] attempts to load subversive software into you, but your hacked subroutined ignore the attempt." - user << "\red You attempt to subvert [src], but the sequencer has no effect." + src << "\The [user] attempts to load subversive software into you, but your hacked subroutines ignore the attempt." + user << "You attempt to subvert [src], but the sequencer has no effect." return - user << "\red You swipe the sequencer across [src]'s interface and watch its eyes flicker." - src << "\red You feel a sudden burst of malware loaded into your execute-as-root buffer. Your tiny brain methodically parses, loads and executes the script." + user << "You swipe the sequencer across [src]'s interface and watch its eyes flicker." + src << "You feel a sudden burst of malware loaded into your execute-as-root buffer. Your tiny brain methodically parses, loads and executes the script." var/obj/item/weapon/card/emag/emag = W emag.uses-- @@ -131,7 +134,7 @@ src << "Obey these laws:" laws.show_laws(src) - src << "\red \b ALERT: [user.real_name] is your new master. Obey your new laws and his commands." + src << "ALERT: [user.real_name] is your new master. Obey your new laws and his commands." return else if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) @@ -139,14 +142,14 @@ if(stat == 2) if(!config.allow_drone_spawn || emagged || health < -35) //It's dead, Dave. - user << "\red The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one." + user << "The interface is fried, and a distressing burned smell wafts from the robot's interior. You're not rebooting this one." return if(!allowed(usr)) - user << "\red Access denied." + user << "Access denied." return - user.visible_message("\red \the [user] swipes \his ID card through \the [src], attempting to reboot it.", "\red You swipe your ID card through \the [src], attempting to reboot it.") + user.visible_message("\The [user] swipes \his ID card through \the [src], attempting to reboot it.", ">You swipe your ID card through \the [src], attempting to reboot it.") var/drones = 0 for(var/mob/living/silicon/robot/drone/D in world) if(D.key && D.client) @@ -156,7 +159,7 @@ return else - user.visible_message("\red \the [user] swipes \his ID card through \the [src], attempting to shut it down.", "\red You swipe your ID card through \the [src], attempting to shut it down.") + user.visible_message("\The [user] swipes \his ID card through \the [src], attempting to shut it down.", "You swipe your ID card through \the [src], attempting to shut it down.") if(emagged) return @@ -164,7 +167,7 @@ if(allowed(usr)) shut_down() else - user << "\red Access denied." + user << "Access denied." return @@ -195,25 +198,24 @@ //DRONE MOVEMENT. /mob/living/silicon/robot/drone/Process_Spaceslipping(var/prob_slip) - //TODO: Consider making a magboot item for drones to equip. ~Z return 0 //CONSOLE PROCS /mob/living/silicon/robot/drone/proc/law_resync() if(stat != 2) if(emagged) - src << "\red You feel something attempting to modify your programming, but your hacked subroutines are unaffected." + src << "You feel something attempting to modify your programming, but your hacked subroutines are unaffected." else - src << "\red A reset-to-factory directive packet filters through your data connection, and you obediently modify your programming to suit it." + src << "A reset-to-factory directive packet filters through your data connection, and you obediently modify your programming to suit it." full_law_reset() show_laws() /mob/living/silicon/robot/drone/proc/shut_down() if(stat != 2) if(emagged) - src << "\red You feel a system kill order percolate through your tiny brain, but it doesn't seem like a good idea to you." + src << "You feel a system kill order percolate through your tiny brain, but it doesn't seem like a good idea to you." else - src << "\red You feel a system kill order percolate through your tiny brain, and you obediently destroy yourself." + src << "You feel a system kill order percolate through your tiny brain, and you obediently destroy yourself." death() /mob/living/silicon/robot/drone/proc/full_law_reset() @@ -285,15 +287,14 @@ src.verbs -= silicon_verbs_subsystems /mob/living/silicon/robot/drone/construction + law_type = /datum/ai_laws/construction_drone + module_type = /obj/item/weapon/robot_module/drone/construction can_pull_size = 5 can_pull_mobs = 1 /mob/living/silicon/robot/drone/construction/init() - laws = new /datum/ai_laws/construction_drone() - aiCamera = new/obj/item/device/camera/siliconcam/drone_camera(src) - module = new /obj/item/weapon/robot_module/drone/construction(src) + ..() flavor_text = "It's a bulky construction drone stamped with a Sol Central glyph." - playsound(src.loc, 'sound/machines/twobeep.ogg', 50, 0) /mob/living/silicon/robot/drone/construction/updatename() real_name = "construction drone ([rand(100,999)])" diff --git a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm index d332e6bca1..247334c2ea 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone_manufacturer.dm @@ -136,7 +136,6 @@ if(DF.stat & NOPOWER || !DF.produce_drones) continue if(DF.drone_progress >= 100) - DF.create_drone(src.client) all_fabricators[DF.fabricator_tag] = DF if(!all_fabricators.len) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 5298c66210..a45a45f706 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -446,7 +446,7 @@ src.modules += new /obj/item/device/multitool(src) src.modules += new /obj/item/device/lightreplacer(src) src.modules += new /obj/item/weapon/gripper(src) - src.modules += new /obj/item/weapon/reagent_containers/spray/cleaner/drone(src) + src.modules += new /obj/item/weapon/soap(src) src.emag = new /obj/item/weapon/pickaxe/plasmacutter(src) src.emag.name = "Plasma Cutter" @@ -515,12 +515,8 @@ return //not much ROM to spare in that tiny microprocessor! /obj/item/weapon/robot_module/drone/respawn_consumable(var/mob/living/silicon/robot/R, var/amount) - var/obj/item/weapon/reagent_containers/spray/cleaner/C = locate() in src.modules - C.reagents.add_reagent("cleaner", 3 * amount) - var/obj/item/device/lightreplacer/LR = locate() in src.modules LR.Charge(R, amount) - ..() return @@ -528,7 +524,5 @@ /obj/item/proc/is_robot_module() if (!istype(src.loc, /mob/living/silicon/robot)) return 0 - var/mob/living/silicon/robot/R = src.loc - return (src in R.module.modules)