IPC overhaul part deux

This commit is contained in:
Markolie
2015-08-16 02:34:52 +02:00
parent e6408b96c2
commit 4a14a97b3b
31 changed files with 274 additions and 202 deletions
@@ -26,17 +26,45 @@
tod = 0
timeofdeath = 0
/mob/living/carbon/human/adjustBrainLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
if(species && species.has_organ["brain"])
var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"]
if(sponge)
sponge.take_damage(amount)
sponge.damage = min(max(sponge.damage, 0),(maxHealth*2))
brainloss = sponge.damage
else
brainloss = 200
else
brainloss = 0
/mob/living/carbon/human/setBrainLoss(var/amount)
if(status_flags & GODMODE) return 0 //godmode
if(species && species.has_organ["brain"])
var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"]
if(sponge)
sponge.damage = min(max(amount, 0),(maxHealth*2))
brainloss = sponge.damage
else
brainloss = 200
else
brainloss = 0
/mob/living/carbon/human/getBrainLoss()
var/res = brainloss
var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"]
if(!sponge)
return
if (sponge.is_bruised())
res += 20
if (sponge.is_broken())
res += 50
res = min(res,maxHealth*2)
return res
if(status_flags & GODMODE) return 0 //godmode
if(species && species.has_organ["brain"])
var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"]
if(sponge)
brainloss = min(sponge.damage,maxHealth*2)
else
brainloss = 200
else
brainloss = 0
return brainloss
//These procs fetch a cumulative total damage from all organs
/mob/living/carbon/human/getBruteLoss()
@@ -37,9 +37,6 @@ emp_act
return 2
var/obj/item/organ/external/organ = get_organ(check_zone(def_zone))
world << organ
world << def_zone
world << check_zone(def_zone)
if(isnull(organ))
return
@@ -72,11 +72,9 @@
for(var/limb_tag in list("l_leg","r_leg","l_foot","r_foot"))
var/obj/item/organ/external/E = organs_by_name[limb_tag]
if(!E)
stance_damage += 2
else if (E.status & ORGAN_DESTROYED)
stance_damage += 2 // let it fail even if just foot&leg
else if (E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)) || !E.is_usable())
if(!E || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD)) || E.is_malfunctioning())
stance_damage += 2 // let it fail even if just foot&leg. Also malfunctioning happens sporadically so it should impact more when it procs
else if (E.is_broken() || !E.is_usable())
stance_damage += 1
// Canes and crutches help you stand (if the latter is ever added)
@@ -56,7 +56,7 @@
/mob/living/carbon/human/proc/has_organ(name)
var/obj/item/organ/external/O = organs_by_name[name]
return (O && !(O.status & ORGAN_DESTROYED) )
return (O && !(O.status & ORGAN_DESTROYED) && !O.is_stump())
/mob/living/carbon/human/proc/has_organ_for_slot(slot)
switch(slot)
+2 -2
View File
@@ -968,11 +968,11 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
if(species.vision_organ)
vision = internal_organs_by_name[species.vision_organ]
if(!vision) // Presumably if a species has no vision organs, they see via some other means.
if(!species.vision_organ) // Presumably if a species has no vision organs, they see via some other means.
eye_blind = 0
blinded = 0
eye_blurry = 0
else if(vision.is_broken()) // Vision organs cut out or broken? Permablind.
else if(!vision || vision.is_broken()) // Vision organs cut out or broken? Permablind.
eye_blind = 1
blinded = 1
eye_blurry = 1
@@ -452,8 +452,8 @@
unarmed_type = /datum/unarmed_attack/punch
eyes = "blank_eyes"
brute_mod = 2.5
burn_mod = 2.5
brute_mod = 1.5
burn_mod = 1.5
cold_level_1 = 50
cold_level_2 = -1
@@ -495,18 +495,7 @@
)
/datum/species/machine/handle_death(var/mob/living/carbon/human/H)
H.emote("deathgasp")
/*H.h_style = ""
H.h_style = ""
spawn(100)
if(H) H.update_hair()*/
for(var/organ_name in H.organs_by_name)
if (organ_name == "head") // do the head last as that's when the user will be transfered to the posibrain
continue
var/obj/item/organ/external/O = H.organs_by_name[organ_name]
if(O && (O.body_part != UPPER_TORSO) && (O.body_part != LOWER_TORSO)) // We're making them fall apart, not gibbing them!
O.droplimb(1)
var/obj/item/organ/external/O = H.organs_by_name["head"]
if(O)
O.droplimb(1)
if(H) H.update_hair()
@@ -239,7 +239,7 @@
if(!(E.status & ORGAN_ROBOT))
continue
organ_found = 1
user << "[E.name]: <font color='red'>[E.brute_dam]</font> <font color='#FFA500'>[E.burn_dam]</font>"
user << "[E.name]: <font color='red'>[round(E.brute_dam)]</font> <font color='#FFA500'>[round(E.burn_dam)]</font>"
if(!organ_found)
user << "<span class='warning'>No prosthetics located.</span>"
user << "<hr>"
@@ -250,7 +250,7 @@
if(!(O.status & ORGAN_ROBOT))
continue
organ_found = 1
user << "[O.name]: <font color='red'>[O.damage]</font>"
user << "[capitalize(O.name)]: <font color='red'>[O.damage]</font>"
if(!organ_found)
user << "<span class='warning'>No prosthetics located.</span>"
+11 -10
View File
@@ -580,34 +580,35 @@ var/list/robot_verbs_default = list(
return
if (istype(W, /obj/item/weapon/weldingtool))
if(W == module_active) return
if (istype(W, /obj/item/weapon/weldingtool) && user.a_intent == "help")
if(W == module_active)
return
if (!getBruteLoss())
user << "Nothing to fix here!"
user << "<span class='notice'>Nothing to fix!</span>"
return
var/obj/item/weapon/weldingtool/WT = W
user.changeNext_move(CLICK_CD_MELEE)
if (WT.remove_fuel(0))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
adjustBruteLoss(-30)
updatehealth()
add_fingerprint(user)
for(var/mob/O in viewers(user, null))
O.show_message(text("\red [user] has fixed some of the dents on [src]!"), 1)
user.visible_message("<span class='alert'>\The [user] patches some dents on \the [src] with \the [WT].</span>")
else
user << "Need more welding fuel!"
user << "<span class='warning'>Need more welding fuel!</span>"
return
else if(istype(W, /obj/item/stack/cable_coil) && (wiresexposed || istype(src,/mob/living/silicon/robot/drone)))
else if(istype(W, /obj/item/stack/cable_coil) && user.a_intent == "help" && (wiresexposed || istype(src,/mob/living/silicon/robot/drone)))
if (!getFireLoss())
user << "Nothing to fix here!"
user << "<span class='notice'>Nothing to fix!</span>"
return
var/obj/item/stack/cable_coil/coil = W
adjustFireLoss(-30)
updatehealth()
add_fingerprint(user)
coil.use(1)
for(var/mob/O in viewers(user, null))
O.show_message(text("\red [user] has fixed some of the burnt wires on [src]!"), 1)
user.visible_message("<span class='alert'>\The [user] fixes some of the burnt wires on \the [src] with \the [coil].</span>")
else if (istype(W, /obj/item/weapon/crowbar)) // crowbar means open or close the cover
if(opened)
@@ -96,7 +96,7 @@
if(prob(5))
host.adjustBrainLoss(rand(1,2))
if(prob(host.brainloss/20))
if(prob(host.getBrainLoss()/20))
host.say("*[pick(list("blink","blink_r","choke","aflap","drool","twitch","twitch_s","gasp"))]")
/mob/living/simple_animal/borer/New(var/by_gamemode=0)
@@ -188,7 +188,7 @@
src << "You begin delicately adjusting your connection to the host brain..."
spawn(300+(host.brainloss*5))
spawn(300+(host.getBrainLoss()*5))
if(!host || !src || controlling)
return
+14 -2
View File
@@ -58,6 +58,7 @@ var/list/organ_cache = list()
if(status & ORGAN_ROBOT)
return
damage = max_damage
status |= ORGAN_DEAD
processing_objects -= src
if(dead_icon)
icon_state = dead_icon
@@ -80,17 +81,23 @@ var/list/organ_cache = list()
if ((status & ORGAN_ROBOT) || (owner && owner.species && (owner.species.flags & IS_PLANT)))
germ_level = 0
return
if(!owner)
if(reagents)
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in reagents.reagent_list
if(B && prob(40))
reagents.remove_reagent("blood",0.1)
blood_splatter(src,B,1)
if(prob(5)) //How about we not have organs become completely useless less than a minute after removal?
damage += 1
germ_level += rand(2,6)
if(germ_level >= INFECTION_LEVEL_TWO)
germ_level += rand(2,6)
if(germ_level >= INFECTION_LEVEL_THREE)
die()
if(damage >= max_damage)
die()
else if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
//** Handle antibiotics and curing infections
handle_antibiotics()
@@ -99,6 +106,11 @@ var/list/organ_cache = list()
//check if we've hit max_damage
if(damage >= max_damage)
die()
/obj/item/organ/examine(mob/user)
..(user)
if(status & ORGAN_DEAD)
user << "<span class='notice'>The decay has set in.</span>"
/obj/item/organ/proc/handle_germ_effects()
//** Handle the effects of infections
+19 -23
View File
@@ -106,6 +106,7 @@
/obj/item/organ/external/replaced(var/mob/living/carbon/human/target)
owner = target
status = status & ~ORGAN_DESTROYED
if(istype(owner))
owner.organs_by_name[limb_name] = src
owner.organs |= src
@@ -123,8 +124,8 @@
/obj/item/organ/external/robotize()
..()
//robot limbs take reduced damage
brute_mod = 0.8
burn_mod = 0.8
brute_mod = 0.66
burn_mod = 0.66
/****************************************************
DAMAGE PROCS
@@ -302,12 +303,12 @@ This function completely restores a damaged organ to perfect condition.
W.open_wound(damage)
if(prob(25))
if(status & ORGAN_ROBOT)
owner.visible_message("\red The damage to [owner.name]'s [name] worsens.",\
"\red The damage to your [name] worsens.",\
owner.visible_message("<span class='alert'>The damage to [owner.name]'s [name] worsens.</span>",\
"<span class='alert'>The damage to your [name] worsens.</span>",\
"You hear the screech of abused metal.")
else
owner.visible_message("\red The wound on [owner.name]'s [name] widens with a nasty ripping noise.",\
"\red The wound on your [name] widens with a nasty ripping noise.",\
owner.visible_message("<span class='alert'>The wound on [owner.name]'s [name] widens with a nasty ripping noise.</span>",\
"<span class='alert'>The wound on your [name] widens with a nasty ripping noise.</span>",\
"You hear a nasty ripping noise, as if flesh is being torn apart.")
return
@@ -348,11 +349,6 @@ This function completely restores a damaged organ to perfect condition.
/obj/item/organ/external/process()
if(owner)
//Dismemberment
if(status & ORGAN_DESTROYED)
if(config.limbs_can_break)
droplimb(0,DROPLIMB_EDGE) //Might be worth removing this check since take_damage handles it.
return
if(parent)
if(parent.status & ORGAN_DESTROYED)
status |= ORGAN_DESTROYED
@@ -718,13 +714,13 @@ Note that amputating the affected organ does in fact remove the infection from t
if((status & ORGAN_BROKEN) || cannot_break)
return
owner.visible_message(\
"\red You hear a loud cracking sound coming from \the [owner].",\
"\red <b>Something feels like it shattered in your [name]!</b>",\
"You hear a sickening crack.")
if(owner.species && !(owner.species.flags & NO_PAIN))
owner.emote("scream")
if(owner)
owner.visible_message(\
"\red You hear a loud cracking sound coming from \the [owner].",\
"\red <b>Something feels like it shattered in your [name]!</b>",\
"You hear a sickening crack.")
if(owner.species && !(owner.species.flags & NO_PAIN))
owner.emote("scream")
status |= ORGAN_BROKEN
broken_description = pick("broken","fracture","hairline fracture")
@@ -762,11 +758,11 @@ Note that amputating the affected organ does in fact remove the infection from t
/obj/item/organ/external/proc/mutate()
src.status |= ORGAN_MUTATED
owner.update_body()
if(owner) owner.update_body()
/obj/item/organ/external/proc/unmutate()
src.status &= ~ORGAN_MUTATED
owner.update_body()
if(owner) owner.update_body()
/obj/item/organ/external/proc/get_damage() //returns total damage
return max(brute_dam + burn_dam - perma_injury, perma_injury) //could use health?
@@ -786,7 +782,7 @@ Note that amputating the affected organ does in fact remove the infection from t
return ((status & ORGAN_ROBOT) && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam))
/obj/item/organ/external/proc/embed(var/obj/item/weapon/W, var/silent = 0)
if(loc != owner)
if(!owner || loc != owner)
return
if(!silent)
owner.visible_message("<span class='danger'>\The [W] sticks in the wound!</span>")
@@ -819,12 +815,12 @@ Note that amputating the affected organ does in fact remove the infection from t
for(var/obj/item/organ/external/O in children)
O.removed()
if(O)
O.loc = src
O.forceMove(src)
// Grab all the internal giblets too.
for(var/obj/item/organ/organ in internal_organs)
organ.removed()
organ.loc = src
organ.forceMove(src)
release_restraints(victim)
victim.organs -= src
+4 -2
View File
@@ -1,7 +1,6 @@
/obj/item/organ/external/stump
name = "limb stump"
icon_name = ""
cannot_amputate = 0 //You need to remove stumps to attach new limbs, but you can't remove stumps... What the fuck?
/obj/item/organ/external/stump/New(var/mob/living/carbon/holder, var/internal, var/obj/item/organ/external/limb)
if(istype(limb))
@@ -13,7 +12,7 @@
..(holder, internal)
if(istype(limb))
max_damage = limb.max_damage
if((limb.status & ORGAN_ROBOT) && (!parent || (parent.status & ORGAN_ROBOT)))
if((limb.status & ORGAN_ROBOT) && (!parent || (parent.status & ORGAN_ROBOT)))
robotize() //if both limb and the parent are robotic, the stump is robotic too
/obj/item/organ/external/stump/is_stump()
@@ -22,3 +21,6 @@
/obj/item/organ/external/stump/removed()
..()
qdel(src)
/obj/item/organ/external/stump/is_usable()
return 0
+1
View File
@@ -125,6 +125,7 @@
name = "head"
max_damage = 50
min_broken_damage = 25
vital = 1
w_class = 3
body_part = HEAD
parent_organ = "chest"
+2 -2
View File
@@ -70,12 +70,12 @@
..()
// This is very ghetto way of rebooting an IPC. TODO better way.
if(owner && owner.stat == DEAD)
owner.stat = 0
owner.stat = ALIVE
owner.visible_message("<span class='danger'>\The [owner] twitches visibly!</span>")
/obj/item/organ/optical_sensor
name = "optical sensor"
organ_tag = "eyes"
organ_tag = "optics"
parent_organ = "head"
icon = 'icons/obj/robot_component.dmi'
icon_state = "camera"
+7 -4
View File
@@ -499,9 +499,12 @@ obj/structure/cable/proc/cableColor(var/colorC)
//you can use wires to heal robotics
/obj/item/stack/cable_coil/attack(mob/M as mob, mob/user as mob)
if(istype(M,/mob/living/carbon/human))
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/S = H.get_organ(user.zone_sel.selecting)
var/obj/item/organ/external/S = H.organs_by_name[user.zone_sel.selecting]
if(!S)
return
if(!(S.status & ORGAN_ROBOT) || user.a_intent != "help")
return ..()
@@ -511,8 +514,8 @@ obj/structure/cable/proc/cableColor(var/colorC)
user.visible_message("<span class='alert'>\The [user] repairs some burn damage on \the [M]'s [S.name] with \the [src].</span>")
else
user << "<span class='warning'>The damage is far too severe to patch over externally.</span>"
return
else
return 1
else if(!S.open)
user << "<span class='notice'>Nothing to fix!</span>"
else
+5
View File
@@ -130,6 +130,11 @@
forcedodge = -1
else
*/
if(ishuman(A))
var/mob/living/carbon/human/H = A
var/obj/item/organ/external/organ = H.get_organ(check_zone(def_zone))
if(isnull(organ))
return
if(silenced)
playsound(loc, hitsound, 5, 1, -1)
M << "\red You've been shot in the [parse_zone(def_zone)] by the [src.name]!"
+1 -1
View File
@@ -125,7 +125,7 @@ datum/reagent/neurotoxin2/on_mob_life(var/mob/living/M as mob)
if(current_cycle >= 5)
if(prob(5))
M.emote("drool")
if(M.brainloss < 60)
if(M.getBrainLoss() < 60)
M.adjustBrainLoss(1*REM)
M.adjustToxLoss(1*REM)
if(current_cycle >= 9)
-33
View File
@@ -1,33 +0,0 @@
//This is an uguu head restoration surgery TOTALLY not yoinked from chinsky's limb reattacher
/datum/surgery_step/attach_head/
priority = 3 // Must be higher than /datum/surgery_step/internal
allowed_tools = list(/obj/item/organ/external/head = 100)
can_infect = 0
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/head = target.get_organ(target_zone)
return isnull(head) && target_zone == "head" && !isnull(target.species.has_limbs["head"])
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts attaching [tool] to [target]'s neck.", \
"You start attaching [tool] to [target]'s neck.")
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has attached [target]'s head to the body.", \
"\blue You have attached [target]'s head to the body.")
var/obj/item/organ/external/head = tool
user.unEquip(head)
head.replaced(target)
head.loc = target
head.status = 0
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, damaging [target]'s neck!", \
"\red Your hand slips, damaging [target]'s neck!")
target.apply_damage(10, BRUTE, null, sharp=1)
+1 -1
View File
@@ -150,7 +150,7 @@
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts poking around inside [target]'s [affected.name] with \the [tool].", \
"You start poking around inside [target]'s [affected.name] with \the [tool]" )
"You start poking around inside [target]'s [affected.name] with \the [tool]." )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
..()
+129
View File
@@ -0,0 +1,129 @@
//Procedures in this file: Robotic limbs attachment, meat limbs attachment
//////////////////////////////////////////////////////////////////
// LIMB SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/limb/
priority = 3 // Must be higher than /datum/surgery_step/internal
can_infect = 0
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected)
return 0
var/list/organ_data = target.species.has_limbs["[target_zone]"]
return !isnull(organ_data)
/datum/surgery_step/limb/attach
allowed_tools = list(/obj/item/organ/external = 100)
min_duration = 50
max_duration = 70
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message("[user] starts attaching [E.name] to [target]'s [E.amputation_point].", \
"You start attaching [E.name] to [target]'s [E.amputation_point].")
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message("<span class='notice'>[user] has attached [target]'s [E.name] to the [E.amputation_point].</span>", \
"<span class='notice'>You have attached [target]'s [E.name] to the [E.amputation_point].</span>")
user.unEquip(E)
E.replaced(target)
E.forceMove(target)
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message("<span class='alert'>[user]'s hand slips, damaging [target]'s [E.amputation_point]!</span>", \
"<span class='alert'>Your hand slips, damaging [target]'s [E.amputation_point]!</span>")
target.apply_damage(10, BRUTE, null, sharp=1)
/datum/surgery_step/limb/connect
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/stack/cable_coil = 75, \
/obj/item/device/assembly/mousetrap = 20
)
can_infect = 1
min_duration = 100
max_duration = 120
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = target.get_organ(target_zone)
return E && !E.is_stump() && (E.status & ORGAN_DESTROYED)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = target.get_organ(target_zone)
user.visible_message("[user] starts connecting tendons and muscles in [target]'s [E.amputation_point] with [tool].", \
"You start connecting tendons and muscle in [target]'s [E.amputation_point].")
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = target.get_organ(target_zone)
user.visible_message("<span class='notice'>[user] has connected tendons and muscles in [target]'s [E.amputation_point] with [tool].</span>", \
"<span class='notice'>You have connected tendons and muscles in [target]'s [E.amputation_point] with [tool].</span>")
E.status &= ~ORGAN_DESTROYED
if(E.children)
for(var/obj/item/organ/external/C in E.children)
C.status &= ~ORGAN_DESTROYED
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/E = tool
user.visible_message("<span class='alert'>[user]'s hand slips, damaging [target]'s [E.amputation_point]!</span>", \
"<span class='alert'>Your hand slips, damaging [target]'s [E.amputation_point]!</span>")
target.apply_damage(10, BRUTE, null, sharp=1)
/datum/surgery_step/limb/mechanize
allowed_tools = list(/obj/item/robot_parts = 100)
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/robot_parts/p = tool
if (p.part)
if (!(target_zone in p.part))
return 0
return isnull(target.get_organ(target_zone))
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts attaching \the [tool] to [target].", \
"You start attaching \the [tool] to [target].")
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/robot_parts/L = tool
user.visible_message("<span class='notice'>[user] has attached \the [tool] to [target].</span>", \
"<span class='notice'>You have attached \the [tool] to [target].</span>")
if(L.part)
for(var/part_name in L.part)
if(!isnull(target.get_organ(part_name)))
continue
var/list/organ_data = target.species.has_limbs["[part_name]"]
if(!organ_data)
continue
var/new_limb_type = organ_data["path"]
var/obj/item/organ/external/new_limb = new new_limb_type(target)
new_limb.robotize(L.model_info)
if(L.sabotaged)
new_limb.sabotaged = 1
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
qdel(tool)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("<span class='alert'>[user]'s hand slips, damaging [target]'s flesh!</span>", \
"<span class='alert'>Your hand slips, damaging [target]'s flesh!</span>")
target.apply_damage(10, BRUTE, null, sharp=1)
-60
View File
@@ -1,60 +0,0 @@
//Procedures in this file: Robotic limbs attachment
//////////////////////////////////////////////////////////////////
// LIMB SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/limb/
can_infect = 0
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected)
return 0
var/list/organ_data = target.species.has_limbs["[target_zone]"]
return !isnull(organ_data) && !(target_zone in list("head","groin","chest"))
/datum/surgery_step/limb/attach
allowed_tools = list(/obj/item/robot_parts = 100)
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/obj/item/robot_parts/p = tool
if (p.part)
if (!(target_zone in p.part))
return 0
return isnull(target.get_organ(target_zone))
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts attaching \the [tool] to [target].", \
"You start attaching \the [tool] to [target].")
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/robot_parts/L = tool
user.visible_message("\blue [user] has attached \the [tool] to [target].", \
"\blue You have attached \the [tool] to [target].")
if(L.part)
for(var/part_name in L.part)
if(!isnull(target.get_organ(part_name))) continue
var/list/organ_data = target.species.has_limbs["[part_name]"]
if(!organ_data) continue
var/new_limb_type = organ_data["path"]
var/obj/item/organ/external/new_limb = new new_limb_type(target)
new_limb.robotize(L.model_info)
if(L.sabotaged)
new_limb.sabotaged = 1
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
qdel(tool)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, damaging [target]'s flesh!", \
"\red Your hand slips, damaging [target]'s flesh!")
target.apply_damage(10, BRUTE, null, sharp=1)
+2 -2
View File
@@ -146,7 +146,7 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] finishes patching damage to [target]'s [affected.name] with \the [tool].", \
"\blue You finish patching damage to [target]'s [affected.name] with \the [tool].")
affected.heal_damage(rand(30,50),0)
affected.heal_damage(rand(30,50),0,1,1)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
@@ -177,7 +177,7 @@
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] finishes splicing cable into [target]'s [affected.name].", \
"\blue You finishes splicing new cable into [target]'s [affected.name].")
affected.heal_damage(0,rand(30,50))
affected.heal_damage(0,rand(30,50),1,1)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/external/affected = target.get_organ(target_zone)