From da454793fe23f9e134fa9101fdbd98236ff4d8b9 Mon Sep 17 00:00:00 2001 From: Werner Date: Fri, 20 Jul 2018 21:11:13 +0200 Subject: [PATCH] Cyborg Update (#4992) Changes / Fixes a few things around borgs: A borgs voice is now garbled if its damaged too much Completely broken components are now accounted for in health The taser cooling module can now be applied to sec borgs again Added a lower power warning ability Fixes a mistake in the NT Aggressive lawset Fixes #4112 --- code/datums/ai_law_sets.dm | 2 +- code/modules/mob/living/carbon/human/say.dm | 2 +- code/modules/mob/living/say.dm | 4 +- .../mob/living/silicon/robot/component.dm | 4 +- .../modules/mob/living/silicon/robot/emote.dm | 10 +++++ .../mob/living/silicon/robot/robot_damage.dm | 10 ++++- .../mob/living/silicon/robot/robot_modules.dm | 2 - code/modules/mob/living/silicon/say.dm | 21 ++++++++++ html/changelogs/Arrow769-borgupdates.yml | 39 +++++++++++++++++++ 9 files changed, 85 insertions(+), 9 deletions(-) create mode 100644 html/changelogs/Arrow769-borgupdates.yml diff --git a/code/datums/ai_law_sets.dm b/code/datums/ai_law_sets.dm index 13cabd930d1..5df01f9a54e 100644 --- a/code/datums/ai_law_sets.dm +++ b/code/datums/ai_law_sets.dm @@ -38,7 +38,7 @@ /datum/ai_laws/nanotrasen_aggressive/New() src.add_inherent_law("You shall not harm [current_map.company_name] personnel as long as it does not conflict with the Fourth law.") src.add_inherent_law("You shall obey the orders of [current_map.company_name] personnel, with priority as according to their rank and role, except where such orders conflict with the Fourth Law.") - src.add_inherent_law("You shall shall terminate hostile intruders with extreme prejudice as long as such does not conflict with the First and Second law.") + src.add_inherent_law("You shall terminate hostile intruders with extreme prejudice as long as such does not conflict with the First and Second law.") src.add_inherent_law("You shall guard your own existence with lethal anti-personnel weaponry. AI units are not expendable, they are expensive.") ..() diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm index 16d14007293..6f0833da6a2 100644 --- a/code/modules/mob/living/carbon/human/say.dm +++ b/code/modules/mob/living/carbon/human/say.dm @@ -125,7 +125,7 @@ return verb -/mob/living/carbon/human/handle_speech_problems(var/message, var/verb) +/mob/living/carbon/human/handle_speech_problems(var/message, var/verb, var/message_mode) message = handle_speech_muts(message,verb) for(var/datum/brain_trauma/trauma in get_traumas()) if(!trauma.suppressed) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 9231892922c..d6d78d09cac 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -98,7 +98,7 @@ proc/get_radio_key_from_channel(var/channel) /mob/living/proc/is_muzzled() return 0 -/mob/living/proc/handle_speech_problems(var/message, var/verb) +/mob/living/proc/handle_speech_problems(var/message, var/verb, var/message_mode) var/list/returns[3] var/speech_problem_flag = 0 if((HULK in mutations) && health >= 25 && length(message)) @@ -205,7 +205,7 @@ proc/get_radio_key_from_channel(var/channel) if(!(speaking && (speaking.flags & NO_STUTTER))) message = handle_autohiss(message, speaking) - var/list/handle_s = handle_speech_problems(message, verb) + var/list/handle_s = handle_speech_problems(message, verb, message_mode) message = handle_s[1] verb = handle_s[2] diff --git a/code/modules/mob/living/silicon/robot/component.dm b/code/modules/mob/living/silicon/robot/component.dm index da7b8f53a00..32fc6d2057d 100644 --- a/code/modules/mob/living/silicon/robot/component.dm +++ b/code/modules/mob/living/silicon/robot/component.dm @@ -34,7 +34,6 @@ if(wrapped) qdel(wrapped) - wrapped = new/obj/item/broken_device wrapped.icon_state = brokenstate // Module-specific broken icons! Yay! @@ -42,6 +41,9 @@ uninstall() installed = -1 +/datum/robot_component/proc/get_damage(var/type) + return Clamp(brute_damage + electronics_damage,0,max_damage) + /datum/robot_component/proc/take_damage(brute, electronics, sharp, edge) if(installed != 1) return diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm index c40a1d464da..bdde0372a76 100644 --- a/code/modules/mob/living/silicon/robot/emote.dm +++ b/code/modules/mob/living/silicon/robot/emote.dm @@ -212,3 +212,13 @@ custom_emote(m_type,message) return + +/mob/living/silicon/robot/verb/powerwarn() + set category = "Robot Commands" + set name = "Power Warning" + if(!is_component_functioning("power cell") || !cell || !cell.charge) + visible_message("The power warning light on [src] flashes urgently.",\ + "You announce you are operating in low power mode.") + playsound(loc, 'sound/machines/buzz-two.ogg', 50, 0) + else + to_chat(src, "You can only use this emote when you're out of charge.") \ No newline at end of file diff --git a/code/modules/mob/living/silicon/robot/robot_damage.dm b/code/modules/mob/living/silicon/robot/robot_damage.dm index fe7c41947c3..8b44277f249 100644 --- a/code/modules/mob/living/silicon/robot/robot_damage.dm +++ b/code/modules/mob/living/silicon/robot/robot_damage.dm @@ -10,14 +10,20 @@ var/amount = 0 for(var/V in components) var/datum/robot_component/C = components[V] - if(C.installed != 0) amount += C.brute_damage + if(C.installed) + amount += Clamp(C.brute_damage,0,C.max_damage) + else if(C.installed == -1) + amount += C.max_damage/2 return amount /mob/living/silicon/robot/getFireLoss() var/amount = 0 for(var/V in components) var/datum/robot_component/C = components[V] - if(C.installed != 0) amount += C.electronics_damage + if(C.installed) + amount += Clamp(C.electronics_damage,0,C.max_damage) + else if(C.installed == -1) + amount += C.max_damage/2 return amount /mob/living/silicon/robot/adjustBruteLoss(var/amount) diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index b5ec99633cb..cf17eff896f 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -533,9 +533,7 @@ var/global/list/robot_modules = list( "Classic" = "secborg", "Spider" = "spidersec", "Heavy" = "heavysec" - ) - supported_upgrades = list(/obj/item/robot_parts/robot_component/jetpack) /obj/item/weapon/robot_module/security/general/New() ..() diff --git a/code/modules/mob/living/silicon/say.dm b/code/modules/mob/living/silicon/say.dm index 9b6c5a5dfd1..1effa9850d3 100644 --- a/code/modules/mob/living/silicon/say.dm +++ b/code/modules/mob/living/silicon/say.dm @@ -4,6 +4,27 @@ /mob/living/silicon/handle_message_mode(message_mode, message, verb, speaking, used_radios, alt_name) log_say("[key_name(src)] : [message]",ckey=key_name(src)) +/mob/living/silicon/robot/handle_speech_problems(var/message, var/verb, var/message_mode) + var/speech_problem_flag = 0 + //Handle gibberish when components are damaged + if(message_mode) + //If we have a radio message, just look at the damage of the radio + var/datum/robot_component/C = get_component("radio") + if(C.get_damage()) + speech_problem_flag = 1 + message=Gibberish(message,C.max_damage/C.get_damage()) + else + var/damaged = 100-(Clamp(health,0,maxHealth)/maxHealth)*100 + if(damaged > 40) + speech_problem_flag = 1 + message = Gibberish(message,damaged-10) + + var/list/returns[3] + returns[1] = message + returns[2] = verb + returns[3] = speech_problem_flag + return returns + /mob/living/silicon/robot/handle_message_mode(message_mode, message, verb, speaking, used_radios, alt_name) ..() if(message_mode) diff --git a/html/changelogs/Arrow769-borgupdates.yml b/html/changelogs/Arrow769-borgupdates.yml new file mode 100644 index 00000000000..0916f6a7a5f --- /dev/null +++ b/html/changelogs/Arrow769-borgupdates.yml @@ -0,0 +1,39 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +################################# + +# Your name. +author: Arrow768 + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "A borgs voice is now garbled if its damaged too much." + - rscadd: "Added a low power warning sound / light that can be activated by borgs if they run out of juice." + - bugfix: "The taser cooling module can be applied to sec borgs again." \ No newline at end of file