From 4c0ce0acc3e73cdee9d7cd883326fa9dc93d3cef Mon Sep 17 00:00:00 2001 From: NanakoAC Date: Wed, 21 Sep 2016 05:04:23 +0100 Subject: [PATCH] Fixes #970, fixes #953 (#978) --- .../mob/living/silicon/robot/drone/drone.dm | 14 -------- .../modules/mob/living/silicon/robot/robot.dm | 2 +- code/modules/mob/mob_helpers.dm | 8 ++++- code/modules/reagents/reagent_containers.dm | 35 +++++++++++++------ .../reagent_containers/food/drinks.dm | 8 ++--- 5 files changed, 36 insertions(+), 31 deletions(-) diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm index 1acf016185f..46eb624381b 100644 --- a/code/modules/mob/living/silicon/robot/drone/drone.dm +++ b/code/modules/mob/living/silicon/robot/drone/drone.dm @@ -280,20 +280,6 @@ return ..() -/mob/living/silicon/robot/drone/Bump(var/atom/movable/AM, yes) - - if(istype(AM,/obj/machinery/door)) // check for doors first as that will be most common - return ..(AM,yes) - - if(!(istype(AM,/obj/item/pipe) || istype(AM,/obj/structure/disposalconstruct))) - if(istype(AM,/obj/item)) //Would this even be possible? Someone try to activate that message - var/obj/item/O = AM - if(O.w_class > can_pull_size) - src << "You are too small to push that." - return 0 - else if(istype(AM,/obj)) - return 0 - ..(AM,yes) /mob/living/silicon/robot/drone/add_robot_verbs() src.verbs |= silicon_subsystems diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 7500f4a622f..630bd0ef1d5 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -678,7 +678,7 @@ else - if( !(istype(W, /obj/item/device/robotanalyzer) || istype(W, /obj/item/device/healthanalyzer)) ) + if(W.force && !(istype(W, /obj/item/device/robotanalyzer) || istype(W, /obj/item/device/healthanalyzer)) ) spark_system.start() return ..() diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index d59aaffc8d8..24d8397afc8 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -1072,7 +1072,13 @@ var/list/wierd_mobs_inclusive = list( /mob/living/simple_animal/construct, ) -/mob/living/proc/find_type() +/mob/proc/find_type() + if (istype(src, /mob/living)) + var/mob/living/L = src + return L.find_type() + return 0 + +/mob/living/find_type() //This function returns a bitfield indicating what type(s) the passed mob is. //Synthetic and wierd are exclusive from organic. We assume it's organic if it's not either of those //var/mob/living/test = src diff --git a/code/modules/reagents/reagent_containers.dm b/code/modules/reagents/reagent_containers.dm index 3b17e5aaeb7..791a0b27e0e 100644 --- a/code/modules/reagents/reagent_containers.dm +++ b/code/modules/reagents/reagent_containers.dm @@ -25,9 +25,9 @@ /obj/item/weapon/reagent_containers/attack_self(mob/user as mob) return -/obj/item/weapon/reagent_containers/attack(mob/M as mob, mob/user as mob, def_zone) +/obj/item/weapon/reagent_containers/attack(mob/M as mob, mob/user as mob, def_zone) if(can_operate(M))//Checks if mob is lying down on table for surgery - if(do_surgery(M, user, src)) + if(do_surgery(M, user, src)) return /obj/item/weapon/reagent_containers/afterattack(obj/target, mob/user, flag) @@ -66,6 +66,8 @@ user << "[target] is full." return 1 + + var/contained = reagentlist() target.attack_log += text("\[[time_stamp()]\] Has been splashed with [name] by [user.name] ([user.ckey]). Reagents: [contained]") user.attack_log += text("\[[time_stamp()]\] Used the [name] to splash [target.name] ([target.key]). Reagents: [contained]") @@ -73,6 +75,11 @@ user.visible_message("[target] has been splashed with something by [user]!", "You splash the solution onto [target].") reagents.splash(target, reagents.total_volume) + + if (istype(target, /mob/living/silicon/robot)) + var/mob/living/silicon/robot/R = target + R.spark_system.start() + return 1 /obj/item/weapon/reagent_containers/proc/self_feed_message(var/mob/user) @@ -95,9 +102,13 @@ user << "\The [src] is empty." return 1 + var/types = target.find_type() + var/mob/living/carbon/human/H + if(istype(target, /mob/living/carbon/human)) + H = target + if(target == user) - if(istype(user, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = user + if (H) if(H.species.flags & IS_SYNTHETIC) H << "You have a monitor for a head, where do you think you're going to put that?" return 1 @@ -111,13 +122,15 @@ reagents.trans_to_mob(user, amount_per_transfer_from_this, CHEM_INGEST) feed_sound(user) return 1 - else - if(istype(target, /mob/living/carbon/human)) - var/mob/living/carbon/human/H = target - if(H.species.flags & IS_SYNTHETIC) - H << "They have a monitor for a head, where do you think you're going to put that?" - return + else if (types & TYPE_SYNTHETIC) + if(H && (H.species.flags & IS_SYNTHETIC)) + H << "They have a monitor for a head, where do you think you're going to put that?" + return 1 + standard_splash_mob(user, target) + return 0 + else + if (H) var/obj/item/blocked = H.check_mouth_coverage() if(blocked) user << "\The [blocked] is in the way!" @@ -153,4 +166,4 @@ var/trans = reagents.trans_to(target, amount_per_transfer_from_this) user << "You transfer [trans] units of the solution to [target]." - return 1 + return 1 diff --git a/code/modules/reagents/reagent_containers/food/drinks.dm b/code/modules/reagents/reagent_containers/food/drinks.dm index f70e06f421a..e4223197268 100644 --- a/code/modules/reagents/reagent_containers/food/drinks.dm +++ b/code/modules/reagents/reagent_containers/food/drinks.dm @@ -16,11 +16,11 @@ attack_self(mob/user as mob) return - attack(mob/M as mob, mob/user as mob, def_zone) - if(standard_feed_mob(user, M)) - return + attack(mob/M as mob, mob/user as mob, def_zone) + if (user.a_intent == I_HURT) + return standard_splash_mob(user, M) + return standard_feed_mob(user, M) - return 0 afterattack(obj/target, mob/user, proximity) if(!proximity) return