mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 13:38:41 +01:00
Spooky Scary Supreme Surgery (Rework) (#93697)
This commit is contained in:
@@ -99,6 +99,8 @@
|
||||
var/skin = "generic"
|
||||
/// How much healing do we do at a time?
|
||||
var/heal_amount = 2.5
|
||||
/// How much healing multiplier do we have from upgrades?
|
||||
VAR_FINAL/heal_multiplier = 1.0
|
||||
/// Start healing when they have this much damage in a category
|
||||
var/heal_threshold = 10
|
||||
/// What damage type does this bot support. Because the default is brute, if the medkit is brute-oriented there is a slight bonus to healing. set to "all" for it to heal any of the 4 base damage types
|
||||
@@ -163,6 +165,13 @@
|
||||
if(!CONFIG_GET(flag/no_default_techweb_link) && !linked_techweb)
|
||||
CONNECT_TO_RND_SERVER_ROUNDSTART(linked_techweb, src)
|
||||
|
||||
if(linked_techweb)
|
||||
RegisterSignal(linked_techweb, COMSIG_TECHWEB_ADD_DESIGN, PROC_REF(on_techweb_research))
|
||||
RegisterSignal(linked_techweb, COMSIG_TECHWEB_REMOVE_DESIGN, PROC_REF(on_techweb_unresearch))
|
||||
|
||||
for(var/datum/design/medibot_upgrade/design in linked_techweb.get_researched_design_datums())
|
||||
heal_multiplier += design.additive_multiplier
|
||||
|
||||
/mob/living/basic/bot/medbot/on_craft_completion(list/components, datum/crafting_recipe/current_recipe, atom/crafter)
|
||||
. = ..()
|
||||
var/obj/item/storage/medkit/medkit = locate() in contents
|
||||
@@ -214,7 +223,6 @@
|
||||
data["custom_controls"]["speaker"] = medical_mode_flags & MEDBOT_SPEAK_MODE
|
||||
data["custom_controls"]["crit_alerts"] = medical_mode_flags & MEDBOT_DECLARE_CRIT
|
||||
data["custom_controls"]["stationary_mode"] = medical_mode_flags & MEDBOT_STATIONARY_MODE
|
||||
data["custom_controls"]["sync_tech"] = TRUE
|
||||
return data
|
||||
|
||||
// Actions received from TGUI
|
||||
@@ -237,21 +245,6 @@
|
||||
medical_mode_flags ^= MEDBOT_DECLARE_CRIT
|
||||
if("stationary_mode")
|
||||
medical_mode_flags ^= MEDBOT_STATIONARY_MODE
|
||||
if("sync_tech")
|
||||
if(!linked_techweb)
|
||||
to_chat(user, span_notice("No research techweb connected."))
|
||||
return
|
||||
var/oldheal_amount = heal_amount
|
||||
var/tech_boosters
|
||||
for(var/index in linked_techweb.researched_designs)
|
||||
var/datum/design/surgery/healing/design = SSresearch.techweb_design_by_id(index)
|
||||
if(!istype(design))
|
||||
continue
|
||||
tech_boosters++
|
||||
if(tech_boosters)
|
||||
heal_amount = (round(tech_boosters * 0.5, 0.1) * initial(heal_amount)) + initial(heal_amount) //every 2 tend wounds tech gives you an extra 100% healing, adjusting for unique branches (combo is bonus)
|
||||
if(oldheal_amount < heal_amount)
|
||||
speak("New knowledge found! Surgical efficacy improved to [round(heal_amount/initial(heal_amount)*100)]%!")
|
||||
|
||||
update_appearance()
|
||||
|
||||
@@ -341,7 +334,7 @@
|
||||
if(!do_after(src, delay = 2 SECONDS, target = patient, interaction_key = TEND_DAMAGE_INTERACTION))
|
||||
update_bot_mode(new_mode = BOT_IDLE)
|
||||
return
|
||||
var/modified_heal_amount = heal_amount
|
||||
var/modified_heal_amount = heal_amount * heal_multiplier
|
||||
var/done_healing = FALSE
|
||||
if(damage_type_healer == BRUTE && medkit_type == /obj/item/storage/medkit/brute)
|
||||
modified_heal_amount *= 1.1
|
||||
@@ -370,6 +363,24 @@
|
||||
if(patient.IsReachableBy(src))
|
||||
melee_attack(patient)
|
||||
|
||||
/mob/living/basic/bot/medbot/proc/on_techweb_research(datum/source, datum/design/medibot_upgrade/design)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!istype(design))
|
||||
return
|
||||
|
||||
heal_multiplier += design.additive_multiplier
|
||||
INVOKE_ASYNC(src, PROC_REF(speak), "New knowledge found! Surgical efficacy improved to [round(heal_multiplier * 100)]%!")
|
||||
|
||||
/mob/living/basic/bot/medbot/proc/on_techweb_unresearch(datum/source, datum/design/medibot_upgrade/design)
|
||||
SIGNAL_HANDLER
|
||||
|
||||
if(!istype(design))
|
||||
return
|
||||
|
||||
heal_multiplier -= design.additive_multiplier
|
||||
INVOKE_ASYNC(src, PROC_REF(speak), "Error! Surgical efficacy decreased to [round(heal_multiplier * 100)]%!")
|
||||
|
||||
/datum/id_trim/medibot
|
||||
assignment = JOB_MEDIBOT
|
||||
trim_state = "trim_paramedic"
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
|
||||
var/obj/item/bodypart/new_bodypart = new part_type()
|
||||
forceMove(new_bodypart)
|
||||
new_bodypart.replace_limb(target, TRUE)
|
||||
new_bodypart.replace_limb(target)
|
||||
register_to_limb(new_bodypart)
|
||||
|
||||
/mob/living/basic/living_limb_flesh/proc/owner_shocked(datum/source, shock_damage, shock_source, siemens_coeff, flags)
|
||||
|
||||
Reference in New Issue
Block a user