From 7f357963bdd0f6863e2940d55fd11afb5be81211 Mon Sep 17 00:00:00 2001 From: Perakp Date: Sat, 29 Nov 2014 14:36:36 +0200 Subject: [PATCH 1/2] - Fixes belts getting stuck in drone inventory. Fixes #5563. - Gives drones the ability to interact with APCs and air alarms without requiring them to have an ID card. Fixes #5565. - Drones have to be adjacent to the APC/alarm when using it, for balance. --- code/game/machinery/alarm.dm | 7 ++--- .../objects/items/weapons/storage/belt.dm | 28 ------------------- code/modules/mob/living/silicon/silicon.dm | 1 + .../living/simple_animal/friendly/drone.dm | 1 + code/modules/mob/mob_defines.dm | 2 ++ code/modules/power/apc.dm | 8 +++--- 6 files changed, 11 insertions(+), 36 deletions(-) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 8d99276354a..f4ef0fe07d3 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -179,7 +179,7 @@ return - else if (istype(user, /mob/living/silicon) && src.aidisabled) + else if (user.has_unlimited_silicon_privilege && src.aidisabled) user << "AI control for this Air Alarm interface has been disabled." user << browse(null, "window=air_alarm") return @@ -248,11 +248,10 @@ /obj/machinery/alarm/proc/return_text() var/dat = "" - if(!(istype(usr, /mob/living/silicon)) && locked) - dat += "
Swipe ID card to unlock interface
" + dat += "
Swipe ID card to [locked ? "unlock" : "lock"] interface.
" + if(!usr.has_unlimited_silicon_privilege && locked) dat += "[return_status()]" else - dat += "
Swipe ID card to lock interface
" dat += "[return_status()]
[return_controls()]" return dat diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm index 3124979681f..23bd0781691 100644 --- a/code/game/objects/items/weapons/storage/belt.dm +++ b/code/game/objects/items/weapons/storage/belt.dm @@ -7,34 +7,6 @@ slot_flags = SLOT_BELT attack_verb = list("whipped", "lashed", "disciplined") - -/obj/item/weapon/storage/belt/proc/can_use() - if(!ismob(loc)) return 0 - var/mob/M = loc - if(src in M.get_equipped_items()) - return 1 - else - return 0 - - -/obj/item/weapon/storage/belt/MouseDrop(obj/over_object as obj, src_location, over_location) - var/mob/M = usr - if(!istype(over_object, /obj/screen)) - return ..() - playsound(src.loc, "rustle", 50, 1, -5) - if (!M.restrained() && !M.stat && can_use()) - switch(over_object.name) - if("r_hand") - M.unEquip(src) - M.put_in_r_hand(src) - if("l_hand") - M.unEquip(src) - M.put_in_l_hand(src) - src.add_fingerprint(usr) - return - - - /obj/item/weapon/storage/belt/utility name = "toolbelt" //Carn: utility belt is nicer, but it bamboozles the text parsing. desc = "Holds tools." diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index a1d4cc93437..dd327064114 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -2,6 +2,7 @@ gender = NEUTER voice_name = "synthesized voice" languages = ROBOT | HUMAN + has_unlimited_silicon_privilege = 1 var/syndicate = 0 var/datum/ai_laws/laws = null//Now... THEY ALL CAN ALL HAVE LAWS var/list/alarms_to_show = list() diff --git a/code/modules/mob/living/simple_animal/friendly/drone.dm b/code/modules/mob/living/simple_animal/friendly/drone.dm index a220a9d0942..c388dabdde9 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone.dm @@ -30,6 +30,7 @@ voice_name = "synthesized chirp" languages = DRONE mob_size = 0 + has_unlimited_silicon_privilege = 1 var/picked = FALSE var/list/drone_overlays[TOTAL_LAYERS] var/laws = \ diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 6b66ca59f6e..8ade6498f16 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -153,6 +153,8 @@ var/digitalcamo = 0 // Can they be tracked by the AI? + var/has_unlimited_silicon_privilege = 0 // Can they interact with station electronics + var/list/radar_blips = list() // list of screen objects, radar blips var/radar_open = 0 // nonzero is radar is open diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 5adebd7b81f..a2af29d9cb8 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -691,7 +691,7 @@ "chargingStatus" = charging, "totalLoad" = lastused_equip + lastused_light + lastused_environ, "coverLocked" = coverlocked, - "siliconUser" = istype(user, /mob/living/silicon), + "siliconUser" = user.has_unlimited_silicon_privilege, "malfStatus" = get_malf_status(user), "powerChannels" = list( @@ -779,7 +779,7 @@ if(user.lying) user << "You must stand to use [src]!" return 0 - if (istype(user, /mob/living/silicon)) + if(user.has_unlimited_silicon_privilege) var/mob/living/silicon/ai/AI = user var/mob/living/silicon/robot/robot = user if ( \ @@ -845,7 +845,7 @@ update() else if (href_list["overload"]) - if(istype(usr, /mob/living/silicon)) + if(usr.has_unlimited_silicon_privilege) src.overload_lighting() else if (href_list["malfhack"]) @@ -882,7 +882,7 @@ malfvacate() else if (href_list["toggleaccess"]) - if(istype(usr, /mob/living/silicon)) + if(usr.has_unlimited_silicon_privilege) if(emagged || (stat & (BROKEN|MAINT))) usr << "The APC does not respond to the command." else From 953aab610c130179ba73dd9c6dd6535dec0ac445 Mon Sep 17 00:00:00 2001 From: Perakp Date: Tue, 30 Dec 2014 13:50:10 +0200 Subject: [PATCH 2/2] Changes a few more checks to accept drones in addition to silicons. --- code/game/machinery/alarm.dm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index f4ef0fe07d3..9e16d3f3b29 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -563,7 +563,7 @@ table tr:first-child th:first-child { border: none;} var/datum/tlv/tlv = TLV[env] var/newval = input("Enter [varname] for env", "Alarm triggers", tlv.vars[varname]) as num|null - if (isnull(newval) || ..() || (locked && !issilicon(usr))) + if (isnull(newval) || ..() || (locked && !(usr.has_unlimited_silicon_privilege))) return if (newval<0) tlv.vars[varname] = -1.0 @@ -1107,7 +1107,7 @@ FIRE ALARM var/d1 var/d2 var/dat = "" - if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon)) + if (istype(user, /mob/living/carbon/human) || user.has_unlimited_silicon_privilege) A = A.loc if (A.fire) @@ -1280,7 +1280,7 @@ Code shamelessly copied from apc_frame var/area/A = src.loc var/d1 var/dat - if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai)) + if (istype(user, /mob/living/carbon/human) || user.has_unlimited_silicon_privilege) A = A.loc if (A.party)