From 558bbddfb056710f502d8a145d256458639c4194 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Wed, 6 Dec 2023 05:14:38 +0100 Subject: [PATCH] [MIRROR] Fix medibots [MDB IGNORE] (#25454) * Fix medibots * Conflict! --------- Co-authored-by: Verm <32827189+Vermidia@users.noreply.github.com> Co-authored-by: SomeRandomOwl --- code/game/objects/items/storage/medkit.dm | 4 +- .../mob/living/basic/bots/medbot/medbot.dm | 48 +++++++++++++++++-- .../modules/mob/living/silicon/robot/emote.dm | 2 +- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/code/game/objects/items/storage/medkit.dm b/code/game/objects/items/storage/medkit.dm index 4b08d1551a3..23d7f2a9284 100644 --- a/code/game/objects/items/storage/medkit.dm +++ b/code/game/objects/items/storage/medkit.dm @@ -259,7 +259,7 @@ icon_state = "medkit_advanced" inhand_icon_state = "medkit-rad" custom_premium_price = PAYCHECK_COMMAND * 6 - damagetype_healed = "all" + damagetype_healed = HEAL_ALL_DAMAGE /obj/item/storage/medkit/advanced/PopulateContents() if(empty) @@ -276,7 +276,7 @@ desc = "I hope you've got insurance." icon_state = "medkit_tactical" inhand_icon_state = "medkit-tactical" - damagetype_healed = "all" + damagetype_healed = HEAL_ALL_DAMAGE /obj/item/storage/medkit/tactical/Initialize(mapload) . = ..() diff --git a/code/modules/mob/living/basic/bots/medbot/medbot.dm b/code/modules/mob/living/basic/bots/medbot/medbot.dm index fd3b522ab23..f6c03058b16 100644 --- a/code/modules/mob/living/basic/bots/medbot/medbot.dm +++ b/code/modules/mob/living/basic/bots/medbot/medbot.dm @@ -10,6 +10,7 @@ anchored = FALSE health = 20 maxHealth = 20 + speed = 2 pass_flags = PASSMOB | PASSFLAPS status_flags = (CANPUSH | CANSTUN) ai_controller = /datum/ai_controller/basic_controller/bot/medbot @@ -138,7 +139,6 @@ AddElement(/datum/element/hat_wearer, offsets = hat_offsets) RegisterSignal(src, COMSIG_HOSTILE_PRE_ATTACKINGTARGET, PROC_REF(pre_attack)) - if(!HAS_TRAIT(SSstation, STATION_TRAIT_MEDBOT_MANIA) || !mapload || !is_station_level(z)) return skin = "advanced" @@ -246,6 +246,18 @@ playsound(src, SFX_SPARKS, 75, TRUE, SHORT_RANGE_SOUND_EXTRARANGE) return TRUE +/mob/living/basic/bot/medbot/examine() + . = ..() + if(!(medical_mode_flags & MEDBOT_TIPPED_MODE)) + return + var/static/list/panic_state = list( + "It appears to be tipped over, and is quietly waiting for someone to set it right.", + "It is tipped over and requesting help.", + "They are tipped over and appear visibly distressed.", + span_warning("They are tipped over and visibly panicking!"), + span_warning(span_bold("They are freaking out from being tipped over!")) + ) + . += pick(panic_state) /* * Proc used in a callback for before this medibot is tipped by the tippable component. * @@ -263,6 +275,8 @@ medical_mode_flags |= MEDBOT_TIPPED_MODE tipper = WEAKREF(user) playsound(src, 'sound/machines/warning-buzzer.ogg', 50) + if(prob(10)) + speak("PSYCH ALERT: Crewmember [user.name] recorded displaying antisocial tendencies torturing bots in [get_area(src)]. Please schedule psych evaluation.", radio_channel) /* * Proc used in a callback for after this medibot is righted, either by themselves or by a mob, by the tippable component. @@ -300,17 +314,43 @@ if(DOING_INTERACTION(src, TEND_DAMAGE_INTERACTION)) return + if(!isnull(client)) + if((damage_type_healer == HEAL_ALL_DAMAGE && patient.get_total_damage() <= heal_threshold) || (!(damage_type_healer == HEAL_ALL_DAMAGE) && patient.get_current_damage_of_type(damage_type_healer) <= heal_threshold)) + to_chat(src, "[patient] is healthy! Your programming prevents you from tending the wounds of anyone with less than [heal_threshold + 1] [damage_type_healer == HEAL_ALL_DAMAGE ? "total" : damage_type_healer] damage.") + return + update_bot_mode(new_mode = BOT_HEALING, update_hud = FALSE) + patient.visible_message("[src] is trying to tend the wounds of [patient]", span_userdanger("[src] is trying to tend your wounds!")) if(!do_after(src, delay = 2.5 SECONDS, target = patient, interaction_key = TEND_DAMAGE_INTERACTION)) //SKYRAT EDIT CHANGE : Increased time as tradeoff for automated healing. ORIGINAL: if(!do_after(src, delay = 0.5 SECONDS, target = patient, interaction_key = TEND_DAMAGE_INTERACTION)) update_bot_mode(new_mode = BOT_IDLE) return + var/modified_heal_amount = heal_amount + var/done_healing = FALSE + if(damage_type_healer == BRUTE && medkit_type == /obj/item/storage/medkit/brute) + modified_heal_amount *= 1.1 if(bot_access_flags & BOT_COVER_EMAGGED) patient.reagents?.add_reagent(/datum/reagent/toxin/chloralhydrate, 5) + log_combat(src, patient, "pretended to tend wounds on", "internal tools") else if(damage_type_healer == HEAL_ALL_DAMAGE) - patient.heal_overall_damage(heal_amount) + patient.heal_ordered_damage(amount = modified_heal_amount, damage_types = list(BRUTE, BURN, TOX, OXY)) + log_combat(src, patient, "tended the wounds of", "internal tools") + if(patient.get_total_damage() <= heal_threshold) + done_healing = TRUE else - patient.heal_damage_type(heal_amount = heal_amount, damagetype = damage_type_healer) - update_bot_mode(new_mode = BOT_IDLE) + patient.heal_damage_type(heal_amount = modified_heal_amount, damagetype = damage_type_healer) + log_combat(src, patient, "tended the wounds of", "internal tools") + if(patient.get_current_damage_of_type(damage_type_healer) <= heal_threshold) + done_healing = TRUE + patient.visible_message(span_notice("[src] tends the wounds of [patient]!"), "[span_infoplain(span_green("[src] tends your wounds!"))]") + //Go into idle only when we're done + if(done_healing) + visible_message(span_infoplain("[src] places its tools back into itself.")) + to_chat(src, "[patient] is now healthy!") + update_bot_mode(new_mode = BOT_IDLE) + //If player-controlled, call them to heal again here for continous player healing + else if(!isnull(client)) + melee_attack(patient) + /mob/living/basic/bot/medbot/autopatrol bot_mode_flags = BOT_MODE_ON | BOT_MODE_AUTOPATROL | BOT_MODE_REMOTE_ENABLED | BOT_MODE_CAN_BE_SAPIENT | BOT_MODE_ROUNDSTART_POSSESSION diff --git a/code/modules/mob/living/silicon/robot/emote.dm b/code/modules/mob/living/silicon/robot/emote.dm index 5c67310a6b9..41855a0db87 100644 --- a/code/modules/mob/living/silicon/robot/emote.dm +++ b/code/modules/mob/living/silicon/robot/emote.dm @@ -1,6 +1,6 @@ /* SKYRAT EDIT REMOVAL /datum/emote/silicon - mob_type_allowed_typecache = list(/mob/living/silicon, /mob/living/simple_animal/bot) + mob_type_allowed_typecache = list(/mob/living/silicon, /mob/living/simple_animal/bot, /mob/living/basic/bot) emote_type = EMOTE_AUDIBLE /datum/emote/silicon/boop