make ipcs cool

This commit is contained in:
Timothy Teakettle
2020-06-04 14:59:52 +01:00
parent 5e37d3ef3b
commit f2aa370506
33 changed files with 521 additions and 43 deletions
+7 -4
View File
@@ -71,6 +71,8 @@
var/medium_burn_msg = "blistered"
var/heavy_burn_msg = "peeling away"
var/render_like_organic = FALSE // forces limb to render as if it were an organic limb
/obj/item/bodypart/examine(mob/user)
. = ..()
if(brute_dam > DAMAGE_PRECISION)
@@ -285,7 +287,7 @@
if(status == BODYPART_ORGANIC)
icon = base_bp_icon || DEFAULT_BODYPART_ICON_ORGANIC
else if(status == BODYPART_ROBOTIC)
icon = DEFAULT_BODYPART_ICON_ROBOTIC
icon = base_bp_icon || DEFAULT_BODYPART_ICON_ROBOTIC
if(owner)
owner.updatehealth()
@@ -399,8 +401,9 @@
if(status == BODYPART_ROBOTIC)
dmg_overlay_type = "robotic"
body_markings = null
aux_marking = null
if(!render_like_organic)
body_markings = null
aux_marking = null
if(dropping_limb)
no_update = TRUE //when attached, the limb won't be affected by the appearance changes of its mob owner.
@@ -466,7 +469,7 @@
if((body_zone != BODY_ZONE_HEAD && body_zone != BODY_ZONE_CHEST))
should_draw_gender = FALSE
if(is_organic_limb())
if(is_organic_limb() || render_like_organic)
limb.icon = base_bp_icon || 'icons/mob/human_parts.dmi'
if(should_draw_gender)
limb.icon_state = "[species_id]_[body_zone]_[icon_gender]"
+1 -1
View File
@@ -10,7 +10,7 @@
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_HEAD)
requires_bodypart_type = 0
requires_bodypart_type = BODYPART_ORGANIC
/datum/surgery_step/fix_brain
name = "fix brain"
implements = list(TOOL_HEMOSTAT = 85, TOOL_SCREWDRIVER = 35, /obj/item/pen = 15) //don't worry, pouring some alcohol on their open brain will get that chance to 100
+1
View File
@@ -3,6 +3,7 @@
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders,
/datum/surgery_step/incise_heart, /datum/surgery_step/coronary_bypass, /datum/surgery_step/close)
possible_locs = list(BODY_ZONE_CHEST)
requires_bodypart_type = BODYPART_ORGANIC
/datum/surgery/coronary_bypass/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
var/obj/item/organ/heart/H = target.getorganslot(ORGAN_SLOT_HEART)
+1
View File
@@ -2,6 +2,7 @@
name = "dental implant"
steps = list(/datum/surgery_step/drill, /datum/surgery_step/insert_pill)
possible_locs = list(BODY_ZONE_PRECISE_MOUTH)
requires_bodypart_type = BODYPART_ORGANIC
/datum/surgery_step/insert_pill
name = "insert pill"
+1 -1
View File
@@ -7,7 +7,7 @@
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_CHEST)
requires_bodypart_type = 0
requires_bodypart_type = BODYPART_ORGANIC
/datum/surgery_step/embalming
name = "embalming body"
@@ -3,6 +3,7 @@
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders,
/datum/surgery_step/incise_heart, /datum/surgery_step/ventricular_electrotherapy, /datum/surgery_step/close)
possible_locs = list(BODY_ZONE_CHEST)
requires_bodypart_type = BODYPART_ORGANIC
/datum/surgery_step/ventricular_electrotherapy
name = "ventricular electrotherapy"
+2 -1
View File
@@ -3,7 +3,8 @@
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/fix_eyes, /datum/surgery_step/close)
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_PRECISE_EYES)
requires_bodypart_type = 0
requires_bodypart_type = BODYPART_ORGANIC
//fix eyes
/datum/surgery_step/fix_eyes
name = "fix eyes"
+1 -1
View File
@@ -8,7 +8,7 @@
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_CHEST)
requires_bodypart_type = FALSE
requires_bodypart_type = BODYPART_ORGANIC
replaced_by = /datum/surgery
ignore_clothes = TRUE
var/healing_step_type
+3
View File
@@ -2,10 +2,13 @@
name = "Lipoplasty"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/clamp_bleeders, /datum/surgery_step/cut_fat, /datum/surgery_step/remove_fat, /datum/surgery_step/close)
possible_locs = list(BODY_ZONE_CHEST)
requires_bodypart_type = BODYPART_ORGANIC
/datum/surgery/lipoplasty/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
if(HAS_TRAIT(target, TRAIT_FAT))
return 1
return 0
//cut fat
/datum/surgery_step/cut_fat
name = "cut excess fat"
+1
View File
@@ -3,6 +3,7 @@
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/saw, /datum/surgery_step/clamp_bleeders,
/datum/surgery_step/lobectomy, /datum/surgery_step/close)
possible_locs = list(BODY_ZONE_CHEST)
requires_bodypart_type = BODYPART_ORGANIC
/datum/surgery/lobectomy/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
var/obj/item/organ/lungs/L = target.getorganslot(ORGAN_SLOT_LUNGS)
+104
View File
@@ -85,3 +85,107 @@
display_results(user, target, "<span class='notice'>You begin to open the hatch holders in [target]'s [parse_zone(target_zone)]...</span>",
"[user] begins to open the hatch holders in [target]'s [parse_zone(target_zone)].",
"[user] begins to open the hatch holders in [target]'s [parse_zone(target_zone)].")
//cut wires
/datum/surgery_step/cut_wires
name = "cut wires"
implements = list(
TOOL_WIRECUTTER = 100,
TOOL_SCALPEL = 75,
/obj/item/kitchen/knife = 50,
/obj/item = 10) // 10% success with any sharp item.
time = 24
/datum/surgery_step/cut_wires/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You begin to cut loose wires in [target]'s [parse_zone(target_zone)]...</span>",
"[user] begins to cut loose wires in [target]'s [parse_zone(target_zone)].",
"[user] begins to cut loose wires in [target]'s [parse_zone(target_zone)].")
/datum/surgery_step/cut_wires/tool_check(mob/user, obj/item/tool)
if(implement_type == /obj/item && !tool.get_sharpness())
return FALSE
return TRUE
//pry off plating
/datum/surgery_step/pry_off_plating
name = "pry off plating"
implements = list(
TOOL_CROWBAR = 100,
TOOL_HEMOSTAT = 10)
time = 24
/datum/surgery_step/pry_off_plating/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
do_sparks(rand(5, 9), FALSE, target.loc)
return TRUE
/datum/surgery_step/pry_off_plating/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You begin to pry off [target]'s [parse_zone(target_zone)] plating...</span>",
"[user] begins to pry off [target]'s [parse_zone(target_zone)] plating.",
"[user] begins to pry off [target]'s [parse_zone(target_zone)] plating.")
//weld plating
/datum/surgery_step/weld_plating
name = "weld plating"
implements = list(
TOOL_WELDER = 100)
time = 24
/datum/surgery_step/weld_plating/tool_check(mob/user, obj/item/tool)
if(implement_type == TOOL_WELDER && !tool.use_tool(user, user, 0, volume=50, amount=1))
return FALSE
return TRUE
/datum/surgery_step/weld_plating/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You begin to weld [target]'s [parse_zone(target_zone)] plating...</span>",
"[user] begins to weld [target]'s [parse_zone(target_zone)] plating.",
"[user] begins to weld [target]'s [parse_zone(target_zone)] plating.")
//replace wires
/datum/surgery_step/replace_wires
name = "replace wires"
implements = list(/obj/item/stack/cable_coil = 100)
time = 24
var/cableamount = 5
/datum/surgery_step/replace_wires/tool_check(mob/user, obj/item/tool)
var/obj/item/stack/cable_coil/coil = tool
if(coil.get_amount() < cableamount)
to_chat(user, "<span class='warning'>Not enough cable!</span>")
return FALSE
return TRUE
/datum/surgery_step/replace_wires/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/obj/item/stack/cable_coil/coil = tool
if(coil && !(coil.get_amount()<cableamount)) //failproof
coil.use(cableamount)
return TRUE
/datum/surgery_step/replace_wires/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You begin to replace [target]'s [parse_zone(target_zone)] wiring...</span>",
"[user] begins to replace [target]'s [parse_zone(target_zone)] wiring.",
"[user] begins to replace [target]'s [parse_zone(target_zone)] wiring.")
//add plating
/datum/surgery_step/add_plating
name = "add plating"
implements = list(/obj/item/stack/sheet/metal = 100)
time = 24
var/metalamount = 5
/datum/surgery_step/add_plating/tool_check(mob/user, obj/item/tool)
var/obj/item/stack/sheet/metal/plat = tool
if(plat.get_amount() < metalamount)
to_chat(user, "<span class='warning'>Not enough metal!</span>")
return FALSE
return TRUE
/datum/surgery_step/add_plating/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/obj/item/stack/sheet/metal/plat = tool
if(plat && !(plat.get_amount()<metalamount)) //failproof
plat.use(metalamount)
return TRUE
/datum/surgery_step/add_plating/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You begin to add plating to [target]'s [parse_zone(target_zone)]...</span>",
"[user] begins to add plating to [target]'s [parse_zone(target_zone)].",
"[user] begins to add plating to [target]'s [parse_zone(target_zone)].")
@@ -2,6 +2,7 @@
name = "organ manipulation"
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_CHEST, BODY_ZONE_HEAD)
requires_bodypart_type = BODYPART_ORGANIC
requires_real_bodypart = 1
steps = list(
/datum/surgery_step/incise,
@@ -288,3 +288,69 @@
var/obj/item/assembly/flash/armimplant/F = new(src)
items_list += F
F.I = src
/////////////////
//IPC/Synth Arm//
/////////////////
/obj/item/organ/cyberimp/arm/power_cord
name = "power cord implant"
desc = "An internal power cord hooked up to a battery. Useful if you run on volts."
contents = newlist(/obj/item/apc_powercord)
zone = "l_arm"
/obj/item/apc_powercord
name = "power cord"
desc = "An internal power cord hooked up to a battery. Useful if you run on electricity. Not so much otherwise."
icon = 'icons/obj/power.dmi'
icon_state = "wire1"
/obj/item/apc_powercord/afterattack(atom/target, mob/user, proximity_flag, click_parameters)
if(!istype(target, /obj/machinery/power/apc) || !ishuman(user) || !proximity_flag)
return ..()
user.changeNext_move(CLICK_CD_MELEE)
var/obj/machinery/power/apc/A = target
var/mob/living/carbon/human/H = user
var/obj/item/organ/stomach/ipc/cell = locate(/obj/item/organ/stomach/ipc) in H.internal_organs
if(!cell)
to_chat(H, "<span class='warning'>You try to siphon energy from the [A], but your power cell is gone!</span>")
return
if(A.cell && A.cell.charge > 0)
if(H.nutrition >= NUTRITION_LEVEL_WELL_FED)
to_chat(user, "<span class='warning'>You are already fully charged!</span>")
return
else
powerdraw_loop(A, H)
return
to_chat(user, "<span class='warning'>There is no charge to draw from that APC.</span>")
/obj/item/apc_powercord/proc/powerdraw_loop(obj/machinery/power/apc/A, mob/living/carbon/human/H)
H.visible_message("<span class='notice'>[H] inserts a power connector into the [A].</span>", "<span class='notice'>You begin to draw power from the [A].</span>")
while(do_after(H, 10, target = A))
if(loc != H)
to_chat(H, "<span class='warning'>You must keep your connector out while charging!</span>")
break
if(A.cell.charge == 0)
to_chat(H, "<span class='warning'>The [A] doesn't have enough charge to spare.</span>")
break
A.charging = 1
if(A.cell.charge >= 500)
do_sparks(1, FALSE, A)
H.nutrition += 50
A.cell.charge -= 150
to_chat(H, "<span class='notice'>You siphon off some of the stored charge for your own use.</span>")
else
H.nutrition += A.cell.charge/10
A.cell.charge = 0
to_chat(H, "<span class='notice'>You siphon off as much as the [A] can spare.</span>")
break
if(H.nutrition > NUTRITION_LEVEL_WELL_FED)
to_chat(H, "<span class='notice'>You are now fully charged.</span>")
break
H.visible_message("<span class='notice'>[H] unplugs from the [A].</span>", "<span class='notice'>You unplug from the [A].</span>")
+26
View File
@@ -132,3 +132,29 @@
if(. & EMP_PROTECT_SELF)
return
damage += 40/severity
/obj/item/organ/ears/ipc
name = "auditory sensors"
icon_state = "ears-c"
desc = "A pair of microphones intended to be installed in an IPC head, that grant the ability to hear."
zone = BODY_ZONE_HEAD
slot = ORGAN_SLOT_EARS
gender = PLURAL
organ_flags = ORGAN_SYNTHETIC
/obj/item/organ/ears/ipc/emp_act(severity)
. = ..()
if(!owner || . & EMP_PROTECT_SELF)
return
to_chat(owner, "<span class='warning'>Alert: Auditory systems corrupted!.</span>")
switch(severity)
if(1)
owner.Jitter(30)
owner.Dizzy(30)
owner.DefaultCombatKnockdown(80)
deaf = 30
if(2)
owner.Jitter(15)
owner.Dizzy(15)
owner.DefaultCombatKnockdown(40)
+9
View File
@@ -394,6 +394,15 @@
name = "ipc eyes"
icon_state = "cybernetic_eyeballs"
/obj/item/organ/eyes/ipc/emp_act(severity)
. = ..()
if(!owner || . & EMP_PROTECT_SELF)
return
to_chat(owner, "<span class='warning'>Alert: Perception visuals damaged!</span>")
owner.flash_act(visual = 1)
if(severity == EMP_HEAVY)
owner.adjustOrganLoss(ORGAN_SLOT_EYES, 20)
#undef BLURRY_VISION_ONE
#undef BLURRY_VISION_TWO
#undef BLIND_VISION_THREE
+12 -1
View File
@@ -464,9 +464,20 @@
return S
/obj/item/organ/lungs/ipc
name = "ipc lungs"
name = "ipc cooling system"
icon_state = "lungs-c"
/obj/item/organ/lungs/ipc/emp_act(severity) //Should probably put it somewhere else later
. = ..()
if(. & EMP_PROTECT_SELF)
return
to_chat(owner, "<span class='warning'>Alert: Critical cooling system failure!</span>")
switch(severity)
if(1)
owner.adjust_bodytemperature(100*TEMPERATURE_DAMAGE_COEFFICIENT)
if(2)
owner.adjust_bodytemperature(30*TEMPERATURE_DAMAGE_COEFFICIENT)
/obj/item/organ/lungs/plasmaman
name = "plasma filter"
desc = "A spongy rib-shaped mass for filtering plasma from the air."
+13 -1
View File
@@ -89,5 +89,17 @@
desc = "A strange crystal that is responsible for metabolizing the unseen energy force that feeds plasmamen."
/obj/item/organ/stomach/ipc
name = "ipc stomach"
name = "ipc cell"
icon_state = "stomach-ipc"
/obj/item/organ/stomach/ipc/emp_act(severity)
. = ..()
if(!owner || . & EMP_PROTECT_SELF)
return
switch(severity)
if(1)
owner.nutrition = min(owner.nutrition - 50, 0)
to_chat(owner, "<span class='warning'>Alert: Detected severe battery discharge!</span>")
if(2)
owner.nutrition = min(owner.nutrition - 100, 0)
to_chat(owner, "<span class='warning'>Alert: Minor battery discharge!</span>")
+2
View File
@@ -2,6 +2,8 @@
name = "Plastic surgery"
steps = list(/datum/surgery_step/incise, /datum/surgery_step/retract_skin, /datum/surgery_step/reshape_face, /datum/surgery_step/close)
possible_locs = list(BODY_ZONE_HEAD)
requires_bodypart_type = BODYPART_ORGANIC
//reshape_face
/datum/surgery_step/reshape_face
name = "reshape face"
@@ -0,0 +1,51 @@
/datum/surgery/robot_brain_surgery
name = "Reset posibrain logic (Brain surgery)"
steps = list(
/datum/surgery_step/mechanic_open,
/datum/surgery_step/mechanic_unwrench,
/datum/surgery_step/pry_off_plating,
/datum/surgery_step/prepare_electronics,
/datum/surgery_step/fix_robot_brain,
/datum/surgery_step/mechanic_close)
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_HEAD)
requires_bodypart_type = BODYPART_ROBOTIC
desc = "A surgical procedure that restores the default behavior logic and personality matrix of an IPC posibrain."
/datum/surgery_step/fix_robot_brain
name = "fix posibrain (multitool)"
implements = list(TOOL_MULTITOOL = 100, TOOL_HEMOSTAT = 35, TOOL_SCREWDRIVER = 15)
time = 120 //long and complicated
/datum/surgery/robot_brain_surgery/can_start(mob/user, mob/living/carbon/target, obj/item/tool)
var/obj/item/organ/brain/B = target.getorganslot(ORGAN_SLOT_BRAIN)
if(!B)
return FALSE
return TRUE
/datum/surgery_step/fix_robot_brain/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You begin to fix [target]'s posibrain...</span>",
"[user] begins to fix [target]'s posibrain.",
"[user] begins to perform surgery on [target]'s posibrain.")
/datum/surgery_step/fix_robot_brain/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='notice'>You succeed in fixing [target]'s posibrain.</span>",
"[user] successfully fixes [target]'s posibrain!",
"[user] completes the surgery on [target]'s posibrain.")
if(target.mind && target.mind.has_antag_datum(/datum/antagonist/brainwashed))
target.mind.remove_antag_datum(/datum/antagonist/brainwashed)
target.setOrganLoss(ORGAN_SLOT_BRAIN, target.getOrganLoss(ORGAN_SLOT_BRAIN) - 60) //we set damage in this case in order to clear the "failing" flag
target.cure_all_traumas(TRAUMA_RESILIENCE_LOBOTOMY) //Lobotomy tier fix cause you can't clone this!
return TRUE
/datum/surgery_step/fix_robot_brain/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
if(target.getorganslot(ORGAN_SLOT_BRAIN))
display_results(user, target, "<span class='warning'>You screw up, causing more damage!</span>",
"<span class='warning'>[user] screws up, causing damage to the circuits!</span>",
"[user] completes the surgery on [target]'s posibrain.")
target.adjustOrganLoss(ORGAN_SLOT_BRAIN, 60)
target.gain_trauma_type(BRAIN_TRAUMA_SEVERE, TRAUMA_RESILIENCE_LOBOTOMY)
else
user.visible_message("<span class='warning'>[user] suddenly notices that the posibrain [user.p_they()] [user.p_were()] working on is not there anymore.", "<span class='warning'>You suddenly notice that the posibrain you were working on is not there anymore.</span>")
return FALSE
+125
View File
@@ -0,0 +1,125 @@
//Almost copypaste of tend wounds, with some changes
/datum/surgery/robot_healing
name = "Repair robotic limbs (basic)"
desc = "A surgical procedure that provides repairs and maintenance to robotic limbs. Is slightly more efficient when the patient is severely damaged."
steps = list(/datum/surgery_step/mechanic_open,
/datum/surgery_step/pry_off_plating,
/datum/surgery_step/cut_wires,
/datum/surgery_step/robot_heal,
/datum/surgery_step/mechanic_close)
target_mobtypes = list(/mob/living/carbon/human, /mob/living/carbon/monkey)
possible_locs = list(BODY_ZONE_CHEST)
requires_bodypart_type = BODYPART_ROBOTIC
ignore_clothes = TRUE
var/antispam = FALSE
var/healing_step_type = /datum/surgery_step/robot_heal/basic
/datum/surgery/robot_healing/New(surgery_target, surgery_location, surgery_bodypart)
..()
if(healing_step_type)
steps = list(/datum/surgery_step/mechanic_open,
/datum/surgery_step/pry_off_plating,
/datum/surgery_step/cut_wires,
healing_step_type,
/datum/surgery_step/mechanic_close)
/datum/surgery_step/robot_heal
name = "repair body (welder/cable)"
implements = list(TOOL_WELDER = 100, /obj/item/stack/cable_coil = 100)
repeatable = TRUE
time = 15
var/healsbrute = FALSE
var/healsburn = FALSE
var/brutehealing = 0
var/burnhealing = 0
var/missinghpbonus = 0 //heals an extra point of damager per X missing damage of type (burn damage for burn healing, brute for brute). Smaller Number = More Healing!
/datum/surgery_step/robot_heal/tool_check(mob/user, obj/item/tool)
if(implement_type == TOOL_WELDER && !tool.tool_use_check(user, 1))
return FALSE
return TRUE
/datum/surgery_step/robot_heal/preop(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/woundtype
if(implement_type == TOOL_WELDER)
healsbrute = TRUE
healsburn = FALSE
woundtype = "dents"
else
healsbrute = FALSE
healsburn = TRUE
woundtype = "wiring"
if(istype(surgery,/datum/surgery/robot_healing))
var/datum/surgery/robot_healing/the_surgery = surgery
if(!the_surgery.antispam)
display_results(user, target, "<span class='notice'>You attempt to fix some of [target]'s [woundtype].</span>",
"<span class='notice'>[user] attempts to fix some of [target]'s [woundtype].</span>",
"<span class='notice'>[user] attempts to fix some of [target]'s [woundtype].</span>")
/datum/surgery_step/robot_heal/initiate(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery, try_to_fail = FALSE)
if(..())
while((healsbrute && target.getBruteLoss() && tool.tool_use_check(user,1)) || (healsburn && target.getFireLoss() && tool))
if(!..())
break
/datum/surgery_step/robot_heal/success(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
var/umsg = "You succeed in fixing some of [target]'s damage" //no period, add initial space to "addons"
var/tmsg = "[user] fixes some of [target]'s damage" //see above
var/urhealedamt_brute = 0
if(healsbrute)
urhealedamt_brute = brutehealing
tool.use_tool(target, user, 0, volume=50, amount=1)
var/urhealedamt_burn = 0
if(healsburn)
urhealedamt_burn = burnhealing
if(tool)
tool.use(1)
if(missinghpbonus)
if(target.stat != DEAD)
urhealedamt_brute += round((target.getBruteLoss()/ missinghpbonus),0.1)
urhealedamt_burn += round((target.getFireLoss()/ missinghpbonus),0.1)
else //less healing bonus for the dead since they're expected to have lots of damage to begin with (to make TW into defib not TOO simple)
urhealedamt_brute += round((target.getBruteLoss()/ (missinghpbonus*5)),0.1)
urhealedamt_burn += round((target.getFireLoss()/ (missinghpbonus*5)),0.1)
if(!get_location_accessible(target, target_zone))
urhealedamt_brute *= 0.55
urhealedamt_burn *= 0.55
umsg += " as best as you can while they have clothing on"
tmsg += " as best as they can while [target] has clothing on"
target.heal_bodypart_damage(urhealedamt_brute,urhealedamt_burn, only_organic = FALSE, only_robotic = TRUE)
display_results(user, target, "<span class='notice'>[umsg].</span>",
"[tmsg].",
"[tmsg].")
if(istype(surgery, /datum/surgery/robot_healing))
var/datum/surgery/robot_healing/the_surgery = surgery
the_surgery.antispam = TRUE
return TRUE
/datum/surgery_step/robot_heal/failure(mob/user, mob/living/carbon/target, target_zone, obj/item/tool, datum/surgery/surgery)
display_results(user, target, "<span class='warning'>You screwed up!</span>",
"<span class='warning'>[user] screws up!</span>",
"<span class='notice'>[user] fixes some of [target]'s damage.</span>", TRUE)
var/urdamageamt_brute = 0
if(healsbrute)
urdamageamt_brute = brutehealing * 0.8
var/urdamageamt_burn = 0
if(healsburn)
urdamageamt_burn = burnhealing * 0.8
if(missinghpbonus)
urdamageamt_brute += round((target.getBruteLoss()/ (missinghpbonus*2)),0.1)
urdamageamt_burn += round((target.getFireLoss()/ (missinghpbonus*2)),0.1)
target.take_bodypart_damage(urdamageamt_brute, urdamageamt_burn)
return FALSE
/***************************STEPS***************************/
/datum/surgery_step/robot_heal/basic
name = "repair damage"
brutehealing = 10
burnhealing = 10
missinghpbonus = 15