From c4fa8133311c2ed4fbf11e249f73d21143895e47 Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 30 Sep 2015 10:50:10 -0700 Subject: [PATCH 1/4] Remove remaining arbitrary restrictions on has_fine_manip This commit removes all (most) of the remaining code limiting xenomorphs that have has_fine_manipulation on an entirely arbitrary basis. Xenomorphs with has_fine_manipulation may now interact with NanoUI, and will only break computers on non-help intent. The can also tear down walls, since walls used an ishuman check in place of an isAdvancedToolUser check as they should have. Minor refactor to machinery.dm as well; Instead of the slightly (completely) insane attack_hand restriction to humans and silicons (it was a multi-line IF, why), it now checks user.IsAdvancedToolUser(); This means restrictions on monkies will actually function properly now. --- code/game/machinery/computer/computer.dm | 11 +++++++--- code/game/machinery/machinery.dm | 7 ++++--- code/game/objects/items/devices/flashlight.dm | 4 ++-- code/game/objects/items/devices/scanners.dm | 4 ++-- code/game/objects/items/stacks/medical.dm | 2 +- code/game/objects/items/toys.dm | 4 ++-- code/game/turfs/simulated/walls.dm | 2 +- code/game/turfs/simulated/walls_reinforced.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 4 +--- code/modules/mob/living/silicon/silicon.dm | 20 ++++++++----------- code/modules/nano/interaction/default.dm | 7 +++++++ 11 files changed, 37 insertions(+), 30 deletions(-) diff --git a/code/game/machinery/computer/computer.dm b/code/game/machinery/computer/computer.dm index 6081882582f..220e27e0be8 100644 --- a/code/game/machinery/computer/computer.dm +++ b/code/game/machinery/computer/computer.dm @@ -18,8 +18,8 @@ /obj/machinery/computer/New() overlay_layer = layer - ..() - + ..() + /obj/machinery/computer/initialize() power_change() update_icon() @@ -79,7 +79,7 @@ overlays += image(icon,"[icon_state]_broken",overlay_layer) else overlays += image(icon,icon_screen,overlay_layer) - + if(icon_keyboard) overlays += image(icon, icon_keyboard ,overlay_layer) @@ -134,6 +134,11 @@ return /obj/machinery/computer/attack_alien(mob/living/user) + if(isalien(user) && user.a_intent == I_HELP) + var/mob/living/carbon/alien/humanoid/xeno = user + if(xeno.has_fine_manipulation) + return attack_hand(user) + user.changeNext_move(CLICK_CD_MELEE) user.do_attack_animation(src) if(circuit) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 0d046868bb8..5d90d407c69 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -341,10 +341,11 @@ Class Procs: return 1 if(user.lying || user.stat) return 1 - if ( ! (istype(usr, /mob/living/carbon/human) || \ - istype(usr, /mob/living/silicon))) - usr << "\red You don't have the dexterity to do this!" + + if(!user.IsAdvancedToolUser()) + user << "\red You don't have the dexterity to do this!" return 1 + /* //distance checks are made by atom/proc/DblClick if ((get_dist(src, user) > 1 || !istype(src.loc, /turf)) && !istype(user, /mob/living/silicon)) diff --git a/code/game/objects/items/devices/flashlight.dm b/code/game/objects/items/devices/flashlight.dm index 4e1a5843f60..ef8cba90463 100644 --- a/code/game/objects/items/devices/flashlight.dm +++ b/code/game/objects/items/devices/flashlight.dm @@ -183,7 +183,7 @@ obj/item/device/flashlight/lamp/bananalamp update_brightness(U) else update_brightness(null) - + /obj/item/device/flashlight/flare/update_brightness(var/mob/user = null) ..() if(on) @@ -207,7 +207,7 @@ obj/item/device/flashlight/lamp/bananalamp src.force = on_damage src.damtype = "fire" processing_objects += src - + /obj/item/device/flashlight/flare/torch name = "torch" desc = "A torch fashioned from some leaves and a log." diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 976fed562c0..89d235999c6 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -384,7 +384,7 @@ REAGENT SCANNER if (crit_fail) user << "\red This device has critically failed and is no longer functional!" return - if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") + if (!user.IsAdvancedToolUser()) user << "\red You don't have the dexterity to do this!" return if(reagents.total_volume) @@ -441,7 +441,7 @@ REAGENT SCANNER /obj/item/device/reagent_scanner/afterattack(obj/O, mob/user as mob) if (user.stat) return - if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") + if (!user.IsAdvancedToolUser()) user << "\red You don't have the dexterity to do this!" return if(!istype(O)) diff --git a/code/game/objects/items/stacks/medical.dm b/code/game/objects/items/stacks/medical.dm index 4f83c7bd2ac..62214dd86c2 100644 --- a/code/game/objects/items/stacks/medical.dm +++ b/code/game/objects/items/stacks/medical.dm @@ -15,7 +15,7 @@ user << "\The [src] cannot be applied to [M]!" return 1 - if (!(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon))) + if (!user.IsAdvancedToolUser()) user << "You don't have the dexterity to do this!" return 1 diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index 29aeace7ea7..ffae91a70ce 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -169,8 +169,8 @@ afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag) if (flag) return - if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") - usr << "\red You don't have the dexterity to do this!" + if (!user.IsAdvancedToolUser()) + user << "\red You don't have the dexterity to do this!" return src.add_fingerprint(user) if (src.bullets < 1) diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 51c2a3d2b3a..82379c9defd 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -287,7 +287,7 @@ /turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob, params) user.changeNext_move(CLICK_CD_MELEE) - if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") + if (!user.IsAdvancedToolUser()) user << "You don't have the dexterity to do this!" return diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm index 04ef0fdf73f..09656143c3c 100644 --- a/code/game/turfs/simulated/walls_reinforced.dm +++ b/code/game/turfs/simulated/walls_reinforced.dm @@ -36,7 +36,7 @@ /turf/simulated/wall/r_wall/attackby(obj/item/W as obj, mob/user as mob, params) user.changeNext_move(CLICK_CD_MELEE) - if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey") + if (!user.IsAdvancedToolUser()) user << "You don't have the dexterity to do this!" return diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 1b1964a000f..0194aeea7f3 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1758,11 +1758,9 @@ return (health <= config.health_threshold_crit && stat == UNCONSCIOUS) -/mob/living/carbon/human/IsAdvancedToolUser(var/silent) +/mob/living/carbon/human/IsAdvancedToolUser() if(species.has_fine_manipulation) return 1 - if(!silent) - src << "You don't have the dexterity to use that!" return 0 /mob/living/carbon/human/get_permeability_protection() diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index ad3146b2527..c78721f8357 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -18,23 +18,23 @@ var/speak_exclamation = "declares" var/speak_query = "queries" var/pose //Yes, now AIs can pose too. - + var/sensor_mode = 0 //Determines the current HUD. - + var/next_alarm_notice var/list/datum/alarm/queued_alarms = new() - + #define SEC_HUD 1 //Security HUD mode #define MED_HUD 2 //Medical HUD mode var/local_transmit //If set, can only speak to others of the same type within a short range. var/obj/item/device/radio/common_radio - + /mob/living/silicon/New() silicon_mob_list |= src ..() add_language("Galactic Common") init_subsystems() - + /mob/living/silicon/Destroy() silicon_mob_list -= src for(var/datum/alarm_handler/AH in alarm_handlers) @@ -43,8 +43,8 @@ /mob/living/silicon/proc/SetName(pickedName as text) real_name = pickedName - name = real_name - + name = real_name + /mob/living/silicon/proc/show_laws() return @@ -267,9 +267,6 @@ sensor_mode = 0 src << "Sensor augmentations disabled." -/mob/living/silicon/IsAdvancedToolUser() - return 1 - /mob/living/silicon/proc/receive_alarm(var/datum/alarm_handler/alarm_handler, var/datum/alarm/alarm, was_raised) if(!next_alarm_notice) next_alarm_notice = world.time + SecondsToTicks(10) @@ -310,7 +307,7 @@ reported = 1 src << "--- [AH.category] Cleared ---" src << "\The [A.alarm_name()]." - + if(alarm_raised) src << "\[Show Alerts\]" @@ -326,4 +323,3 @@ for(var/obj/machinery/camera/C in A.cameras()) cameratext += "[(cameratext == "")? "" : "|"][C.c_tag]" src << "[A.alarm_name()]! ([(cameratext)? cameratext : "No Camera"])" - \ No newline at end of file diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm index deaae348d30..9b5b2e5da91 100644 --- a/code/modules/nano/interaction/default.dm +++ b/code/modules/nano/interaction/default.dm @@ -102,3 +102,10 @@ . = min(., shared_living_nano_distance(src_object)) if(. == STATUS_UPDATE && (TK in mutations)) // If we have telekinesis and remain close enough, allow interaction. return STATUS_INTERACTIVE + +/mob/living/carbon/alien/default_can_use_topic(var/src_object) + . = shared_nano_interaction(src_object) + if(. != STATUS_CLOSE) + . = min(., shared_living_nano_distance(src_object)) + if(!IsAdvancedToolUser()) + . = STATUS_UPDATE \ No newline at end of file From e39c69a8a61ce254a9666d1e008b111305477588 Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 30 Sep 2015 11:12:16 -0700 Subject: [PATCH 2/4] Change paper to work based on say_understands; This means that if you have galactic common in your languages, or understand/speak all languages, you can also read paper. --- code/modules/paperwork/paper.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/paperwork/paper.dm b/code/modules/paperwork/paper.dm index 41ceb1f5464..a453b76a123 100644 --- a/code/modules/paperwork/paper.dm +++ b/code/modules/paperwork/paper.dm @@ -65,7 +65,7 @@ send_asset_list(user.client, S.assets) var/data - if((!(istype(usr, /mob/living/carbon/human) || istype(usr, /mob/dead/observer) || istype(usr, /mob/living/silicon)) && !forceshow) || forcestars) + if(!(user.say_understands(null, all_languages["Galactic Common"]) && !forceshow) || forcestars) //assuming all paper is written in common is better than hardcoded type checks data = "[name][stars(info)][stamps]" if(view) usr << browse(data, "window=[name]") From d0af69afd5c85584f13bfa958be80b5b780203dc Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 30 Sep 2015 13:45:54 -0700 Subject: [PATCH 3/4] Spanssss --- code/game/machinery/machinery.dm | 6 +++--- code/game/objects/items/devices/scanners.dm | 18 +++++++++--------- code/game/objects/items/toys.dm | 7 +++---- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm index 5d90d407c69..ab437a4a1e9 100644 --- a/code/game/machinery/machinery.dm +++ b/code/game/machinery/machinery.dm @@ -343,7 +343,7 @@ Class Procs: return 1 if(!user.IsAdvancedToolUser()) - user << "\red You don't have the dexterity to do this!" + user << "You don't have the dexterity to do this!" return 1 /* @@ -354,10 +354,10 @@ Class Procs: if (ishuman(user)) var/mob/living/carbon/human/H = user if(H.getBrainLoss() >= 60) - visible_message("\red [H] stares cluelessly at [src] and drools.") + visible_message("[H] stares cluelessly at [src] and drools.") return 1 else if(prob(H.getBrainLoss())) - user << "\red You momentarily forget how to use [src]." + user << "You momentarily forget how to use [src]." return 1 src.add_fingerprint(user) diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm index 89d235999c6..74a612762e7 100644 --- a/code/game/objects/items/devices/scanners.dm +++ b/code/game/objects/items/devices/scanners.dm @@ -382,17 +382,17 @@ REAGENT SCANNER if (user.stat) return if (crit_fail) - user << "\red This device has critically failed and is no longer functional!" + user << "This device has critically failed and is no longer functional!" return if (!user.IsAdvancedToolUser()) - user << "\red You don't have the dexterity to do this!" + user << "You don't have the dexterity to do this!" return if(reagents.total_volume) var/list/blood_traces = list() for(var/datum/reagent/R in reagents.reagent_list) if(R.id != "blood") reagents.clear_reagents() - user << "\red The sample was contaminated! Please insert another sample" + user << "The sample was contaminated! Please insert another sample." return else blood_traces = params2list(R.data["trace_chem"]) @@ -442,12 +442,12 @@ REAGENT SCANNER if (user.stat) return if (!user.IsAdvancedToolUser()) - user << "\red You don't have the dexterity to do this!" + user << "You don't have the dexterity to do this!" return if(!istype(O)) return if (crit_fail) - user << "\red This device has critically failed and is no longer functional!" + user << "This device has critically failed and is no longer functional!" return if(!isnull(O.reagents)) @@ -456,7 +456,7 @@ REAGENT SCANNER var/one_percent = O.reagents.total_volume / 100 for (var/datum/reagent/R in O.reagents.reagent_list) if(prob(reliability)) - dat += "\n \t \blue [R][details ? ": [R.volume / one_percent]%" : ""]" + dat += "
[TAB][R][details ? ": [R.volume / one_percent]%" : ""]" recent_fail = 0 else if(recent_fail) crit_fail = 1 @@ -465,11 +465,11 @@ REAGENT SCANNER else recent_fail = 1 if(dat) - user << "\blue Chemicals found: [dat]" + user << "Chemicals found: [dat]" else - user << "\blue No active chemical agents found in [O]." + user << "No active chemical agents found in [O]." else - user << "\blue No significant chemical agents found in [O]." + user << "No significant chemical agents found in [O]." return diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index ffae91a70ce..f52de29785b 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -170,17 +170,16 @@ if (flag) return if (!user.IsAdvancedToolUser()) - user << "\red You don't have the dexterity to do this!" + user << "You don't have the dexterity to do this!" return src.add_fingerprint(user) if (src.bullets < 1) - user.show_message("\red *click* *click*", 2) + user.show_message("*click* *click*", 2) playsound(user, 'sound/weapons/empty.ogg', 100, 1) return playsound(user, 'sound/weapons/Gunshot.ogg', 100, 1) src.bullets-- - for(var/mob/O in viewers(user, null)) - O.show_message(text("\red [] fires a cap gun at []!", user, target), 1, "\red You hear a gunshot", 2) + user.visible_message("[user] fires a cap gun at [target]!", null, "You hear a gunshot.") /obj/item/toy/ammo/gun name = "ammo-caps" From 413f35298e529042260295891a421dd72005432b Mon Sep 17 00:00:00 2001 From: Tigercat2000 Date: Wed, 30 Sep 2015 16:44:25 -0700 Subject: [PATCH 4/4] okay mark --- code/modules/nano/interaction/default.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/nano/interaction/default.dm b/code/modules/nano/interaction/default.dm index 9b5b2e5da91..ae999cbcf03 100644 --- a/code/modules/nano/interaction/default.dm +++ b/code/modules/nano/interaction/default.dm @@ -108,4 +108,4 @@ if(. != STATUS_CLOSE) . = min(., shared_living_nano_distance(src_object)) if(!IsAdvancedToolUser()) - . = STATUS_UPDATE \ No newline at end of file + . = STATUS_CLOSE \ No newline at end of file