mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Ports Bay's Robolimb Changes (#1779)
* Consolidates copypasta for repairing robolimbs Also prevents self-repairing a limb you are using to hold the tool * Fixes robot organs becoming undamagable after reaching cap * Fixes repairing with cable not using any cable, repairing with weldingtool not doing eyecheck * Removes ORGAN_ROBOT and ORGAN_ASSISTED flags, fixes #13123 * Fixes damage to robotic limbs not triggering organ processing At the same time, robotic limbs with damage don't need to process. However, it's much safer to explicitly have robot limbs return 0 from needs_process() instead of not rechecking bad external organs. * Build on HarpyEagle changes to apply to Polaris Had to apply the change from flag to an enumeration. * Removes unneeded file * Fix bruisepacks, remove heart Well, the unused bay version of the heart anyway * Tweaks examine, reverts isSynthetic Reverted that because Bay doesn't use it the same way. Also changed Examine to not list every robo-limb on non-FBPs in red, but left them listed as normal per Spookerton
This commit is contained in:
@@ -35,11 +35,9 @@
|
||||
#define ORGAN_BLEEDING (1<<1)
|
||||
#define ORGAN_BROKEN (1<<2)
|
||||
#define ORGAN_DESTROYED (1<<3)
|
||||
#define ORGAN_ROBOT (1<<4)
|
||||
#define ORGAN_SPLINTED (1<<5)
|
||||
#define ORGAN_DEAD (1<<6)
|
||||
#define ORGAN_MUTATED (1<<7)
|
||||
#define ORGAN_ASSISTED (1<<8)
|
||||
#define ORGAN_SPLINTED (1<<4)
|
||||
#define ORGAN_DEAD (1<<5)
|
||||
#define ORGAN_MUTATED (1<<6)
|
||||
|
||||
#define DROPLIMB_EDGE 0
|
||||
#define DROPLIMB_BLUNT 1
|
||||
@@ -48,6 +46,9 @@
|
||||
// Damage above this value must be repaired with surgery.
|
||||
#define ROBOLIMB_SELF_REPAIR_CAP 30
|
||||
|
||||
#define ORGAN_ASSISTED 1
|
||||
#define ORGAN_ROBOT 2
|
||||
|
||||
//Germs and infections.
|
||||
#define GERM_LEVEL_AMBIENT 110 // Maximum germ level you can reach by standing still.
|
||||
#define GERM_LEVEL_MOVE_CAP 200 // Maximum germ level you can reach by running around.
|
||||
|
||||
@@ -46,7 +46,7 @@ var/datum/antagonist/borer/borers
|
||||
for(var/mob/living/carbon/human/H in mob_list)
|
||||
if(H.stat != DEAD && !H.has_brain_worms())
|
||||
var/obj/item/organ/external/head = H.get_organ(BP_HEAD)
|
||||
if(head && !(head.status & ORGAN_ROBOT))
|
||||
if(head && !(head.robotic >= ORGAN_ROBOT))
|
||||
host = H
|
||||
break
|
||||
if(istype(host))
|
||||
|
||||
@@ -433,8 +433,9 @@
|
||||
bled = "Bleeding:"
|
||||
if(e.status & ORGAN_BROKEN)
|
||||
AN = "[e.broken_description]:"
|
||||
if(e.status & ORGAN_ROBOT)
|
||||
robot = "Prosthetic:"
|
||||
switch(e.robotic)
|
||||
if(ORGAN_ROBOT) robot = "Prosthetic:"
|
||||
if(ORGAN_ASSISTED) robot = "Augmented:"
|
||||
if(e.open)
|
||||
open = "Open:"
|
||||
|
||||
@@ -478,7 +479,7 @@
|
||||
var/mech = ""
|
||||
if(i.status & ORGAN_ASSISTED)
|
||||
mech = "Assisted:"
|
||||
if(i.status & ORGAN_ROBOT)
|
||||
if(i.robotic >= ORGAN_ROBOT)
|
||||
mech = "Mechanical:"
|
||||
|
||||
var/infection = "None"
|
||||
|
||||
@@ -481,7 +481,7 @@ var/list/global/slot_flags_enumeration = list(
|
||||
eyes.damage += rand(3,4)
|
||||
if(eyes.damage >= eyes.min_bruised_damage)
|
||||
if(M.stat != 2)
|
||||
if(!(eyes.status & ORGAN_ROBOT)) //robot eyes bleeding might be a bit silly
|
||||
if(!(eyes.robotic >= ORGAN_ROBOT)) //robot eyes bleeding might be a bit silly
|
||||
M << "<span class='danger'>Your eyes start to bleed profusely!</span>"
|
||||
if(prob(50))
|
||||
if(M.stat != 2)
|
||||
|
||||
@@ -75,7 +75,7 @@ REAGENT SCANNER
|
||||
for(var/obj/item/organ/external/org in damaged)
|
||||
user.show_message(text("<span class='notice'> [][]: [][] - []</span>",
|
||||
capitalize(org.name),
|
||||
(org.status & ORGAN_ROBOT) ? "(Cybernetic)" : "",
|
||||
(org.robotic >= ORGAN_ROBOT) ? "(Cybernetic)" : "",
|
||||
(org.brute_dam > 0) ? "<span class='warning'>[org.brute_dam]</span>" : 0,
|
||||
(org.status & ORGAN_BLEEDING)?"<span class='danger'>\[Bleeding\]</span>":"",
|
||||
(org.burn_dam > 0) ? "<font color='#FFA500'>[org.burn_dam]</font>" : 0),1)
|
||||
|
||||
@@ -24,6 +24,10 @@
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/external/affecting = H.get_organ(user.zone_sel.selecting)
|
||||
|
||||
if(!affecting)
|
||||
user << "<span class='warning'>No body part there to work on!</span>"
|
||||
return 1
|
||||
|
||||
if(affecting.organ_tag == BP_HEAD)
|
||||
if(H.head && istype(H.head,/obj/item/clothing/head/helmet/space))
|
||||
user << "<span class='warning'>You can't apply [src] through [H.head]!</span>"
|
||||
@@ -33,7 +37,7 @@
|
||||
user << "<span class='warning'>You can't apply [src] through [H.wear_suit]!</span>"
|
||||
return 1
|
||||
|
||||
if(affecting.status & ORGAN_ROBOT)
|
||||
if(affecting.robotic >= ORGAN_ROBOT)
|
||||
user << "<span class='warning'>This isn't useful at all on a robotic limb..</span>"
|
||||
return 1
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
var/obj/item/organ/external/S = H.get_organ(user.zone_sel.selecting)
|
||||
|
||||
if(S.open == 1)
|
||||
if (S && (S.status & ORGAN_ROBOT))
|
||||
if (S && (S.robotic >= ORGAN_ROBOT))
|
||||
if(S.get_damage())
|
||||
S.heal_damage(15, 15, robo_repair = 1)
|
||||
H.updatehealth()
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
var/picked = pick(check)
|
||||
var/obj/item/organ/external/affecting = H.get_organ(picked)
|
||||
if(affecting)
|
||||
if(affecting.status & ORGAN_ROBOT)
|
||||
if(affecting.robotic >= ORGAN_ROBOT)
|
||||
return
|
||||
if(affecting.take_damage(5, 0))
|
||||
H.UpdateDamageIcon()
|
||||
|
||||
@@ -1,71 +0,0 @@
|
||||
/obj/item/robot_parts/attack(mob/living/carbon/human/M as mob, mob/living/carbon/user as mob)
|
||||
var/limbloc = null
|
||||
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
|
||||
if(!((locate(/obj/machinery/optable, M.loc) && M.resting) || (locate(/obj/structure/bed/roller, M.loc) && (M.buckled || M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat)) && prob(75) || (locate(/obj/structure/table/, M.loc) && (M.lying || M.weakened || M.stunned || M.paralysis || M.sleeping || M.stat) && prob(66))))
|
||||
return ..()
|
||||
|
||||
if(!istype(M, /mob/living/carbon/human))
|
||||
return ..()
|
||||
|
||||
if((user.zone_sel.selecting == "l_arm") && (istype(src, /obj/item/robot_parts/l_arm)))
|
||||
limbloc = "l_hand"
|
||||
else if((user.zone_sel.selecting == "r_arm") && (istype(src, /obj/item/robot_parts/r_arm)))
|
||||
limbloc = "r_hand"
|
||||
else if((user.zone_sel.selecting == "r_leg") && (istype(src, /obj/item/robot_parts/r_leg)))
|
||||
limbloc = "r_foot"
|
||||
else if((user.zone_sel.selecting == "l_leg") && (istype(src, /obj/item/robot_parts/l_leg)))
|
||||
limbloc = "l_foot"
|
||||
else
|
||||
user << "<span class='warning'>That doesn't fit there!</span>"
|
||||
return ..()
|
||||
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/datum/organ/external/S = H.organs[user.zone_sel.selecting]
|
||||
if(S.status & ORGAN_DESTROYED)
|
||||
if(!(S.status & ORGAN_ATTACHABLE))
|
||||
user << "<span class='warning'>The wound is not ready for a replacement!</span>"
|
||||
return 0
|
||||
if(M != user)
|
||||
M.visible_message( \
|
||||
"<span class='notice'>\The [user] is beginning to attach \the [src] where [H]'s [S.display_name] used to be.</span>", \
|
||||
"<span class='notice'>\The [user] begins to attach \the [src] where your [S.display_name] used to be.</span>")
|
||||
else
|
||||
M.visible_message( \
|
||||
"<span class='notice'>\The [user] begins to attach a robotic limb where \his [S.display_name] used to be with [src].</span>", \
|
||||
"<span class='notice'>You begin to attach \the [src] where your [S.display_name] used to be.</span>")
|
||||
|
||||
if(do_mob(user, H, 100))
|
||||
if(M != user)
|
||||
M.visible_message( \
|
||||
"<span class='notice'>\The [user] finishes attaching [H]'s new [S.display_name].</span>", \
|
||||
"<span class='notice'>\The [user] finishes attaching your new [S.display_name].</span>")
|
||||
else
|
||||
M.visible_message( \
|
||||
"<span class='notice'>\The [user] finishes attaching \his new [S.display_name].</span>", \
|
||||
"<span class='notice'>You finish attaching your new [S.display_name].</span>")
|
||||
|
||||
if(H == user && prob(25))
|
||||
user << "<span class='warning'>You mess up!</span>"
|
||||
S.take_damage(15)
|
||||
|
||||
S.status &= ~ORGAN_BROKEN
|
||||
S.status &= ~ORGAN_SPLINTED
|
||||
S.status &= ~ORGAN_ATTACHABLE
|
||||
S.status &= ~ORGAN_DESTROYED
|
||||
S.status |= ORGAN_ROBOT
|
||||
var/datum/organ/external/T = H.organs["[limbloc]"]
|
||||
T.status &= ~ORGAN_BROKEN
|
||||
T.status &= ~ORGAN_SPLINTED
|
||||
T.status &= ~ORGAN_ATTACHABLE
|
||||
T.status &= ~ORGAN_DESTROYED
|
||||
T.status |= ORGAN_ROBOT
|
||||
H.update_body()
|
||||
M.updatehealth()
|
||||
M.UpdateDamageIcon()
|
||||
qdel(src)
|
||||
|
||||
return 1
|
||||
return 0
|
||||
@@ -428,22 +428,18 @@
|
||||
var/mob/living/carbon/human/H = A
|
||||
var/obj/item/organ/external/S = H.organs_by_name[user.zone_sel.selecting]
|
||||
|
||||
if(!S || !(S.status & ORGAN_ROBOT))
|
||||
if(!S || S.robotic < ORGAN_ROBOT || S.open == 3)
|
||||
return ..()
|
||||
|
||||
if(S.brute_dam)
|
||||
if(S.brute_dam < ROBOLIMB_SELF_REPAIR_CAP)
|
||||
S.heal_damage(15,0,0,1)
|
||||
user.visible_message("<span class='notice'>\The [user] patches some dents on \the [H]'s [S.name] with \the [src].</span>")
|
||||
else if(S.open < 3)
|
||||
user << "<span class='danger'>The damage is far too severe to patch over externally.</span>"
|
||||
if(!welding)
|
||||
user << "<span class='warning'>You'll need to turn [src] on to patch the damage on [H]'s [S.name]!</span>"
|
||||
return 1
|
||||
|
||||
if(S.robo_repair(15, BRUTE, "some dents", src, user))
|
||||
remove_fuel(1, user)
|
||||
|
||||
else
|
||||
return ..()
|
||||
else
|
||||
user << "<span class='notice'>Nothing to fix!</span>"
|
||||
S.update_wounds()
|
||||
return
|
||||
return ..()
|
||||
|
||||
/*/obj/item/weapon/combitool
|
||||
name = "combi-tool"
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
return 0
|
||||
if(istype(user))
|
||||
var/obj/item/organ/external/E = user.organs_by_name[BP_HEAD]
|
||||
if(istype(E) && (E.status & ORGAN_ROBOT))
|
||||
if(istype(E) && (E.robotic >= ORGAN_ROBOT))
|
||||
return 1
|
||||
user << "<span class='warning'>You must have a robotic head to install this upgrade.</span>"
|
||||
return 0
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
var/sound_strength = "cannot hear"
|
||||
var/heartbeat = 0
|
||||
var/obj/item/organ/internal/heart/heart = M.internal_organs_by_name[O_HEART]
|
||||
if(heart && !(heart.status & ORGAN_ROBOT))
|
||||
if(heart && !(heart.robotic >= ORGAN_ROBOT))
|
||||
heartbeat = 1
|
||||
if(M.stat == DEAD || (M.status_flags&FAKEDEATH))
|
||||
sound_strength = "cannot hear"
|
||||
|
||||
@@ -276,12 +276,12 @@
|
||||
if(temp.status & ORGAN_DESTROYED)
|
||||
wound_flavor_text["[temp.name]"] = "<span class='warning'><b>[T.He] [T.is] missing [T.his] [temp.name].</b></span>\n"
|
||||
continue
|
||||
if(!is_synth && temp.status & ORGAN_ROBOT)
|
||||
if(!is_synth && temp.robotic >= ORGAN_ROBOT)
|
||||
if(!(temp.brute_dam + temp.burn_dam))
|
||||
wound_flavor_text["[temp.name]"] = "<span class='warning'>[T.He] [T.has] a [temp.name]!</span>\n"
|
||||
continue
|
||||
wound_flavor_text["[temp.name]"] = "[T.He] [T.has] a [temp.name].\n"
|
||||
else
|
||||
wound_flavor_text["[temp.name]"] = "<span class='warning'>[T.He] [T.has] a [temp.name]. It has[temp.get_wounds_desc()]!</span>\n"
|
||||
wound_flavor_text["[temp.name]"] = "<span class='warning'>[T.He] [T.has] a [temp.name]. It has [temp.get_wounds_desc()]!</span>\n"
|
||||
continue
|
||||
else if(temp.wounds.len > 0 || temp.open)
|
||||
if(temp.is_stump() && temp.parent_organ && organs_by_name[temp.parent_organ])
|
||||
var/obj/item/organ/external/parent = organs_by_name[temp.parent_organ]
|
||||
|
||||
@@ -1030,7 +1030,7 @@
|
||||
src << msg
|
||||
|
||||
organ.take_damage(rand(1,3), 0, 0)
|
||||
if(!(organ.status & ORGAN_ROBOT) && !should_have_organ(O_HEART)) //There is no blood in protheses.
|
||||
if(!(organ.robotic >= ORGAN_ROBOT) && !(should_have_organ(O_HEART))) //There is no blood in protheses.
|
||||
organ.status |= ORGAN_BLEEDING
|
||||
src.adjustToxLoss(rand(1,3))
|
||||
|
||||
@@ -1216,7 +1216,7 @@
|
||||
if(!affecting)
|
||||
. = 0
|
||||
fail_msg = "They are missing that limb."
|
||||
else if (affecting.status & ORGAN_ROBOT)
|
||||
else if (affecting.robotic >= ORGAN_ROBOT)
|
||||
. = 0
|
||||
fail_msg = "That limb is robotic."
|
||||
else
|
||||
@@ -1444,7 +1444,7 @@
|
||||
else if(organ_check in list(O_LIVER, O_KIDNEYS))
|
||||
affecting = organs_by_name[BP_GROIN]
|
||||
|
||||
if(affecting && (affecting.status & ORGAN_ROBOT))
|
||||
if(affecting && (affecting.robotic >= ORGAN_ROBOT))
|
||||
return 0
|
||||
return (species && species.has_organ[organ_check])
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
var/total_burn = 0
|
||||
var/total_brute = 0
|
||||
for(var/obj/item/organ/external/O in organs) //hardcoded to streamline things a bit
|
||||
if((O.status & ORGAN_ROBOT) && !O.vital)
|
||||
continue // Non-vital robot limbs don't count towards shock and crit
|
||||
if((O.robotic >= ORGAN_ROBOT) && !O.vital)
|
||||
continue //*non-vital* robot limbs don't count towards shock and crit
|
||||
total_brute += O.brute_dam
|
||||
total_burn += O.burn_dam
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
/mob/living/carbon/human/getBruteLoss()
|
||||
var/amount = 0
|
||||
for(var/obj/item/organ/external/O in organs)
|
||||
if((O.status & ORGAN_ROBOT) && !O.vital)
|
||||
if(O.robotic >= ORGAN_ROBOT)
|
||||
continue //robot limbs don't count towards shock and crit
|
||||
amount += O.brute_dam
|
||||
return amount
|
||||
@@ -75,7 +75,7 @@
|
||||
/mob/living/carbon/human/getFireLoss()
|
||||
var/amount = 0
|
||||
for(var/obj/item/organ/external/O in organs)
|
||||
if((O.status & ORGAN_ROBOT) && !O.vital)
|
||||
if(O.robotic >= ORGAN_ROBOT)
|
||||
continue //robot limbs don't count towards shock and crit
|
||||
amount += O.burn_dam
|
||||
return amount
|
||||
@@ -106,7 +106,7 @@
|
||||
O.take_damage(amount, 0, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
|
||||
else
|
||||
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
|
||||
O.heal_damage(-amount, 0, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
|
||||
O.heal_damage(-amount, 0, internal=0, robo_repair=(O.robotic >= ORGAN_ROBOT))
|
||||
|
||||
BITSET(hud_updateflag, HEALTH_HUD)
|
||||
|
||||
@@ -119,7 +119,7 @@
|
||||
O.take_damage(0, amount, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
|
||||
else
|
||||
//if you don't want to heal robot organs, they you will have to check that yourself before using this proc.
|
||||
O.heal_damage(0, -amount, internal=0, robo_repair=(O.status & ORGAN_ROBOT))
|
||||
O.heal_damage(0, -amount, internal=0, robo_repair=(O.robotic >= ORGAN_ROBOT))
|
||||
|
||||
BITSET(hud_updateflag, HEALTH_HUD)
|
||||
|
||||
|
||||
@@ -57,7 +57,7 @@ emp_act
|
||||
msg_admin_attack("[src.name] ([src.ckey]) was disarmed by a stun effect")
|
||||
|
||||
drop_from_inventory(c_hand)
|
||||
if (affected.status & ORGAN_ROBOT)
|
||||
if (affected.robotic >= ORGAN_ROBOT)
|
||||
emote("me", 1, "drops what they were holding, their [affected.name] malfunctioning!")
|
||||
else
|
||||
var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ")
|
||||
@@ -165,7 +165,7 @@ emp_act
|
||||
return 0
|
||||
|
||||
if(istype(I,/obj/item/weapon/card/emag))
|
||||
if(!(affecting.status & ORGAN_ROBOT))
|
||||
if(!(affecting.robotic >= ORGAN_ROBOT))
|
||||
user << "\red That limb isn't robotic."
|
||||
return
|
||||
if(affecting.sabotaged)
|
||||
|
||||
@@ -9,15 +9,24 @@
|
||||
/mob/living/carbon/human/var/list/organs_by_name = list() // map organ names to organs
|
||||
/mob/living/carbon/human/var/list/internal_organs_by_name = list() // so internal organs have less ickiness too
|
||||
|
||||
/mob/living/carbon/human/proc/get_bodypart_name(var/zone)
|
||||
var/obj/item/organ/external/E = get_organ(zone)
|
||||
if(E) . = E.name
|
||||
|
||||
/mob/living/carbon/human/proc/recheck_bad_external_organs()
|
||||
var/damage_this_tick = getToxLoss()
|
||||
for(var/obj/item/organ/external/O in organs)
|
||||
damage_this_tick += O.burn_dam + O.brute_dam
|
||||
|
||||
if(damage_this_tick > last_dam)
|
||||
. = TRUE
|
||||
last_dam = damage_this_tick
|
||||
|
||||
// Takes care of organ related updates, such as broken and missing limbs
|
||||
/mob/living/carbon/human/proc/handle_organs()
|
||||
|
||||
number_wounds = 0
|
||||
var/force_process = 0
|
||||
var/damage_this_tick = getBruteLoss() + getFireLoss() + getToxLoss()
|
||||
if(damage_this_tick > last_dam)
|
||||
force_process = 1
|
||||
last_dam = damage_this_tick
|
||||
var/force_process = recheck_bad_external_organs()
|
||||
|
||||
if(force_process)
|
||||
bad_external_organs.Cut()
|
||||
for(var/obj/item/organ/external/Ex in organs)
|
||||
|
||||
@@ -1512,7 +1512,7 @@
|
||||
|
||||
var/obj/item/organ/internal/heart/H = internal_organs_by_name[O_HEART]
|
||||
|
||||
if(!H || (H.status & ORGAN_ROBOT))
|
||||
if(!H || (H.robotic >= ORGAN_ROBOT))
|
||||
return
|
||||
|
||||
if(pulse >= PULSE_2FAST || shock_stage >= 10 || istype(get_turf(src), /turf/space))
|
||||
|
||||
@@ -247,7 +247,7 @@ var/global/list/damage_icon_parts = list()
|
||||
var/obj/item/organ/external/part = organs_by_name[organ_tag]
|
||||
if(isnull(part) || part.is_stump())
|
||||
icon_key += "0"
|
||||
else if(part.status & ORGAN_ROBOT)
|
||||
else if(part.robotic >= ORGAN_ROBOT)
|
||||
icon_key += "2[part.model ? "-[part.model]": ""]"
|
||||
else if(part.status & ORGAN_DEAD)
|
||||
icon_key += "3"
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
var/organ_found
|
||||
if(H.internal_organs.len)
|
||||
for(var/obj/item/organ/external/E in H.organs)
|
||||
if(!(E.status & ORGAN_ROBOT))
|
||||
if(!(E.robotic >= ORGAN_ROBOT))
|
||||
continue
|
||||
organ_found = 1
|
||||
user << "[E.name]: <font color='red'>[E.brute_dam]</font> <font color='#FFA500'>[E.burn_dam]</font>"
|
||||
@@ -86,7 +86,7 @@
|
||||
organ_found = null
|
||||
if(H.internal_organs.len)
|
||||
for(var/obj/item/organ/O in H.internal_organs)
|
||||
if(!(O.status & ORGAN_ROBOT))
|
||||
if(!(O.robotic >= ORGAN_ROBOT))
|
||||
continue
|
||||
organ_found = 1
|
||||
user << "[O.name]: <font color='red'>[O.damage]</font>"
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
var/mob/living/carbon/human/H = target
|
||||
if(prob(poison_per_bite))
|
||||
var/obj/item/organ/external/O = pick(H.organs)
|
||||
if(!(O.status & ORGAN_ROBOT))
|
||||
if(!(O.robotic >= ORGAN_ROBOT))
|
||||
var/eggs = PoolOrNew(/obj/effect/spider/eggcluster/, list(O, src))
|
||||
O.implants += eggs
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
if(isnull(full_prosthetic))
|
||||
robolimb_count = 0
|
||||
for(var/obj/item/organ/external/E in organs)
|
||||
if(E.status & ORGAN_ROBOT)
|
||||
if(E.robotic >= ORGAN_ROBOT)
|
||||
robolimb_count++
|
||||
if(robolimb_count == organs.len)
|
||||
full_prosthetic = 1
|
||||
|
||||
@@ -126,7 +126,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 40
|
||||
//Bleeding out
|
||||
var/blood_max = 0
|
||||
for(var/obj/item/organ/external/temp in organs)
|
||||
if(!(temp.status & ORGAN_BLEEDING) || (temp.status & ORGAN_ROBOT))
|
||||
if(!(temp.status & ORGAN_BLEEDING) || (temp.robotic >= ORGAN_ROBOT))
|
||||
continue
|
||||
for(var/datum/wound/W in temp.wounds) if(W.bleeding())
|
||||
blood_max += W.damage / 40
|
||||
|
||||
@@ -10,9 +10,10 @@ var/list/organ_cache = list()
|
||||
var/parent_organ = BP_TORSO // Organ holding this object.
|
||||
|
||||
// Status tracking.
|
||||
var/status = 0 // Various status flags (such as robotic)
|
||||
var/status = 0 // Various status flags
|
||||
var/vital // Lose a vital limb, die immediately.
|
||||
var/damage = 0 // Current damage to the organ
|
||||
var/robotic = 0
|
||||
|
||||
// Reference data.
|
||||
var/mob/living/carbon/human/owner // Current mob owning the organ.
|
||||
@@ -77,7 +78,7 @@ var/list/organ_cache = list()
|
||||
blood_DNA[dna.unique_enzymes] = dna.b_type
|
||||
|
||||
/obj/item/organ/proc/die()
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
return
|
||||
damage = max_damage
|
||||
status |= ORGAN_DEAD
|
||||
@@ -99,7 +100,7 @@ var/list/organ_cache = list()
|
||||
if(istype(loc,/obj/structure/closet/body_bag/cryobag) || istype(loc,/obj/structure/closet/crate/freezer) || istype(loc,/obj/item/weapon/storage/box/freezer))
|
||||
return
|
||||
//Process infections
|
||||
if ((status & ORGAN_ROBOT) || (owner && owner.species && (owner.species.flags & IS_PLANT)))
|
||||
if ((robotic >= ORGAN_ROBOT) || (owner && owner.species && (owner.species.flags & IS_PLANT)))
|
||||
germ_level = 0
|
||||
return
|
||||
|
||||
@@ -231,7 +232,7 @@ var/list/organ_cache = list()
|
||||
|
||||
//Note: external organs have their own version of this proc
|
||||
/obj/item/organ/proc/take_damage(amount, var/silent=0)
|
||||
if(src.status & ORGAN_ROBOT)
|
||||
if(src.robotic >= ORGAN_ROBOT)
|
||||
src.damage = between(0, src.damage + (amount * 0.8), max_damage)
|
||||
else
|
||||
src.damage = between(0, src.damage + amount, max_damage)
|
||||
@@ -243,19 +244,20 @@ var/list/organ_cache = list()
|
||||
owner.custom_pain("Something inside your [parent.name] hurts a lot.", 1)
|
||||
|
||||
/obj/item/organ/proc/robotize() //Being used to make robutt hearts, etc
|
||||
status = 0
|
||||
status |= ORGAN_ASSISTED
|
||||
status |= ORGAN_ROBOT
|
||||
|
||||
robotic = ORGAN_ROBOT
|
||||
src.status &= ~ORGAN_BROKEN
|
||||
src.status &= ~ORGAN_BLEEDING
|
||||
src.status &= ~ORGAN_SPLINTED
|
||||
src.status &= ~ORGAN_CUT_AWAY
|
||||
|
||||
/obj/item/organ/proc/mechassist() //Used to add things like pacemakers, etc
|
||||
status = 0
|
||||
status |= ORGAN_ASSISTED
|
||||
robotize()
|
||||
robotic = ORGAN_ASSISTED
|
||||
min_bruised_damage = 15
|
||||
min_broken_damage = 35
|
||||
|
||||
/obj/item/organ/emp_act(severity)
|
||||
if(!(status & ORGAN_ROBOT))
|
||||
if(!(robotic >= ORGAN_ROBOT))
|
||||
return
|
||||
switch (severity)
|
||||
if (1)
|
||||
@@ -316,7 +318,7 @@ var/list/organ_cache = list()
|
||||
|
||||
/obj/item/organ/proc/bitten(mob/user)
|
||||
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
return
|
||||
|
||||
user << "<span class='notice'>You take an experimental bite out of \the [src].</span>"
|
||||
@@ -342,9 +344,9 @@ var/list/organ_cache = list()
|
||||
/obj/item/organ/attack_self(mob/user as mob)
|
||||
|
||||
// Convert it to an edible form, yum yum.
|
||||
if(!(status & ORGAN_ROBOT) && user.a_intent == I_HELP && user.zone_sel.selecting == O_MOUTH)
|
||||
if(!(robotic >= ORGAN_ROBOT) && user.a_intent == I_HELP && user.zone_sel.selecting == O_MOUTH)
|
||||
bitten(user)
|
||||
return
|
||||
|
||||
/obj/item/organ/proc/can_feel_pain()
|
||||
return !(status & (ORGAN_ROBOT|ORGAN_DESTROYED)) && !(species.flags & NO_PAIN)
|
||||
return !(robotic >= (ORGAN_ROBOT|ORGAN_DESTROYED)) && !(species.flags & NO_PAIN)
|
||||
|
||||
@@ -92,7 +92,7 @@
|
||||
return ..()
|
||||
|
||||
/obj/item/organ/external/emp_act(severity)
|
||||
if(!(status & ORGAN_ROBOT))
|
||||
if(!(robotic >= ORGAN_ROBOT))
|
||||
return
|
||||
switch (severity)
|
||||
if (1)
|
||||
@@ -225,7 +225,8 @@
|
||||
****************************************************/
|
||||
|
||||
/obj/item/organ/external/proc/is_damageable(var/additional_damage = 0)
|
||||
return (vital || brute_dam + burn_dam + additional_damage < max_damage)
|
||||
//Continued damage to vital organs can kill you, and robot organs don't count towards total damage so no need to cap them.
|
||||
return (vital || (robotic >= ORGAN_ROBOT) || brute_dam + burn_dam + additional_damage < max_damage)
|
||||
|
||||
/obj/item/organ/external/take_damage(brute, burn, sharp, edge, used_weapon = null, list/forbidden_limbs = list())
|
||||
if((brute <= 0) && (burn <= 0))
|
||||
@@ -243,12 +244,12 @@
|
||||
brute -= brute / 2
|
||||
|
||||
if(status & ORGAN_BROKEN && prob(40) && brute)
|
||||
if(!((species.flags & NO_PAIN) || (status & ORGAN_ROBOT)))
|
||||
if(!((species.flags & NO_PAIN) || (robotic >= ORGAN_ROBOT)))
|
||||
owner.emote("scream") //getting hit on broken hand hurts
|
||||
if(used_weapon)
|
||||
add_autopsy_data("[used_weapon]", brute + burn)
|
||||
|
||||
var/can_cut = (prob(brute*2) || sharp) && !(status & ORGAN_ROBOT)
|
||||
var/can_cut = (prob(brute*2) || sharp) && (robotic < ORGAN_ROBOT)
|
||||
|
||||
// If the limbs can break, make sure we don't exceed the maximum damage a limb can take before breaking
|
||||
// Non-vital organs are limited to max_damage. You can't kill someone by bludeonging their arm all the way to 200 -- you can
|
||||
@@ -330,7 +331,7 @@
|
||||
return update_icon()
|
||||
|
||||
/obj/item/organ/external/proc/heal_damage(brute, burn, internal = 0, robo_repair = 0)
|
||||
if(status & ORGAN_ROBOT && !robo_repair)
|
||||
if(robotic >= ORGAN_ROBOT && !robo_repair)
|
||||
return
|
||||
|
||||
//Heal damage on the individual wounds
|
||||
@@ -355,12 +356,57 @@
|
||||
var/result = update_icon()
|
||||
return result
|
||||
|
||||
//Helper proc used by various tools for repairing robot limbs
|
||||
/obj/item/organ/external/proc/robo_repair(var/repair_amount, var/damage_type, var/damage_desc, obj/item/tool, mob/living/user)
|
||||
if((src.robotic < ORGAN_ROBOT))
|
||||
return 0
|
||||
|
||||
var/damage_amount
|
||||
switch(damage_type)
|
||||
if(BRUTE) damage_amount = brute_dam
|
||||
if(BURN) damage_amount = burn_dam
|
||||
else return 0
|
||||
|
||||
if(!damage_amount)
|
||||
user << "<span class='notice'>Nothing to fix!</span>"
|
||||
return 0
|
||||
|
||||
if(damage_amount >= ROBOLIMB_SELF_REPAIR_CAP)
|
||||
user << "<span class='danger'>The damage is far too severe to patch over externally.</span>"
|
||||
return 0
|
||||
|
||||
if(user == src.owner)
|
||||
var/grasp
|
||||
if(user.l_hand == tool && (src.body_part & (ARM_LEFT|HAND_LEFT)))
|
||||
grasp = "l_hand"
|
||||
else if(user.r_hand == tool && (src.body_part & (ARM_RIGHT|HAND_RIGHT)))
|
||||
grasp = "r_hand"
|
||||
|
||||
if(grasp)
|
||||
user << "<span class='warning'>You can't reach your [src.name] while holding [tool] in your [owner.get_bodypart_name(grasp)].</span>"
|
||||
return 0
|
||||
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
if(!do_mob(user, owner, 10))
|
||||
user << "<span class='warning'>You must stand still to do that.</span>"
|
||||
return 0
|
||||
|
||||
switch(damage_type)
|
||||
if(BRUTE) src.heal_damage(repair_amount, 0, 0, 1)
|
||||
if(BURN) src.heal_damage(0, repair_amount, 0, 1)
|
||||
if(user == src.owner)
|
||||
user.visible_message("<span class='notice'>\The [user] patches [damage_desc] on \his [src.name] with [tool].</span>")
|
||||
else
|
||||
user.visible_message("<span class='notice'>\The [user] patches [damage_desc] on [owner]'s [src.name] with [tool].</span>")
|
||||
|
||||
return 1
|
||||
|
||||
|
||||
/*
|
||||
This function completely restores a damaged organ to perfect condition.
|
||||
*/
|
||||
/obj/item/organ/external/rejuvenate(var/ignore_prosthetic_prefs)
|
||||
damage_state = "00"
|
||||
|
||||
status = 0
|
||||
brute_dam = 0
|
||||
burn_dam = 0
|
||||
@@ -411,7 +457,7 @@ This function completely restores a damaged organ to perfect condition.
|
||||
//moved this before the open_wound check so that having many small wounds for example doesn't somehow protect you from taking internal damage (because of the return)
|
||||
//Possibly trigger an internal wound, too.
|
||||
var/local_damage = brute_dam + burn_dam + damage
|
||||
if(damage > 15 && type != BURN && local_damage > 30 && prob(damage) && !(status & ORGAN_ROBOT))
|
||||
if(damage > 15 && type != BURN && local_damage > 30 && prob(damage) && (robotic < ORGAN_ROBOT))
|
||||
var/datum/wound/internal_bleeding/I = new (min(damage - 15, 15))
|
||||
wounds += I
|
||||
owner.custom_pain("You feel something rip in your [name]!", 1)
|
||||
@@ -429,7 +475,7 @@ This function completely restores a damaged organ to perfect condition.
|
||||
var/datum/wound/W = pick(compatible_wounds)
|
||||
W.open_wound(damage)
|
||||
if(prob(25))
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
owner.visible_message("<span class='danger'>The damage to [owner.name]'s [name] worsens.</span>",\
|
||||
"<span class='danger'>The damage to your [name] worsens.</span>",\
|
||||
"<span class='danger'>You hear the screech of abused metal.</span>")
|
||||
@@ -467,7 +513,7 @@ This function completely restores a damaged organ to perfect condition.
|
||||
/obj/item/organ/external/proc/need_process()
|
||||
if(status & (ORGAN_CUT_AWAY|ORGAN_BLEEDING|ORGAN_BROKEN|ORGAN_DESTROYED|ORGAN_SPLINTED|ORGAN_DEAD|ORGAN_MUTATED))
|
||||
return 1
|
||||
if(brute_dam || burn_dam)
|
||||
if((brute_dam || burn_dam) && (robotic < ORGAN_ROBOT)) //Robot limbs don't autoheal and thus don't need to process when damaged
|
||||
return 1
|
||||
if(last_dam != brute_dam + burn_dam) // Process when we are fully healed up.
|
||||
last_dam = brute_dam + burn_dam
|
||||
@@ -523,7 +569,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
*/
|
||||
/obj/item/organ/external/proc/update_germs()
|
||||
|
||||
if(status & (ORGAN_ROBOT) || (owner.species && owner.species.flags & IS_PLANT)) //Robotic limbs shouldn't be infected, nor should nonexistant limbs.
|
||||
if(robotic >= ORGAN_ROBOT || (owner.species && owner.species.flags & IS_PLANT)) //Robotic limbs shouldn't be infected, nor should nonexistant limbs.
|
||||
germ_level = 0
|
||||
return
|
||||
|
||||
@@ -581,12 +627,12 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
//spread the infection to child and parent organs
|
||||
if (children)
|
||||
for (var/obj/item/organ/external/child in children)
|
||||
if (child.germ_level < germ_level && !(child.status & ORGAN_ROBOT))
|
||||
if (child.germ_level < germ_level && (child.robotic < ORGAN_ROBOT))
|
||||
if (child.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
|
||||
child.germ_level++
|
||||
|
||||
if (parent)
|
||||
if (parent.germ_level < germ_level && !(parent.status & ORGAN_ROBOT))
|
||||
if (parent.germ_level < germ_level && (parent.robotic < ORGAN_ROBOT))
|
||||
if (parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30))
|
||||
parent.germ_level++
|
||||
|
||||
@@ -602,10 +648,10 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
//Updating wounds. Handles wound natural I had some free spachealing, internal bleedings and infections
|
||||
/obj/item/organ/external/proc/update_wounds()
|
||||
|
||||
if((status & ORGAN_ROBOT)) //Robotic limbs don't heal or get worse.
|
||||
for(var/datum/wound/W in wounds)
|
||||
if(W.damage <= 0)
|
||||
wounds -= W
|
||||
if((robotic >= ORGAN_ROBOT)) //Robotic limbs don't heal or get worse.
|
||||
for(var/datum/wound/W in wounds) //Repaired wounds disappear though
|
||||
if(W.damage <= 0) //and they disappear right away
|
||||
wounds -= W //TODO: robot wounds for robot limbs
|
||||
return
|
||||
|
||||
for(var/datum/wound/W in wounds)
|
||||
@@ -675,7 +721,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
else
|
||||
brute_dam += W.damage
|
||||
|
||||
if(!(status & ORGAN_ROBOT) && W.bleeding() && (H && H.should_have_organ(O_HEART)))
|
||||
if(!(robotic >= ORGAN_ROBOT) && W.bleeding() && (H && !H.should_have_organ(O_HEART)))
|
||||
W.bleed_timer--
|
||||
status |= ORGAN_BLEEDING
|
||||
|
||||
@@ -688,7 +734,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
status |= ORGAN_BLEEDING
|
||||
|
||||
//Bone fractures
|
||||
if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(status & ORGAN_ROBOT))
|
||||
if(config.bones_can_break && brute_dam > min_broken_damage * config.organ_health_multiplier && !(robotic >= ORGAN_ROBOT))
|
||||
src.fracture()
|
||||
|
||||
// new damage icon system
|
||||
@@ -742,7 +788,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
switch(disintegrate)
|
||||
if(DROPLIMB_EDGE)
|
||||
if(!clean)
|
||||
var/gore_sound = "[(status & ORGAN_ROBOT) ? "tortured metal" : "ripping tendons and flesh"]"
|
||||
var/gore_sound = "[(robotic >= ORGAN_ROBOT) ? "tortured metal" : "ripping tendons and flesh"]"
|
||||
owner.visible_message(
|
||||
"<span class='danger'>\The [owner]'s [src.name] flies off in an arc!</span>",\
|
||||
"<span class='moderate'><b>Your [src.name] goes flying off!</b></span>",\
|
||||
@@ -750,7 +796,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(DROPLIMB_BURN)
|
||||
if(cannot_gib)
|
||||
return
|
||||
var/gore = "[(status & ORGAN_ROBOT) ? "": " of burning flesh"]"
|
||||
var/gore = "[(robotic >= ORGAN_ROBOT) ? "": " of burning flesh"]"
|
||||
owner.visible_message(
|
||||
"<span class='danger'>\The [owner]'s [src.name] flashes away into ashes!</span>",\
|
||||
"<span class='moderate'><b>Your [src.name] flashes away into ashes!</b></span>",\
|
||||
@@ -758,8 +804,8 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(DROPLIMB_BLUNT)
|
||||
if(cannot_gib)
|
||||
return
|
||||
var/gore = "[(status & ORGAN_ROBOT) ? "": " in shower of gore"]"
|
||||
var/gore_sound = "[(status & ORGAN_ROBOT) ? "rending sound of tortured metal" : "sickening splatter of gore"]"
|
||||
var/gore = "[(robotic >= ORGAN_ROBOT) ? "": " in shower of gore"]"
|
||||
var/gore_sound = "[(status >= ORGAN_ROBOT) ? "rending sound of tortured metal" : "sickening splatter of gore"]"
|
||||
owner.visible_message(
|
||||
"<span class='danger'>\The [owner]'s [src.name] explodes[gore]!</span>",\
|
||||
"<span class='moderate'><b>Your [src.name] explodes[gore]!</b></span>",\
|
||||
@@ -781,7 +827,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
parent_organ.update_damages()
|
||||
else
|
||||
var/obj/item/organ/external/stump/stump = new (victim, 0, src)
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
stump.robotize()
|
||||
stump.wounds |= W
|
||||
victim.organs |= stump
|
||||
@@ -813,7 +859,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
qdel(src)
|
||||
if(DROPLIMB_BLUNT)
|
||||
var/obj/effect/decal/cleanable/blood/gibs/gore
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
gore = new /obj/effect/decal/cleanable/blood/gibs/robot(get_turf(victim))
|
||||
else
|
||||
gore = new /obj/effect/decal/cleanable/blood/gibs(get_turf(victim))
|
||||
@@ -920,7 +966,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
return rval
|
||||
|
||||
/obj/item/organ/external/proc/fracture()
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
return //ORGAN_BROKEN doesn't have the same meaning for robot limbs
|
||||
if((status & ORGAN_BROKEN) || cannot_break)
|
||||
return
|
||||
@@ -960,7 +1006,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
return
|
||||
|
||||
/obj/item/organ/external/proc/mend_fracture()
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
return 0 //ORGAN_BROKEN doesn't have the same meaning for robot limbs
|
||||
if(brute_dam > min_broken_damage * config.organ_health_multiplier)
|
||||
return 0 //will just immediately fracture again
|
||||
@@ -970,7 +1016,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
/obj/item/organ/external/robotize(var/company, var/skip_prosthetics = 0, var/keep_organs = 0)
|
||||
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
return
|
||||
|
||||
..()
|
||||
@@ -1015,7 +1061,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
return 1
|
||||
|
||||
/obj/item/organ/external/proc/mutate()
|
||||
if(src.status & ORGAN_ROBOT)
|
||||
if(src.robotic >= ORGAN_ROBOT)
|
||||
return
|
||||
src.status |= ORGAN_MUTATED
|
||||
if(owner) owner.update_body()
|
||||
@@ -1037,7 +1083,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
return !is_dislocated() && !(status & (ORGAN_MUTATED|ORGAN_DEAD))
|
||||
|
||||
/obj/item/organ/external/proc/is_malfunctioning()
|
||||
return ((status & ORGAN_ROBOT) && (brute_dam + burn_dam) >= 10 && prob(brute_dam + burn_dam))
|
||||
return ((robotic >= 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(!owner || loc != owner)
|
||||
@@ -1057,7 +1103,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
|
||||
if(!owner)
|
||||
return
|
||||
var/is_robotic = status & ORGAN_ROBOT
|
||||
var/is_robotic = robotic >= ORGAN_ROBOT
|
||||
var/mob/living/carbon/human/victim = owner
|
||||
|
||||
..()
|
||||
@@ -1129,7 +1175,7 @@ Note that amputating the affected organ does in fact remove the infection from t
|
||||
if(status & ORGAN_DESTROYED && !is_stump())
|
||||
. += "tear at [amputation_point] so severe that it hangs by a scrap of flesh"
|
||||
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
if(brute_dam)
|
||||
switch(brute_dam)
|
||||
if(0 to 20)
|
||||
|
||||
@@ -16,7 +16,7 @@ var/global/list/limb_icon_cache = list()
|
||||
s_tone = null
|
||||
s_col = null
|
||||
h_col = null
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
return
|
||||
if(species && human.species && species.name != human.species.name)
|
||||
return
|
||||
@@ -30,7 +30,7 @@ var/global/list/limb_icon_cache = list()
|
||||
s_tone = null
|
||||
s_col = null
|
||||
h_col = null
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
return
|
||||
if(!isnull(dna.GetUIValue(DNA_UI_SKIN_TONE)) && (species.appearance_flags & HAS_SKIN_TONE))
|
||||
s_tone = dna.GetUIValue(DNA_UI_SKIN_TONE)
|
||||
@@ -110,7 +110,7 @@ var/global/list/limb_icon_cache = list()
|
||||
|
||||
if(skeletal)
|
||||
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
|
||||
else if (status & ORGAN_ROBOT)
|
||||
else if (robotic >= ORGAN_ROBOT)
|
||||
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
|
||||
else
|
||||
mob_icon = new /icon(species.get_icobase(owner, (status & ORGAN_MUTATED)), "[icon_name][gender ? "_[gender]" : ""]")
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
..(holder, internal)
|
||||
if(istype(limb))
|
||||
max_damage = limb.max_damage
|
||||
if((limb.status & ORGAN_ROBOT) && (!parent || (parent.status & ORGAN_ROBOT)))
|
||||
if((limb.robotic >= ORGAN_ROBOT) && (!parent || (parent.robotic >= ORGAN_ROBOT)))
|
||||
robotize() //if both limb and the parent are robotic, the stump is robotic too
|
||||
|
||||
/obj/item/organ/external/stump/is_stump()
|
||||
|
||||
@@ -82,7 +82,7 @@ mob/living/carbon/human/proc/handle_pain()
|
||||
var/maxdam = 0
|
||||
var/obj/item/organ/external/damaged_organ = null
|
||||
for(var/obj/item/organ/external/E in organs)
|
||||
if(E.status & (ORGAN_DEAD|ORGAN_ROBOT)) continue
|
||||
if((E.status & ORGAN_DEAD) || E.robotic >= ORGAN_ROBOT) continue
|
||||
var/dam = E.get_damage()
|
||||
// make the choice of the organ depend on damage,
|
||||
// but also sometimes use one of the less damaged ones
|
||||
@@ -94,7 +94,7 @@ mob/living/carbon/human/proc/handle_pain()
|
||||
|
||||
// Damage to internal organs hurts a lot.
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
if(I.status & (ORGAN_DEAD|ORGAN_ROBOT)) continue
|
||||
if((I.status & ORGAN_DEAD) || I.robotic >= ORGAN_ROBOT) continue
|
||||
if(I.damage > 2) if(prob(2))
|
||||
var/obj/item/organ/external/parent = get_organ(I.parent_organ)
|
||||
src.custom_pain("You feel a sharp pain in your [parent.name]", 1)
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
//DIONA ORGANS.
|
||||
/obj/item/organ/external/diona/removed()
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
return ..()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
..()
|
||||
@@ -142,7 +142,7 @@
|
||||
organ_tag = "special" // Turns into a nymph instantly, no transplanting possible.
|
||||
|
||||
/obj/item/organ/internal/diona/removed(var/mob/living/user, var/skip_nymph)
|
||||
if(status & ORGAN_ROBOT)
|
||||
if(robotic >= ORGAN_ROBOT)
|
||||
return ..()
|
||||
var/mob/living/carbon/human/H = owner
|
||||
..()
|
||||
|
||||
@@ -522,22 +522,16 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
var/mob/living/carbon/human/H = A
|
||||
var/obj/item/organ/external/S = H.organs_by_name[user.zone_sel.selecting]
|
||||
|
||||
if(!S || !(S.status & ORGAN_ROBOT))
|
||||
if(!S || S.robotic < ORGAN_ROBOT || S.open == 3)
|
||||
return ..()
|
||||
|
||||
if(S.burn_dam)
|
||||
if(S.burn_dam < ROBOLIMB_SELF_REPAIR_CAP)
|
||||
S.heal_damage(0,15,0,1)
|
||||
user.visible_message("<span class='danger'>\The [user] repairs some burn damage on \the [H]'s [S.name] with \the [src].</span>")
|
||||
else if(S.open < 3)
|
||||
user << "<span class='danger'>The damage is far too severe to patch over externally.</span>"
|
||||
else
|
||||
return ..()
|
||||
else
|
||||
user << "<span class='notice'>Nothing to fix!</span>"
|
||||
return
|
||||
return ..()
|
||||
var/use_amt = min(src.amount, ceil(S.burn_dam/3), 5)
|
||||
if(can_use(use_amt))
|
||||
if(S.robo_repair(3*use_amt, BURN, "some damaged wiring", src, user))
|
||||
src.use(use_amt)
|
||||
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/cable_coil/update_icon()
|
||||
if (!color)
|
||||
|
||||
@@ -257,7 +257,7 @@
|
||||
var/mob/living/carbon/human/H = M
|
||||
var/obj/item/organ/internal/eyes/E = H.internal_organs_by_name[O_EYES]
|
||||
if(istype(E))
|
||||
if(E.status & ORGAN_ROBOT)
|
||||
if(E.robotic >= ORGAN_ROBOT)
|
||||
return
|
||||
if(E.damage > 0)
|
||||
E.damage = max(E.damage - 5 * removed, 0)
|
||||
@@ -277,7 +277,7 @@
|
||||
if(ishuman(M))
|
||||
var/mob/living/carbon/human/H = M
|
||||
for(var/obj/item/organ/I in H.internal_organs)
|
||||
if(I.status & ORGAN_ROBOT)
|
||||
if(I.robotic >= ORGAN_ROBOT)
|
||||
continue
|
||||
if(I.damage > 0) //Peridaxon heals only non-robotic organs
|
||||
I.damage = max(I.damage - removed, 0)
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
if(!affected)
|
||||
user << "<span class='danger'>\The [H] is missing that limb!</span>"
|
||||
return
|
||||
else if(affected.status & ORGAN_ROBOT)
|
||||
else if(affected.robotic >= ORGAN_ROBOT)
|
||||
user << "<span class='danger'>You cannot inject a robotic limb.</span>"
|
||||
return
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
if(!affected)
|
||||
user << "<span class='danger'>\The [H] is missing that limb!</span>"
|
||||
return
|
||||
else if(affected.status & ORGAN_ROBOT)
|
||||
else if(affected.robotic >= ORGAN_ROBOT)
|
||||
user << "<span class='danger'>You cannot inject a robotic limb.</span>"
|
||||
return
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
if(!affected)
|
||||
user << "<span class='danger'>\The [H] is missing that limb!</span>"
|
||||
return
|
||||
else if(affected.status & ORGAN_ROBOT)
|
||||
else if(affected.robotic >= ORGAN_ROBOT)
|
||||
user << "<span class='danger'>You cannot inject a robotic limb.</span>"
|
||||
return
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if (!hasorgans(target))
|
||||
return 0
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 0
|
||||
return affected && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 0
|
||||
|
||||
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)
|
||||
@@ -52,7 +52,7 @@
|
||||
if (!hasorgans(target))
|
||||
return 0
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.organ_tag != BP_HEAD && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
|
||||
return affected && affected.organ_tag != BP_HEAD && !(affected.robotic >= ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
|
||||
|
||||
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)
|
||||
@@ -91,7 +91,7 @@
|
||||
if (!hasorgans(target))
|
||||
return 0
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.organ_tag == BP_HEAD && !(affected.status & ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
|
||||
return affected && affected.organ_tag == BP_HEAD && (affected.robotic < ORGAN_ROBOT) && affected.open >= 2 && affected.stage == 1
|
||||
|
||||
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
user.visible_message("[user] is beginning to piece together [target]'s skull with \the [tool]." , \
|
||||
@@ -127,7 +127,7 @@
|
||||
if (!hasorgans(target))
|
||||
return 0
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && affected.open >= 2 && !(affected.status & ORGAN_ROBOT) && affected.stage == 2
|
||||
return affected && affected.open >= 2 && !(affected.robotic >= ORGAN_ROBOT) && affected.stage == 2
|
||||
|
||||
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)
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
return 0
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
return affected && !(affected.status & ORGAN_ROBOT) && affected.encased && affected.open >= 2
|
||||
return affected && !(affected.robotic >= ORGAN_ROBOT) && affected.encased && affected.open >= 2
|
||||
|
||||
|
||||
/datum/surgery_step/open_encased/saw
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
if (!hasorgans(target))
|
||||
return 0
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if (!affected || (affected.status & ORGAN_ROBOT))
|
||||
if (!affected || (affected.robotic >= ORGAN_ROBOT))
|
||||
return 0
|
||||
return target_zone == O_MOUTH
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
return 0
|
||||
if (affected.is_stump())
|
||||
return 0
|
||||
if (affected.status & ORGAN_ROBOT)
|
||||
if (affected.robotic >= ORGAN_ROBOT)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
|
||||
@@ -128,7 +128,7 @@
|
||||
|
||||
user.visible_message("\blue [user] puts \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
|
||||
"\blue You put \the [tool] inside [target]'s [get_cavity(affected)] cavity." )
|
||||
if (tool.w_class > get_max_wclass(affected)/2 && prob(50) && !(affected.status & ORGAN_ROBOT))
|
||||
if (tool.w_class > get_max_wclass(affected)/2 && prob(50) && !(affected.robotic >= ORGAN_ROBOT))
|
||||
user << "\red You tear some blood vessels trying to fit such a big object in this cavity."
|
||||
var/datum/wound/internal_bleeding/I = new (10)
|
||||
affected.wounds += I
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
if(I && I.damage > 0)
|
||||
if(!(I.status & ORGAN_ROBOT))
|
||||
if(!(I.robotic >= ORGAN_ROBOT))
|
||||
user.visible_message("[user] starts treating damage to [target]'s [I.name] with [tool_name].", \
|
||||
"You start treating damage to [target]'s [I.name] with [tool_name]." )
|
||||
|
||||
@@ -72,7 +72,7 @@
|
||||
|
||||
for(var/obj/item/organ/internal/I in affected.internal_organs)
|
||||
if(I && I.damage > 0)
|
||||
if(!(I.status & ORGAN_ROBOT))
|
||||
if(!(I.robotic >= ORGAN_ROBOT))
|
||||
user.visible_message("<span class='notice'>[user] treats damage to [target]'s [I.name] with [tool_name].</span>", \
|
||||
"<span class='notice'>You treat damage to [target]'s [I.name] with [tool_name].</span>" )
|
||||
I.damage = 0
|
||||
@@ -119,7 +119,7 @@
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
|
||||
if(!(affected && !(affected.status & ORGAN_ROBOT)))
|
||||
if(!(affected && !(affected.robotic >= ORGAN_ROBOT)))
|
||||
return 0
|
||||
|
||||
target.op_stage.current_organ = null
|
||||
@@ -234,7 +234,7 @@
|
||||
if(!istype(O))
|
||||
return 0
|
||||
|
||||
if((affected.status & ORGAN_ROBOT) && !(O.status & ORGAN_ROBOT))
|
||||
if((affected.robotic >= ORGAN_ROBOT) && !(O.robotic >= ORGAN_ROBOT))
|
||||
user << "<span class='danger'>You cannot install a naked organ into a robotic body.</span>"
|
||||
return SURGERY_FAILURE
|
||||
|
||||
@@ -307,7 +307,7 @@
|
||||
var/list/removable_organs = list()
|
||||
for(var/organ in target.internal_organs_by_name)
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[organ]
|
||||
if(istype(I) && (I.status & ORGAN_CUT_AWAY) && !(I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
|
||||
if(istype(I) && (I.status & ORGAN_CUT_AWAY) && !(I.robotic >= ORGAN_ROBOT) && I.parent_organ == target_zone)
|
||||
removable_organs |= organ
|
||||
|
||||
var/organ_to_replace = input(user, "Which organ do you want to reattach?") as null|anything in removable_organs
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
return 0
|
||||
if (affected.status & ORGAN_DESTROYED)
|
||||
return 0
|
||||
if (!(affected.status & ORGAN_ROBOT))
|
||||
if (!(affected.robotic >= ORGAN_ROBOT))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
if(!affected) return
|
||||
var/is_organ_damaged = 0
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
if(I.damage > 0 && (I.status & ORGAN_ROBOT))
|
||||
if(I.damage > 0 && (I.robotic >= ORGAN_ROBOT))
|
||||
is_organ_damaged = 1
|
||||
break
|
||||
return affected.open == 3 && is_organ_damaged
|
||||
@@ -226,7 +226,7 @@
|
||||
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
if(I && I.damage > 0)
|
||||
if(I.status & ORGAN_ROBOT)
|
||||
if(I.robotic >= ORGAN_ROBOT)
|
||||
user.visible_message("[user] starts mending the damage to [target]'s [I.name]'s mechanisms.", \
|
||||
"You start mending the damage to [target]'s [I.name]'s mechanisms." )
|
||||
|
||||
@@ -242,7 +242,7 @@
|
||||
for(var/obj/item/organ/I in affected.internal_organs)
|
||||
|
||||
if(I && I.damage > 0)
|
||||
if(I.status & ORGAN_ROBOT)
|
||||
if(I.robotic >= ORGAN_ROBOT)
|
||||
user.visible_message("<span class='notice'>[user] repairs [target]'s [I.name] with [tool].</span>", \
|
||||
"<span class='notice'>You repair [target]'s [I.name] with [tool].</span>" )
|
||||
I.damage = 0
|
||||
@@ -277,7 +277,7 @@
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!(affected && (affected.status & ORGAN_ROBOT)))
|
||||
if(!(affected && (affected.robotic >= ORGAN_ROBOT)))
|
||||
return 0
|
||||
if(affected.open < 3)
|
||||
return 0
|
||||
@@ -326,7 +326,7 @@
|
||||
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
|
||||
|
||||
var/obj/item/organ/external/affected = target.get_organ(target_zone)
|
||||
if(!(affected && (affected.status & ORGAN_ROBOT)))
|
||||
if(!(affected && (affected.robotic >= ORGAN_ROBOT)))
|
||||
return 0
|
||||
if(affected.open < 3)
|
||||
return 0
|
||||
@@ -336,7 +336,7 @@
|
||||
var/list/removable_organs = list()
|
||||
for(var/organ in target.internal_organs_by_name)
|
||||
var/obj/item/organ/I = target.internal_organs_by_name[organ]
|
||||
if(I && (I.status & ORGAN_CUT_AWAY) && (I.status & ORGAN_ROBOT) && I.parent_organ == target_zone)
|
||||
if(I && (I.status & ORGAN_CUT_AWAY) && (I.robotic >= ORGAN_ROBOT) && I.parent_organ == target_zone)
|
||||
removable_organs |= organ
|
||||
|
||||
var/organ_to_replace = input(user, "Which organ do you want to reattach?") as null|anything in removable_organs
|
||||
@@ -388,12 +388,11 @@
|
||||
user << "<span class='danger'>That brain is not usable.</span>"
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!(affected.status & ORGAN_ROBOT))
|
||||
if(!(affected.robotic >= ORGAN_ROBOT))
|
||||
user << "<span class='danger'>You cannot install a computer brain into a meat skull.</span>"
|
||||
return SURGERY_FAILURE
|
||||
|
||||
if(!target.should_have_organ("brain"))
|
||||
|
||||
user << "<span class='danger'>You're pretty sure [target.species.name_plural] don't normally have a brain.</span>"
|
||||
return SURGERY_FAILURE
|
||||
|
||||
|
||||
Reference in New Issue
Block a user