Merge pull request #710 from ZomgPonies/limb

Port of the BS12 limb overhaul
This commit is contained in:
Fox-McCloud
2015-04-05 19:06:39 -04:00
149 changed files with 3451 additions and 2530 deletions
+1
View File
@@ -570,6 +570,7 @@ var/list/admin_verbs_mentor = list(
M.r_eyes = hex2num(copytext(new_eyes, 2, 4))
M.g_eyes = hex2num(copytext(new_eyes, 4, 6))
M.b_eyes = hex2num(copytext(new_eyes, 6, 8))
M.update_eyes()
var/new_skin = input("Please select body color. This is for Tajaran, Unathi, and Skrell only!", "Character Generation") as color
if(new_skin)
+1 -1
View File
@@ -2221,7 +2221,7 @@
if(!security)
//strip their stuff before they teleport into a cell :downs:
for(var/obj/item/weapon/W in H)
if(istype(W, /datum/organ/external))
if(istype(W, /obj/item/organ/external))
continue
//don't strip organs
H.unEquip(W)
+2
View File
@@ -596,6 +596,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
for (var/obj/item/I in M)
if (istype(I, /obj/item/weapon/implant))
continue
if(istype(I, /obj/item/organ))
continue
del(I)
switch(dresscode)
if ("strip")
+2 -2
View File
@@ -526,11 +526,11 @@ client/proc/one_click_antag()
new_vox.h_style = "Short Vox Quills"
new_vox.f_style = "Shaved"
for(var/datum/organ/external/limb in new_vox.organs)
for(var/obj/item/organ/external/limb in new_vox.organs)
limb.status &= ~(ORGAN_DESTROYED | ORGAN_ROBOT)
//Now apply cortical stack.
var/datum/organ/external/E = new_vox.get_organ("head")
var/obj/item/organ/external/E = new_vox.get_organ("head")
var/obj/item/weapon/implant/cortical/I = new(new_vox)
I.imp_in = new_vox
I.implanted = 1
+2
View File
@@ -30,6 +30,8 @@
for (var/obj/item/I in H)
if (istype(I, /obj/item/weapon/implant))
continue
if(istype(I, /obj/item/organ))
continue
del(I)
H.equip_to_slot_or_del(new /obj/item/clothing/under/kilt(H), slot_w_uniform)
+2
View File
@@ -15,6 +15,8 @@
for (var/obj/item/I in H)
if (istype(I, /obj/item/weapon/implant))
continue
if(istype (I, /obj/item/organ))
continue
del(I)
H << "<B>You are part of the [station_name()] dodgeball tournament. Throw dodgeballs at crewmembers wearing a different color than you. OOC: Use THROW on an EMPTY-HAND to catch thrown dodgeballs.</B>"
+1 -1
View File
@@ -65,7 +65,7 @@ var/global/vox_tick = 1
var/obj/item/weapon/implant/cortical/I = new(src)
I.imp_in = src
I.implanted = 1
var/datum/organ/external/affected = src.get_organ("head")
var/obj/item/organ/external/affected = src.get_organ("head")
affected.implants += I
I.part = affected
+1 -1
View File
@@ -40,7 +40,7 @@
proc/triggered(mob/target as mob, var/type = "feet")
if(!armed)
return
var/datum/organ/external/affecting = null
var/obj/item/organ/external/affecting = null
if(ishuman(target))
var/mob/living/carbon/human/H = target
switch(type)
+43 -33
View File
@@ -154,6 +154,7 @@ datum/preferences
// maps each organ to either null(intact), "cyborg" or "amputated"
// will probably not be able to do this for head and torso ;)
var/list/organ_data = list()
var/list/rlimb_data = list()
var/list/player_alt_titles = new() // the default name of a job like "Medical Doctor"
// var/accent = "en-us"
@@ -276,13 +277,13 @@ datum/preferences
++ind
if(ind > 1)
dat += ", "
dat += "\tMechanical [organ_name] prothesis"
var/datum/robolimb/R
if(rlimb_data[name] && all_robolimbs[rlimb_data[name]])
R = all_robolimbs[rlimb_data[name]]
else
R = basic_robolimb
dat += "\t[R.company] [organ_name] prothesis"
else if(status == "peg")
++ind
if(ind > 1)
dat += ", "
dat += "\tWooden [organ_name] prothesis"
else if(status == "amputated")
++ind
@@ -1259,11 +1260,9 @@ datum/preferences
if("Left Leg")
limb = "l_leg"
second_limb = "l_foot"
valid_limb_states += "Peg Leg"
if("Right Leg")
limb = "r_leg"
second_limb = "r_foot"
valid_limb_states += "Peg Leg"
if("Left Arm")
limb = "l_arm"
second_limb = "l_hand"
@@ -1289,20 +1288,25 @@ datum/preferences
switch(new_state)
if("Normal")
organ_data[limb] = null
rlimb_data[limb] = null
if(third_limb)
organ_data[third_limb] = null
rlimb_data[third_limb] = null
if("Amputated")
organ_data[limb] = "amputated"
rlimb_data[limb] = null
if(second_limb)
organ_data[second_limb] = "amputated"
rlimb_data[second_limb] = null
if("Prothesis")
var/choice = input(user, "Which manufacturer do you wish to use for this limb?") as null|anything in chargen_robolimbs
if(!choice)
return
rlimb_data[limb] = choice
organ_data[limb] = "cyborg"
if(second_limb)
rlimb_data[second_limb] = choice
organ_data[second_limb] = "cyborg"
if("Peg Leg")
organ_data[limb] = "peg"
if(second_limb)
organ_data[second_limb] = "amputated"
if("organs")
var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in list("Heart", "Eyes")
@@ -1478,28 +1482,34 @@ datum/preferences
character.slime_color = slime_color
// Destroy/cyborgize organs
for(var/name in organ_data)
var/datum/organ/external/O = character.organs_by_name[name]
var/datum/organ/internal/I = character.internal_organs_by_name[name]
var/status = organ_data[name]
if(status == "amputated")
O.status &= ~ORGAN_ROBOT
O.status &= ~ORGAN_PEG
O.amputated = 1
O.status |= ORGAN_DESTROYED
O.destspawn = 1
if(status == "cyborg")
O.status &= ~ORGAN_PEG
O.status |= ORGAN_ROBOT
if(status == "peg")
O.status &= ~ORGAN_ROBOT
O.status |= ORGAN_PEG
if(status == "assisted")
I.mechassist()
else if(status == "mechanical")
I.mechanize()
else continue
var/obj/item/organ/external/O = character.organs_by_name[name]
if(O)
if(status == "amputated")
character.organs_by_name[O.limb_name] = null
character.organs -= O
if(O.children) // This might need to become recursive.
for(var/obj/item/organ/external/child in O.children)
character.organs_by_name[child.limb_name] = null
character.organs -= child
else if(status == "cyborg")
if(rlimb_data[name])
O.robotize(rlimb_data[name])
else
O.robotize()
else
var/obj/item/organ/I = character.internal_organs_by_name[name]
if(I)
if(status == "assisted")
I.mechassist()
else if(status == "mechanical")
I.robotize()
if(disabilities & DISABILITY_FLAG_FAT && character.species.flags & CAN_BE_FAT)//character.species.flags & CAN_BE_FAT)
character.mutations += FAT
@@ -1512,8 +1522,8 @@ datum/preferences
character.sdisabilities|=DEAF
// Wheelchair necessary?
var/datum/organ/external/l_foot = character.get_organ("l_foot")
var/datum/organ/external/r_foot = character.get_organ("r_foot")
var/obj/item/organ/external/l_foot = character.get_organ("l_foot")
var/obj/item/organ/external/r_foot = character.get_organ("r_foot")
if((!l_foot || l_foot.status & ORGAN_DESTROYED) && (!r_foot || r_foot.status & ORGAN_DESTROYED))
var/obj/structure/stool/bed/chair/wheelchair/W = new /obj/structure/stool/bed/chair/wheelchair (character.loc)
character.buckled = W
+3 -2
View File
@@ -173,6 +173,7 @@
// if(isnull(disabilities)) disabilities = 0
if(!player_alt_titles) player_alt_titles = new()
if(!organ_data) src.organ_data = list()
if(!rlimb_data) src.rlimb_data = list()
return 1
@@ -188,14 +189,14 @@
firstquery.Execute()
while(firstquery.NextRow())
if(text2num(firstquery.item[1]) == default_slot)
var/DBQuery/query = dbcon.NewQuery("UPDATE characters SET OOC_Notes='[sql_sanitize_text(metadata)]',real_name='[sql_sanitize_text(real_name)]',name_is_always_random='[be_random_name]',gender='[gender]',age='[age]',species='[sql_sanitize_text(species)]',language='[sql_sanitize_text(language)]',hair_red='[r_hair]',hair_green='[g_hair]',hair_blue='[b_hair]',facial_red='[r_facial]',facial_green='[g_facial]',facial_blue='[b_facial]',skin_tone='[s_tone]',skin_red='[r_skin]',skin_green='[g_skin]',skin_blue='[b_skin]',hair_style_name='[sql_sanitize_text(h_style)]',facial_style_name='[sql_sanitize_text(f_style)]',eyes_red='[r_eyes]',eyes_green='[g_eyes]',eyes_blue='[b_eyes]',underwear='[underwear]',undershirt='[undershirt]',backbag='[backbag]',b_type='[b_type]',alternate_option='[alternate_option]',job_support_high='[job_support_high]',job_support_med='[job_support_med]',job_support_low='[job_support_low]',job_medsci_high='[job_medsci_high]',job_medsci_med='[job_medsci_med]',job_medsci_low='[job_medsci_low]',job_engsec_high='[job_engsec_high]',job_engsec_med='[job_engsec_med]',job_engsec_low='[job_engsec_low]',job_karma_high='[job_karma_high]',job_karma_med='[job_karma_med]',job_karma_low='[job_karma_low]',flavor_text='[sql_sanitize_text(flavor_text)]',med_record='[sql_sanitize_text(med_record)]',sec_record='[sql_sanitize_text(sec_record)]',gen_record='[sql_sanitize_text(gen_record)]',player_alt_titles='[playertitlelist]',be_special='[be_special]',disabilities='[disabilities]',organ_data='[organlist]',nanotrasen_relation='[nanotrasen_relation]', speciesprefs='[speciesprefs]', slime_color='[slime_color]' WHERE ckey='[C.ckey]' AND slot='[default_slot]'")
var/DBQuery/query = dbcon.NewQuery("UPDATE characters SET OOC_Notes='[sql_sanitize_text(metadata)]',real_name='[sql_sanitize_text(real_name)]',name_is_always_random='[be_random_name]',gender='[gender]',age='[age]',species='[sql_sanitize_text(species)]',language='[sql_sanitize_text(language)]',hair_red='[r_hair]',hair_green='[g_hair]',hair_blue='[b_hair]',facial_red='[r_facial]',facial_green='[g_facial]',facial_blue='[b_facial]',skin_tone='[s_tone]',skin_red='[r_skin]',skin_green='[g_skin]',skin_blue='[b_skin]',hair_style_name='[sql_sanitize_text(h_style)]',facial_style_name='[sql_sanitize_text(f_style)]',eyes_red='[r_eyes]',eyes_green='[g_eyes]',eyes_blue='[b_eyes]',underwear='[underwear]',undershirt='[undershirt]',backbag='[backbag]',b_type='[b_type]',alternate_option='[alternate_option]',job_support_high='[job_support_high]',job_support_med='[job_support_med]',job_support_low='[job_support_low]',job_medsci_high='[job_medsci_high]',job_medsci_med='[job_medsci_med]',job_medsci_low='[job_medsci_low]',job_engsec_high='[job_engsec_high]',job_engsec_med='[job_engsec_med]',job_engsec_low='[job_engsec_low]',job_karma_high='[job_karma_high]',job_karma_med='[job_karma_med]',job_karma_low='[job_karma_low]',flavor_text='[sql_sanitize_text(flavor_text)]',med_record='[sql_sanitize_text(med_record)]',sec_record='[sql_sanitize_text(sec_record)]',gen_record='[sql_sanitize_text(gen_record)]',player_alt_titles='[playertitlelist]',be_special='[be_special]',disabilities='[disabilities]',organ_data='[organlist]',rlimb_data='[rlimb_data]',nanotrasen_relation='[nanotrasen_relation]', speciesprefs='[speciesprefs]', slime_color='[slime_color]' WHERE ckey='[C.ckey]' AND slot='[default_slot]'")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during character slot saving. Error : \[[err]\]\n")
message_admins("SQL ERROR during character slot saving. Error : \[[err]\]\n")
return
return 1
var/DBQuery/query = dbcon.NewQuery("INSERT INTO characters (ckey,slot,OOC_Notes,real_name,name_is_always_random,gender,age,species,language,hair_red,hair_green,hair_blue,facial_red,facial_green,facial_blue,skin_tone,skin_red,skin_green,skin_blue,hair_style_name,facial_style_name,eyes_red,eyes_green,eyes_blue,underwear,undershirt,backbag,b_type,alternate_option,job_support_high,job_support_med,job_support_low,job_medsci_high,job_medsci_med,job_medsci_low,job_engsec_high,job_engsec_med,job_engsec_low,job_karma_high,job_karma_med,job_karma_low,flavor_text,med_record,sec_record,gen_record,player_alt_titles,be_special,disabilities,organ_data,nanotrasen_relation, speciesprefs, slime_color) VALUES ('[C.ckey]','[default_slot]','[sql_sanitize_text(metadata)]','[sql_sanitize_text(real_name)]','[be_random_name]','[gender]','[age]','[sql_sanitize_text(species)]','[sql_sanitize_text(language)]','[r_hair]','[g_hair]','[b_hair]','[r_facial]','[g_facial]','[b_facial]','[s_tone]','[r_skin]','[g_skin]','[b_skin]','[sql_sanitize_text(h_style)]','[sql_sanitize_text(f_style)]','[r_eyes]','[g_eyes]','[b_eyes]','[underwear]','[undershirt]','[backbag]','[b_type]','[alternate_option]','[job_support_high]','[job_support_med]','[job_support_low]','[job_medsci_high]','[job_medsci_med]','[job_medsci_low]','[job_engsec_high]','[job_engsec_med]','[job_engsec_low]','[job_karma_high]','[job_karma_med]','[job_karma_low]','[sql_sanitize_text(flavor_text)]','[sql_sanitize_text(med_record)]','[sql_sanitize_text(sec_record)]','[sql_sanitize_text(gen_record)]','[playertitlelist]','[be_special]','[disabilities]','[organlist]','[nanotrasen_relation]', '[speciesprefs]', '[slime_color]')")
var/DBQuery/query = dbcon.NewQuery("INSERT INTO characters (ckey,slot,OOC_Notes,real_name,name_is_always_random,gender,age,species,language,hair_red,hair_green,hair_blue,facial_red,facial_green,facial_blue,skin_tone,skin_red,skin_green,skin_blue,hair_style_name,facial_style_name,eyes_red,eyes_green,eyes_blue,underwear,undershirt,backbag,b_type,alternate_option,job_support_high,job_support_med,job_support_low,job_medsci_high,job_medsci_med,job_medsci_low,job_engsec_high,job_engsec_med,job_engsec_low,job_karma_high,job_karma_med,job_karma_low,flavor_text,med_record,sec_record,gen_record,player_alt_titles,be_special,disabilities,organ_data,rlimb_data,nanotrasen_relation, speciesprefs, slime_color) VALUES ('[C.ckey]','[default_slot]','[sql_sanitize_text(metadata)]','[sql_sanitize_text(real_name)]','[be_random_name]','[gender]','[age]','[sql_sanitize_text(species)]','[sql_sanitize_text(language)]','[r_hair]','[g_hair]','[b_hair]','[r_facial]','[g_facial]','[b_facial]','[s_tone]','[r_skin]','[g_skin]','[b_skin]','[sql_sanitize_text(h_style)]','[sql_sanitize_text(f_style)]','[r_eyes]','[g_eyes]','[b_eyes]','[underwear]','[undershirt]','[backbag]','[b_type]','[alternate_option]','[job_support_high]','[job_support_med]','[job_support_low]','[job_medsci_high]','[job_medsci_med]','[job_medsci_low]','[job_engsec_high]','[job_engsec_med]','[job_engsec_low]','[job_karma_high]','[job_karma_med]','[job_karma_low]','[sql_sanitize_text(flavor_text)]','[sql_sanitize_text(med_record)]','[sql_sanitize_text(sec_record)]','[sql_sanitize_text(gen_record)]','[playertitlelist]','[be_special]','[disabilities]','[organlist]','[rlimb_data]','[nanotrasen_relation]', '[speciesprefs]', '[slime_color]')")
if(!query.Execute())
var/err = query.ErrorMsg()
log_game("SQL ERROR during character slot saving. Error : \[[err]\]\n")
+1 -1
View File
@@ -142,7 +142,7 @@
/datum/recipe/microwave/brainburger
items = list(
/obj/item/weapon/reagent_containers/food/snacks/bun,
/obj/item/brain
/obj/item/organ/brain
)
result = /obj/item/weapon/reagent_containers/food/snacks/brainburger
+1 -1
View File
@@ -382,7 +382,7 @@
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/weapon/reagent_containers/food/snacks/egg,
/obj/item/brain
/obj/item/organ/brain
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/braincake
+2 -2
View File
@@ -26,7 +26,7 @@
finish(mob/living/carbon/human/H)
if(!H.reagents.has_reagent("salbutamol"))
for(var/organ_name in list("chest","l_arm","r_arm","r_leg","l_leg","head","groin"))
var/datum/organ/external/E = H.get_organ(organ_name)
var/obj/item/organ/external/E = H.get_organ(organ_name)
E.take_damage(0, 5, 0)
/datum/genetics/side_effect/bone_snap
@@ -42,7 +42,7 @@
finish(mob/living/carbon/human/H)
if(!H.reagents.has_reagent("styptic_powder"))
var/organ_name = pick("chest","l_arm","r_arm","r_leg","l_leg","head","groin")
var/datum/organ/external/E = H.get_organ(organ_name)
var/obj/item/organ/external/E = H.get_organ(organ_name)
E.take_damage(20, 0, 0)
E.fracture()
+2 -2
View File
@@ -105,7 +105,7 @@
user << "\red The nettle burns your bare hand!"
if(istype(user, /mob/living/carbon/human))
var/organ = ((user.hand ? "l_":"r_") + "arm")
var/datum/organ/external/affecting = user.get_organ(organ)
var/obj/item/organ/external/affecting = user.get_organ(organ)
if(affecting.take_damage(0,force))
user.UpdateDamageIcon()
else
@@ -151,7 +151,7 @@
if(!user.gloves)
if(istype(user, /mob/living/carbon/human))
var/organ = ((user.hand ? "l_":"r_") + "arm")
var/datum/organ/external/affecting = user.get_organ(organ)
var/obj/item/organ/external/affecting = user.get_organ(organ)
if(affecting.take_damage(0,force))
user.UpdateDamageIcon()
else
+1 -1
View File
@@ -157,7 +157,7 @@
H.adjustBruteLoss(damage)
return
var/datum/organ/external/affecting = H.get_organ(pick("l_foot","r_foot","l_leg","r_leg","l_hand","r_hand","l_arm", "r_arm","head","chest","groin"))
var/obj/item/organ/external/affecting = H.get_organ(pick("l_foot","r_foot","l_leg","r_leg","l_hand","r_hand","l_arm", "r_arm","head","chest","groin"))
if(affecting)
affecting.take_damage(damage, 0)
@@ -37,7 +37,7 @@
/mob/living/carbon/alien/New()
verbs += /mob/living/carbon/verb/mob_sleep
verbs += /mob/living/verb/lay_down
internal_organs += new /obj/item/brain/alien
internal_organs += new /obj/item/organ/brain/xeno
..()
+6 -6
View File
@@ -22,7 +22,7 @@
var/obj/mecha = null//This does not appear to be used outside of reference in mecha.dm.
attackby(var/obj/item/O as obj, var/mob/user as mob, params)
if(istype(O,/obj/item/brain) && !brainmob) //Time to stick a brain in it --NEO
if(istype(O,/obj/item/organ/brain) && !brainmob) //Time to stick a brain in it --NEO
if(!O:brainmob)
user << "\red You aren't sure where this brain came from, but you're pretty sure it's a useless brain."
return
@@ -38,7 +38,7 @@
living_mob_list += brainmob
user.drop_item()
if(istype(O,/obj/item/brain/alien))
if(istype(O,/obj/item/organ/brain/xeno))
name = "Man-Machine Interface: Alien - [brainmob.real_name]"
icon = 'icons/mob/alien.dmi'
icon_state = "AlienMMI"
@@ -78,10 +78,10 @@
else
user << "\blue You upend the MMI, spilling the brain onto the floor."
if(alien)
var/obj/item/brain/alien/brain = new(user.loc)
var/obj/item/organ/brain/xeno/brain = new(user.loc)
dropbrain(brain,get_turf(user))
else
var/obj/item/brain/brain = new(user.loc)
var/obj/item/organ/brain/brain = new(user.loc)
dropbrain(brain,get_turf(user))
icon = 'icons/obj/assemblies.dmi'
icon_state = "mmi_empty"
@@ -101,7 +101,7 @@
return
//I made this proc as a way to have a brainmob be transferred to any created brain, and to solve the
//problem i was having with alien/nonalien brain drops.
dropbrain(var/obj/item/brain/brain, var/turf/dropspot)
dropbrain(var/obj/item/organ/brain/brain, var/turf/dropspot)
brainmob.container = null//Reset brainmob mmi var.
brainmob.loc = brain//Throw mob into brain.
respawnable_list += brainmob
@@ -161,4 +161,4 @@
brainmob.emp_damage += rand(10,20)
if(3)
brainmob.emp_damage += rand(0,10)
..()
..()
@@ -1,107 +1,90 @@
/obj/item/brain
/obj/item/organ/brain
name = "brain"
desc = "A piece of juicy meat found in a persons head."
icon = 'icons/obj/surgery.dmi'
health = 400 //They need to live awhile longer than other organs.
icon_state = "brain2"
force = 1.0
w_class = 1.0
w_class = 2.0
throwforce = 1.0
throw_speed = 3
throw_range = 5
origin_tech = "biotech=3"
attack_verb = list("attacked", "slapped", "whacked")
var/mob/living/carbon/brain/brainmob = null
organ_tag = "brain"
parent_organ = "head"
vital = 1
New()
..()
//Shifting the brain "mob" over to the brain object so it's easier to keep track of. --NEO
//WASSSSSUUUPPPP /N
spawn(5)
if(brainmob && brainmob.client)
brainmob.client.screen.len = null //clear the hud
proc
transfer_identity(var/mob/living/carbon/H)
name = "[H]'s brain"
brainmob = new(src)
brainmob.name = H.real_name
brainmob.real_name = H.real_name
brainmob.dna = H.dna.Clone()
brainmob.timeofhostdeath = H.timeofdeath
if(H.mind)
H.mind.transfer_to(brainmob)
respawnable_list += brainmob
brainmob << "\blue You feel slightly disoriented. That's normal when you're just a brain."
callHook("debrain", list(brainmob))
/obj/item/brain/examine() // -- TLE
set src in oview(12)
if (!( usr ))
return
usr << "This is \icon[src] \an [name]."
if(brainmob && brainmob.client)//if thar be a brain inside... the brain.
usr << "You can feel the small spark of life still left in this one."
else
usr << "This one seems particularly lifeless. Perhaps it will regain some of its luster later.."
/obj/item/brain/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
if(!istype(M, /mob))
return
add_fingerprint(user)
if(!(user.zone_sel.selecting == ("head")) || !istype(M, /mob/living/carbon/human))
return ..()
if( !(locate(/obj/machinery/optable, M.loc) && M.resting) && ( !(locate(/obj/structure/table/, M.loc) && M.lying) && prob(50) ) )
return ..()
var/mob/living/carbon/human/H = M
if(istype(M, /mob/living/carbon/human) && ((H.head && H.head.flags & HEADCOVERSEYES) || (H.wear_mask && H.wear_mask.flags & MASKCOVERSEYES) || (H.glasses && H.glasses.flags & GLASSESCOVERSEYES)))
// you can't stab someone in the eyes wearing a mask!
user << "\blue You're going to need to remove their head cover first."
return
//since these people will be dead M != usr
if(M:brain_op_stage == 4.0)
for(var/mob/O in viewers(M, null))
if(O == (user || M))
continue
if(M == user)
O.show_message(text("\red [user] inserts [src] into his head!"), 1)
else
O.show_message(text("\red [M] has [src] inserted into his head by [user]."), 1)
if(M != user)
M << "\red [user] inserts [src] into your head!"
user << "\red You insert [src] into [M]'s head!"
else
user << "\red You insert [src] into your head!"
//this might actually be outdated since barring badminnery, a debrain'd body will have any client sucked out to the brain's internal mob. Leaving it anyway to be safe. --NEO
if(M.key)//Revised. /N
M.ghostize()
if(brainmob.mind)
respawnable_list -= brainmob
brainmob.mind.transfer_to(M)
else
M.key = brainmob.key
M:brain_op_stage = 3.0
del(src)
else
..()
return
/obj/item/brain/alien
name = "alien brain"
desc = "We barely understand the brains of terrestial animals. Who knows what we may find in the brain of such an advanced species?"
/obj/item/organ/brain/xeno
name = "thinkpan"
desc = "It looks kind of like an enormous wad of purple bubblegum."
icon = 'icons/mob/alien.dmi'
icon_state = "AlienBrain"
origin_tech = "biotech=7"
icon_state = "chitin"
/obj/item/organ/brain/New()
..()
spawn(5)
if(brainmob && brainmob.client)
brainmob.client.screen.len = null //clear the hud
/obj/item/organ/brain/proc/transfer_identity(var/mob/living/carbon/H)
name = "\the [H]'s [initial(src.name)]"
brainmob = new(src)
brainmob.name = H.real_name
brainmob.real_name = H.real_name
brainmob.dna = H.dna.Clone()
brainmob.timeofhostdeath = H.timeofdeath
if(H.mind)
H.mind.transfer_to(brainmob)
brainmob << "<span class='notice'>You feel slightly disoriented. That's normal when you're just a [initial(src.name)].</span>"
callHook("debrain", list(brainmob))
/obj/item/organ/brain/examine(mob/user) // -- TLE
..(user)
if(brainmob && brainmob.client)//if thar be a brain inside... the brain.
user << "You can feel the small spark of life still left in this one."
else
user << "This one seems particularly lifeless. Perhaps it will regain some of its luster later.."
/obj/item/organ/brain/removed(var/mob/living/user)
name = "[owner.real_name]'s brain"
var/mob/living/simple_animal/borer/borer = owner.has_brain_worms()
if(borer)
borer.detatch() //Should remove borer if the brain is removed - RR
owner.brain_op_stage = 4.0
var/obj/item/organ/brain/B = src
if(istype(B) && istype(owner))
B.transfer_identity(owner)
..()
/obj/item/organ/brain/replaced(var/mob/living/target)
if(target.key)
target.ghostize()
if(brainmob)
if(brainmob.mind)
brainmob.mind.transfer_to(target)
else
target.key = brainmob.key
..()
/obj/item/organ/brain/slime
name = "slime core"
desc = "A complex, organic knot of jelly and crystalline particles."
robotic = 2
icon = 'icons/mob/slimes.dmi'
icon_state = "green slime extract"
/obj/item/organ/brain/golem
name = "chem"
desc = "A tightly furled roll of paper, covered with indecipherable runes."
robotic = 2
icon = 'icons/obj/wizard.dmi'
icon_state = "scroll"
@@ -36,7 +36,7 @@
if(container && istype(container, /obj/item/device/mmi))
del(container)//Gets rid of the MMI if there is one
if(loc)
if(istype(loc,/obj/item/brain))
if(istype(loc,/obj/item/organ/brain))
del(loc)//Gets rid of the brain item
spawn(15)
if(animation) del(animation)
+11 -11
View File
@@ -35,10 +35,9 @@
var/d = rand(round(I.force / 4), I.force)
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
var/organ = H.get_organ("chest")
if (istype(organ, /datum/organ/external))
var/datum/organ/external/temp = organ
if(temp.take_damage(d, 0))
var/obj/item/organ/external/organ = H.get_organ("chest")
if (istype(organ))
if(organ.take_damage(d, 0))
H.UpdateDamageIcon()
H.updatehealth()
else
@@ -67,12 +66,13 @@
/mob/living/carbon/attack_hand(mob/M as mob)
if(!istype(M, /mob/living/carbon)) return
if (hasorgans(M))
var/datum/organ/external/temp = M:organs_by_name["r_hand"]
if (M.hand)
temp = M:organs_by_name["l_hand"]
if (ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
M << "\red You can't use your [temp.display_name]"
H << "\red You can't use your [temp.name]"
return
return
@@ -166,7 +166,7 @@
"\blue You check yourself for injuries." \
)
for(var/datum/organ/external/org in H.organs)
for(var/obj/item/organ/external/org in H.organs)
var/status = ""
var/brutedamage = org.brute_dam
var/burndamage = org.burn_dam
@@ -197,7 +197,7 @@
status = "weirdly shapen."
if(status == "")
status = "OK"
src.show_message(text("\t []My [] is [].",status=="OK"?"\blue ":"\red ",org.display_name,status),1)
src.show_message(text("\t []My [] is [].",status=="OK"?"\blue ":"\red ",org.name,status),1)
if(staminaloss)
if(staminaloss > 30)
src << "<span class='info'>You're completely exhausted.</span>"
@@ -20,5 +20,4 @@
var/pulse = PULSE_NORM //current pulse level
var/list/internal_organs = list() //List of /obj/item/organ in the mob. they don't go in the contents.
var/heart_attack = 0
@@ -13,13 +13,13 @@
playsound(src.loc, 'sound/effects/gib.ogg', 100, 1, 10)
for(var/datum/organ/external/E in src.organs)
if(istype(E, /datum/organ/external/chest))
for(var/obj/item/organ/external/E in src.organs)
if(istype(E, /obj/item/organ/external/chest))
continue
// Only make the limb drop if it's not too damaged
if(prob(100 - E.get_damage()))
// Override the current limb status and don't cause an explosion
E.droplimb(1,1)
E.droplimb(1,pick(DROPLIMB_EDGE,DROPLIMB_BLUNT))
if(!(species.flags & IS_SYNTHETIC))
flick("gibbed-h", animation)
@@ -91,7 +91,7 @@
if(species) species.handle_death(src)
//Handle brain slugs.
var/datum/organ/external/head = get_organ("head")
var/obj/item/organ/external/head = get_organ("head")
var/mob/living/simple_animal/borer/B
if(istype(head))
+31 -24
View File
@@ -198,9 +198,9 @@
//splints
for(var/organ in list("l_leg","r_leg","l_arm","r_arm"))
var/datum/organ/external/o = get_organ(organ)
var/obj/item/organ/external/o = get_organ(organ)
if(o && o.status & ORGAN_SPLINTED)
msg += "<span class='warning'>[t_He] [t_has] a splint on his [o.display_name]!</span>\n"
msg += "<span class='warning'>[t_He] [t_has] a splint on his [o.name]!</span>\n"
if(suiciding)
msg += "<span class='warning'>[t_He] appears to have commited suicide... there is no hope of recovery.</span>\n"
@@ -253,33 +253,43 @@
var/list/wound_flavor_text = list()
var/list/is_destroyed = list()
var/list/is_bleeding = list()
for(var/datum/organ/external/temp in organs)
for(var/organ_tag in species.has_limbs)
var/list/organ_data = species.has_limbs[organ_tag]
var/organ_descriptor = organ_data["descriptor"]
is_destroyed["[organ_data["descriptor"]]"] = 1
var/obj/item/organ/external/E = organs_by_name[organ_tag]
if(!E)
wound_flavor_text["[organ_descriptor]"] = "<span class='warning'><b>[t_He] is missing [t_his] [organ_descriptor].</b></span>\n"
else if(E.is_stump())
wound_flavor_text["[organ_descriptor]"] = "<span class='warning'><b>[t_He] has a stump where [t_his] [organ_descriptor] should be.</b></span>\n"
else
continue
for(var/obj/item/organ/external/temp in organs)
if(temp)
if(temp.status & ORGAN_DESTROYED)
is_destroyed["[temp.display_name]"] = 1
wound_flavor_text["[temp.display_name]"] = "<span class='warning'><b>[t_He] is missing [t_his] [temp.display_name].</b></span>\n"
continue
if(temp.status & ORGAN_ROBOT)
if(!(temp.brute_dam + temp.burn_dam))
if(!species.flags & IS_SYNTHETIC)
wound_flavor_text["[temp.display_name]"] = "<span class='warning'>[t_He] has a robot [temp.display_name]!</span>\n"
wound_flavor_text["[temp.name]"] = "<span class='warning'>[t_He] has a robot [temp.name]!</span>\n"
continue
else
wound_flavor_text["[temp.display_name]"] = "<span class='warning'>[t_He] has a robot [temp.display_name]. It has"
wound_flavor_text["[temp.name]"] = "<span class='warning'>[t_He] has a robot [temp.name]. It has"
if(temp.brute_dam) switch(temp.brute_dam)
if(0 to 20)
wound_flavor_text["[temp.display_name]"] += " some dents"
wound_flavor_text["[temp.name]"] += " some dents"
if(21 to INFINITY)
wound_flavor_text["[temp.display_name]"] += pick(" a lot of dents"," severe denting")
wound_flavor_text["[temp.name]"] += pick(" a lot of dents"," severe denting")
if(temp.brute_dam && temp.burn_dam)
wound_flavor_text["[temp.display_name]"] += " and"
wound_flavor_text["[temp.name]"] += " and"
if(temp.burn_dam) switch(temp.burn_dam)
if(0 to 20)
wound_flavor_text["[temp.display_name]"] += " some burns"
wound_flavor_text["[temp.name]"] += " some burns"
if(21 to INFINITY)
wound_flavor_text["[temp.display_name]"] += pick(" a lot of burns"," severe melting")
if(wound_flavor_text["[temp.display_name]"])
wound_flavor_text["[temp.display_name]"] += "!</span>\n"
wound_flavor_text["[temp.name]"] += pick(" a lot of burns"," severe melting")
if(wound_flavor_text["[temp.name]"])
wound_flavor_text["[temp.name]"] += "!</span>\n"
else if(temp.wounds.len > 0)
var/list/wound_descriptors = list()
for(var/datum/wound/W in temp.wounds)
@@ -327,14 +337,14 @@
else if(flavor_text.len > 1 && text > 1)
flavor_text_string += ","
flavor_text_string += flavor_text[text]
flavor_text_string += " on [t_his] [temp.display_name].</span><br>"
wound_flavor_text["[temp.display_name]"] = flavor_text_string
flavor_text_string += " on [t_his] [temp.name].</span><br>"
wound_flavor_text["[temp.name]"] = flavor_text_string
else
wound_flavor_text["[temp.display_name]"] = ""
wound_flavor_text["[temp.name]"] = ""
if(temp.status & ORGAN_BLEEDING)
is_bleeding["[temp.display_name]"] = 1
is_bleeding["[temp.name]"] = 1
else
wound_flavor_text["[temp.display_name]"] = ""
wound_flavor_text["[temp.name]"] = ""
//Handles the text strings being added to the actual description.
//If they have something that covers the limb, and it is not missing, put flavortext. If it is covered but bleeding, add other flavortext.
@@ -392,9 +402,6 @@
if(display_gloves)
msg += "<span class='warning'><b>[src] has blood running from under [t_his] gloves!</b></span>\n"
var/datum/organ/external/head/H = get_organ("head")
if(H && H.brained)
msg += "<span class='warning'><b>[src]'s skull is crushed and the brain is exposed to the air!</b></span>\n"
for(var/implant in get_visible_implants(0))
msg += "<span class='warning'><b>[src] has \a [implant] sticking out of [t_his] flesh!</span>\n"
+50 -75
View File
@@ -12,10 +12,13 @@
/mob/living/carbon/human/New(var/new_loc, var/new_species = null, var/delay_ready_dna=0)
if(!species)
if(new_species)
set_species(new_species,null,1)
set_species(new_species,1)
else
set_species()
if(species)
name = species.get_random_name(gender)
var/datum/reagents/R = new/datum/reagents(330)
reagents = R
R.my_atom = src
@@ -228,12 +231,12 @@
throw_at(target, 200, 4)
var/limbs_affected = pick(2,3,4)
var/datum/organ/external/processing_dismember
var/obj/item/organ/external/processing_dismember
while(limbs_affected != 0)
processing_dismember = pick(organs)
if(processing_dismember.name != "chest" && processing_dismember.name != "head")
processing_dismember.droplimb(1,0,1,pick(0,1,2))
if(processing_dismember.name != "chest" && processing_dismember.name != "head" && processing_dismember.name != "groin")
processing_dismember.droplimb(1,pick(0,1,2),0,1)
limbs_affected -= 1
@@ -251,23 +254,23 @@
b_loss = b_loss/1.5
f_loss = f_loss/1.5
var/limbs_affected = pick(0, 1, 2)
var/datum/organ/external/processing_dismember
var/limbs_affected = pick(1, 1, 2)
var/obj/item/organ/external/processing_dismember
while(limbs_affected != 0)
processing_dismember = pick(organs)
if(processing_dismember.name != "chest" && processing_dismember.name != "head")
processing_dismember.droplimb(1,0,1,pick(0,2))
if(processing_dismember.name != "chest" && processing_dismember.name != "head" && processing_dismember.name != "groin")
processing_dismember.droplimb(1,pick(0,2),0,1)
limbs_affected -= 1
else
var/limbs_affected = pick(1, 2, 3)
var/datum/organ/external/processing_dismember
var/obj/item/organ/external/processing_dismember
while(limbs_affected != 0)
processing_dismember = pick(organs)
if(processing_dismember.name != "chest" && processing_dismember.name != "head")
processing_dismember.droplimb(1,0,1,pick(0,2))
if(processing_dismember.name != "chest" && processing_dismember.name != "head" && processing_dismember.name != "groin")
processing_dismember.droplimb(1,pick(0,2),0,1)
limbs_affected -= 1
if (!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
@@ -284,12 +287,12 @@
else
var/limbs_affected = pick(0, 1)
var/datum/organ/external/processing_dismember
var/obj/item/organ/external/processing_dismember
while(limbs_affected != 0)
processing_dismember = pick(organs)
if(processing_dismember.name != "chest" && processing_dismember.name != "head")
processing_dismember.droplimb(1,0,1)
if(processing_dismember.name != "chest" && processing_dismember.name != "head" && processing_dismember.name != "groin")
processing_dismember.droplimb(1,1,0,1)
limbs_affected -= 1
if (!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
@@ -300,7 +303,7 @@
var/update = 0
var/weapon_message = "Explosive Blast"
for(var/datum/organ/external/temp in organs)
for(var/obj/item/organ/external/temp in organs)
switch(temp.name)
if("head")
update |= temp.take_damage(b_loss * 0.2, f_loss * 0.2, used_weapon = weapon_message)
@@ -332,7 +335,7 @@
if(stat == 2) return
show_message("\red The blob attacks you!")
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
apply_damage(rand(20,30), BRUTE, affecting, run_armor_check(affecting, "melee"))
return
@@ -341,7 +344,7 @@
if ((M.client && !( M.blinded )))
M.show_message("\red [src] has been hit by [O]", 1)
if (health > 0)
var/datum/organ/external/affecting = get_organ(pick("chest", "chest", "chest", "head"))
var/obj/item/organ/external/affecting = get_organ(pick("chest", "chest", "chest", "head"))
if(!affecting) return
if (istype(O, /obj/effect/immovablerod))
if(affecting.take_damage(101, 0))
@@ -365,10 +368,10 @@
src.attack_log += text("\[[time_stamp()]\] <font color='orange'>was attacked by [M.name] ([M.ckey])</font>")
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
var/armor = run_armor_check(affecting, "melee")
var/datum/organ/external/affected = src.get_organ(dam_zone)
var/obj/item/organ/external/affected = src.get_organ(dam_zone)
affected.add_autopsy_data(M.name, damage) // Add the mob's name to the autopsy data
apply_damage(damage, BRUTE, affecting, armor, M.name)
if(armor >= 2) return
@@ -389,14 +392,14 @@
if(stat != DEAD)
L.amount_grown = min(L.amount_grown + damage, L.max_grown)
var/datum/organ/external/affecting = get_organ(ran_zone(L.zone_sel.selecting))
var/obj/item/organ/external/affecting = get_organ(ran_zone(L.zone_sel.selecting))
var/armor_block = run_armor_check(affecting, "melee")
apply_damage(damage, BRUTE, affecting, armor_block)
/mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M)
for(var/L in M.contents)
if(istype(L, /obj/item/weapon/implant/loyalty))
for(var/datum/organ/external/O in M.organs)
for(var/obj/item/organ/external/O in M.organs)
if(L in O.implants)
return 1
return 0
@@ -420,7 +423,7 @@
var/dam_zone = pick("head", "chest", "l_arm", "r_arm", "l_leg", "r_leg", "groin")
var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
var/armor_block = run_armor_check(affecting, "melee")
apply_damage(damage, BRUTE, affecting, armor_block)
@@ -597,7 +600,7 @@
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
/mob/living/carbon/human/proc/get_face_name()
var/datum/organ/external/head/head = get_organ("head")
var/obj/item/organ/external/head = get_organ("head")
if( !head || head.disfigured || (head.status & ORGAN_DESTROYED) || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible
return "Unknown"
return real_name
@@ -632,7 +635,7 @@
if (!def_zone)
def_zone = pick("l_hand", "r_hand")
var/datum/organ/external/affected_organ = get_organ(check_zone(def_zone))
var/obj/item/organ/external/affected_organ = get_organ(check_zone(def_zone))
var/siemens_coeff = base_siemens_coeff * get_siemens_coefficient_organ(affected_organ)
return ..(shock_damage, source, siemens_coeff, def_zone)
@@ -1151,35 +1154,24 @@
germ_level += n
/mob/living/carbon/human/revive()
for (var/datum/organ/external/O in organs)
O.status &= ~ORGAN_BROKEN
O.status &= ~ORGAN_BLEEDING
O.status &= ~ORGAN_SPLINTED
O.status &= ~ORGAN_CUT_AWAY
O.status &= ~ORGAN_ATTACHABLE
if (!O.amputated)
O.status &= ~ORGAN_DESTROYED
O.destspawn = 0
O.wounds.Cut()
O.heal_damage(1000,1000,1,1)
var/datum/organ/external/head/h = organs_by_name["head"]
h.disfigured = 0
if(species && !(species.flags & NO_BLOOD))
vessel.add_reagent("blood",560-vessel.total_volume)
fixblood()
for (var/obj/item/weapon/organ/head/H in world)
if(H.brainmob)
if(H.brainmob.real_name == src.real_name)
if(H.brainmob.mind)
H.brainmob.mind.transfer_to(src)
del(H)
// Fix up all organs.
// This will ignore any prosthetics in the prefs currently.
species.create_organs(src)
if(!client || !key) //Don't boot out anyone already in the mob.
for (var/obj/item/organ/brain/H in world)
if(H.brainmob)
if(H.brainmob.real_name == src.real_name)
if(H.brainmob.mind)
H.brainmob.mind.transfer_to(src)
del(H)
for(var/name in internal_organs_by_name)
var/datum/organ/internal/I = internal_organs_by_name[name]
I.damage = 0
for (var/ID in virus2)
var/datum/disease2/disease/V = virus2[ID]
@@ -1188,14 +1180,14 @@
..()
/mob/living/carbon/human/proc/is_lung_ruptured()
var/datum/organ/internal/lungs/L = internal_organs_by_name["lungs"]
var/obj/item/organ/lungs/L = internal_organs_by_name["lungs"]
if(!L)
return 0
return L.is_bruised()
/mob/living/carbon/human/proc/rupture_lung()
var/datum/organ/internal/lungs/L = internal_organs_by_name["lungs"]
var/obj/item/organ/lungs/L = internal_organs_by_name["lungs"]
if(!L)
return 0
@@ -1258,7 +1250,7 @@
/mob/living/carbon/human/get_visible_implants(var/class = 0)
var/list/visible_implants = list()
for(var/datum/organ/external/organ in src.organs)
for(var/obj/item/organ/external/organ in src.organs)
for(var/obj/item/weapon/O in organ.implants)
if(!istype(O,/obj/item/weapon/implant) && (O.w_class > class) && !istype(O,/obj/item/weapon/shard/shrapnel))
visible_implants += O
@@ -1272,7 +1264,7 @@
/mob/living/carbon/human/proc/handle_embedded_objects()
for(var/datum/organ/external/organ in src.organs)
for(var/obj/item/organ/external/organ in src.organs)
if(organ.status & ORGAN_SPLINTED) //Splints prevent movement.
continue
for(var/obj/item/weapon/O in organ.implants)
@@ -1281,11 +1273,11 @@
var/msg = null
switch(rand(1,3))
if(1)
msg ="<span class='warning'>A spike of pain jolts your [organ.display_name] as you bump [O] inside.</span>"
msg ="<span class='warning'>A spike of pain jolts your [organ.name] as you bump [O] inside.</span>"
if(2)
msg ="<span class='warning'>Your movement jostles [O] in your [organ.display_name] painfully.</span>"
msg ="<span class='warning'>Your movement jostles [O] in your [organ.name] painfully.</span>"
if(3)
msg ="<span class='warning'>[O] in your [organ.display_name] twists painfully as you move.</span>"
msg ="<span class='warning'>[O] in your [organ.name] twists painfully as you move.</span>"
src << msg
organ.take_damage(rand(1,3), 0, 0)
@@ -1325,7 +1317,7 @@
else
usr << "\blue [self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]."
/mob/living/carbon/human/proc/set_species(var/new_species, var/force_organs, var/default_colour)
/mob/living/carbon/human/proc/set_species(var/new_species, var/default_colour)
var/datum/species/oldspecies = species
if(!dna)
@@ -1353,9 +1345,6 @@
if(oldspecies.default_genes.len)
oldspecies.handle_dna(src,1) // Remove any genes that belong to the old species
if(force_organs || !organs || !organs.len)
species.create_organs(src)
if(vessel)
vessel = null
make_blood()
@@ -1372,9 +1361,6 @@
else
see_invisible = SEE_INVISIBLE_LIVING
spawn(0)
update_icons()
if(species.base_color && default_colour)
//Apply colour.
r_skin = hex2num(copytext(species.base_color,2,4))
@@ -1385,6 +1371,8 @@
g_skin = 0
b_skin = 0
species.create_organs(src)
if(!dna)
dna = new /datum/dna(null)
dna.species = species.name
@@ -1396,6 +1384,7 @@
spawn(0)
overlays.Cut()
update_mutantrace(1)
regenerate_icons()
fixblood()
if(species)
@@ -1453,20 +1442,6 @@
W.add_fingerprint(src)
/mob/living/carbon/human/proc/expose_brain()
var/datum/organ/external/head/H = get_organ("head")
if(H)
H.brained=1
h_style = "Bald"
update_hair()
update_body()
/mob/living/carbon/human/proc/unexpose_brain()
var/datum/organ/external/head/H = get_organ("head")
if(H)
H.brained=0
update_hair()
update_body()
/mob/living/carbon/human/canSingulothPull(var/obj/machinery/singularity/singulo)
@@ -31,7 +31,7 @@
playsound(loc, 'sound/weapons/slashmiss.ogg', 50, 1, -1)
visible_message("\red <B>[M] has lunged at [src]!</B>")
return 0
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/armor_block = run_armor_check(affecting, "melee")
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
@@ -7,12 +7,14 @@
M << "\red Do not touch Admin-Frozen people."
return
var/datum/organ/external/temp = M:organs_by_name["r_hand"]
if (M.hand)
temp = M:organs_by_name["l_hand"]
if(temp && !temp.is_usable())
M << "\red You can't use your [temp.display_name]."
return
var/mob/living/carbon/human/H = M
if(istype(H))
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(!temp || !temp.is_usable())
H << "\red You can't use your hand."
return
..()
@@ -29,7 +31,7 @@
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("\red <B>[M] has attempted to punch [src]!</B>")
return 0
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/armor_block = run_armor_check(affecting, "melee")
if(HULK in M.mutations)
@@ -138,7 +140,7 @@
return 0
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/armor_block = run_armor_check(affecting, "melee")
if(HULK in M.mutations)
@@ -165,7 +167,7 @@
if(w_uniform)
w_uniform.add_fingerprint(M)
var/datum/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/randn = rand(1, 100)
if (randn <= 25)
apply_effect(2, WEAKEN, run_armor_check(affecting, "melee"))
@@ -13,6 +13,6 @@
var/damage = rand(1, 3)
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/datum/organ/external/affecting = get_organ(ran_zone(dam_zone))
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
apply_damage(damage, BRUTE, affecting, run_armor_check(affecting, "melee"))
return
@@ -6,7 +6,7 @@
return
var/total_burn = 0
var/total_brute = 0
for(var/datum/organ/external/O in organs) //hardcoded to streamline things a bit
for(var/obj/item/organ/external/O in organs) //hardcoded to streamline things a bit
total_brute += O.brute_dam
total_burn += O.burn_dam
health = 100 - getOxyLoss() - getToxLoss() - getCloneLoss() - total_burn - total_brute
@@ -14,9 +14,9 @@
if( (((100 - total_burn) < config.health_threshold_dead) && stat == DEAD) && (!species.flags & IS_SYNTHETIC))//100 only being used as the magic human max health number, feel free to change it if you add a var for it -- Urist
ChangeToHusk()
if (species.flags & IS_SYNTHETIC)
var/datum/organ/external/H = organs_by_name["head"]
if (!H.amputated)
if ((health >= (config.health_threshold_dead/100*75)) && stat == DEAD) //need to get them 25% away from death point before reviving synthetics
var/obj/item/organ/external/head/H = organs_by_name["head"]
if(H)
if((health >= (config.health_threshold_dead/100*75)) && stat == DEAD) //need to get them 25% away from death point before reviving synthetics
update_revive()
if (stat == CONSCIOUS && (src in dead_mob_list)) //Defib fix
update_revive()
@@ -35,7 +35,7 @@
if(species && species.flags & NO_INTORGANS)
return
var/res = brainloss
var/datum/organ/internal/brain/sponge = internal_organs_by_name["brain"]
var/obj/item/organ/brain/sponge = internal_organs_by_name["brain"]
if(!sponge)
return
if (sponge.is_bruised())
@@ -48,13 +48,13 @@
//These procs fetch a cumulative total damage from all organs
/mob/living/carbon/human/getBruteLoss()
var/amount = 0
for(var/datum/organ/external/O in organs)
for(var/obj/item/organ/external/O in organs)
amount += O.brute_dam
return amount
/mob/living/carbon/human/getFireLoss()
var/amount = 0
for(var/datum/organ/external/O in organs)
for(var/obj/item/organ/external/O in organs)
amount += O.burn_dam
return amount
@@ -82,7 +82,7 @@
amount = amount*species.brute_mod
if (organ_name in organs_by_name)
var/datum/organ/external/O = get_organ(organ_name)
var/obj/item/organ/external/O = get_organ(organ_name)
if(amount > 0)
O.take_damage(amount, 0, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
@@ -97,7 +97,7 @@
amount = amount*species.burn_mod
if (organ_name in organs_by_name)
var/datum/organ/external/O = get_organ(organ_name)
var/obj/item/organ/external/O = get_organ(organ_name)
if(amount > 0)
O.take_damage(0, amount, sharp=is_sharp(damage_source), edge=has_edge(damage_source), used_weapon=damage_source)
@@ -128,46 +128,46 @@
var/mut_prob = min(80, getCloneLoss()+10)
if (amount > 0)
if (prob(mut_prob))
var/list/datum/organ/external/candidates = list()
for (var/datum/organ/external/O in organs)
var/list/obj/item/organ/external/candidates = list()
for (var/obj/item/organ/external/O in organs)
if(O.status & ORGAN_ROBOT) continue
if(!(O.status & ORGAN_MUTATED))
candidates |= O
if (candidates.len)
var/datum/organ/external/O = pick(candidates)
var/obj/item/organ/external/O = pick(candidates)
O.mutate()
src << "<span class = 'notice'>Something is not right with your [O.display_name]...</span>"
src << "<span class = 'notice'>Something is not right with your [O.name]...</span>"
O.add_autopsy_data("Mutation", amount)
return
else
if (prob(heal_prob))
for (var/datum/organ/external/O in organs)
for (var/obj/item/organ/external/O in organs)
if (O.status & ORGAN_MUTATED)
O.unmutate()
src << "<span class = 'notice'>Your [O.display_name] is shaped normally again.</span>"
src << "<span class = 'notice'>Your [O.name] is shaped normally again.</span>"
return
if (getCloneLoss() < 1)
for (var/datum/organ/external/O in organs)
for (var/obj/item/organ/external/O in organs)
if (O.status & ORGAN_MUTATED)
O.unmutate()
src << "<span class = 'notice'>Your [O.display_name] is shaped normally again.</span>"
src << "<span class = 'notice'>Your [O.name] is shaped normally again.</span>"
hud_updateflag |= 1 << HEALTH_HUD
////////////////////////////////////////////
//Returns a list of damaged organs
/mob/living/carbon/human/proc/get_damaged_organs(var/brute, var/burn)
var/list/datum/organ/external/parts = list()
for(var/datum/organ/external/O in organs)
var/list/obj/item/organ/external/parts = list()
for(var/obj/item/organ/external/O in organs)
if((brute && O.brute_dam) || (burn && O.burn_dam))
parts += O
return parts
//Returns a list of damageable organs
/mob/living/carbon/human/proc/get_damageable_organs()
var/list/datum/organ/external/parts = list()
for(var/datum/organ/external/O in organs)
var/list/obj/item/organ/external/parts = list()
for(var/obj/item/organ/external/O in organs)
if(O.brute_dam + O.burn_dam < O.max_damage)
parts += O
return parts
@@ -176,9 +176,9 @@
//It automatically updates damage overlays if necesary
//It automatically updates health status
/mob/living/carbon/human/heal_organ_damage(var/brute, var/burn)
var/list/datum/organ/external/parts = get_damaged_organs(brute,burn)
var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn)
if(!parts.len) return
var/datum/organ/external/picked = pick(parts)
var/obj/item/organ/external/picked = pick(parts)
if(picked.heal_damage(brute,burn))
UpdateDamageIcon()
hud_updateflag |= 1 << HEALTH_HUD
@@ -188,9 +188,9 @@
//It automatically updates damage overlays if necesary
//It automatically updates health status
/mob/living/carbon/human/take_organ_damage(var/brute, var/burn, var/sharp = 0, var/edge = 0)
var/list/datum/organ/external/parts = get_damageable_organs()
var/list/obj/item/organ/external/parts = get_damageable_organs()
if(!parts.len) return
var/datum/organ/external/picked = pick(parts)
var/obj/item/organ/external/picked = pick(parts)
if(picked.take_damage(brute,burn,sharp,edge))
UpdateDamageIcon()
hud_updateflag |= 1 << HEALTH_HUD
@@ -200,11 +200,11 @@
//Heal MANY external organs, in random order
/mob/living/carbon/human/heal_overall_damage(var/brute, var/burn)
var/list/datum/organ/external/parts = get_damaged_organs(brute,burn)
var/list/obj/item/organ/external/parts = get_damaged_organs(brute,burn)
var/update = 0
while(parts.len && (brute>0 || burn>0) )
var/datum/organ/external/picked = pick(parts)
var/obj/item/organ/external/picked = pick(parts)
var/brute_was = picked.brute_dam
var/burn_was = picked.burn_dam
@@ -223,10 +223,10 @@
// damage MANY external organs, in random order
/mob/living/carbon/human/take_overall_damage(var/brute, var/burn, var/sharp = 0, var/edge = 0, var/used_weapon = null)
if(status_flags & GODMODE) return //godmode
var/list/datum/organ/external/parts = get_damageable_organs()
var/list/obj/item/organ/external/parts = get_damageable_organs()
var/update = 0
while(parts.len && (brute>0 || burn>0) )
var/datum/organ/external/picked = pick(parts)
var/obj/item/organ/external/picked = pick(parts)
var/brute_was = picked.brute_dam
var/burn_was = picked.burn_dam
@@ -255,12 +255,12 @@ This function restores the subjects blood to max.
This function restores all organs.
*/
/mob/living/carbon/human/restore_all_organs()
for(var/datum/organ/external/current_organ in organs)
for(var/obj/item/organ/external/current_organ in organs)
current_organ.rejuvenate()
/mob/living/carbon/human/proc/HealDamage(zone, brute, burn)
var/datum/organ/external/E = get_organ(zone)
if(istype(E, /datum/organ/external))
var/obj/item/organ/external/E = get_organ(zone)
if(istype(E, /obj/item/organ/external))
if (E.heal_damage(brute, burn))
UpdateDamageIcon()
hud_updateflag |= 1 << HEALTH_HUD
@@ -295,7 +295,7 @@ This function restores all organs.
blocked = (100-blocked)/100
if(blocked <= 0) return 0
var/datum/organ/external/organ = null
var/obj/item/organ/external/organ = null
if(isorgan(def_zone))
organ = def_zone
else
@@ -38,7 +38,9 @@ emp_act
//Shrapnel
if (P.damage_type == BRUTE)
var/datum/organ/external/organ = get_organ(check_zone(def_zone))
var/obj/item/organ/external/organ = get_organ(check_zone(def_zone))
if(!organ)
return
var/armor = getarmor_organ(organ, "bullet")
if((P.embed && prob(20 + max(P.damage - armor, -10))))
var/obj/item/weapon/shard/shrapnel/SP = new()
@@ -48,13 +50,13 @@ emp_act
organ.embed(SP)
var/mob/living/carbon/human/M = src
var/datum/organ/external/affected = M.get_organ(def_zone)
var/obj/item/organ/external/affected = M.get_organ(def_zone)
affected.add_autopsy_data(P.name, P.damage) // Add the bullet's name to the autopsy data
return (..(P , def_zone))
/mob/living/carbon/human/stun_effect_act(var/stun_amount, var/agony_amount, var/def_zone, var/used_weapon = null)
var/datum/organ/external/affected = get_organ(check_zone(def_zone))
var/obj/item/organ/external/affected = get_organ(check_zone(def_zone))
var/siemens_coeff = get_siemens_coefficient_organ(affected)
stun_amount *= siemens_coeff
agony_amount *= siemens_coeff
@@ -74,10 +76,10 @@ emp_act
unEquip(c_hand)
if (affected.status & ORGAN_ROBOT)
emote("me", 1, "drops what they were holding, their [affected.display_name] malfunctioning!")
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")
emote("me", 1, "[(species && species.flags & NO_PAIN) ? "" : emote_scream ] drops what they were holding in their [affected.display_name]!")
emote("me", 1, "[(species && species.flags & NO_PAIN) ? "" : emote_scream ] drops what they were holding in their [affected.name]!")
if(used_weapon)
var/obj/item/W = used_weapon
@@ -92,20 +94,21 @@ emp_act
if(def_zone)
if(isorgan(def_zone))
return getarmor_organ(def_zone, type)
var/datum/organ/external/affecting = get_organ(def_zone)
return getarmor_organ(affecting, type)
var/obj/item/organ/external/affecting = get_organ(def_zone)
if(affecting)
return getarmor_organ(affecting, type)
//If a specific bodypart is targetted, check how that bodypart is protected and return the value.
//If you don't specify a bodypart, it checks ALL your bodyparts for protection, and averages out the values
for(var/datum/organ/external/organ in organs)
for(var/obj/item/organ/external/organ in organs)
armorval += getarmor_organ(organ, type)
organnum++
return (armorval/max(organnum, 1))
//this proc returns the armour value for a particular external organ.
/mob/living/carbon/human/proc/getarmor_organ(var/datum/organ/external/def_zone, var/type)
if(!type) return 0
/mob/living/carbon/human/proc/getarmor_organ(var/obj/item/organ/external/def_zone, var/type)
if(!type || !def_zone) return 0
var/protection = 0
var/list/body_parts = list(head, wear_mask, wear_suit, w_uniform)
for(var/bp in body_parts)
@@ -117,7 +120,7 @@ emp_act
return protection
//this proc returns the Siemens coefficient of electrical resistivity for a particular external organ.
/mob/living/carbon/human/proc/get_siemens_coefficient_organ(var/datum/organ/external/def_zone)
/mob/living/carbon/human/proc/get_siemens_coefficient_organ(var/obj/item/organ/external/def_zone)
if (!def_zone)
return 1.0
@@ -191,21 +194,23 @@ emp_act
for(var/obj/O in src)
if(!O) continue
O.emp_act(severity)
for(var/datum/organ/external/O in organs)
for(var/obj/item/organ/external/O in organs)
if(O.status & ORGAN_DESTROYED) continue
O.emp_act(severity)
for(var/datum/organ/internal/I in O.internal_organs)
for(var/obj/item/organ/I in O.internal_organs)
I.emp_act(severity)
..()
/mob/living/carbon/human/emag_act(user as mob, var/datum/organ/external/affecting)
/mob/living/carbon/human/emag_act(user as mob, var/obj/item/organ/external/affecting)
if(!istype(affecting))
return
if(!(affecting.status & ORGAN_ROBOT))
user << "\red That limb isn't robotic."
return
if(affecting.sabotaged)
user << "\red [src]'s [affecting.display_name] is already sabotaged!"
user << "\red [src]'s [affecting.name] is already sabotaged!"
else
user << "\red You sneakily slide the card into the dataport on [src]'s [affecting.display_name] and short out the safeties."
user << "\red You sneakily slide the card into the dataport on [src]'s [affecting.name] and short out the safeties."
affecting.sabotaged = 1
return 1
@@ -234,13 +239,11 @@ emp_act
del(src)
var/datum/organ/external/affecting = get_organ(ran_zone(user.zone_sel.selecting))
if (!affecting)
return 0
if(affecting.status & ORGAN_DESTROYED)
user << "What [affecting.display_name]?"
return 0
var/hit_area = affecting.display_name
var/obj/item/organ/external/affecting = get_organ(ran_zone(user.zone_sel.selecting))
if(!affecting || affecting.is_stump() || (affecting.status & ORGAN_DESTROYED))
user << "<span class='danger'>They are missing that limb!</span>"
return 1
var/hit_area = affecting.name
if(user != src)
user.do_attack_animation(src)
@@ -285,35 +288,36 @@ emp_act
H.bloody_body(src)
H.bloody_hands(src)
switch(hit_area)
if("head")//Harder to score a stun but if you do it lasts a bit longer
if(stat == CONSCIOUS && prob(I.force) && armor < 50)
visible_message("<span class='danger'>[src] has been knocked down!</span>", \
"<span class='userdanger'>[src] has been knocked down!</span>")
apply_effect(5, WEAKEN, armor)
confused += 15
if(src != user && I.damtype == BRUTE)
ticker.mode.remove_revolutionary(mind)
if(!stat)
switch(hit_area)
if("head")//Harder to score a stun but if you do it lasts a bit longer
if(stat == CONSCIOUS && prob(I.force) && armor < 50)
visible_message("<span class='danger'>[src] has been knocked down!</span>", \
"<span class='userdanger'>[src] has been knocked down!</span>")
apply_effect(5, WEAKEN, armor)
confused += 15
if(src != user && I.damtype == BRUTE)
ticker.mode.remove_revolutionary(mind)
if(bloody)//Apply blood
if(wear_mask)
wear_mask.add_blood(src)
update_inv_wear_mask(0)
if(head)
head.add_blood(src)
update_inv_head(0,0)
if(glasses && prob(33))
glasses.add_blood(src)
update_inv_glasses(0)
if(bloody)//Apply blood
if(wear_mask)
wear_mask.add_blood(src)
update_inv_wear_mask(0)
if(head)
head.add_blood(src)
update_inv_head(0,0)
if(glasses && prob(33))
glasses.add_blood(src)
update_inv_glasses(0)
if("chest")//Easier to score a stun but lasts less time
if(stat == CONSCIOUS && I.force && prob(I.force + 10))
visible_message("<span class='danger'>[src] has been knocked down!</span>", \
"<span class='userdanger'>[src] has been knocked down!</span>")
apply_effect(5, WEAKEN, armor)
if("chest")//Easier to score a stun but lasts less time
if(stat == CONSCIOUS && I.force && prob(I.force + 10))
visible_message("<span class='danger'>[src] has been knocked down!</span>", \
"<span class='userdanger'>[src] has been knocked down!</span>")
apply_effect(5, WEAKEN, armor)
if(bloody)
bloody_body(src)
if(bloody)
bloody_body(src)
if(Iforce > 10 || Iforce >= 5 && prob(33))
@@ -364,8 +368,8 @@ emp_act
if ((O.thrower != src) && check_shields(throw_damage, "[O]"))
return
var/datum/organ/external/affecting = get_organ(zone)
var/hit_area = affecting.display_name
var/obj/item/organ/external/affecting = get_organ(zone)
var/hit_area = affecting.name
src.visible_message("\red [src] has been hit in the [hit_area] by [O].")
var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].") //I guess "melee" is the best fit here
@@ -457,7 +461,7 @@ emp_act
if(M.occupant.a_intent == "harm")
if(M.damtype == "brute")
step_away(src,M,15)
var/datum/organ/external/affecting = get_organ(pick("chest", "chest", "chest", "head"))
var/obj/item/organ/external/affecting = get_organ(pick("chest", "chest", "chest", "head"))
if(affecting)
var/update = 0
switch(M.damtype)
@@ -32,21 +32,23 @@
if(shoes)
tally += shoes.slowdown
/*
for(var/organ_name in list("l_foot","r_foot","l_leg","r_leg"))
var/datum/organ/external/E = get_organ(organ_name)
var/obj/item/organ/external/E = get_organ(organ_name)
if(!E || (E.status & ORGAN_DESTROYED))
tally += 4
if(E.status & ORGAN_SPLINTED)
else if(E.status & ORGAN_SPLINTED)
tally += 0.5
else if(E.status & ORGAN_BROKEN)
tally += 1.5
*/
if(buckled && istype(buckled, /obj/structure/stool/bed/chair/wheelchair))
for(var/organ_name in list("l_hand","r_hand","l_arm","r_arm"))
var/datum/organ/external/E = get_organ(organ_name)
var/obj/item/organ/external/E = get_organ(organ_name)
if(!E || (E.status & ORGAN_DESTROYED))
tally += 4
if(E.status & ORGAN_SPLINTED)
else if(E.status & ORGAN_SPLINTED)
tally += 0.5
else if(E.status & ORGAN_BROKEN)
tally += 1.5
@@ -62,6 +64,8 @@
if (bodytemperature < 283.222)
tally += (283.222 - bodytemperature) / 10 * 1.75
tally += 2*stance_damage //damaged/missing feet or legs is slow
if(RUN in mutations)
tally = 0
if(status_flags & IGNORESLOWDOWN) // make sure this is always at the end so we don't have ignore slowdown getting ignored itself
@@ -0,0 +1,142 @@
/mob/living/carbon/human/proc/update_eyes()
var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"]
if(eyes)
eyes.update_colour()
regenerate_icons()
/mob/living/carbon/var/list/internal_organs = list()
/mob/living/carbon/human/var/list/organs = list()
/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
// 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
if(force_process)
bad_external_organs.Cut()
for(var/obj/item/organ/external/Ex in organs)
bad_external_organs |= Ex
//processing internal organs is pretty cheap, do that first.
for(var/obj/item/organ/I in internal_organs)
I.process()
//handle_stance()
handle_grasp()
handle_stance()
if(!force_process && !bad_external_organs.len)
return
for(var/obj/item/organ/external/E in bad_external_organs)
if(!E)
continue
if(!E.need_process())
bad_external_organs -= E
continue
else
E.process()
number_wounds += E.number_wounds
if (!lying && world.time - l_move_time < 15)
//Moving around with fractured ribs won't do you any good
if (E.is_broken() && E.internal_organs && E.internal_organs.len && prob(15))
var/obj/item/organ/I = pick(E.internal_organs)
custom_pain("You feel broken bones moving in your [E.name]!", 1)
I.take_damage(rand(3,5))
//Moving makes open wounds get infected much faster
if (E.wounds.len)
for(var/datum/wound/W in E.wounds)
if (W.infection_check())
W.germ_level += 1
/mob/living/carbon/human/proc/handle_stance()
// Don't need to process any of this if they aren't standing anyways
// unless their stance is damaged, and we want to check if they should stay down
if (!stance_damage && (lying || resting) && (life_tick % 4) == 0)
return
stance_damage = 0
// Buckled to a bed/chair. Stance damage is forced to 0 since they're sitting on something solid
if (istype(buckled, /obj/structure/stool/bed))
return
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())
stance_damage += 1
// Canes and crutches help you stand (if the latter is ever added)
// One cane mitigates a broken leg+foot, or a missing foot.
// Two canes are needed for a lost leg. If you are missing both legs, canes aren't gonna help you.
if (l_hand && istype(l_hand, /obj/item/weapon/cane))
stance_damage -= 2
if (r_hand && istype(r_hand, /obj/item/weapon/cane))
stance_damage -= 2
// standing is poor
if(stance_damage >= 4 || (stance_damage >= 2 && prob(5)))
if(!(lying || resting))
if(species && !(species.flags & NO_PAIN))
emote("scream")
custom_emote(1, "collapses!")
Weaken(5) //can't emote while weakened, apparently.
/mob/living/carbon/human/proc/handle_grasp()
if(!l_hand && !r_hand)
return
for (var/obj/item/organ/external/E in organs)
if(!E || !E.can_grasp || (E.status & ORGAN_SPLINTED))
continue
if(E.is_broken())
if(E.body_part == HAND_LEFT)
if(!l_hand)
continue
unEquip(l_hand)
else
if(!r_hand)
continue
unEquip(r_hand)
var/emote_scream = pick("screams in pain and ", "lets out a sharp cry and ", "cries out and ")
emote("me", 1, "[(species.flags & NO_PAIN) ? "" : emote_scream ]drops what they were holding in their [E.name]!")
else if(E.is_malfunctioning())
if(E.body_part == HAND_LEFT)
unEquip(l_hand)
else
unEquip(r_hand)
emote("me", 1, "drops what they were holding, their [E.name] malfunctioning!")
var/datum/effect/effect/system/spark_spread/spark_system = new /datum/effect/effect/system/spark_spread()
spark_system.set_up(5, 0, src)
spark_system.attach(src)
spark_system.start()
spawn(10)
del(spark_system)
//Handles chem traces
/mob/living/carbon/human/proc/handle_trace_chems()
//New are added for reagents to random organs.
for(var/datum/reagent/A in reagents.reagent_list)
var/obj/item/organ/O = pick(organs)
O.trace_chemicals[A.name] = 100
@@ -54,7 +54,7 @@
/mob/living/carbon/human/proc/has_organ(name)
var/datum/organ/external/O = organs_by_name[name]
var/obj/item/organ/external/O = organs_by_name[name]
return (O && !(O.status & ORGAN_DESTROYED) )
@@ -404,7 +404,7 @@
if("splints")
var/count = 0
for(var/organ in list("l_leg","r_leg","l_arm","r_arm"))
var/datum/organ/external/o = target.organs_by_name[organ]
var/obj/item/organ/external/o = target.organs_by_name[organ]
if(o.status & ORGAN_SPLINTED)
count = 1
break
@@ -726,7 +726,7 @@ It can still be worn/put on as normal.
strip_item = target.legcuffed
if("splints")
for(var/organ in list("l_leg","r_leg","l_arm","r_arm"))
var/datum/organ/external/o = target.get_organ(organ)
var/obj/item/organ/external/o = target.get_organ(organ)
if (o && o.status & ORGAN_SPLINTED)
var/obj/item/W = new /obj/item/stack/medical/splint/single()
o.status &= ~ORGAN_SPLINTED
+7 -7
View File
@@ -319,7 +319,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
updatehealth()
if(damage && organs.len)
var/datum/organ/external/O = pick(organs)
var/obj/item/organ/external/O = pick(organs)
if(istype(O)) O.add_autopsy_data("Radiation Poisoning", damage)
proc/breathe()
@@ -446,7 +446,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
adjustOxyLoss(oxyloss)
failed_last_breath = 1
var/datum/organ/external/affected = get_organ("chest")
var/obj/item/organ/external/affected = get_organ("chest")
affected.add_autopsy_data("Suffocation", oxyloss)
oxygen_alert = max(oxygen_alert, 1)
@@ -1275,7 +1275,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
healthdoll.icon_state = "healthdoll_DEAD"
else
healthdoll.icon_state = "healthdoll_OVERLAY"
for(var/datum/organ/external/O in organs)
for(var/obj/item/organ/external/O in organs)
var/damage = O.burn_dam + O.brute_dam
var/comparison = (O.max_damage/5)
var/icon_num = 0
@@ -1290,7 +1290,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
if(damage > (comparison*4))
icon_num = 5
if(icon_num)
healthdoll.overlays += image('icons/mob/screen_gen.dmi',"[O.name][icon_num]")
healthdoll.overlays += image('icons/mob/screen_gen.dmi',"[O.limb_name][icon_num]")
if(nutrition_icon)
switch(nutrition)
@@ -1641,8 +1641,8 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
proc/handle_heartbeat()
var/client/C = src.client
if(C && C.prefs.sound & SOUND_HEARTBEAT) //disable heartbeat by pref
var/datum/organ/internal/heart/H = internal_organs_by_name["heart"]
if(istype(H,/datum/organ/internal/heart/robotic)) //Handle robotic hearts specially with a wuuuubb. This also applies to machine-people.
var/obj/item/organ/heart/H = internal_organs_by_name["heart"]
if(H.status & ORGAN_ROBOT) //Handle robotic hearts specially with a wuuuubb. This also applies to machine-people.
if(shock_stage >= 10 || istype(get_turf(src), /turf/space))
//PULSE_THREADY - maximum value for pulse, currently it 5.
//High pulse value corresponds to a fast rate of heartbeat.
@@ -1671,7 +1671,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
if(heartbeat >= rate)
heartbeat = 0
if(istype(H,/datum/organ/internal/heart/assisted))
if(H.status & ORGAN_ASSISTED)
src << sound('sound/effects/pacemakebeat.ogg',0,0,0,50)
else
src << sound('sound/effects/singlebeat.ogg',0,0,0,50)
@@ -200,7 +200,9 @@ proc/get_damage_icon_part(damage_state, body_part)
// first check whether something actually changed about damage appearance
var/damage_appearance = ""
for(var/datum/organ/external/O in organs)
for(var/obj/item/organ/external/O in organs)
if(O.is_stump())
continue
if(O.status & ORGAN_DESTROYED) damage_appearance += "d"
else
damage_appearance += O.damage_state
@@ -216,7 +218,9 @@ proc/get_damage_icon_part(damage_state, body_part)
var/image/standing_image = new /image("icon" = standing)
// blend the individual damage states with our icons
for(var/datum/organ/external/O in organs)
for(var/obj/item/organ/external/O in organs)
if(O.is_stump())
continue
if(!(O.status & ORGAN_DESTROYED))
O.update_icon()
if(O.damage_state == "00") continue
@@ -234,112 +238,68 @@ proc/get_damage_icon_part(damage_state, body_part)
var/husk_color_mod = rgb(96,88,80)
var/hulk_color_mod = rgb(48,224,40)
var/necrosis_color_mod = rgb(10,50,0)
var/husk = (HUSK in src.mutations) //100% unnecessary -Agouri //nope, do you really want to iterate through src.mutations repeatedly? -Pete
var/husk = (HUSK in src.mutations)
var/fat = (FAT in src.mutations)
var/hulk = (HULK in src.mutations)
var/skeleton = (SKELETON in src.mutations)
var/g = (gender == FEMALE ? "f" : "m")
var/has_head = 0
var/brain_showing = 0
//CACHING: Generate an index key from visible bodyparts.
//0 = destroyed, 1 = normal, 2 = robotic, 3 = necrotic.
//Create a new, blank icon for our mob to use.
if(stand_icon)
del(stand_icon)
stand_icon = new(species.icon_template ? species.icon_template : 'icons/mob/human.dmi',"blank")
var/icon_key = "[species.race_key][g][s_tone][r_skin][g_skin][b_skin]"
var/obj/item/organ/eyes/eyes = internal_organs_by_name["eyes"]
var/icon_key = "[species.race_key][g][s_tone]"
for(var/datum/organ/external/part in organs)
if(eyes)
icon_key += "[rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3])]"
else
icon_key += "#000000"
if(istype(part,/datum/organ/external/head) && !(part.status & ORGAN_DESTROYED))
has_head = 1
var/datum/organ/external/head/head = part
if(head.brained==1)
brain_showing = 1
else brain_showing = 0
if(part.status & ORGAN_DESTROYED)
icon_key = "[icon_key]0"
for(var/organ_tag in species.has_limbs)
var/obj/item/organ/external/part = organs_by_name[organ_tag]
if(isnull(part) || part.is_stump() || (part.status & ORGAN_DESTROYED))
icon_key += "0"
else if(part.status & ORGAN_ROBOT)
icon_key = "[icon_key]2"
icon_key += "2[part.model ? "-[part.model]": ""]"
else if(part.status & ORGAN_DEAD)
icon_key = "[icon_key]3"
icon_key += "3"
else
icon_key = "[icon_key]1"
icon_key += "1"
icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0][s_tone]"
icon_key = "[icon_key][husk ? 1 : 0][fat ? 1 : 0][hulk ? 1 : 0][skeleton ? 1 : 0]"
var/icon/base_icon
if(human_icon_cache[icon_key])
//Icon is cached, use existing icon.
base_icon = human_icon_cache[icon_key]
//log_debug("Retrieved cached mob icon ([icon_key] \icon[human_icon_cache[icon_key]]) for [src].")
else
//BEGIN CACHED ICON GENERATION.
var/obj/item/organ/external/chest = get_organ("chest")
base_icon = chest.get_icon()
//BEGIN CACHED ICON GENERATION.
//Icon is not cached, generate and store it.
//Robotic limbs are handled in get_icon() so all we worry about are missing or dead limbs.
//No icon stored, so we need to start with a basic one.
var/datum/organ/external/chest = get_organ("chest")
if(chest)
base_icon = chest.get_icon(g,fat)
if(chest.status & ORGAN_DEAD)
base_icon.ColorTone(necrosis_color_mod)
base_icon.SetIntensity(0.7)
for(var/datum/organ/external/part in organs)
var/icon/temp //Hold the bodypart icon for processing.
if(part.status & ORGAN_DESTROYED)
continue
if (istype(part, /datum/organ/external/groin) || istype(part, /datum/organ/external/head))
temp = part.get_icon(g,fat)
else
temp = part.get_icon()
if(part.status & ORGAN_DEAD)
temp.ColorTone(necrosis_color_mod)
temp.SetIntensity(0.7)
for(var/obj/item/organ/external/part in organs)
var/icon/temp = part.get_icon(skeleton)
//That part makes left and right legs drawn topmost and lowermost when human looks WEST or EAST
//And no change in rendering for other parts (they icon_position is 0, so goes to 'else' part)
if(part.icon_position&(LEFT|RIGHT))
var/icon/temp2 = new('icons/mob/human.dmi',"blank")
temp2.Insert(new/icon(temp,dir=NORTH),dir=NORTH)
temp2.Insert(new/icon(temp,dir=SOUTH),dir=SOUTH)
if(!(part.icon_position & LEFT))
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
if(!(part.icon_position & RIGHT))
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
base_icon.Blend(temp2, ICON_OVERLAY)
if(part.icon_position & LEFT)
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
if(part.icon_position & RIGHT)
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
base_icon.Blend(temp2, ICON_UNDERLAY)
else
base_icon.Blend(temp, ICON_OVERLAY)
if(!skeleton)
@@ -350,55 +310,24 @@ proc/get_damage_icon_part(damage_state, body_part)
base_icon.MapColors(rgb(tone[1],0,0),rgb(0,tone[2],0),rgb(0,0,tone[3]))
//Handle husk overlay.
if(husk)
if(husk && ("overlay_husk" in icon_states(species.icobase)))
var/icon/mask = new(base_icon)
var/icon/husk_over = new(species.icobase,"overlay_husk")
mask.MapColors(0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,1, 0,0,0,0)
husk_over.Blend(mask, ICON_ADD)
base_icon.Blend(husk_over, ICON_OVERLAY)
//Skin tone.
if(!husk && !hulk)
if(species.bodyflags & HAS_SKIN_TONE)
if(s_tone >= 0)
base_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
else
base_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
human_icon_cache[icon_key] = base_icon
//log_debug("Generated new cached mob icon ([icon_key] \icon[human_icon_cache[icon_key]]) for [src]. [human_icon_cache.len] cached mob icons.")
//END CACHED ICON GENERATION.
stand_icon.Blend(base_icon,ICON_OVERLAY)
//Skin colour. Not in cache because highly variable (and relatively benign).
if (species.bodyflags & HAS_SKIN_COLOR)
stand_icon.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
if(has_head)
//Eyes
if(!skeleton)
var/icon/eyes = new/icon('icons/mob/human_face.dmi', species.eyes)
eyes.Blend(rgb(r_eyes, g_eyes, b_eyes), ICON_ADD)
stand_icon.Blend(eyes, ICON_OVERLAY)
//Mouth (lipstick!)
if(lip_style && (species && species.flags & HAS_LIPS)) //skeletons are allowed to wear lipstick no matter what you think, agouri.
stand_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[lip_style]_s"), ICON_OVERLAY)
//Brain showing
if(brain_showing)
stand_icon.Blend(new/icon('icons/mob/dam_human.dmi', "brain"), ICON_OVERLAY)
//Underwear
if(underwear >0 && underwear < 12 && species.flags & HAS_UNDERWEAR)
if(!fat && !skeleton)
stand_icon.Blend(new /icon('icons/mob/human.dmi', "underwear[underwear]_[g]_s"), ICON_OVERLAY)
if(underwear && species.flags & HAS_UNDERWEAR)
stand_icon.Blend(new /icon('icons/mob/human.dmi', underwear), ICON_OVERLAY)
if(undershirt>0 && undershirt < 45 && species.flags & HAS_UNDERWEAR)
stand_icon.Blend(new /icon('icons/mob/human.dmi', "undershirt[undershirt]_s"), ICON_OVERLAY)
if(undershirt && species.flags & HAS_UNDERWEAR)
stand_icon.Blend(new /icon('icons/mob/human.dmi', undershirt), ICON_OVERLAY)
if(update_icons)
update_icons()
@@ -407,14 +336,12 @@ proc/get_damage_icon_part(damage_state, body_part)
update_tail_showing(0)
//HAIR OVERLAY
/mob/living/carbon/human/proc/update_hair(var/update_icons=1)
//Reset our hair
overlays_standing[HAIR_LAYER] = null
var/datum/organ/external/head/head_organ = get_organ("head")
var/obj/item/organ/external/head/head_organ = get_organ("head")
if( !head_organ || (head_organ.status & ORGAN_DESTROYED) )
if(update_icons) update_icons()
return
@@ -1069,6 +996,11 @@ proc/get_damage_icon_part(damage_state, body_part)
var/image/face_lying_image = new /image(icon = face_lying)
return face_lying_image
/mob/living/carbon/human/proc/force_update_limbs()
for(var/obj/item/organ/external/O in organs)
O.sync_colour_to_human(src)
update_body(0)
//Human Overlays Indexes/////////
#undef MUTANTRACE_LAYER
#undef MUTATIONS_LAYER
@@ -44,6 +44,9 @@
var/mood = "" // To show its face
var/is_adult = 0
var/core_removal_stage = 0 //For removing cores.
///////////TIME FOR SUBSPECIES
var/colour = "grey"
+1 -3
View File
@@ -23,11 +23,9 @@
// broken or ripped off organs will add quite a bit of pain
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/M = src
for(var/datum/organ/external/organ in M.organs)
for(var/obj/item/organ/external/organ in M.organs)
if (!organ)
continue
if((organ.status & ORGAN_DESTROYED) && !organ.amputated)
src.traumatic_shock += 30
else if(organ.status & ORGAN_BROKEN || organ.open)
src.traumatic_shock += 15
if(organ.status & ORGAN_SPLINTED)
+100 -79
View File
@@ -53,6 +53,8 @@
var/blood_color = "#A10808" //Red.
var/flesh_color = "#FFC896" //Pink.
var/single_gib_type = /obj/effect/decal/cleanable/blood/gibs
var/base_color //Used when setting species.
//Used in icon caching.
@@ -66,6 +68,31 @@
var/list/speech_sounds // A list of sounds to potentially play when speaking.
var/list/speech_chance // The likelihood of a speech sound playing.
// Determines the organs that the species spawns with and
var/list/has_organ = list( // which required-organ checks are conducted.
"heart" = /obj/item/organ/heart,
"lungs" = /obj/item/organ/lungs,
"liver" = /obj/item/organ/liver,
"kidneys" = /obj/item/organ/kidneys,
"brain" = /obj/item/organ/brain,
"appendix" = /obj/item/organ/appendix,
"eyes" = /obj/item/organ/eyes
)
var/list/has_limbs = list(
"chest" = list("path" = /obj/item/organ/external/chest),
"groin" = list("path" = /obj/item/organ/external/groin),
"head" = list("path" = /obj/item/organ/external/head),
"l_arm" = list("path" = /obj/item/organ/external/arm),
"r_arm" = list("path" = /obj/item/organ/external/arm/right),
"l_leg" = list("path" = /obj/item/organ/external/leg),
"r_leg" = list("path" = /obj/item/organ/external/leg/right),
"l_hand" = list("path" = /obj/item/organ/external/hand),
"r_hand" = list("path" = /obj/item/organ/external/hand/right),
"l_foot" = list("path" = /obj/item/organ/external/foot),
"r_foot" = list("path" = /obj/item/organ/external/foot/right)
)
/datum/species/New()
unarmed = new unarmed_type()
@@ -74,33 +101,44 @@
return species_language.get_random_name(gender)
/datum/species/proc/create_organs(var/mob/living/carbon/human/H) //Handles creation of mob organs.
//This is a basic humanoid limb setup.
for(var/obj/item/organ/organ in H.contents)
if((organ in H.organs) || (organ in H.internal_organs))
del(organ)
if(H.organs) H.organs.Cut()
if(H.internal_organs) H.internal_organs.Cut()
if(H.organs_by_name) H.organs_by_name.Cut()
if(H.internal_organs_by_name) H.internal_organs_by_name.Cut()
H.organs = list()
H.organs_by_name["chest"] = new/datum/organ/external/chest()
H.organs_by_name["groin"] = new/datum/organ/external/groin(H.organs_by_name["chest"])
H.organs_by_name["head"] = new/datum/organ/external/head(H.organs_by_name["chest"])
H.organs_by_name["l_arm"] = new/datum/organ/external/l_arm(H.organs_by_name["chest"])
H.organs_by_name["r_arm"] = new/datum/organ/external/r_arm(H.organs_by_name["chest"])
H.organs_by_name["r_leg"] = new/datum/organ/external/r_leg(H.organs_by_name["groin"])
H.organs_by_name["l_leg"] = new/datum/organ/external/l_leg(H.organs_by_name["groin"])
H.organs_by_name["l_hand"] = new/datum/organ/external/l_hand(H.organs_by_name["l_arm"])
H.organs_by_name["r_hand"] = new/datum/organ/external/r_hand(H.organs_by_name["r_arm"])
H.organs_by_name["l_foot"] = new/datum/organ/external/l_foot(H.organs_by_name["l_leg"])
H.organs_by_name["r_foot"] = new/datum/organ/external/r_foot(H.organs_by_name["r_leg"])
H.internal_organs = list()
H.organs_by_name = list()
H.internal_organs_by_name = list()
if (name != "Slime People")
new/datum/organ/internal/heart(H)
new/datum/organ/internal/lungs(H)
new/datum/organ/internal/liver(H)
new/datum/organ/internal/kidney(H)
new/datum/organ/internal/brain(H)
new/datum/organ/internal/eyes(H)
for(var/limb_type in has_limbs)
var/list/organ_data = has_limbs[limb_type]
var/limb_path = organ_data["path"]
var/obj/item/organ/O = new limb_path(H)
organ_data["descriptor"] = O.name
for(var/n in H.organs_by_name)
var/datum/organ/external/O = H.organs_by_name[n]
for(var/organ in has_organ)
var/organ_type = has_organ[organ]
H.internal_organs_by_name[organ] = new organ_type(H,1)
for(var/name in H.organs_by_name)
H.organs |= H.organs_by_name[name]
for(var/obj/item/organ/external/O in H.organs)
O.owner = H
H.organs += O
return
if(flags & IS_SYNTHETIC)
for(var/obj/item/organ/external/E in H.organs)
if(E.status & ORGAN_CUT_AWAY || E.status & ORGAN_DESTROYED) continue
E.robotize()
for(var/obj/item/organ/I in H.internal_organs)
I.robotize()
/datum/species/proc/handle_breath(var/datum/gas_mixture/breath, var/mob/living/carbon/human/H)
var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa
@@ -480,29 +518,15 @@
tail = "armalis_tail"
icon_template = 'icons/mob/human_races/r_armalis.dmi'
/datum/species/vox/create_organs(var/mob/living/carbon/human/H)
..() //create organs first.
//Now apply cortical stack.
var/datum/organ/external/affected = H.get_organ("head")
//To avoid duplicates.
for(var/obj/item/weapon/implant/cortical/imp in H.contents)
affected.implants -= imp
del(imp)
var/obj/item/weapon/implant/cortical/I = new(H)
I.imp_in = H
I.implanted = 1
affected.implants += I
I.part = affected
if(ticker.mode && ( istype( ticker.mode,/datum/game_mode/heist ) ) )
var/datum/game_mode/heist/M = ticker.mode
M.cortical_stacks += I
has_organ = list(
"heart" = /obj/item/organ/heart,
"lungs" = /obj/item/organ/lungs,
"liver" = /obj/item/organ/liver,
"kidneys" = /obj/item/organ/kidneys,
"brain" = /obj/item/organ/brain,
"eyes" = /obj/item/organ/eyes,
"stack" = /obj/item/organ/stack/vox
)
/datum/species/kidan
name = "Kidan"
@@ -532,6 +556,11 @@
flags = IS_WHITELISTED | NO_BREATHE | HAS_LIPS | NO_INTORGANS | NO_SCAN
bloodflags = BLOOD_SLIME
has_organ = list(
"brain" = /obj/item/organ/brain/slime
)
/datum/species/slime/handle_post_spawn(var/mob/living/carbon/human/H)
H.dna = new /datum/dna(null)
H.dna.real_name = H.real_name
@@ -611,6 +640,29 @@
reagent_tag = IS_DIONA
has_organ = list(
"nutrient channel" = /obj/item/organ/diona/nutrients,
"neural strata" = /obj/item/organ/diona/strata,
"response node" = /obj/item/organ/diona/node,
"gas bladder" = /obj/item/organ/diona/bladder,
"polyp segment" = /obj/item/organ/diona/polyp,
"anchoring ligament" = /obj/item/organ/diona/ligament
)
has_limbs = list(
"chest" = list("path" = /obj/item/organ/external/diona/chest),
"groin" = list("path" = /obj/item/organ/external/diona/groin),
"head" = list("path" = /obj/item/organ/external/diona/head),
"l_arm" = list("path" = /obj/item/organ/external/diona/arm),
"r_arm" = list("path" = /obj/item/organ/external/diona/arm/right),
"l_leg" = list("path" = /obj/item/organ/external/diona/leg),
"r_leg" = list("path" = /obj/item/organ/external/diona/leg/right),
"l_hand" = list("path" = /obj/item/organ/external/diona/hand),
"r_hand" = list("path" = /obj/item/organ/external/diona/hand/right),
"l_foot" = list("path" = /obj/item/organ/external/diona/foot),
"r_foot" = list("path" = /obj/item/organ/external/diona/foot/right)
)
/datum/species/diona/can_understand(var/mob/other)
var/mob/living/carbon/monkey/diona/D = other
if(istype(D))
@@ -673,43 +725,12 @@
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/datum/organ/external/O = H.organs_by_name[organ_name]
var/obj/item/organ/external/O = H.organs_by_name[organ_name]
if((O.body_part != UPPER_TORSO) && (O.body_part != LOWER_TORSO)) // We're making them fall apart, not gibbing them!
O.droplimb(1)
var/datum/organ/external/O = H.organs_by_name["head"]
var/obj/item/organ/external/O = H.organs_by_name["head"]
O.droplimb(1)
/datum/species/machine/create_organs(var/mob/living/carbon/human/H)
H.organs = new /list()
H.organs_by_name["chest"] = new/datum/organ/external/chest()
H.organs_by_name["groin"] = new/datum/organ/external/groin(H.organs_by_name["chest"])
H.organs_by_name["head"] = new/datum/organ/external/head(H.organs_by_name["chest"])
H.organs_by_name["l_arm"] = new/datum/organ/external/l_arm(H.organs_by_name["chest"])
H.organs_by_name["r_arm"] = new/datum/organ/external/r_arm(H.organs_by_name["chest"])
H.organs_by_name["r_leg"] = new/datum/organ/external/r_leg(H.organs_by_name["groin"])
H.organs_by_name["l_leg"] = new/datum/organ/external/l_leg(H.organs_by_name["groin"])
H.organs_by_name["l_hand"] = new/datum/organ/external/l_hand(H.organs_by_name["l_arm"])
H.organs_by_name["r_hand"] = new/datum/organ/external/r_hand(H.organs_by_name["r_arm"])
H.organs_by_name["l_foot"] = new/datum/organ/external/l_foot(H.organs_by_name["l_leg"])
H.organs_by_name["r_foot"] = new/datum/organ/external/r_foot(H.organs_by_name["r_leg"])
new/datum/organ/internal/heart/robotic(H)
new/datum/organ/internal/lungs/robotic(H)
new/datum/organ/internal/liver/robotic(H)
new/datum/organ/internal/kidney/robotic(H)
new/datum/organ/internal/brain/robotic(H)
new/datum/organ/internal/eyes/robotic(H)
for(var/n in H.organs_by_name)
var/datum/organ/external/O = H.organs_by_name[n]
O.owner = H
if(!(O.status & ORGAN_CUT_AWAY || O.status & ORGAN_DESTROYED))
O.status |= ORGAN_ROBOT
H.organs += O
return
//Species unarmed attacks
+2 -2
View File
@@ -61,7 +61,7 @@
var/mob/living/carbon/human/H = src //make this damage method divide the damage to be done among all the body parts, then burn each body part for that much damage. will have better effect then just randomly picking a body part
var/divided_damage = (burn_amount)/(H.organs.len)
var/extradam = 0 //added to when organ is at max dam
for(var/datum/organ/external/affecting in H.organs)
for(var/obj/item/organ/external/affecting in H.organs)
if(!affecting) continue
if(affecting.take_damage(0, divided_damage+extradam)) //TODO: fix the extradam stuff. Or, ebtter yet...rewrite this entire proc ~Carn
H.UpdateDamageIcon()
@@ -256,7 +256,7 @@
var/t = shooter:zone_sel.selecting
if ((t in list( "eyes", "mouth" )))
t = "head"
var/datum/organ/external/def_zone = ran_zone(t)
var/obj/item/organ/external/def_zone = ran_zone(t)
return def_zone
@@ -231,9 +231,9 @@
var/list/damaged = H.get_damaged_organs(1,1)
user.show_message("\blue Localized Damage, Brute/Electronics:",1)
if(length(damaged)>0)
for(var/datum/organ/external/org in damaged)
for(var/obj/item/organ/external/org in damaged)
user.show_message(text("\blue \t []: [] - []", \
capitalize(org.display_name), \
capitalize(org.name), \
(org.brute_dam > 0) ? "\red [org.brute_dam]" :0, \
(org.burn_dam > 0) ? "<font color='#FFA500'>[org.burn_dam]</font>" :0),1)
else
@@ -307,7 +307,7 @@ mob/living/simple_animal/borer/proc/detatch()
if(istype(host,/mob/living/carbon/human))
var/mob/living/carbon/human/H = host
var/datum/organ/external/head = H.get_organ("head")
var/obj/item/organ/external/head = H.get_organ("head")
head.implants -= src
controlling = 0
@@ -433,7 +433,7 @@ mob/living/simple_animal/borer/proc/detatch()
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/datum/organ/external/head = H.get_organ("head")
var/obj/item/organ/external/head = H.get_organ("head")
head.implants += src
host.status_flags |= PASSEMOTES
@@ -449,7 +449,7 @@ mob/living/simple_animal/borer/proc/detatch()
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/datum/organ/external/head = H.get_organ("head")
var/obj/item/organ/external/head = H.get_organ("head")
head.implants += src
host_brain.name = M.name
@@ -137,7 +137,7 @@
if(ishuman(target))
var/mob/living/carbon/human/H = target
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/datum/organ/external/affecting = H.get_organ(ran_zone(dam_zone))
var/obj/item/organ/external/affecting = H.get_organ(ran_zone(dam_zone))
H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"), sharp=1, edge=1)
return H
else if(isliving(target))
@@ -476,7 +476,7 @@
if(ishuman(parrot_interest))
var/mob/living/carbon/human/H = parrot_interest
var/datum/organ/external/affecting = H.get_organ(ran_zone(pick(parrot_dam_zone)))
var/obj/item/organ/external/affecting = H.get_organ(ran_zone(pick(parrot_dam_zone)))
H.apply_damage(damage, BRUTE, affecting, H.run_armor_check(affecting, "melee"), sharp=1)
emote(pick("pecks [H]'s [affecting].", "cuts [H]'s [affecting] with its talons."))
@@ -750,4 +750,4 @@
parrot_interest = user
parrot_state = PARROT_SWOOP | PARROT_ATTACK //Attack other animals regardless
icon_state = "parrot_fly"
return success
return success
+11 -8
View File
@@ -787,8 +787,8 @@ var/list/slot_equipment_priority = list( \
var/mob/living/carbon/human/H = src
if(H.health - H.halloss <= config.health_threshold_softcrit)
for(var/name in H.organs_by_name)
var/datum/organ/external/e = H.organs_by_name[name]
if(H.lying)
var/obj/item/organ/external/e = H.organs_by_name[name]
if(e && H.lying)
if(((e.status & ORGAN_BROKEN && !(e.status & ORGAN_SPLINTED)) || e.status & ORGAN_BLEEDING) && (H.getBruteLoss() + H.getFireLoss() >= 100))
return 1
break
@@ -1071,14 +1071,15 @@ var/list/slot_equipment_priority = list( \
lying = 1
canmove = 0
else if( stunned )
// lying = 0
canmove = 0
else if (!buckled)
lying = !can_stand
canmove = has_limbs
else
lying = 0
canmove = 1
if(lying)
density = 0
drop_l_hand()
drop_r_hand()
else
density = 1
@@ -1296,9 +1297,9 @@ mob/proc/yank_out_object()
if(ishuman(src))
var/mob/living/carbon/human/H = src
var/datum/organ/external/affected
var/obj/item/organ/external/affected
for(var/datum/organ/external/organ in H.organs) //Grab the organ holding the implant.
for(var/obj/item/organ/external/organ in H.organs) //Grab the organ holding the implant.
for(var/obj/item/weapon/O in organ.implants)
if(O == selection)
affected = organ
@@ -1316,6 +1317,8 @@ mob/proc/yank_out_object()
human_user.bloody_hands(H)
selection.loc = get_turf(src)
if(!(U.l_hand && U.r_hand))
U.put_in_hands(selection)
for(var/obj/item/weapon/O in pinned)
if(O == selection)
+1 -1
View File
@@ -217,7 +217,6 @@
var/alien_talk_understand = 0
var/has_limbs = 1 //Whether this mob have any limbs he can move with
var/can_stand = 1 //Whether this mob have ability to stand
//SSD var, changed it up some so people can have special things happen for different mobs when SSD.
var/player_logged = 0
@@ -227,6 +226,7 @@
var/kills=0
var/stance_damage = 0 //Whether this mob's ability to stand has been affected
var/list/active_genes=list()
+1 -1
View File
@@ -146,7 +146,7 @@ proc/isovermind(A)
return 0
proc/isorgan(A)
if(istype(A, /datum/organ/external))
if(istype(A, /obj/item/organ/external))
return 1
return 0
+2 -2
View File
@@ -273,8 +273,8 @@
else if(istype(mob.buckled, /obj/structure/stool/bed/chair/wheelchair))
if(ishuman(mob.buckled))
var/mob/living/carbon/human/driver = mob.buckled
var/datum/organ/external/l_hand = driver.get_organ("l_hand")
var/datum/organ/external/r_hand = driver.get_organ("r_hand")
var/obj/item/organ/external/l_hand = driver.get_organ("l_hand")
var/obj/item/organ/external/r_hand = driver.get_organ("r_hand")
if((!l_hand || (l_hand.status & ORGAN_DESTROYED)) && (!r_hand || (r_hand.status & ORGAN_DESTROYED)))
return // No hands to drive your chair? Tough luck!
move_delay += 2
@@ -510,6 +510,10 @@
domutcheck(new_character)
new_character.dna.UpdateSE()
// Do the initial caching of the player's body icons.
new_character.force_update_limbs()
new_character.update_eyes()
new_character.regenerate_icons()
new_character.key = key //Manually transfer the key to log them in
@@ -215,15 +215,16 @@ datum/preferences
for(var/name in list("r_arm","r_hand","r_leg","r_foot","l_leg","l_foot","l_arm","l_hand"))
if(organ_data[name] == "amputated") continue
var/icon/temp = new /icon(icobase, "[name]")
if(organ_data[name] == "cyborg")
temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
preview_icon.Blend(temp, ICON_OVERLAY)
var/datum/robolimb/R
if(rlimb_data[name]) R = all_robolimbs[rlimb_data[name]]
if(!R) R = basic_robolimb
preview_icon.Blend(icon(R.icon, "[name]"), ICON_OVERLAY) // This doesn't check gendered_icon. Not an issue while only limbs can be robotic.
continue
preview_icon.Blend(new /icon(icobase, "[name]"), ICON_OVERLAY)
//Tail
if(current_species && (current_species.flags & HAS_TAIL))
if(current_species && (current_species.bodyflags & HAS_TAIL))
var/icon/temp = new/icon("icon" = 'icons/effects/species.dmi', "icon_state" = "[current_species.tail]_s")
preview_icon.Blend(temp, ICON_OVERLAY)
@@ -232,7 +233,7 @@ datum/preferences
preview_icon.Blend(rgb(r_skin, g_skin, b_skin), ICON_ADD)
// Skin tone
if(current_species && (current_species.flags & HAS_SKIN_TONE))
if(current_species && (current_species.bodyflags & HAS_SKIN_TONE))
if (s_tone >= 0)
preview_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
else
+2
View File
@@ -189,6 +189,8 @@
invisibility = 101
for(var/t in organs)
del(t)
for(var/i in internal_organs)
del(i)
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot( loc )
+2 -2
View File
@@ -80,7 +80,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
// Damaged heart virtually reduces the blood volume, as the blood isn't
// being pumped properly anymore.
var/datum/organ/internal/heart/heart = internal_organs_by_name["heart"]
var/obj/item/organ/heart/heart = internal_organs_by_name["heart"]
if(heart)
if(heart.damage > 1 && heart.damage < heart.min_bruised_damage)
@@ -146,7 +146,7 @@ var/const/BLOOD_VOLUME_SURVIVE = 122
//Bleeding out
var/blood_max = 0
for(var/datum/organ/external/temp in organs)
for(var/obj/item/organ/external/temp in organs)
if(!(temp.status & ORGAN_BLEEDING) || temp.status & ORGAN_ROBOT)
continue
for(var/datum/wound/W in temp.wounds) if(W.bleeding())
+248 -77
View File
@@ -1,24 +1,155 @@
/datum/organ
var/name = "organ"
var/mob/living/carbon/human/owner = null
var/list/organ_cache = list()
/obj/item/organ
name = "organ"
icon = 'icons/obj/surgery.dmi'
var/dead_icon
var/mob/living/carbon/human/owner = null
var/status = 0
var/vital //Lose a vital limb, die immediately.
var/damage = 0 // amount of damage to the organ
var/min_bruised_damage = 10
var/min_broken_damage = 30
var/max_damage
var/organ_tag = "organ"
var/parent_organ = "chest"
var/robotic = 0 //For being a robot
var/rejecting // Is this organ already being rejected?
var/list/transplant_data
var/list/datum/autopsy_data/autopsy_data = list()
var/list/trace_chemicals = list() // traces of chemicals in the organ,
// links chemical IDs to number of ticks for which they'll stay in the blood
germ_level = 0
var/germ_level = 0 // INTERNAL germs inside the organ, this is BAD if it's greater than INFECTION_LEVEL_ONE
/obj/item/organ/proc/update_health()
return
proc/process()
return 0
/obj/item/organ/New(var/mob/living/carbon/holder, var/internal)
..(holder)
create_reagents(5)
if(!max_damage)
max_damage = min_broken_damage * 2
if(istype(holder))
src.owner = holder
var/mob/living/carbon/human/H = holder
if(istype(H))
if(internal)
var/obj/item/organ/external/E = H.organs_by_name[src.parent_organ]
if(E)
if(E.internal_organs == null)
E.internal_organs = list()
E.internal_organs |= src
if(H.dna)
if(!blood_DNA)
blood_DNA = list()
blood_DNA[H.dna.unique_enzymes] = H.dna.b_type
if(internal)
holder.internal_organs |= src
proc/receive_chem(chemical as obj)
return 0
/obj/item/organ/proc/die()
if(status & ORGAN_ROBOT)
return
damage = max_damage
processing_objects -= src
if(dead_icon)
icon_state = dead_icon
/datum/organ/proc/get_icon()
return icon('icons/mob/human.dmi',"blank")
/obj/item/organ/process()
// Don't process if we're in a freezer, an MMI or a stasis bag. //TODO: ambient temperature?
if(istype(loc,/obj/item/device/mmi) || istype(loc,/obj/item/bodybag/cryobag) || istype(loc,/obj/structure/closet/crate/freezer))
return
//Process infections
if (robotic >= 2 || (owner && owner.species && (owner.species.flags & IS_PLANT)))
germ_level = 0
return
if(loc != owner)
owner = null
if(!owner)
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)
damage += rand(1,3)
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()
handle_rejection()
handle_germ_effects()
/obj/item/organ/proc/handle_germ_effects()
//** Handle the effects of infections
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (germ_level > 0 && germ_level < INFECTION_LEVEL_ONE/2 && prob(30))
germ_level--
if (germ_level >= INFECTION_LEVEL_ONE/2)
//aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes
if(antibiotics < 5 && prob(round(germ_level/6)))
germ_level++
if(germ_level >= INFECTION_LEVEL_ONE)
var/fever_temperature = (owner.species.heat_level_1 - owner.species.body_temperature - 5)* min(germ_level/INFECTION_LEVEL_TWO, 1) + owner.species.body_temperature
owner.bodytemperature += between(0, (fever_temperature - T20C)/BODYTEMP_COLD_DIVISOR + 1, fever_temperature - owner.bodytemperature)
if (germ_level >= INFECTION_LEVEL_TWO)
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
//spread germs
if (antibiotics < 5 && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
parent.germ_level++
if (prob(3)) //about once every 30 seconds
take_damage(1,silent=prob(30))
/obj/item/organ/proc/handle_rejection()
// Process unsuitable transplants. TODO: consider some kind of
// immunosuppressant that changes transplant data to make it match.
if(transplant_data)
if(!rejecting && prob(20) && owner.dna && blood_incompatible(transplant_data["blood_type"],owner.dna.b_type,owner.species,transplant_data["species"]))
rejecting = 1
else
rejecting++ //Rejection severity increases over time.
if(rejecting % 10 == 0) //Only fire every ten rejection ticks.
switch(rejecting)
if(1 to 50)
take_damage(1)
if(51 to 200)
owner.reagents.add_reagent("toxin", 1)
take_damage(1)
if(201 to 500)
take_damage(rand(2,3))
owner.reagents.add_reagent("toxin", 2)
if(501 to INFINITY)
take_damage(4)
owner.reagents.add_reagent("toxin", rand(3,5))
/obj/item/organ/proc/receive_chem(chemical as obj)
return 0
/obj/item/organ/proc/rejuvenate()
damage = 0
/obj/item/organ/proc/is_damaged()
return damage > 0
/obj/item/organ/proc/is_bruised()
return damage >= min_bruised_damage
/obj/item/organ/proc/is_broken()
return (damage >= min_broken_damage || (status & ORGAN_CUT_AWAY) || ((status & ORGAN_BROKEN) && !(status & ORGAN_SPLINTED)))
//Germs
/datum/organ/proc/handle_antibiotics()
/obj/item/organ/proc/handle_antibiotics()
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (!germ_level || antibiotics < 5)
@@ -31,15 +162,8 @@
else
germ_level -= 2 //at germ_level == 1000, this will cure the infection in 5 minutes
//Handles chem traces
/mob/living/carbon/human/proc/handle_trace_chems()
//New are added for reagents to random organs.
for(var/datum/reagent/A in reagents.reagent_list)
var/datum/organ/O = pick(organs)
O.trace_chemicals[A.name] = 100
//Adds autopsy data for used_weapon.
/datum/organ/proc/add_autopsy_data(var/used_weapon, var/damage)
/obj/item/organ/proc/add_autopsy_data(var/used_weapon, var/damage)
var/datum/autopsy_data/W = autopsy_data[used_weapon]
if(!W)
W = new()
@@ -50,74 +174,121 @@
W.damage += damage
W.time_inflicted = world.time
/mob/living/carbon/human/var/list/organs = list()
/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
/obj/item/organ/proc/take_damage(amount, var/silent=0)
if(src.robotic == 2)
src.damage += (amount * 0.8)
else
src.damage += amount
// Takes care of organ related updates, such as broken and missing limbs
/mob/living/carbon/human/proc/handle_organs()
number_wounds = 0
var/leg_tally = 2
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
if(force_process)
bad_external_organs.Cut()
for(var/datum/organ/external/Ex in organs)
bad_external_organs += Ex
if(owner && parent_organ)
var/obj/item/organ/external/parent = owner.get_organ(parent_organ)
if(parent && !silent)
owner.custom_pain("Something inside your [parent.name] hurts a lot.", 1)
//processing internal organs is pretty cheap, do that first.
for(var/name in internal_organs_by_name)
var/datum/organ/internal/I = internal_organs_by_name[name]
I.process()
/obj/item/organ/proc/robotize() //Being used to make robutt hearts, etc
robotic = 2
src.status &= ~ORGAN_BROKEN
src.status &= ~ORGAN_BLEEDING
src.status &= ~ORGAN_SPLINTED
src.status &= ~ORGAN_CUT_AWAY
src.status &= ~ORGAN_ATTACHABLE
src.status &= ~ORGAN_DESTROYED
src.status |= ORGAN_ROBOT
src.status |= ORGAN_ASSISTED
//Check arms and legs for existence
can_stand = 2 //can stand on both legs
var/datum/organ/external/F = organs_by_name["l_foot"]
if(F.status & ORGAN_DESTROYED)
can_stand--
/obj/item/organ/proc/mechassist() //Used to add things like pacemakers, etc
robotize()
src.status &= ~ORGAN_ROBOT
robotic = 1
min_bruised_damage = 15
min_broken_damage = 35
F = organs_by_name["r_foot"]
if(F.status & ORGAN_DESTROYED)
can_stand--
/obj/item/organ/emp_act(severity)
switch(robotic)
if(0)
return
if(1)
switch (severity)
if (1.0)
take_damage(20,0)
return
if (2.0)
take_damage(7,0)
return
if(3.0)
take_damage(3,0)
return
if(2)
switch (severity)
if (1.0)
take_damage(40,0)
return
if (2.0)
take_damage(15,0)
return
if(3.0)
take_damage(10,0)
return
if(!force_process && !bad_external_organs.len)
/obj/item/organ/proc/removed(var/mob/living/user)
if(!istype(owner))
return
for(var/datum/organ/external/E in bad_external_organs)
if(!E)
continue
if(!E.need_process())
bad_external_organs -= E
continue
else
E.process()
number_wounds += E.number_wounds
owner.internal_organs_by_name[organ_tag] = null
owner.internal_organs_by_name -= organ_tag
owner.internal_organs_by_name -= null
owner.internal_organs -= src
if (!lying && world.time - l_move_time < 15)
//Moving around with fractured ribs won't do you any good
if (E.is_broken() && E.internal_organs && prob(15))
var/datum/organ/internal/I = pick(E.internal_organs)
custom_pain("You feel broken bones moving in your [E.display_name]!", 1)
I.take_damage(rand(3,5))
var/obj/item/organ/external/affected = owner.get_organ(parent_organ)
if(affected) affected.internal_organs -= src
//Moving makes open wounds get infected much faster
if (E.wounds.len)
for(var/datum/wound/W in E.wounds)
if (W.infection_check())
W.germ_level += 1
loc = get_turf(owner)
processing_objects |= src
rejecting = null
var/datum/reagent/blood/organ_blood = locate(/datum/reagent/blood) in reagents.reagent_list
if(!organ_blood || !organ_blood.data["blood_DNA"])
owner.vessel.trans_to(src, 5, 1, 1)
if(E.name in list("l_leg","l_foot","r_leg","r_foot") && !lying)
if (!E.is_usable() || E.is_malfunctioning() || (E.is_broken() && !(E.status & ORGAN_SPLINTED)))
leg_tally-- // let it fail even if just foot&leg
if(owner && vital)
if(user)
user.attack_log += "\[[time_stamp()]\]<font color='red'> removed a vital organ ([src]) from [owner.name] ([owner.ckey]) (INTENT: [uppertext(user.a_intent)])</font>"
owner.attack_log += "\[[time_stamp()]\]<font color='orange'> had a vital organ ([src]) removed by [user.name] ([user.ckey]) (INTENT: [uppertext(user.a_intent)])</font>"
msg_admin_attack("[user.name] ([user.ckey]) removed a vital organ ([src]) from [owner.name] ([owner.ckey]) (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
owner.death()
owner = null
// standing is poor
if(leg_tally <= 0 && !paralysis && !(lying || resting) && prob(5))
if(species && species.flags & NO_PAIN)
emote("scream")
emote("collapse")
paralysis = 10
/obj/item/organ/proc/replaced(var/mob/living/carbon/human/target,var/obj/item/organ/external/affected)
if(!istype(target)) return
var/datum/reagent/blood/transplant_blood = locate(/datum/reagent/blood) in reagents.reagent_list
transplant_data = list()
if(!transplant_blood)
transplant_data["species"] = target.species.name
transplant_data["blood_type"] = target.dna.b_type
transplant_data["blood_DNA"] = target.dna.unique_enzymes
else
transplant_data["species"] = transplant_blood.data["species"]
transplant_data["blood_type"] = transplant_blood.data["blood_type"]
transplant_data["blood_DNA"] = transplant_blood.data["blood_DNA"]
owner = target
processing_objects -= src
target.internal_organs |= src
affected.internal_organs |= src
target.internal_organs_by_name[organ_tag] = src
src.loc = target
if(robotic)
status |= ORGAN_ROBOT
/obj/item/organ/eyes/replaced(var/mob/living/carbon/human/target)
// Apply our eye colour to the target.
if(istype(target) && eye_colour)
target.r_eyes = eye_colour[1]
target.g_eyes = eye_colour[2]
target.b_eyes = eye_colour[3]
target.update_eyes()
..()
+338
View File
@@ -0,0 +1,338 @@
/*
/proc/spawn_diona_nymph_from_organ(var/obj/item/organ/organ)
if(!istype(organ))
return
//This is a terrible hack and I should be ashamed.
var/datum/seed/diona = plant_controller.seeds["diona"]
if(!diona)
del(src)
spawn(1) // So it has time to be thrown about by the gib() proc.
var/mob/living/carbon/alien/diona/D = new(get_turf(organ))
diona.request_player(D)
del(organ)
*/
/obj/item/organ/external/diona
name = "tendril"
cannot_break = 1
amputation_point = "branch"
/obj/item/organ/external/diona/chest
name = "core trunk"
limb_name = "chest"
icon_name = "torso"
health = 200
min_broken_damage = 50
body_part = UPPER_TORSO
vital = 1
cannot_amputate = 1
parent_organ = null
/obj/item/organ/external/diona/groin
name = "fork"
limb_name = "groin"
icon_name = "groin"
health = 100
min_broken_damage = 50
body_part = LOWER_TORSO
parent_organ = "chest"
/obj/item/organ/external/diona/arm
name = "left upper tendril"
limb_name = "l_arm"
icon_name = "l_arm"
health = 35
min_broken_damage = 20
body_part = ARM_LEFT
parent_organ = "chest"
can_grasp = 1
/obj/item/organ/external/diona/arm/right
name = "right upper tendril"
limb_name = "r_arm"
icon_name = "r_arm"
body_part = ARM_RIGHT
/obj/item/organ/external/diona/leg
name = "left lower tendril"
limb_name = "l_leg"
icon_name = "l_leg"
health = 35
min_broken_damage = 20
body_part = LEG_LEFT
icon_position = LEFT
parent_organ = "groin"
can_stand = 1
/obj/item/organ/external/diona/leg/right
name = "right lower tendril"
limb_name = "r_leg"
icon_name = "r_leg"
body_part = LEG_RIGHT
icon_position = RIGHT
/obj/item/organ/external/diona/foot
name = "left foot"
limb_name = "l_foot"
icon_name = "l_foot"
health = 20
min_broken_damage = 10
body_part = FOOT_LEFT
icon_position = LEFT
parent_organ = "l_leg"
can_stand = 1
/obj/item/organ/external/diona/foot/right
name = "right foot"
limb_name = "r_foot"
icon_name = "r_foot"
body_part = FOOT_RIGHT
icon_position = RIGHT
parent_organ = "r_leg"
amputation_point = "right ankle"
/obj/item/organ/external/diona/hand
name = "left grasper"
limb_name = "l_hand"
icon_name = "l_hand"
health = 30
min_broken_damage = 15
body_part = HAND_LEFT
parent_organ = "l_arm"
can_grasp = 1
/obj/item/organ/external/diona/hand/right
name = "right grasper"
limb_name = "r_hand"
icon_name = "r_hand"
body_part = HAND_RIGHT
parent_organ = "r_arm"
/obj/item/organ/external/diona/head
limb_name = "head"
icon_name = "head"
name = "head"
health = 50
min_broken_damage = 25
body_part = HEAD
parent_organ = "chest"
/obj/item/organ/external/diona/head/removed()
if(owner)
owner.unEquip(owner.head)
owner.unEquip(owner.l_ear)
..()
/*
//DIONA ORGANS.
/obj/item/organ/external/diona/removed()
..()
if(!istype(owner))
del(src)
if(!owner.organs.len)
owner.death()
if(prob(50))
spawn_diona_nymph_from_organ(src)
*/
/obj/item/organ/diona/process()
return
/obj/item/organ/diona/strata
name = "neural strata"
parent_organ = "chest"
/obj/item/organ/diona/bladder
name = "gas bladder"
parent_organ = "head"
/obj/item/organ/diona/polyp
name = "polyp segment"
parent_organ = "groin"
/obj/item/organ/diona/ligament
name = "anchoring ligament"
parent_organ = "groin"
/obj/item/organ/diona/node
name = "receptor node"
parent_organ = "head"
/obj/item/organ/diona/nutrients
name = "nutrient vessel"
parent_organ = "chest"
/obj/item/organ/diona
name = "diona nymph"
icon = 'icons/obj/objects.dmi'
icon_state = "nymph"
organ_tag = "special" // Turns into a nymph instantly, no transplanting possible.
/*
/obj/item/organ/diona/removed(var/mob/living/user)
..()
if(!istype(owner))
del(src)
if(!owner.internal_organs.len)
owner.death()
spawn_diona_nymph_from_organ(src)
*/
// These are different to the standard diona organs as they have a purpose in other
// species (absorbing radiation and light respectively)
/obj/item/organ/diona/nutrients
name = "nutrient vessel"
organ_tag = "nutrient vessel"
icon = 'icons/mob/alien.dmi'
icon_state = "claw"
/obj/item/organ/diona/nutrients/removed()
return
/obj/item/organ/diona/node
name = "receptor node"
organ_tag = "receptor node"
icon = 'icons/mob/alien.dmi'
icon_state = "claw"
/obj/item/organ/diona/node/removed()
return
//CORTICAL BORER ORGANS.
/obj/item/organ/borer
name = "cortical borer"
parent_organ = "head"
vital = 1
/obj/item/organ/borer/process()
// Borer husks regenerate health, feel no pain, and are resistant to stuns and brainloss.
for(var/chem in list("saline", "sailcylic", "meth", "mannitol"))
if(owner.reagents.get_reagent_amount(chem) < 3)
owner.reagents.add_reagent(chem, 5)
// They're also super gross and ooze ichor.
if(prob(5))
var/mob/living/carbon/human/H = owner
if(!istype(H))
return
var/datum/reagent/blood/B = locate(/datum/reagent/blood) in H.vessel.reagent_list
blood_splatter(H,B,1)
var/obj/effect/decal/cleanable/blood/splatter/goo = locate() in get_turf(owner)
if(goo)
goo.name = "husk ichor"
goo.desc = "It's thick and stinks of decay."
goo.basecolor = "#412464"
goo.update_icon()
/obj/item/organ/borer
name = "cortical borer"
icon = 'icons/obj/objects.dmi'
icon_state = "borer"
organ_tag = "brain"
desc = "A disgusting space slug."
/obj/item/organ/borer/removed(var/mob/living/user)
..()
var/mob/living/simple_animal/borer/B = owner.has_brain_worms()
if(B)
B.leave_host()
B.ckey = owner.ckey
spawn(0)
del(src)
//XENOMORPH ORGANS
/obj/item/organ/xenos/eggsac
name = "egg sac"
parent_organ = "groin"
/obj/item/organ/xenos/plasmavessel
name = "plasma vessel"
parent_organ = "chest"
var/stored_plasma = 0
var/max_plasma = 500
/obj/item/organ/xenos/plasmavessel/queen
name = "bloated plasma vessel"
stored_plasma = 200
max_plasma = 500
/obj/item/organ/xenos/plasmavessel/sentinel
stored_plasma = 100
max_plasma = 250
/obj/item/organ/xenos/plasmavessel/hunter
name = "tiny plasma vessel"
stored_plasma = 100
max_plasma = 150
/obj/item/organ/xenos/acidgland
name = "acid gland"
parent_organ = "head"
/obj/item/organ/xenos/hivenode
name = "hive node"
parent_organ = "chest"
/obj/item/organ/xenos/resinspinner
name = "resin spinner"
parent_organ = "head"
/obj/item/organ/xenos
name = "xeno organ"
icon = 'icons/effects/blood.dmi'
desc = "It smells like an accident in a chemical factory."
/obj/item/organ/xenos/eggsac
name = "egg sac"
icon_state = "xgibmid1"
organ_tag = "egg sac"
/obj/item/organ/xenos/plasmavessel
name = "plasma vessel"
icon_state = "xgibdown1"
organ_tag = "plasma vessel"
/obj/item/organ/xenos/acidgland
name = "acid gland"
icon_state = "xgibtorso"
organ_tag = "acid gland"
/obj/item/organ/xenos/hivenode
name = "hive node"
icon_state = "xgibmid2"
organ_tag = "hive node"
/obj/item/organ/xenos/resinspinner
name = "hive node"
icon_state = "xgibmid2"
organ_tag = "resin spinner"
//VOX ORGANS.
/obj/item/organ/stack
name = "cortical stack"
icon_state = "brain-prosthetic"
parent_organ = "head"
organ_tag = "stack"
robotic = 2
vital = 1
var/backup_time = 0
var/datum/mind/backup
/obj/item/organ/stack/process()
if(owner && owner.stat != 2 && !is_broken())
backup_time = world.time
if(owner.mind) backup = owner.mind
/obj/item/organ/stack/vox
name = "vox cortical stack"
/obj/item/organ/stack/vox/stack
File diff suppressed because it is too large Load Diff
+115
View File
@@ -0,0 +1,115 @@
var/global/list/limb_icon_cache = list()
/obj/item/organ/external/proc/compile_icon()
overlays.Cut()
// This is a kludge, only one icon has more than one generation of children though.
for(var/obj/item/organ/external/organ in contents)
if(organ.children && organ.children.len)
for(var/obj/item/organ/external/child in organ.children)
overlays += child.mob_icon
overlays += organ.mob_icon
/obj/item/organ/external/proc/sync_colour_to_human(var/mob/living/carbon/human/human)
s_tone = null
s_col = null
if(status & ORGAN_ROBOT)
return
if(!isnull(human.s_tone) && (human.species.bodyflags & HAS_SKIN_TONE))
s_tone = human.s_tone
if(human.species.bodyflags & HAS_SKIN_COLOR)
s_col = list(human.r_skin, human.g_skin, human.b_skin)
/obj/item/organ/external/head/sync_colour_to_human(var/mob/living/carbon/human/human)
..()
var/obj/item/organ/eyes/eyes = owner.internal_organs_by_name["eyes"]
if(eyes) eyes.update_colour()
/obj/item/organ/external/head/removed()
get_icon()
..()
/obj/item/organ/external/head/get_icon()
..()
if(owner.species.has_organ["eyes"])
var/obj/item/organ/eyes/eyes = owner.internal_organs_by_name["eyes"]
if(owner.species.eyes)
var/icon/eyes_icon = new/icon('icons/mob/human_face.dmi', owner.species.eyes)
if(eyes)
eyes_icon.Blend(rgb(eyes.eye_colour[1], eyes.eye_colour[2], eyes.eye_colour[3]), ICON_ADD)
else
eyes_icon.Blend(rgb(128,0,0), ICON_ADD)
mob_icon.Blend(eyes_icon, ICON_OVERLAY)
if(owner.lip_style && (owner.species && (owner.species.flags & HAS_LIPS)))
mob_icon.Blend(new/icon('icons/mob/human_face.dmi', "lips_[owner.lip_style]_s"), ICON_OVERLAY)
if(owner.f_style)
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[owner.f_style]
if(facial_hair_style && facial_hair_style.species_allowed && (owner.species.name in facial_hair_style.species_allowed))
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
if(facial_hair_style.do_colouration)
facial_s.Blend(rgb(owner.r_facial, owner.g_facial, owner.b_facial), ICON_ADD)
overlays |= facial_s
if(owner.h_style && !(owner.head && (owner.head.flags & BLOCKHEADHAIR)))
var/datum/sprite_accessory/hair_style = hair_styles_list[owner.h_style]
if(hair_style && (owner.species.name in hair_style.species_allowed))
var/icon/hair_s = new/icon("icon" = hair_style.icon, "icon_state" = "[hair_style.icon_state]_s")
if(hair_style.do_colouration)
hair_s.Blend(rgb(owner.r_hair, owner.g_hair, owner.b_hair), ICON_ADD)
overlays |= hair_s
return mob_icon
/obj/item/organ/external/proc/get_icon(var/skeletal)
var/gender
if(force_icon)
mob_icon = new /icon(force_icon, "[icon_name]")
else
if(!owner)
mob_icon = new /icon('icons/mob/human_races/r_human.dmi', "[icon_name][gendered_icon ? "_f" : ""]")
else
if(gendered_icon)
if(owner.gender == FEMALE)
gender = "f"
else
gender = "m"
if(skeletal)
mob_icon = new /icon('icons/mob/human_races/r_skeleton.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else if ((status & ORGAN_ROBOT) && !(owner.species && owner.species.flags & IS_SYNTHETIC))
mob_icon = new /icon('icons/mob/human_races/robotic.dmi', "[icon_name][gender ? "_[gender]" : ""]")
else
if (status & ORGAN_MUTATED)
mob_icon = new /icon(owner.species.deform, "[icon_name][gender ? "_[gender]" : ""]")
else
mob_icon = new /icon(owner.species.icobase, "[icon_name][gender ? "_[gender]" : ""]")
if(status & ORGAN_DEAD)
mob_icon.ColorTone(rgb(10,50,0))
mob_icon.SetIntensity(0.7)
if(!isnull(s_tone))
if(s_tone >= 0)
mob_icon.Blend(rgb(s_tone, s_tone, s_tone), ICON_ADD)
else
mob_icon.Blend(rgb(-s_tone, -s_tone, -s_tone), ICON_SUBTRACT)
else if(s_col && s_col.len >= 3)
mob_icon.Blend(rgb(s_col[1], s_col[2], s_col[3]), ICON_ADD)
dir = EAST
icon = mob_icon
return mob_icon
// new damage icon system
// adjusted to set damage_state to brute/burn code only (without r_name0 as before)
/obj/item/organ/external/update_icon()
var/n_is = damage_state_text()
if (n_is != damage_state)
damage_state = n_is
return 1
return 0
+114 -271
View File
@@ -1,142 +1,32 @@
/****************************************************
INTERNAL ORGANS
****************************************************/
/datum/organ/internal
// amount of damage to the organ
var/damage = 0
var/min_bruised_damage = 10
var/min_broken_damage = 30
var/parent_organ = "chest"
var/desc = ""
var/list/emplevel = list(0,0,0) // [1] is the highest amount of emp damage, [3] is the least
var/damagelevel = 1
/datum/organ/internal/proc/rejuvenate()
damage=0
/datum/organ/internal/proc/is_bruised()
return damage >= min_bruised_damage
/datum/organ/internal/proc/is_broken()
return damage >= min_broken_damage
/datum/organ/internal/New(mob/living/carbon/human/H)
..()
if(H)
var/datum/organ/internal/check = H.internal_organs_by_name[name]
if(check)
remove(H)
add(H)
/datum/organ/internal/process()
//Process infections
if (owner.species && owner.species.flags & IS_PLANT)
germ_level = 0
return
if(owner.bodytemperature >= 170) //cryo stops germs from moving and doing their bad stuffs
//** Handle antibiotics and curing infections
handle_antibiotics()
//** Handle the effects of infections
var/antibiotics = owner.reagents.get_reagent_amount("spaceacillin")
if (germ_level > 0 && germ_level < INFECTION_LEVEL_ONE/2 && prob(30))
germ_level--
if (germ_level >= INFECTION_LEVEL_ONE/2)
//aiming for germ level to go from ambient to INFECTION_LEVEL_TWO in an average of 15 minutes
if(antibiotics < 5 && prob(round(germ_level/6)))
germ_level++
if (germ_level >= INFECTION_LEVEL_TWO)
var/datum/organ/external/parent = owner.get_organ(parent_organ)
//spread germs
if (antibiotics < 5 && parent.germ_level < germ_level && ( parent.germ_level < INFECTION_LEVEL_ONE*2 || prob(30) ))
parent.germ_level++
if (prob(3)) //about once every 30 seconds
take_damage(1,silent=prob(30))
/datum/organ/internal/proc/take_damage(amount, var/silent=0)
damage += amount * damagelevel
var/datum/organ/external/parent = owner.get_organ(parent_organ)
if (!silent)
owner.custom_pain("Something inside your [parent.display_name] hurts a lot.", 1)
/datum/organ/internal/proc/emp_act(severity)
if(emplevel[1])
take_damage(emplevel[severity])
/datum/organ/internal/proc/mechanize() //Being used to make robutt hearts, etc
/datum/organ/internal/proc/mechassist() //Used to add things like pacemakers, etc
/datum/organ/internal/proc/remove(var/mob/living/carbon/human/H)
if(H)
var/datum/organ/internal/toremove = H.internal_organs_by_name[name]
if(toremove)
var/datum/organ/external/E = H.organs_by_name[toremove.parent_organ]
for (var/datum/organ/internal/I in E.internal_organs)
if (I == toremove)
I = null
return
/datum/organ/internal/proc/add(var/mob/living/carbon/human/H)
var/datum/organ/external/P = H.organs_by_name[parent_organ]
if(P)
if(P.internal_organs == null)
P.internal_organs = list()
P.internal_organs += src
H.internal_organs_by_name[name] = src
H.internal_organs |= src
owner = H
return
#define PROCESS_ACCURACY 10
/****************************************************
INTERNAL ORGANS DEFINES
****************************************************/
/datum/organ/internal/heart
// Brain is defined in brain_item.dm.
/obj/item/organ/heart
name = "heart"
icon_state = "heart-on"
organ_tag = "heart"
parent_organ = "chest"
dead_icon = "heart-off"
vital = 1
/datum/organ/internal/heart/robotic
damagelevel = 0.8
emplevel = list(40,15,10)
desc = "Mechanical"
/datum/organ/internal/heart/robotic/process()
germ_level = 0
return
/datum/organ/internal/heart/mechanize()
new /datum/organ/internal/heart/robotic(owner)
return
/datum/organ/internal/heart/assisted
min_bruised_damage = 15
min_broken_damage = 35
emplevel = list(20,7,3)
desc = "Assisted"
/datum/organ/internal/heart/mechassist()
new /datum/organ/internal/heart/assisted(owner)
return
/datum/organ/internal/lungs
/obj/item/organ/lungs
name = "lungs"
icon_state = "lungs"
gender = PLURAL
organ_tag = "lungs"
parent_organ = "chest"
/datum/organ/internal/lungs/process()
/obj/item/organ/lungs/process()
..()
if(!owner)
return
if (germ_level > INFECTION_LEVEL_ONE)
if(prob(5))
owner.emote("cough") //respitory tract infection
@@ -149,36 +39,72 @@
spawn owner.emote("me", 1, "gasps for air!")
owner.losebreath += 5
/datum/organ/internal/lungs/robotic
damagelevel = 0.8
emplevel = list(40,15,10)
desc = "Mechanical"
/obj/item/organ/kidneys
name = "kidneys"
icon_state = "kidneys"
gender = PLURAL
organ_tag = "kidneys"
parent_organ = "groin"
/datum/organ/internal/lungs/robotic/process()
germ_level = 0
return
/obj/item/organ/kidneys/process()
/datum/organ/internal/lungs/mechanize()
new /datum/organ/internal/lungs/robotic(owner)
return
/datum/organ/internal/lungs/assisted
min_bruised_damage = 15
min_broken_damage = 35
emplevel = list(20,7,3)
desc = "Assisted"
/datum/organ/internal/lungs/mechassist()
new /datum/organ/internal/lungs/assisted(owner)
return
/datum/organ/internal/liver
name = "liver"
parent_organ = "chest"
var/process_accuracy = 10
/datum/organ/internal/liver/process()
..()
if(!owner)
return
// Coffee is really bad for you with busted kidneys.
// This should probably be expanded in some way, but fucked if I know
// what else kidneys can process in our reagent list.
var/datum/reagent/coffee = locate(/datum/reagent/drink/coffee) in owner.reagents.reagent_list
if(coffee)
if(is_bruised())
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
else if(is_broken())
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
/obj/item/organ/eyes
name = "eyeballs"
icon_state = "eyes"
gender = PLURAL
organ_tag = "eyes"
parent_organ = "head"
var/list/eye_colour = list(0,0,0)
/obj/item/organ/eyes/proc/update_colour()
if(!owner)
return
eye_colour = list(
owner.r_eyes ? owner.r_eyes : 0,
owner.g_eyes ? owner.g_eyes : 0,
owner.b_eyes ? owner.b_eyes : 0
)
/obj/item/organ/eyes/process() //Eye damage replaces the old eye_stat var.
..()
if(!owner)
return
if(is_bruised())
owner.eye_blurry = 20
if(is_broken())
owner.eye_blind = 20
/obj/item/organ/liver
name = "liver"
icon_state = "liver"
organ_tag = "liver"
parent_organ = "groin"
/obj/item/organ/liver/process()
..()
if(!owner)
return
if (germ_level > INFECTION_LEVEL_ONE)
if(prob(1))
owner << "\red Your skin itches."
@@ -186,146 +112,63 @@
if(prob(1))
spawn owner.vomit()
if(owner.life_tick % process_accuracy == 0)
if(src.damage < 0)
src.damage = 0
if(owner.life_tick % PROCESS_ACCURACY == 0)
//High toxins levels are dangerous
if(owner.getToxLoss() >= 60 && !owner.reagents.has_reagent("charcoal"))
//Healthy liver suffers on its own
if (src.damage < min_broken_damage)
src.damage += 0.2 * process_accuracy
src.damage += 0.2 * PROCESS_ACCURACY
//Damaged one shares the fun
else
var/datum/organ/internal/O = pick(owner.internal_organs)
var/obj/item/organ/O = pick(owner.internal_organs)
if(O)
O.damage += 0.2 * process_accuracy
O.damage += 0.2 * PROCESS_ACCURACY
//Detox can heal small amounts of damage
if (src.damage && src.damage < src.min_bruised_damage && owner.reagents.has_reagent("charcoal"))
src.damage -= 0.2 * process_accuracy
src.damage -= 0.2 * PROCESS_ACCURACY
if(src.damage < 0)
src.damage = 0
// Get the effectiveness of the liver.
var/filter_effect = 3
if(is_bruised())
filter_effect -= 1
if(is_broken())
filter_effect -= 2
// Damaged liver means some chemicals are very dangerous
if(src.damage >= src.min_bruised_damage)
for(var/datum/reagent/R in owner.reagents.reagent_list)
// Ethanol and all drinks are bad
if(istype(R, /datum/reagent/ethanol))
owner.adjustToxLoss(0.1 * process_accuracy)
owner.adjustToxLoss(0.1 * PROCESS_ACCURACY)
// Can't cope with toxins at all
for(var/toxin in list("toxin", "plasma", "sacid", "facid", "cyanide", "amanitin", "carpotoxin", "mindbreaker"))
if(owner.reagents.has_reagent(toxin))
owner.adjustToxLoss(0.3 * process_accuracy)
owner.adjustToxLoss(0.3 * PROCESS_ACCURACY)
/datum/organ/internal/liver/robotic
damagelevel = 0.8
emplevel = list(40,15,10)
/obj/item/organ/appendix
name = "appendix"
icon_state = "appendix"
organ_tag = "appendix"
parent_organ = "groin"
/datum/organ/internal/liver/robotic/process()
germ_level = 0
return
/datum/organ/internal/liver/mechanize()
new /datum/organ/internal/liver/robotic(owner)
return
/*
/obj/item/organ/appendix/removed()
/datum/organ/internal/liver/assisted
min_bruised_damage = 15
min_broken_damage = 35
emplevel = list(20,7,3)
desc = "Assisted"
/datum/organ/internal/liver/mechassist()
new /datum/organ/internal/liver/assisted(owner)
return
/datum/organ/internal/kidney
name = "kidney"
parent_organ = "chest"
/datum/organ/internal/kidney/robotic
damagelevel = 0.8
emplevel = list(40,15,10)
desc = "Mechanical"
/datum/organ/internal/kidney/robotic/process()
germ_level = 0
return
/datum/organ/internal/kidney/mechanize()
new /datum/organ/internal/kidney/robotic(owner)
return
/datum/organ/internal/kidney/assisted
min_bruised_damage = 15
min_broken_damage = 35
emplevel = list(20,7,3)
desc = "Assisted"
/datum/organ/internal/kidney/mechassist()
new /datum/organ/internal/kidney/assisted(owner)
return
/datum/organ/internal/brain
name = "brain"
parent_organ = "head"
/datum/organ/internal/brain/robotic
damagelevel = 0.8
emplevel = list(40,15,10)
desc = "Mechanical"
/datum/organ/internal/brain/robotic/process()
germ_level = 0
return
/datum/organ/internal/brain/mechanize()
new /datum/organ/internal/brain/robotic(owner)
return
/datum/organ/internal/brain/assisted
min_bruised_damage = 15
min_broken_damage = 35
emplevel = list(20,7,3)
desc = "Assisted"
/datum/organ/internal/brain/mechassist()
new /datum/organ/internal/brain/assisted(owner)
return
/datum/organ/internal/eyes
name = "eyes"
parent_organ = "head"
/datum/organ/internal/eyes/process() //Eye damage replaces the old eye_stat var.
if(owner)
var/inflamed = 0
for(var/datum/disease/appendicitis/appendicitis in owner.viruses)
inflamed = 1
appendicitis.cure()
owner.resistances += appendicitis
if(inflamed)
icon_state = "appendixinflamed"
name = "inflamed appendix"
..()
if(is_bruised())
owner.eye_blurry = 20
if(is_broken())
owner.eye_blind = 20
/datum/organ/internal/eyes/robotic
damagelevel = 0.8
emplevel = list(40,15,10)
desc = "Mechanical"
/datum/organ/internal/eyes/robotic/process()
germ_level = 0
if(is_bruised())
owner.eye_blurry = 20
if(is_broken())
owner.eye_blind = 20
/datum/organ/internal/eyes/mechanize()
new /datum/organ/internal/eyes/robotic(owner)
return
/datum/organ/internal/eyes/assisted
min_bruised_damage = 15
min_broken_damage = 35
emplevel = list(20,7,3)
desc = "Assisted"
/datum/organ/internal/eyes/mechassist()
new /datum/organ/internal/eyes/assisted(owner)
return
*/
+22
View File
@@ -0,0 +1,22 @@
/obj/item/organ/external/stump
name = "limb stump"
icon_name = ""
cannot_amputate = 1
/obj/item/organ/external/stump/New(var/mob/living/carbon/holder, var/internal, var/obj/item/organ/external/limb)
if(istype(limb))
limb_name = limb.limb_name
body_part = limb.body_part
amputation_point = limb.amputation_point
parent_organ = limb.parent_organ
wounds = limb.wounds
..(holder, internal)
if(istype(limb))
max_damage = limb.max_damage
/obj/item/organ/external/stump/is_stump()
return 1
/obj/item/organ/external/stump/removed()
..()
del(src)
+6 -9
View File
@@ -87,10 +87,8 @@ mob/living/carbon/human/proc/handle_pain()
if(analgesic)
return
var/maxdam = 0
var/datum/organ/external/damaged_organ = null
for(var/datum/organ/external/E in organs)
// amputated limbs don't cause pain
if(E.amputated) continue
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
var/dam = E.get_damage()
// make the choice of the organ depend on damage,
@@ -99,15 +97,14 @@ mob/living/carbon/human/proc/handle_pain()
damaged_organ = E
maxdam = dam
if(damaged_organ)
pain(damaged_organ.display_name, maxdam, 0)
pain(damaged_organ.name, maxdam, 0)
// Damage to internal organs hurts a lot.
for(var/n in internal_organs_by_name)
var/datum/organ/internal/I = internal_organs_by_name[n]
for(var/obj/item/organ/I in internal_organs)
if(I.damage > 2) if(prob(2))
var/datum/organ/external/parent = get_organ(I.parent_organ)
src.custom_pain("You feel a sharp pain in your [parent.display_name]", 1)
var/obj/item/organ/external/parent = get_organ(I.parent_organ)
src.custom_pain("You feel a sharp pain in your [parent.name]", 1)
var/toxDamageMessage = null
var/toxMessageProb = 1
+37
View File
@@ -0,0 +1,37 @@
var/global/list/all_robolimbs = list()
var/global/list/chargen_robolimbs = list()
var/global/datum/robolimb/basic_robolimb
/proc/populate_robolimb_list()
basic_robolimb = new()
for(var/limb_type in typesof(/datum/robolimb))
var/datum/robolimb/R = new limb_type()
all_robolimbs[R.company] = R
if(!R.unavailable_at_chargen)
chargen_robolimbs[R.company] = R
/datum/robolimb
var/company = "Unbranded" // Shown when selecting the limb.
var/desc = "A generic unbranded robotic prosthesis." // Seen when examining a limb.
var/icon = 'icons/mob/human_races/robotic.dmi' // Icon base to draw from.
var/unavailable_at_chargen // If set, not available at chargen.
/datum/robolimb/bishop
company = "Bishop Cybernetics"
desc = "This limb has a white polymer casing with blue holo-displays."
icon = 'icons/mob/human_races/cyberlimbs/bishop.dmi'
/datum/robolimb/hesphaistos
company = "Hesphiastos Industries"
desc = "This limb has a militaristic black and green casing with gold stripes."
icon = 'icons/mob/human_races/cyberlimbs/hesphaistos.dmi'
/datum/robolimb/zenghu
company = "Zeng-Hu Pharmaceuticals"
desc = "This limb has a rubbery fleshtone covering with visible seams."
icon = 'icons/mob/human_races/cyberlimbs/zenghu.dmi'
/datum/robolimb/xion
company = "Xion Manufacturing Group"
desc = "This limb has a minimalist black and red casing."
icon = 'icons/mob/human_races/cyberlimbs/xion.dmi'
+3 -3
View File
@@ -209,9 +209,9 @@
/** WOUND DEFINITIONS **/
//Note that the MINIMUM damage before a wound can be applied should correspond to
//Note that the MINIMUM damage before a wound can be applied should correspond to
//the damage amount for the stage with the same name as the wound.
//e.g. /datum/wound/cut/deep should only be applied for 15 damage and up,
//e.g. /datum/wound/cut/deep should only be applied for 15 damage and up,
//because in it's stages list, "deep cut" = 15.
/proc/get_wound_type(var/type = CUT, var/damage)
switch(type)
@@ -323,4 +323,4 @@ datum/wound/cut/massive
return 0 //cannot be merged
/datum/wound/lost_limb/small
stages = list("ripped stump" = 40, "bloody stump" = 30, "clotted stump" = 15, "scarred stump" = 0)
stages = list("ripped hole" = 40, "bloody hole" = 30, "clotted hole" = 15, "scarred hole" = 0)
+9 -8
View File
@@ -29,10 +29,10 @@
var/mob/M = usr
if(M.restrained() || M.stat || !Adjacent(M))
return
if(over_object == M)
M.put_in_hands(src)
else if(istype(over_object, /obj/screen))
switch(over_object.name)
if("r_hand")
@@ -43,7 +43,7 @@
if(!M.unEquip(src))
return
M.put_in_l_hand(src)
add_fingerprint(M)
@@ -52,12 +52,13 @@
/obj/item/weapon/paper_bin/attack_hand(mob/user as mob)
if (hasorgans(user))
var/datum/organ/external/temp = user:organs_by_name["r_hand"]
if (user.hand)
temp = user:organs_by_name["l_hand"]
if (ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
if (H.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
user << "<span class='notice'>You try to move your [temp.display_name], but cannot!"
H << "<span class='notice'>You try to move your [temp.name], but cannot!"
return
if(amount >= 1)
amount--
+9 -13
View File
@@ -614,25 +614,21 @@ obj/structure/cable/proc/cableColor(var/colorC)
..()
/obj/item/stack/cable_coil/attack(mob/M as mob, mob/user as mob)
if(hasorgans(M))
var/datum/organ/external/S = M:get_organ(user.zone_sel.selecting)
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/S = H.get_organ(user.zone_sel.selecting)
if(!(S.status & ORGAN_ROBOT) || user.a_intent != "help")
return ..()
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
if(H.species.flags & IS_SYNTHETIC)
if(M == user)
user << "\red You can't repair damage to your own body - it's against OH&S."
return
if(H.species.flags & IS_SYNTHETIC)
if(M == user)
user << "\red You can't repair damage to your own body - it's against OH&S."
return
if(S.burn_dam > 0 && use(1))
S.heal_damage(0,15,0,1)
user.visible_message("\red \The [user] repairs some burn damage on \the [M]'s [S.display_name] with \the [src].")
if(istype(M,/mob/living/carbon/human))
var/mob/living/carbon/human/H = M
H.updatehealth()
user.visible_message("\red \The [user] repairs some burn damage on \the [M]'s [S.name] with \the [src].")
H.updatehealth()
return
else
user << "Nothing to fix!"
+1 -1
View File
@@ -519,7 +519,7 @@
else
user << "You try to remove the light [fitting], but you burn your hand on it!"
var/datum/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand")
var/obj/item/organ/external/affecting = H.get_organ("[user.hand ? "l" : "r" ]_hand")
if(affecting.take_damage( 0, 5 )) // 5 burn damage
H.UpdateDamageIcon()
H.updatehealth()
@@ -213,7 +213,7 @@
if(isliving(target) && isliving(user))
if(target == user)
var/datum/organ/external/affecting = user.zone_sel.selecting
var/obj/item/organ/external/affecting = user.zone_sel.selecting
if(affecting == "head")
var/obj/item/ammo_casing/AC = chambered
if(!process_chambered())
+4 -4
View File
@@ -752,7 +752,7 @@ datum
if(!M.unacidable)
if(prob(15) && istype(M, /mob/living/carbon/human) && volume >= 30)
var/mob/living/carbon/human/H = M
var/datum/organ/external/affecting = H.get_organ("head")
var/obj/item/organ/external/affecting = H.get_organ("head")
if(affecting)
if(affecting.take_damage(25, 0))
H.UpdateDamageIcon()
@@ -1180,7 +1180,7 @@ datum
M.eye_blind = 0
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/datum/organ/internal/eyes/E = H.internal_organs_by_name["eyes"]
var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"]
if(istype(E))
E.damage = max(E.damage-5 , 0)
M.SetWeakened(0)
@@ -1252,7 +1252,7 @@ datum
//Mitocholide is hard enough to get, it's probably fair to make this all internal organs
for(var/name in H.internal_organs_by_name)
var/datum/organ/internal/I = H.internal_organs_by_name[name]
var/obj/item/organ/I = H.internal_organs_by_name[name]
if(I.damage > 0)
I.damage -= 0.20
..()
@@ -2439,7 +2439,7 @@ datum
M:drowsyness = max(M:drowsyness, 30/sober_str)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/datum/organ/internal/liver/L = H.internal_organs_by_name["liver"]
var/obj/item/organ/liver/L = H.internal_organs_by_name["liver"]
if (istype(L))
L.take_damage(0.1, 1)
H.adjustToxLoss(0.1)
+1 -1
View File
@@ -515,7 +515,7 @@ datum/reagent/oculine/on_mob_life(var/mob/living/M as mob)
M.eye_blind = max(M.eye_blind-5 , 0)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/datum/organ/internal/eyes/E = H.internal_organs_by_name["eyes"]
var/obj/item/organ/eyes/E = H.internal_organs_by_name["eyes"]
if(istype(E))
if(E.damage > 0)
E.damage -= 1
+2 -2
View File
@@ -250,7 +250,7 @@ datum/reagent/facid/reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)
return
if(!H.unacidable)
var/datum/organ/external/affecting = H.get_organ("head")
var/obj/item/organ/external/affecting = H.get_organ("head")
if(affecting.take_damage(15, 0))
H.UpdateDamageIcon()
H.emote("scream")
@@ -272,7 +272,7 @@ datum/reagent/facid/reaction_mob(var/mob/living/M, var/method=TOUCH, var/volume)
if(!M.unacidable)
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/datum/organ/external/affecting = H.get_organ("head")
var/obj/item/organ/external/affecting = H.get_organ("head")
if(affecting.take_damage(15, 0))
H.UpdateDamageIcon()
H.emote("scream")
@@ -43,7 +43,7 @@
force = 15 //Smashing bottles over someoen's head hurts.
var/datum/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at
var/obj/item/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at
var/armor_block = 0 //Get the target's armour values for normal attack damage.
var/armor_duration = 0 //The more force the bottle has, the longer the duration.
@@ -32,7 +32,7 @@
force = 5
var/datum/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at
var/obj/item/organ/external/affecting = user.zone_sel.selecting //Find what the player is aiming at
var/armor_block = 0 //Get the target's armour values for normal attack damage.
@@ -1676,9 +1676,9 @@
surprise.transform *= 0.6
surprise.add_blood(M)
var/mob/living/carbon/human/H = M
var/datum/organ/external/E = H.get_organ("chest")
var/obj/item/organ/external/E = H.get_organ("chest")
E.fracture()
for (var/datum/organ/internal/I in E.internal_organs)
for (var/obj/item/organ/I in E.internal_organs)
I.take_damage(rand(I.min_bruised_damage, I.min_broken_damage+1))
if (!E.hidden && prob(60)) //set it snuggly
@@ -283,14 +283,12 @@
if(istype(target, /mob/living/carbon/human))
var/target_zone = ran_zone(check_zone(user.zone_sel.selecting, target))
var/datum/organ/external/affecting = target:get_organ(target_zone)
var/obj/item/organ/external/affecting = target:get_organ(target_zone)
if (!affecting)
if (!affecting || (affecting.status & ORGAN_DESTROYED) || affecting.is_stump())
user << "<span class='danger'>They are missing that limb!</span>"
return
if(affecting.status & ORGAN_DESTROYED)
user << "What [affecting.display_name]?"
return
var/hit_area = affecting.display_name
var/hit_area = affecting.name
var/mob/living/carbon/human/H = target
if((user != target) && H.check_shields(7, "the [src.name]"))
@@ -13,7 +13,7 @@
if(ishuman(toucher))
var/mob/living/carbon/human/H = toucher
for(var/datum/organ/external/affecting in H.organs)
for(var/obj/item/organ/external/affecting in H.organs)
if(affecting && istype(affecting))
affecting.heal_damage(25 * weakness, 25 * weakness)
//H:heal_organ_damage(25, 25)
+3 -3
View File
@@ -10,7 +10,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (target_zone != "groin")
return 0
var/datum/organ/external/groin = target.get_organ("groin")
var/obj/item/organ/external/groin = target.get_organ("groin")
if (!groin)
return 0
if (groin.open < 2)
@@ -44,7 +44,7 @@
target.op_stage.appendix = 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/groin = target.get_organ("groin")
var/obj/item/organ/external/groin = target.get_organ("groin")
user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s abdomen with \the [tool]!", \
"\red Your hand slips, slicing an artery inside [target]'s abdomen with \the [tool]!")
groin.createwound(CUT, 50, 1)
@@ -83,7 +83,7 @@
target.op_stage.appendix = 2
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, nicking internal organs in [target]'s abdomen with \the [tool]!", \
"\red Your hand slips, nicking internal organs in [target]'s abdomen with \the [tool]!")
affected.createwound(BRUISE, 20)
+42 -43
View File
@@ -15,27 +15,27 @@
max_duration = 60
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
return affected.open == 2 && affected.stage == 0
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 2 && affected.stage == 0
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected.stage == 0)
user.visible_message("[user] starts applying medication to the damaged bones in [target]'s [affected.display_name] with \the [tool]." , \
"You start applying medication to the damaged bones in [target]'s [affected.display_name] with \the [tool].")
target.custom_pain("Something in your [affected.display_name] is causing you a lot of pain!",1)
user.visible_message("[user] starts applying medication to the damaged bones in [target]'s [affected.name] with \the [tool]." , \
"You start applying medication to the damaged bones in [target]'s [affected.name] with \the [tool].")
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] applies some [tool] to [target]'s bone in [affected.display_name]", \
"\blue You apply some [tool] to [target]'s bone in [affected.display_name] with \the [tool].")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] applies some [tool] to [target]'s bone in [affected.name]", \
"\blue You apply some [tool] to [target]'s bone in [affected.name] with \the [tool].")
affected.stage = 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")
/datum/surgery_step/set_bone
allowed_tools = list(
@@ -47,31 +47,31 @@
max_duration = 70
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
return affected.name != "head" && affected.open == 2 && affected.stage == 1
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.name != "head" && affected.open == 2 && affected.stage == 1
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to set the bone in [target]'s [affected.display_name] in place with \the [tool]." , \
"You are beginning to set the bone in [target]'s [affected.display_name] in place with \the [tool].")
target.custom_pain("The pain in your [affected.display_name] is going to make you pass out!",1)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to set the bone in [target]'s [affected.name] in place with \the [tool]." , \
"You are beginning to set the bone in [target]'s [affected.name] in place with \the [tool].")
target.custom_pain("The pain in your [affected.name] is going to make you pass out!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected.status & ORGAN_BROKEN)
user.visible_message("\blue [user] sets the bone in [target]'s [affected.display_name] in place with \the [tool].", \
"\blue You set the bone in [target]'s [affected.display_name] in place with \the [tool].")
user.visible_message("\blue [user] sets the bone in [target]'s [affected.name] in place with \the [tool].", \
"\blue You set the bone in [target]'s [affected.name] in place with \the [tool].")
affected.stage = 2
else
user.visible_message("\blue [user] sets the bone in [target]'s [affected.display_name]\red in the WRONG place with \the [tool].", \
"\blue You set the bone in [target]'s [affected.display_name]\red in the WRONG place with \the [tool].")
user.visible_message("\blue [user] sets the bone in [target]'s [affected.name]\red in the WRONG place with \the [tool].", \
"\blue You set the bone in [target]'s [affected.name]\red in the WRONG place with \the [tool].")
affected.fracture()
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, damaging the bone in [target]'s [affected.display_name] with \the [tool]!" , \
"\red Your hand slips, damaging the bone in [target]'s [affected.display_name] with \the [tool]!")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!" , \
"\red Your hand slips, damaging the bone in [target]'s [affected.name] with \the [tool]!")
affected.createwound(BRUISE, 5)
/datum/surgery_step/mend_skull
@@ -84,8 +84,8 @@
max_duration = 70
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
return affected.name == "head" && affected.open == 2 && affected.stage == 1
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.name == "head" && 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 piece together [target]'s skull with \the [tool]." , \
@@ -93,17 +93,16 @@
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] sets [target]'s skull with \the [tool]." , \
"\blue You set [target]'s skull with \the [tool].")
affected.stage = 2
target.unexpose_brain()
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, damaging [target]'s face with \the [tool]!" , \
"\red Your hand slips, damaging [target]'s face with \the [tool]!")
var/datum/organ/external/head/h = affected
var/obj/item/organ/external/head/h = affected
h.createwound(BRUISE, 10)
h.disfigured = 1
@@ -119,25 +118,25 @@
max_duration = 60
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
return affected.open == 2 && affected.stage == 2
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected && affected.open == 2 && affected.stage == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to finish mending the damaged bones in [target]'s [affected.display_name] with \the [tool].", \
"You start to finish mending the damaged bones in [target]'s [affected.display_name] with \the [tool].")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts to finish mending the damaged bones in [target]'s [affected.name] with \the [tool].", \
"You start to finish mending the damaged bones in [target]'s [affected.name] with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has mended the damaged bones in [target]'s [affected.display_name] with \the [tool]." , \
"\blue You have mended the damaged bones in [target]'s [affected.display_name] with \the [tool]." )
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has mended the damaged bones in [target]'s [affected.name] with \the [tool]." , \
"\blue You have mended the damaged bones in [target]'s [affected.name] with \the [tool]." )
affected.status &= ~ORGAN_BROKEN
affected.status &= ~ORGAN_SPLINTED
affected.stage = 0
affected.perma_injury = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")
+4 -22
View File
@@ -95,28 +95,10 @@
user.attack_log += "\[[time_stamp()]\]<font color='red'> Debrained [target.name] ([target.ckey]) with [tool.name] (INTENT: [uppertext(user.a_intent)])</font>"
target.attack_log += "\[[time_stamp()]\]<font color='orange'> Debrained by [user.name] ([user.ckey]) with [tool.name] (INTENT: [uppertext(user.a_intent)])</font>"
msg_admin_attack("[user.name] ([user.ckey]) debrained [target.name] ([target.ckey]) with [tool.name] (INTENT: [uppertext(user.a_intent)]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
if(!iscarbon(user))
target.LAssailant = null
else
target.LAssailant = user
var/mob/living/carbon/human/H
if(istype(target,/mob/living/carbon/human))
H = target
var/obj/item/brain/B
if(H && H.species && H.species.flags & IS_SYNTHETIC)
var/obj/item/device/mmi/posibrain/P = new(target.loc)
P.transfer_identity(target)
else
B = new(target.loc)
B.transfer_identity(target)
target.internal_organs_by_name -= B
target.internal_organs_by_name -= "brain"
target:brain_op_stage = 4.0
target.death()//You want them to die after the brain was transferred, so not to trigger client death() twice.
var/obj/item/organ/brain/B = target.internal_organs_by_name["brain"]
if(B && istype(B))
B.removed(user)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, cutting a vein in [target]'s brain with \the [tool]!", \
@@ -180,7 +162,7 @@
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] mends hematoma in [target]'s brain with \the [tool].", \
"\blue You mend hematoma in [target]'s brain with \the [tool].")
var/datum/organ/internal/brain/sponge = target.internal_organs_by_name["brain"]
var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"]
if (sponge)
sponge.damage = 0
+70
View File
@@ -0,0 +1,70 @@
//////////////////////////////////////////////////////////////////
// BRAIN DAMAGE FIXING //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/brain/bone_chips
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/kitchen/utensil/fork = 20
)
priority = 3
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/affected = target.get_organ(target_zone)
if(!affected) return
var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"]
return (sponge && sponge.damage > 0 && sponge.damage <= 20) && affected.open == 3
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts taking bone chips out of [target]'s brain with \the [tool].", \
"You start taking bone chips out of [target]'s brain with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] takes out all the bone chips in [target]'s brain with \the [tool].", \
"\blue You take out all the bone chips in [target]'s brain with \the [tool].")
var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"]
if (sponge)
sponge.damage = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, jabbing \the [tool] in [target]'s brain!", \
"\red Your hand slips, jabbing \the [tool] in [target]'s brain!")
target.apply_damage(30, BRUTE, "head", 1, sharp=1)
/datum/surgery_step/brain/hematoma
allowed_tools = list(
/obj/item/weapon/FixOVein = 100, \
/obj/item/stack/cable_coil = 75
)
priority = 3
min_duration = 90
max_duration = 110
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) return
var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"]
return (sponge && sponge.damage > 20) && affected.open == 3
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts mending hematoma in [target]'s brain with \the [tool].", \
"You start mending hematoma in [target]'s brain with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] mends hematoma in [target]'s brain with \the [tool].", \
"\blue You mend hematoma in [target]'s brain with \the [tool].")
var/obj/item/organ/brain/sponge = target.internal_organs_by_name["brain"]
if (sponge)
sponge.damage = 20
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, bruising [target]'s brain with \the [tool]!", \
"\red Your hand slips, bruising [target]'s brain with \the [tool]!")
target.apply_damage(20, BRUTE, "head", 1, sharp=1)
+218
View File
@@ -0,0 +1,218 @@
//Procedures in this file: Generic ribcage opening steps, Removing alien embryo, Fixing internal organs.
//////////////////////////////////////////////////////////////////
// GENERIC RIBCAGE SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/open_encased
priority = 2
can_infect = 1
blood_level = 1
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)
return affected && affected.encased && affected.open >= 2
/datum/surgery_step/open_encased/saw
allowed_tools = list(
/obj/item/weapon/circular_saw = 100, \
/obj/item/weapon/hatchet = 75
)
min_duration = 50
max_duration = 70
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] begins to cut through [target]'s [affected.encased] with \the [tool].", \
"You begin to cut through [target]'s [affected.encased] with \the [tool].")
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has cut [target]'s [affected.encased] open with \the [tool].", \
"\blue You have cut [target]'s [affected.encased] open with \the [tool].")
affected.open = 2.5
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, cracking [target]'s [affected.encased] with \the [tool]!" , \
"\red Your hand slips, cracking [target]'s [affected.encased] with \the [tool]!" )
affected.createwound(CUT, 20)
affected.fracture()
/datum/surgery_step/open_encased/retract
allowed_tools = list(
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 75
)
min_duration = 30
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2.5
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]."
var/self_msg = "You start to force open the [affected.encased] in [target]'s [affected.name] with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\blue [user] forces open [target]'s [affected.encased] with \the [tool]."
var/self_msg = "\blue You force open [target]'s [affected.encased] with \the [tool]."
user.visible_message(msg, self_msg)
affected.open = 3
// Whoops!
if(prob(10))
affected.fracture()
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\red [user]'s hand slips, cracking [target]'s [affected.encased]!"
var/self_msg = "\red Your hand slips, cracking [target]'s [affected.encased]!"
user.visible_message(msg, self_msg)
affected.createwound(BRUISE, 20)
affected.fracture()
/datum/surgery_step/open_encased/close
allowed_tools = list(
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 75
)
min_duration = 20
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 3
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts bending [target]'s [affected.encased] back into place with \the [tool]."
var/self_msg = "You start bending [target]'s [affected.encased] back into place with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\blue [user] bends [target]'s [affected.encased] back into place with \the [tool]."
var/self_msg = "\blue You bend [target]'s [affected.encased] back into place with \the [tool]."
user.visible_message(msg, self_msg)
affected.open = 2.5
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\red [user]'s hand slips, bending [target]'s [affected.encased] the wrong way!"
var/self_msg = "\red Your hand slips, bending [target]'s [affected.encased] the wrong way!"
user.visible_message(msg, self_msg)
affected.createwound(BRUISE, 20)
affected.fracture()
/*if (prob(40)) //TODO: ORGAN REMOVAL UPDATE.
user.visible_message("\red A rib pierces the lung!")
target.rupture_lung()*/
/datum/surgery_step/open_encased/mend
allowed_tools = list(
/obj/item/weapon/bonegel = 100, \
/obj/item/weapon/screwdriver = 75
)
min_duration = 20
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && affected.open == 2.5
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts applying \the [tool] to [target]'s [affected.encased]."
var/self_msg = "You start applying \the [tool] to [target]'s [affected.encased]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your [affected.name]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\blue [user] applied \the [tool] to [target]'s [affected.encased]."
var/self_msg = "\blue You applied \the [tool] to [target]'s [affected.encased]."
user.visible_message(msg, self_msg)
affected.open = 2
+10 -10
View File
@@ -9,7 +9,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!affected)
return 0
return target_zone == "eyes"
@@ -39,8 +39,8 @@
target.blinded += 1.5
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"]
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"]
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, slicing [target]'s eyes wth \the [tool]!" , \
"\red Your hand slips, slicing [target]'s eyes wth \the [tool]!" )
affected.createwound(CUT, 10)
@@ -69,8 +69,8 @@
target.op_stage.eyes = 2
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"]
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"]
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, damaging [target]'s eyes with \the [tool]!", \
"\red Your hand slips, damaging [target]'s eyes with \the [tool]!")
target.apply_damage(10, BRUTE, affected)
@@ -100,8 +100,8 @@
target.op_stage.eyes = 3
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"]
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"]
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, stabbing \the [tool] into [target]'s eye!", \
"\red Your hand slips, stabbing \the [tool] into [target]'s eye!")
target.apply_damage(10, BRUTE, affected, sharp=1)
@@ -126,7 +126,7 @@
"You are beginning to cauterize the incision around [target]'s eyes with \the [tool].")
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"]
var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"]
user.visible_message("\blue [user] cauterizes the incision around [target]'s eyes with \the [tool].", \
"\blue You cauterize the incision around [target]'s eyes with \the [tool].")
if (target.op_stage.eyes == 3)
@@ -136,8 +136,8 @@
target.op_stage.eyes = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/eyes/eyes = target.internal_organs_by_name["eyes"]
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/eyes/eyes = target.internal_organs_by_name["eyes"]
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, searing [target]'s eyes with \the [tool]!", \
"\red Your hand slips, searing [target]'s eyes with \the [tool]!")
target.apply_damage(5, BURN, affected)
+6 -6
View File
@@ -9,7 +9,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!affected)
return 0
return target_zone == "mouth"
@@ -38,7 +38,7 @@
target.op_stage.face = 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, slicing [target]'s throat wth \the [tool]!" , \
"\red Your hand slips, slicing [target]'s throat wth \the [tool]!" )
affected.createwound(CUT, 60)
@@ -95,7 +95,7 @@
target.op_stage.face = 3
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, tearing skin on [target]'s face with \the [tool]!", \
"\red Your hand slips, tearing skin on [target]'s face with \the [tool]!")
target.apply_damage(10, BRUTE, affected, sharp=1, sharp=1)
@@ -120,20 +120,20 @@
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] cauterizes the incision on [target]'s face and neck with \the [tool].", \
"\blue You cauterize the incision on [target]'s face and neck with \the [tool].")
affected.open = 0
affected.status &= ~ORGAN_BLEEDING
if (target.op_stage.face == 3)
var/datum/organ/external/head/h = affected
var/obj/item/organ/external/head/h = affected
h.disfigured = 0
h.update_icon()
target.regenerate_icons()
target.op_stage.face = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, leaving a small burn on [target]'s face with \the [tool]!", \
"\red Your hand slips, leaving a small burn on [target]'s face with \the [tool]!")
target.apply_damage(4, BURN, affected)
+61 -60
View File
@@ -10,7 +10,7 @@
return 0
if (!hasorgans(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected == null)
return 0
if (affected.status & ORGAN_DESTROYED)
@@ -34,20 +34,20 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!ishuman(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open == 0 && target_zone != "mouth"
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts the incision on [target]'s [affected.display_name] with \the [tool].", \
"You start the incision on [target]'s [affected.display_name] with \the [tool].")
target.custom_pain("You feel a horrible pain as if from a sharp knife in your [affected.display_name]!",1)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts the incision on [target]'s [affected.name] with \the [tool].", \
"You start the incision on [target]'s [affected.name] with \the [tool].")
target.custom_pain("You feel a horrible pain as if from a sharp knife in your [affected.name]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has made an incision on [target]'s [affected.display_name] with \the [tool].", \
"\blue You have made an incision on [target]'s [affected.display_name] with \the [tool].",)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has made an incision on [target]'s [affected.name] with \the [tool].", \
"\blue You have made an incision on [target]'s [affected.name] with \the [tool].",)
affected.open = 1
affected.status |= ORGAN_BLEEDING
affected.createwound(CUT, 1)
@@ -55,9 +55,9 @@
target.brain_op_stage = 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, slicing open [target]'s [affected.display_name] in a wrong spot with \the [tool]!", \
"\red Your hand slips, slicing open [target]'s [affected.display_name] in a wrong spot with \the [tool]!")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!", \
"\red Your hand slips, slicing open [target]'s [affected.name] in a wrong spot with \the [tool]!")
affected.createwound(CUT, 10)
/datum/surgery_step/generic/clamp_bleeders
@@ -71,27 +71,27 @@
max_duration = 60
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open && (affected.status & ORGAN_BLEEDING)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts clamping bleeders in [target]'s [affected.display_name] with \the [tool].", \
"You start clamping bleeders in [target]'s [affected.display_name] with \the [tool].")
target.custom_pain("The pain in your [affected.display_name] is maddening!",1)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts clamping bleeders in [target]'s [affected.name] with \the [tool].", \
"You start clamping bleeders in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in your [affected.name] is maddening!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] clamps bleeders in [target]'s [affected.display_name] with \the [tool].", \
"\blue You clamp bleeders in [target]'s [affected.display_name] with \the [tool].")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] clamps bleeders in [target]'s [affected.name] with \the [tool].", \
"\blue You clamp bleeders in [target]'s [affected.name] with \the [tool].")
affected.clamp()
spread_germs_to_organ(affected, user)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, tearing blood vessals and causing massive bleeding in [target]'s [affected.display_name] with \the [tool]!", \
"\red Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.display_name] with \the [tool]!",)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, tearing blood vessals and causing massive bleeding in [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, tearing blood vessels and causing massive bleeding in [target]'s [affected.name] with \the [tool]!",)
affected.createwound(CUT, 10)
/datum/surgery_step/generic/retract_skin
@@ -105,13 +105,13 @@
max_duration = 40
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open == 1 && !(affected.status & ORGAN_BLEEDING)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts to pry open the incision on [target]'s [affected.display_name] with \the [tool]."
var/self_msg = "You start to pry open the incision on [target]'s [affected.display_name] with \the [tool]."
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "[user] starts to pry open the incision on [target]'s [affected.name] with \the [tool]."
var/self_msg = "You start to pry open the incision on [target]'s [affected.name] with \the [tool]."
if (target_zone == "chest")
msg = "[user] starts to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
self_msg = "You start to separate the ribcage and rearrange the organs in [target]'s torso with \the [tool]."
@@ -119,13 +119,13 @@
msg = "[user] starts to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
self_msg = "You start to pry open the incision and rearrange the organs in [target]'s lower abdomen with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("It feels like the skin on your [affected.display_name] is on fire!",1)
target.custom_pain("It feels like the skin on your [affected.name] is on fire!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/msg = "\blue [user] keeps the incision open on [target]'s [affected.display_name] with \the [tool]."
var/self_msg = "\blue You keep the incision open on [target]'s [affected.display_name] with \the [tool]."
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\blue [user] keeps the incision open on [target]'s [affected.name] with \the [tool]."
var/self_msg = "\blue You keep the incision open on [target]'s [affected.name] with \the [tool]."
if (target_zone == "chest")
msg = "\blue [user] keeps the ribcage open on [target]'s torso with \the [tool]."
self_msg = "\blue You keep the ribcage open on [target]'s torso with \the [tool]."
@@ -136,9 +136,9 @@
affected.open = 2
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/msg = "\red [user]'s hand slips, tearing the edges of incision on [target]'s [affected.display_name] with \the [tool]!"
var/self_msg = "\red Your hand slips, tearing the edges of incision on [target]'s [affected.display_name] with \the [tool]!"
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/msg = "\red [user]'s hand slips, tearing the edges of incision on [target]'s [affected.name] with \the [tool]!"
var/self_msg = "\red Your hand slips, tearing the edges of incision on [target]'s [affected.name] with \the [tool]!"
if (target_zone == "chest")
msg = "\red [user]'s hand slips, damaging several organs [target]'s torso with \the [tool]!"
self_msg = "\red Your hand slips, damaging several organs [target]'s torso with \the [tool]!"
@@ -160,31 +160,32 @@
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open && target_zone != "mouth"
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to cauterize the incision on [target]'s [affected.display_name] with \the [tool]." , \
"You are beginning to cauterize the incision on [target]'s [affected.display_name] with \the [tool].")
target.custom_pain("Your [affected.display_name] is being burned!",1)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to cauterize the incision on [target]'s [affected.name] with \the [tool]." , \
"You are beginning to cauterize the incision on [target]'s [affected.name] with \the [tool].")
target.custom_pain("Your [affected.name] is being burned!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] cauterizes the incision on [target]'s [affected.display_name] with \the [tool].", \
"\blue You cauterize the incision on [target]'s [affected.display_name] with \the [tool].")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] cauterizes the incision on [target]'s [affected.name] with \the [tool].", \
"\blue You cauterize the incision on [target]'s [affected.name] with \the [tool].")
affected.open = 0
affected.germ_level = 0
affected.status &= ~ORGAN_BLEEDING
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, leaving a small burn on [target]'s [affected.display_name] with \the [tool]!", \
"\red Your hand slips, leaving a small burn on [target]'s [affected.display_name] with \the [tool]!")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, leaving a small burn on [target]'s [affected.name] with \the [tool]!")
target.apply_damage(3, BURN, affected)
/datum/surgery_step/generic/cut_limb
/datum/surgery_step/generic/amputate
allowed_tools = list(
/obj/item/weapon/circular_saw = 100, \
/obj/item/weapon/hatchet = 75, \
@@ -199,29 +200,29 @@
return 0
if (!hasorgans(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected == null)
return 0
if (affected.status & ORGAN_DESTROYED)
return 0
return target_zone != "chest" && target_zone != "groin" && target_zone != "head"
return !affected.cannot_amputate
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to cut off [target]'s [affected.display_name] with \the [tool]." , \
"You are beginning to cut off [target]'s [affected.display_name] with \the [tool].")
target.custom_pain("Your [affected.display_name] is being ripped apart!",1)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to amputate [target]'s [affected.name] with \the [tool]." , \
"You are beginning to cut through [target]'s [affected.amputation_point] with \the [tool].")
target.custom_pain("Your [affected.amputation_point] is being ripped apart!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] cuts off [target]'s [affected.display_name] with \the [tool].", \
"\blue You cut off [target]'s [affected.display_name] with \the [tool].")
affected.droplimb(1,1,1)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] amputates [target]'s [affected.name] at the [affected.amputation_point] with \the [tool].", \
"\blue You amputate [target]'s [affected.name] with \the [tool].")
affected.droplimb(1,DROPLIMB_EDGE)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, sawing through the bone in [target]'s [affected.display_name] with \the [tool]!", \
"\red Your hand slips, sawing through the bone in [target]'s [affected.display_name] with \the [tool]!")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, sawing through the bone in [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, sawwing through the bone in [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 30)
affected.fracture()
affected.fracture()
+16 -201
View File
@@ -1,218 +1,33 @@
//This is an uguu head restoration surgery TOTALLY not yoinked from chinsky's limb reattacher
/datum/surgery_step/head/
can_infect = 0
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
if (!affected)
return 0
if (!(affected.status & ORGAN_DESTROYED))
return 0
if (affected.parent)
if (affected.parent.status & ORGAN_DESTROYED)
return 0
return affected.name == "head"
/datum/surgery_step/head/peel
allowed_tools = list(
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 75, \
/obj/item/weapon/kitchen/utensil/fork = 50, \
)
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
return ..() && !(affected.status & ORGAN_CUT_AWAY)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("[user] starts peeling back tattered flesh where [target]'s head used to be with \the [tool].", \
"You start peeling back tattered flesh where [target]'s head used to be with \the [tool].")
else
user.visible_message("[user] starts peeling back metal where [target]'s head used to be with \the [tool].", \
"You start peeling back metal where [target]'s head used to be with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("\blue [user] peels back tattered flesh where [target]'s head used to be with \the [tool].", \
"\blue You peel back tattered flesh where [target]'s head used to be with \the [tool].")
else
user.visible_message("\blue [user] peels back metal where [target]'s head used to be with \the [tool].", \
"\blue You peel back metal where [target]'s head used to be with \the [tool].")
affected.status |= ORGAN_CUT_AWAY
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
user.visible_message("\red [user]'s hand slips, ripping [target]'s [affected.display_name] open!", \
"\red Your hand slips, ripping [target]'s [affected.display_name] open!")
affected.createwound(CUT, 10)
/datum/surgery_step/head/shape
allowed_tools = list(
/obj/item/weapon/FixOVein = 100, \
/obj/item/stack/cable_coil = 75, \
/obj/item/device/assembly/mousetrap = 10) //ok chinsky
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
var/datum/organ/external/affected = target.get_organ(target_zone)
return affected.status & ORGAN_CUT_AWAY && target.op_stage.head_reattach == 0 && !(affected.status & ORGAN_ATTACHABLE)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] is beginning to reshape [target]'s esophagal and vocal region with \the [tool].", \
"You start to reshape [target]'s [affected.display_name] esophagal and vocal region with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("\blue [user] has finished repositioning flesh and tissue to something anatomically recognizable where [target]'s head used to be with \the [tool].", \
"\blue You have finished repositioning flesh and tissue to something anatomically recognizable where [target]'s head used to be with \the [tool].")
else
user.visible_message("\blue [user] has finished repositioning metal to something recognizable where [target]'s head used to be with \the [tool].", \
"\blue You have finished repositioning metal to something anatomically recognizable where [target]'s head used to be with \the [tool].")
target.op_stage.head_reattach = 1
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("\red [user]'s hand slips, further rending flesh on [target]'s neck!", \
"\red Your hand slips, further rending flesh on [target]'s neck!")
else
user.visible_message("\red [user]'s hand slips, further rending metal on [target]'s neck!", \
"\red Your hand slips, further rending metal on [target]'s neck!")
target.apply_damage(10, BRUTE, affected)
/datum/surgery_step/head/suture
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/stack/cable_coil = 60, \
/obj/item/weapon/FixOVein = 80)
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
return target.op_stage.head_reattach == 1
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
// var/datum/organ/external/affected = target.get_organ(target_zone)
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("[user] is stapling and suturing flesh into place in [target]'s esophagal and vocal region with \the [tool].", \
"You start to staple and suture flesh into place in [target]'s esophagal and vocal region with \the [tool].")
else
user.visible_message("[user] is stapling and suturing metal into place in [target]'s esophagal and vocal region with \the [tool].", \
"You start to staple and suture metal into place in [target]'s esophagal and vocal region with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has finished stapling [target]'s neck into place with \the [tool].", \
"\blue You have finished stapling [target]'s neck into place with \the [tool].")
target.op_stage.head_reattach = 2
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
user.visible_message("\red [user]'s hand slips, ripping apart flesh on [target]'s neck!", \
"\red Your hand slips, ripping apart flesh on [target]'s neck!")
target.apply_damage(10, BRUTE, affected)
/datum/surgery_step/head/prepare
allowed_tools = list(
/obj/item/weapon/cautery = 100, \
/obj/item/clothing/mask/cigarette = 75, \
/obj/item/weapon/lighter = 50, \
/obj/item/weapon/weldingtool = 25
)
min_duration = 60
max_duration = 70
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if(..())
return target.op_stage.head_reattach == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts adjusting area around [target]'s neck with \the [tool].", \
"You start adjusting area around [target]'s neck with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has finished adjusting the area around [target]'s neck with \the [tool].", \
"\blue You have finished adjusting the area around [target]'s neck with \the [tool].")
target.op_stage.head_reattach = 0
affected.status |= ORGAN_ATTACHABLE
affected.amputated = 1
affected.setAmputatedTree()
affected.open = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
user.visible_message("\red [user]'s hand slips, searing [target]'s neck!", \
"\red Your hand slips, searing [target]'s [affected.display_name]!")
target.apply_damage(10, BURN, affected)
/datum/surgery_step/head/attach
allowed_tools = list(/obj/item/weapon/organ/head = 100)
/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/datum/organ/external/head = target.get_organ(target_zone)
return ..() && head.status & ORGAN_ATTACHABLE
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 reshaped neck.", \
"You start attaching [tool] to [target]'s reshaped neck.")
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)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has attached [target]'s head to the body.", \
"\blue You have attached [target]'s head to the body.")
affected.status = 0
if(target.species && (target.species.flags & IS_SYNTHETIC))
affected.status = 128
affected.amputated = 0
affected.destspawn = 0
var/obj/item/weapon/organ/head/B = tool
if (B.brainmob.mind)
B.brainmob.mind.transfer_to(target)
affected.setAmputatedTree()
target.handle_organs()
var/obj/item/organ/external/head = tool
user.unEquip(head)
head.replaced(target)
head.loc = target
head.status = 0
target.update_body()
target.UpdateDamageIcon()
target.regenerate_icons()
target.updatehealth()
del(B)
target.UpdateDamageIcon()
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, damaging connectors on [target]'s neck!", \
"\red Your hand slips, damaging connectors on [target]'s neck!")
target.apply_damage(10, BRUTE, affected, sharp=1)
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)
+38 -38
View File
@@ -7,10 +7,10 @@
/datum/surgery_step/cavity
priority = 1
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected.open == 2 && !(affected.status & ORGAN_BLEEDING) && (target_zone != "chest" || target.op_stage.ribcage == 2)
proc/get_max_wclass(datum/organ/external/affected)
proc/get_max_wclass(obj/item/organ/external/affected)
switch (affected.name)
if ("head")
return 1
@@ -20,7 +20,7 @@
return 2
return 0
proc/get_cavity(datum/organ/external/affected)
proc/get_cavity(obj/item/organ/external/affected)
switch (affected.name)
if ("head")
return "cranial"
@@ -41,11 +41,11 @@
max_duration = 80
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && !affected.cavity && !affected.hidden
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \
"You start making some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." )
target.custom_pain("The pain in your chest is living hell!",1)
@@ -53,14 +53,14 @@
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] makes some space inside [target]'s [get_cavity(affected)] cavity with \the [tool].", \
"\blue You make some space inside [target]'s [get_cavity(affected)] cavity with \the [tool]." )
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 20)
/datum/surgery_step/cavity/close_space
@@ -76,11 +76,11 @@
max_duration = 80
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.cavity
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts mending [target]'s [get_cavity(affected)] cavity wall with \the [tool].", \
"You start mending [target]'s [get_cavity(affected)] cavity wall with \the [tool]." )
target.custom_pain("The pain in your chest is living hell!",1)
@@ -88,14 +88,14 @@
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] mends [target]'s [get_cavity(affected)] cavity walls with \the [tool].", \
"\blue You mend [target]'s [get_cavity(affected)] cavity walls with \the [tool]." )
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 20)
/datum/surgery_step/cavity/place_item
@@ -108,19 +108,19 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!ishuman(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/can_fit = !affected.hidden && affected.cavity && tool.w_class <= get_max_wclass(affected)
return ..() && can_fit
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts putting \the [tool] inside [target]'s [get_cavity(affected)] cavity.", \
"You start putting \the [tool] inside [target]'s [get_cavity(affected)] cavity." )
target.custom_pain("The pain in your chest is living hell!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
if(istype(tool, /obj/item/weapon/disk/nuclear))
user << "Central command would kill you if you implanted the disk into someone."
@@ -131,16 +131,16 @@
user << "\red You tear some vessels trying to fit such big object in this cavity."
var/datum/wound/internal_bleeding/I = new ()
affected.wounds += I
affected.owner.custom_pain("You feel something rip in your [affected.display_name]!", 1)
affected.owner.custom_pain("You feel something rip in your [affected.name]!", 1)
user.drop_item()
affected.hidden = tool
tool.loc = target
affected.cavity = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 20)
//////////////////////////////////////////////////////////////////
@@ -158,14 +158,14 @@
max_duration = 100
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts poking around inside the incision on [target]'s [affected.display_name] with \the [tool].", \
"You start poking around inside the incision on [target]'s [affected.display_name] with \the [tool]" )
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts poking around inside the incision on [target]'s [affected.name] with \the [tool].", \
"You start poking around inside the incision on [target]'s [affected.name] with \the [tool]" )
target.custom_pain("The pain in your chest is living hell!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
var/find_prob = 0
@@ -183,8 +183,8 @@
find_prob +=50
if (prob(find_prob))
user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.display_name] with \the [tool].", \
"\blue You take [obj] out of incision on [target]'s [affected.display_name]s with \the [tool]." )
user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.name] with \the [tool].", \
"\blue You take [obj] out of incision on [target]'s [affected.name]s with \the [tool]." )
affected.implants -= obj
target.hud_updateflag |= 1 << IMPLOYAL_HUD
@@ -202,11 +202,11 @@
imp.imp_in = null
imp.implanted = 0
else
user.visible_message("\blue [user] removes \the [tool] from [target]'s [affected.display_name].", \
"\blue There's something inside [target]'s [affected.display_name], but you just missed it this time." )
user.visible_message("\blue [user] removes \the [tool] from [target]'s [affected.name].", \
"\blue There's something inside [target]'s [affected.name], but you just missed it this time." )
else if (affected.hidden)
user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.display_name] with \the [tool].", \
"\blue You take something out of incision on [target]'s [affected.display_name]s with \the [tool]." )
user.visible_message("\blue [user] takes something out of incision on [target]'s [affected.name] with \the [tool].", \
"\blue You take something out of incision on [target]'s [affected.name]s with \the [tool]." )
affected.hidden.loc = get_turf(target)
if(!affected.hidden.blood_DNA)
affected.hidden.blood_DNA = list()
@@ -215,20 +215,20 @@
affected.hidden = null
else
user.visible_message("\blue [user] could not find anything inside [target]'s [affected.display_name], and pulls \the [tool] out.", \
"\blue You could not find anything inside [target]'s [affected.display_name]." )
user.visible_message("\blue [user] could not find anything inside [target]'s [affected.name], and pulls \the [tool] out.", \
"\blue You could not find anything inside [target]'s [affected.name]." )
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!", \
"\red Your hand slips, scraping tissue inside [target]'s [affected.display_name] with \the [tool]!")
var/obj/item/organ/external/chest/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, scraping tissue inside [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 20)
if (affected.implants.len)
var/fail_prob = 10
fail_prob += 100 - tool_quality(tool)
if (prob(fail_prob))
var/obj/item/weapon/implant/imp = affected.implants[1]
user.visible_message("\red Something beeps inside [target]'s [affected.display_name]!")
user.visible_message("\red Something beeps inside [target]'s [affected.name]!")
playsound(imp.loc, 'sound/items/countdown.ogg', 75, 1, -3)
spawn(25)
imp.activate()
+458
View File
@@ -0,0 +1,458 @@
// Internal surgeries.
/datum/surgery_step/internal
priority = 2
can_infect = 1
blood_level = 1
/datum/surgery_step/internal/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)
return affected && affected.open == (affected.encased ? 3 : 2)
//////////////////////////////////////////////////////////////////
// ALIEN EMBRYO SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/internal/remove_embryo
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/kitchen/utensil/fork = 20
)
blood_level = 2
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/embryo = 0
for(var/obj/item/alien_embryo/A in target)
embryo = 1
break
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && affected && embryo && affected.open == 3 && target_zone == "chest"
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "[user] starts to pull something out from [target]'s ribcage with \the [tool]."
var/self_msg = "You start to pull something out from [target]'s ribcage with \the [tool]."
user.visible_message(msg, self_msg)
target.custom_pain("Something hurts horribly in your chest!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user] rips the larva out of [target]'s ribcage!",
"You rip the larva out of [target]'s ribcage!")
for(var/obj/item/alien_embryo/A in target)
A.loc = A.loc.loc
//////////////////////////////////////////////////////////////////
// CHEST INTERNAL ORGAN SURGERY //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/internal/fix_organ
allowed_tools = list(
/obj/item/stack/medical/advanced/bruise_pack= 100, \
/obj/item/stack/medical/bruise_pack = 20
)
min_duration = 70
max_duration = 90
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!affected)
return
var/is_organ_damaged = 0
for(var/obj/item/organ/I in affected.internal_organs)
if(I.damage > 0)
is_organ_damaged = 1
break
return ..() && is_organ_damaged
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/tool_name = "\the [tool]"
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
tool_name = "regenerative membrane"
else if (istype(tool, /obj/item/stack/medical/bruise_pack))
tool_name = "the bandaid"
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
for(var/obj/item/organ/I in affected.internal_organs)
if(I && I.damage > 0)
if(I.robotic < 2)
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]." )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/tool_name = "\the [tool]"
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
tool_name = "regenerative membrane"
if (istype(tool, /obj/item/stack/medical/bruise_pack))
tool_name = "the bandaid"
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
for(var/obj/item/organ/I in affected.internal_organs)
if(I && I.damage > 0)
if(I.robotic < 2)
user.visible_message("\blue [user] treats damage to [target]'s [I.name] with [tool_name].", \
"\blue You treat damage to [target]'s [I.name] with [tool_name]." )
I.damage = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, getting mess and tearing the inside of [target]'s [affected.name] with \the [tool]!")
var/dam_amt = 2
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
target.adjustToxLoss(5)
else if (istype(tool, /obj/item/stack/medical/bruise_pack))
dam_amt = 5
target.adjustToxLoss(10)
affected.createwound(CUT, 5)
for(var/obj/item/organ/I in affected.internal_organs)
if(I && I.damage > 0)
I.take_damage(dam_amt,0)
/datum/surgery_step/internal/fix_organ_robotic //For artificial organs
allowed_tools = list(
/obj/item/stack/nanopaste = 100, \
/obj/item/weapon/bonegel = 30, \
/obj/item/weapon/screwdriver = 70, \
)
min_duration = 70
max_duration = 90
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!affected) return
var/is_organ_damaged = 0
for(var/obj/item/organ/I in affected.internal_organs)
if(I.damage > 0 && I.robotic >= 2)
is_organ_damaged = 1
break
return ..() && is_organ_damaged
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
for(var/obj/item/organ/I in affected.internal_organs)
if(I && I.damage > 0)
if(I.robotic >= 2)
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." )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
for(var/obj/item/organ/I in affected.internal_organs)
if(I && I.damage > 0)
if(I.robotic >= 2)
user.visible_message("\blue [user] repairs [target]'s [I.name] with [tool].", \
"\blue You repair [target]'s [I.name] with [tool]." )
I.damage = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, gumming up the mechanisms inside of [target]'s [affected.name] with \the [tool]!")
target.adjustToxLoss(5)
affected.createwound(CUT, 5)
for(var/obj/item/organ/I in affected.internal_organs)
if(I)
I.take_damage(rand(3,5),0)
/datum/surgery_step/internal/detatch_organ
allowed_tools = list(
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchenknife = 75, \
/obj/item/weapon/shard = 50, \
)
min_duration = 90
max_duration = 110
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!..())
return 0
target.op_stage.current_organ = null
var/list/attached_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 && I.parent_organ == target_zone)
attached_organs |= organ
var/organ_to_remove = input(user, "Which organ do you want to prepare for removal?") as null|anything in attached_organs
if(!organ_to_remove)
return 0
target.op_stage.current_organ = organ_to_remove
return ..() && organ_to_remove
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 to separate [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You start to separate [target]'s [target.op_stage.current_organ] with \the [tool]." )
target.custom_pain("The pain in your [affected.name] is living hell!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has separated [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"\blue You have separated [target]'s [target.op_stage.current_organ] with \the [tool].")
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
if(I && istype(I))
I.status |= ORGAN_CUT_AWAY
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)
user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, rand(30,50), 1)
/datum/surgery_step/internal/remove_organ
allowed_tools = list(
/obj/item/weapon/hemostat = 100, \
/obj/item/weapon/wirecutters = 75, \
/obj/item/weapon/kitchen/utensil/fork = 20
)
min_duration = 60
max_duration = 80
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!..())
return 0
target.op_stage.current_organ = null
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.status & ORGAN_CUT_AWAY && I.parent_organ == target_zone)
removable_organs |= organ
var/organ_to_remove = input(user, "Which organ do you want to remove?") as null|anything in removable_organs
if(!organ_to_remove)
return 0
target.op_stage.current_organ = organ_to_remove
return ..()
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] starts removing [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You start removing [target]'s [target.op_stage.current_organ] with \the [tool].")
target.custom_pain("Someone's ripping out your [target.op_stage.current_organ]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has removed [target]'s [target.op_stage.current_organ] with \the [tool].", \
"\blue You have removed [target]'s [target.op_stage.current_organ] with \the [tool].")
// Extract the organ!
if(target.op_stage.current_organ)
var/obj/item/organ/O = target.internal_organs_by_name[target.op_stage.current_organ]
if(O && istype(O))
O.removed(user)
target.op_stage.current_organ = null
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)
user.visible_message("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!")
affected.createwound(BRUISE, 20)
/datum/surgery_step/internal/replace_organ
allowed_tools = list(
/obj/item/organ = 100
)
min_duration = 60
max_duration = 80
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/organ/O = tool
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if(!affected) return
var/organ_compatible
var/organ_missing
if(!istype(O))
return 0
if(!target.species)
user << "\red You have no idea what species this person is. Report this on the bug tracker."
return 2
var/o_is = (O.gender == PLURAL) ? "are" : "is"
var/o_a = (O.gender == PLURAL) ? "" : "a "
var/o_do = (O.gender == PLURAL) ? "don't" : "doesn't"
if(O.organ_tag == "limb")
return 0
else if(target.species.has_organ[O.organ_tag])
if(O.damage > (O.max_damage * 0.75))
user << "\red \The [O.organ_tag] [o_is] in no state to be transplanted."
return 2
if(!target.internal_organs_by_name[O.organ_tag])
organ_missing = 1
else
user << "\red \The [target] already has [o_a][O.organ_tag]."
return 2
if(O && affected.limb_name == O.parent_organ)
organ_compatible = 1
else
user << "\red \The [O.organ_tag] [o_do] normally go in \the [affected.name]."
return 2
else
user << "\red You're pretty sure [target.species.name] don't normally have [o_a][O.organ_tag]."
return 2
return ..() && organ_missing && organ_compatible
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 transplanting \the [tool] into [target]'s [affected.name].", \
"You start transplanting \the [tool] into [target]'s [affected.name].")
target.custom_pain("Someone's rooting around in your [affected.name]!",1)
..()
end_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)
user.visible_message("\blue [user] has transplanted \the [tool] into [target]'s [affected.name].", \
"\blue You have transplanted \the [tool] into [target]'s [affected.name].")
user.drop_item(tool)
var/obj/item/organ/O = tool
if(istype(O))
O.replaced(target,affected)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, damaging \the [tool]!", \
"\red Your hand slips, damaging \the [tool]!")
var/obj/item/organ/I = tool
if(istype(I))
I.take_damage(rand(3,5),0)
/datum/surgery_step/internal/attach_organ
allowed_tools = list(
/obj/item/weapon/FixOVein = 100, \
/obj/item/stack/cable_coil = 75
)
min_duration = 100
max_duration = 120
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!..())
return 0
target.op_stage.current_organ = null
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.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
if(!organ_to_replace)
return 0
target.op_stage.current_organ = organ_to_replace
return ..()
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("[user] begins reattaching [target]'s [target.op_stage.current_organ] with \the [tool].", \
"You start reattaching [target]'s [target.op_stage.current_organ] with \the [tool].")
target.custom_pain("Someone's digging needles into your [target.op_stage.current_organ]!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] has reattached [target]'s [target.op_stage.current_organ] with \the [tool]." , \
"\blue You have reattached [target]'s [target.op_stage.current_organ] with \the [tool].")
var/obj/item/organ/I = target.internal_organs_by_name[target.op_stage.current_organ]
if(I && istype(I))
I.status &= ~ORGAN_CUT_AWAY
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)
user.visible_message("\red [user]'s hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, damaging the flesh in [target]'s [affected.name] with \the [tool]!")
affected.createwound(BRUISE, 20)
//////////////////////////////////////////////////////////////////
// HEART SURGERY //
//////////////////////////////////////////////////////////////////
// To be finished after some tests.
// /datum/surgery_step/ribcage/heart/cut
// allowed_tools = list(
// /obj/item/weapon/scalpel = 100, \
// /obj/item/weapon/kitchenknife = 75, \
// /obj/item/weapon/shard = 50, \
// )
// min_duration = 30
// max_duration = 40
// can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
// return ..() && target.op_stage.ribcage == 2
+33 -33
View File
@@ -17,7 +17,7 @@
max_duration = 90
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
var/internal_bleeding = 0
for(var/datum/wound/W in affected.wounds) if(W.internal)
@@ -27,16 +27,16 @@
return affected.open == 2 && internal_bleeding
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts patching the damaged vein in [target]'s [affected.display_name] with \the [tool]." , \
"You start patching the damaged vein in [target]'s [affected.display_name] with \the [tool].")
target.custom_pain("The pain in [affected.display_name] is unbearable!",1)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts patching the damaged vein in [target]'s [affected.name] with \the [tool]." , \
"You start patching the damaged vein in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has patched the damaged vein in [target]'s [affected.display_name] with \the [tool].", \
"\blue You have patched the damaged vein in [target]'s [affected.display_name] with \the [tool].")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has patched the damaged vein in [target]'s [affected.name] with \the [tool].", \
"\blue You have patched the damaged vein in [target]'s [affected.name] with \the [tool].")
for(var/datum/wound/W in affected.wounds) if(W.internal)
affected.wounds -= W
@@ -44,9 +44,9 @@
if (ishuman(user) && prob(40)) user:bloody_hands(target, 0)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.display_name]!")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s [affected.name]!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s [affected.name]!")
affected.take_damage(5, 0)
/datum/surgery_step/fix_dead_tissue //Debridement
@@ -70,27 +70,27 @@
if (target_zone == "mouth" || target_zone == "eyes")
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected.open == 2 && (affected.status & ORGAN_DEAD)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts cutting away necrotic tissue in [target]'s [affected.display_name] with \the [tool]." , \
"You start cutting away necrotic tissue in [target]'s [affected.display_name] with \the [tool].")
target.custom_pain("The pain in [affected.display_name] is unbearable!",1)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts cutting away necrotic tissue in [target]'s [affected.name] with \the [tool]." , \
"You start cutting away necrotic tissue in [target]'s [affected.name] with \the [tool].")
target.custom_pain("The pain in [affected.name] is unbearable!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has cut away necrotic tissue in [target]'s [affected.display_name] with \the [tool].", \
"\blue You have cut away necrotic tissue in [target]'s [affected.display_name] with \the [tool].")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has cut away necrotic tissue in [target]'s [affected.name] with \the [tool].", \
"\blue You have cut away necrotic tissue in [target]'s [affected.name] with \the [tool].")
affected.open = 3
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!", \
"\red Your hand slips, slicing an artery inside [target]'s [affected.display_name] with \the [tool]!")
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!", \
"\red Your hand slips, slicing an artery inside [target]'s [affected.name] with \the [tool]!")
affected.createwound(CUT, 20, 1)
/datum/surgery_step/treat_necrosis
@@ -123,18 +123,18 @@
if (target_zone == "mouth" || target_zone == "eyes")
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return affected.open == 3 && (affected.status & ORGAN_DEAD)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts applying medication to the affected tissue in [target]'s [affected.display_name] with \the [tool]." , \
"You start applying medication to the affected tissue in [target]'s [affected.display_name] with \the [tool].")
target.custom_pain("Something in your [affected.display_name] is causing you a lot of pain!",1)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts applying medication to the affected tissue in [target]'s [affected.name] with \the [tool]." , \
"You start applying medication to the affected tissue in [target]'s [affected.name] with \the [tool].")
target.custom_pain("Something in your [affected.name] is causing you a lot of pain!",1)
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return
@@ -148,11 +148,11 @@
if(container.reagents.has_reagent("mitocholide"))
affected.status &= ~ORGAN_DEAD
user.visible_message("\blue [user] applies [trans] units of the solution to affected tissue in [target]'s [affected.display_name]", \
"\blue You apply [trans] units of the solution to affected tissue in [target]'s [affected.display_name] with \the [tool].")
user.visible_message("\blue [user] applies [trans] units of the solution to affected tissue in [target]'s [affected.name]", \
"\blue You apply [trans] units of the solution to affected tissue in [target]'s [affected.name] with \the [tool].")
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (!istype(tool, /obj/item/weapon/reagent_containers))
return
@@ -162,7 +162,7 @@
var/trans = container.reagents.trans_to(target, container.amount_per_transfer_from_this)
container.reagents.reaction(target, INGEST) //technically it's contact, but the reagents are being applied to internal tissue
user.visible_message("\red [user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.display_name] with the [tool]!" , \
"\red Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.display_name] with the [tool]!")
user.visible_message("\red [user]'s hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!" , \
"\red Your hand slips, applying [trans] units of the solution to the wrong place in [target]'s [affected.name] with the [tool]!")
//no damage or anything, just wastes medicine
+25 -25
View File
@@ -22,7 +22,7 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!ishuman(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
return ..() && target.op_stage.ribcage == 0 && affected.open >= 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
@@ -39,7 +39,7 @@
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, cracking [target]'s ribcage with \the [tool]!" , \
"\red Your hand slips, cracking [target]'s ribcage with \the [tool]!" )
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
affected.createwound(CUT, 20)
affected.fracture()
@@ -72,14 +72,14 @@
// Whoops!
if(prob(10))
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
affected.fracture()
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/msg = "\red [user]'s hand slips, breaking [target]'s ribcage!"
var/self_msg = "\red Your hand slips, breaking [target]'s ribcage!"
user.visible_message(msg, self_msg)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
affected.createwound(BRUISE, 20)
affected.fracture()
@@ -115,7 +115,7 @@
var/msg = "\red [user]'s hand slips, bending [target]'s ribcage in a wrong shape!"
var/self_msg = "\red Your hand slips, bending [target]'s ribcage in a wrong shape!"
user.visible_message(msg, self_msg)
var/datum/organ/external/chest/affected = target.get_organ("chest")
var/obj/item/organ/external/chest/affected = target.get_organ("chest")
affected.createwound(BRUISE, 20)
affected.fracture()
if (prob(40))
@@ -200,18 +200,18 @@
if (!ishuman(target))
return 0
var/is_chest_organ_damaged = 0
var/datum/organ/external/chest/chest = target.get_organ("chest")
for(var/datum/organ/internal/I in chest.internal_organs)
var/obj/item/organ/external/chest/chest = target.get_organ("chest")
for(var/obj/item/organ/I in chest.internal_organs)
if(I.damage > 0)
is_chest_organ_damaged = 1
break
return ..() && is_chest_organ_damaged && target.op_stage.ribcage == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
var/datum/organ/internal/lungs/lungs = target.internal_organs_by_name["lungs"]
var/datum/organ/internal/liver/liver = target.internal_organs_by_name["liver"]
var/datum/organ/internal/liver/kidney = target.internal_organs_by_name["kidney"]
var/obj/item/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
var/obj/item/organ/internal/lungs/lungs = target.internal_organs_by_name["lungs"]
var/obj/item/organ/internal/liver/liver = target.internal_organs_by_name["liver"]
var/obj/item/organ/internal/liver/kidney = target.internal_organs_by_name["kidney"]
if (istype(tool, /obj/item/stack/medical/advanced/bruise_pack))
if(lungs.damage > 0)
@@ -269,10 +269,10 @@
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
var/datum/organ/internal/lungs/lungs = target.internal_organs_by_name["lungs"]
var/datum/organ/internal/liver/liver = target.internal_organs_by_name["liver"]
var/datum/organ/internal/liver/kidney = target.internal_organs_by_name["kidney"]
var/obj/item/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
var/obj/item/organ/internal/lungs/lungs = target.internal_organs_by_name["lungs"]
var/obj/item/organ/internal/liver/liver = target.internal_organs_by_name["liver"]
var/obj/item/organ/internal/liver/kidney = target.internal_organs_by_name["kidney"]
if(lungs.damage > 0)
user.visible_message("\blue [user] mends the rupture in [target]'s lungs with \the [tool].", \
@@ -299,11 +299,11 @@
kidney.damage = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
var/datum/organ/internal/lungs/lungs = target.internal_organs_by_name["lungs"]
var/datum/organ/internal/liver/liver = target.internal_organs_by_name["liver"]
var/datum/organ/internal/liver/kidney = target.internal_organs_by_name["kidney"]
var/datum/organ/external/chest/affected = target.get_organ("chest")
var/obj/item/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
var/obj/item/organ/internal/lungs/lungs = target.internal_organs_by_name["lungs"]
var/obj/item/organ/internal/liver/liver = target.internal_organs_by_name["liver"]
var/obj/item/organ/internal/liver/kidney = target.internal_organs_by_name["kidney"]
var/obj/item/organ/external/chest/affected = target.get_organ("chest")
user.visible_message("\red [user]'s hand slips, getting mess and tearing the inside of [target]'s chest with \the [tool]!", \
"\red Your hand slips, getting mess and tearing the inside of [target]'s chest with \the [tool]!")
switch(tool)
@@ -352,14 +352,14 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/is_chest_organ_damaged = 0
var/datum/organ/external/chest/chest = target.get_organ("chest")
for(var/datum/organ/internal/I in chest.internal_organs) if(I.damage > 0)
var/obj/item/organ/external/chest/chest = target.get_organ("chest")
for(var/obj/item/organ/I in chest.internal_organs) if(I.damage > 0)
is_chest_organ_damaged = 1
break
return ..() && is_chest_organ_damaged && target.op_stage.ribcage == 2
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
var/obj/item/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
if(heart.damage > 0)
if(heart.desc == "Mechanical")
@@ -372,7 +372,7 @@
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
var/obj/item/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
if(heart.damage > 0)
if(heart.desc == "Mechanical")
user.visible_message("\blue [user] repairs [target]'s heart with \the [tool].", \
@@ -380,7 +380,7 @@
heart.damage = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
var/obj/item/organ/internal/heart/heart = target.internal_organs_by_name["heart"]
user.visible_message("\red [user]'s hand slips, smearing [tool] in the incision in [target]'s heart, gumming it up!!" , \
"\red Your hand slips, smearing [tool] in the incision in [target]'s heart, gumming it up!")
heart.take_damage(5, 0)
+29 -164
View File
@@ -8,146 +8,11 @@
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
if (!affected)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (affected)
return 0
if (!(affected.status & ORGAN_DESTROYED))
return 0
if (affected.parent)
if (affected.parent.status & ORGAN_DESTROYED)
return 0
return affected.name != "head"
/datum/surgery_step/limb/cut
allowed_tools = list(
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchenknife = 75, \
/obj/item/weapon/shard = 50, \
)
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
if (!hasorgans(target))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
return ..() && !(affected.status & ORGAN_CUT_AWAY)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("[user] starts cutting away flesh where [target]'s [affected.display_name] used to be with \the [tool].", \
"You start cutting away flesh where [target]'s [affected.display_name] used to be with \the [tool].")
else
user.visible_message("[user] starts cutting away metal where [target]'s [affected.display_name] used to be with \the [tool].", \
"You start cutting away metal where [target]'s [affected.display_name] used to be with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("\blue [user] cuts away flesh where [target]'s [affected.display_name] used to be with \the [tool].", \
"\blue You cut away flesh where [target]'s [affected.display_name] used to be with \the [tool].")
else
user.visible_message("\blue [user] cuts away metal where [target]'s [affected.display_name] used to be with \the [tool].", \
"\blue You cut away metal where [target]'s [affected.display_name] used to be with \the [tool].")
affected.status |= ORGAN_CUT_AWAY
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
user.visible_message("\red [user]'s hand slips, cutting [target]'s [affected.display_name] open!", \
"\red Your hand slips, cutting [target]'s [affected.display_name] open!")
affected.createwound(CUT, 10)
/datum/surgery_step/limb/mend
allowed_tools = list(
/obj/item/weapon/retractor = 100, \
/obj/item/weapon/crowbar = 75, \
/obj/item/weapon/kitchen/utensil/fork = 50)
min_duration = 80
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.status & ORGAN_CUT_AWAY && affected.open < 3 && !(affected.status & ORGAN_ATTACHABLE)
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("[user] is beginning to reposition flesh and nerve endings where where [target]'s [affected.display_name] used to be with [tool].", \
"You start repositioning flesh and nerve endings where where [target]'s [affected.display_name] used to be with [tool].")
else
user.visible_message("[user] is beginning to reposition metal and wire endings where where [target]'s [affected.display_name] used to be with [tool].", \
"You start repositioning metal and wire endings where where [target]'s [affected.display_name] used to be with [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("\blue [user] has finished repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].", \
"\blue You have finished repositioning flesh and nerve endings where [target]'s [affected.display_name] used to be with [tool].")
else
user.visible_message("\blue [user] has finished repositioning metal and wire endings where [target]'s [affected.display_name] used to be with [tool].", \
"\blue You have finished repositioning metal and wire endings where [target]'s [affected.display_name] used to be with [tool].")
affected.open = 3
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
if(!(target.species.flags & IS_SYNTHETIC))
user.visible_message("\red [user]'s hand slips, tearing flesh on [target]'s [affected.display_name]!", \
"\red Your hand slips, tearing flesh on [target]'s [affected.display_name]!")
else
user.visible_message("\red [user]'s hand slips, tearing metal on [target]'s [affected.display_name]!", \
"\red Your hand slips, tearing metal on [target]'s [affected.display_name]!")
target.apply_damage(10, BRUTE, affected, sharp=1)
/datum/surgery_step/limb/prepare
allowed_tools = list(
/obj/item/weapon/cautery = 100, \
/obj/item/clothing/mask/cigarette = 75, \
/obj/item/weapon/lighter = 50, \
/obj/item/weapon/weldingtool = 25
)
min_duration = 60
max_duration = 70
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.open == 3
begin_step(mob/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts adjusting area around [target]'s [affected.display_name] with \the [tool].", \
"You start adjusting area around [target]'s [affected.display_name] with \the [tool].")
..()
end_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has finished adjusting the area around [target]'s [affected.display_name] with \the [tool].", \
"\blue You have finished adjusting the area around [target]'s [affected.display_name] with \the [tool].")
affected.status |= ORGAN_ATTACHABLE
affected.amputated = 1
affected.setAmputatedTree()
affected.open = 0
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
if (affected.parent)
affected = affected.parent
user.visible_message("\red [user]'s hand slips, searing [target]'s [affected.display_name]!", \
"\red Your hand slips, searing [target]'s [affected.display_name]!")
target.apply_damage(10, BURN, affected)
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)
@@ -156,40 +21,40 @@
max_duration = 100
can_use(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/obj/item/robot_parts/p = tool
if (p.part)
if (!(target_zone in p.part))
return 0
var/datum/organ/external/affected = target.get_organ(target_zone)
return ..() && affected.status & ORGAN_ATTACHABLE
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)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("[user] starts attaching [tool] where [target]'s [affected.display_name] used to be.", \
"You start attaching [tool] where [target]'s [affected.display_name] used to be.")
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
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\blue [user] has attached [tool] where [target]'s [affected.display_name] used to be.", \
"\blue You have attached [tool] where [target]'s [affected.display_name] used to be.")
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
affected.germ_level = 0
affected.robotize()
if(L.sabotaged)
affected.sabotaged = 1
else
affected.sabotaged = 0
affected.amputated = 0
affected.setAmputatedTree()
target.handle_organs()
target.update_body()
target.updatehealth()
target.UpdateDamageIcon()
del(tool)
fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
user.visible_message("\red [user]'s hand slips, damaging connectors on [target]'s [affected.display_name]!", \
"\red Your hand slips, damaging connectors on [target]'s [affected.display_name]!")
target.apply_damage(10, BRUTE, affected, sharp=1)
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)
+93
View File
@@ -0,0 +1,93 @@
//////////////////////////////////////////////////////////////////
// SLIME CORE EXTRACTION //
//////////////////////////////////////////////////////////////////
/datum/surgery_step/slime
is_valid_target(mob/living/carbon/slime/target)
return istype(target, /mob/living/carbon/slime/)
can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
return target.stat == 2
/datum/surgery_step/slime/cut_flesh
allowed_tools = list(
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchenknife = 75, \
/obj/item/weapon/shard = 50, \
)
min_duration = 30
max_duration = 50
can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
return ..() && istype(target) && target.core_removal_stage == 0
begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("[user] starts cutting through [target]'s flesh with \the [tool].", \
"You start cutting through [target]'s flesh with \the [tool].")
end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] cuts through [target]'s flesh with \the [tool].", \
"\blue You cut through [target]'s flesh with \the [tool], revealing its silky innards.")
target.core_removal_stage = 1
fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, tearing [target]'s flesh with \the [tool]!", \
"\red Your hand slips, tearing [target]'s flesh with \the [tool]!")
/datum/surgery_step/slime/cut_innards
allowed_tools = list(
/obj/item/weapon/scalpel = 100, \
/obj/item/weapon/kitchenknife = 75, \
/obj/item/weapon/shard = 50, \
)
min_duration = 30
max_duration = 50
can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
return ..() && istype(target) && target.core_removal_stage == 1
begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("[user] starts cutting [target]'s silky innards apart with \the [tool].", \
"You start cutting [target]'s silky innards apart with \the [tool].")
end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\blue [user] cuts [target]'s innards apart with \the [tool], exposing the cores.", \
"\blue You cut [target]'s innards apart with \the [tool], exposing the cores.")
target.core_removal_stage = 2
fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, tearing [target]'s innards with \the [tool]!", \
"\red Your hand slips, tearing [target]'s innards with \the [tool]!")
/datum/surgery_step/slime/saw_core
allowed_tools = list(
/obj/item/weapon/circular_saw = 100, \
/obj/item/weapon/hatchet = 75
)
min_duration = 50
max_duration = 70
can_use(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
return ..() && (istype(target) && target.core_removal_stage == 2 && target.cores > 0) //This is being passed a human as target, unsure why.
begin_step(mob/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("[user] starts cutting out one of [target]'s cores with \the [tool].", \
"You start cutting out one of [target]'s cores with \the [tool].")
end_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
target.cores--
user.visible_message("\blue [user] cuts out one of [target]'s cores with \the [tool].",, \
"\blue You cut out one of [target]'s cores with \the [tool]. [target.cores] cores left.")
if(target.cores >= 0)
new target.coretype(target.loc)
if(target.cores <= 0)
target.icon_state = "[target.colour] baby slime dead-nocore"
fail_step(mob/living/user, mob/living/carbon/slime/target, target_zone, obj/item/tool)
user.visible_message("\red [user]'s hand slips, causing \him to miss the core!", \
"\red Your hand slips, causing you to miss the core!")
+5 -3
View File
@@ -49,7 +49,7 @@
// does stuff to begin the step, usually just printing messages. Moved germs transfering and bloodying here too
proc/begin_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
var/datum/organ/external/affected = target.get_organ(target_zone)
var/obj/item/organ/external/affected = target.get_organ(target_zone)
if (can_infect && affected)
spread_germs_to_organ(affected, user)
if (ishuman(user) && prob(60))
@@ -68,13 +68,13 @@
proc/fail_step(mob/living/user, mob/living/carbon/human/target, target_zone, obj/item/tool)
return null
proc/spread_germs_to_organ(datum/organ/external/E, mob/living/carbon/human/user)
proc/spread_germs_to_organ(obj/item/organ/external/E, mob/living/carbon/human/user)
if(!istype(user) || !istype(E)) return
var/germ_level = user.germ_level
if(user.gloves)
germ_level = user.gloves.germ_level
if(!(E.status & (ORGAN_ROBOT|ORGAN_PEG))) //Germs on robotic limbs bad
if(!(E.status & ORGAN_ROBOT)) //Germs on robotic limbs bad
E.germ_level = max(germ_level,E.germ_level) //as funny as scrubbing microbes out with clean gloves is - no.
proc/do_surgery(mob/living/M, mob/living/user, obj/item/tool)
@@ -117,3 +117,5 @@ proc/sort_surgeries()
var/appendix = 0
var/ribcage = 0
var/head_reattach = 0
var/current_organ = "organ"
var/list/in_progress = list()
+3 -1
View File
@@ -107,6 +107,8 @@
origin_tech = "biotech=1"
attack_verb = list("slapped")
/*
/obj/item/weapon/surgical_drapes/attack(mob/living/M, mob/user)
if(!attempt_initiate_surgery(src, M, user))
..()
..()
*/
+14 -14
View File
@@ -202,7 +202,7 @@
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
var/datum/organ/internal/brain/B = H.internal_organs_by_name["brain"]
var/obj/item/organ/brain/B = H.internal_organs_by_name["brain"]
if (B.damage < B.min_broken_damage)
B.take_damage(5)
else
@@ -217,11 +217,11 @@
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
var/organ = pick(list("r_arm","l_arm","r_leg","r_leg"))
var/datum/organ/external/E = H.organs_by_name[organ]
var/obj/item/organ/external/E = H.organs_by_name[organ]
if (!(E.status & ORGAN_DEAD))
E.status |= ORGAN_DEAD
H << "<span class='notice'>You can't feel your [E.display_name] anymore...</span>"
for (var/datum/organ/external/C in E.children)
H << "<span class='notice'>You can't feel your [E.name] anymore...</span>"
for (var/obj/item/organ/external/C in E.children)
C.status |= ORGAN_DEAD
H.update_body(1)
if(multiplier < 1) multiplier = 1
@@ -232,9 +232,9 @@
deactivate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
for (var/datum/organ/external/E in H.organs)
for (var/obj/item/organ/external/E in H.organs)
E.status &= ~ORGAN_DEAD
for (var/datum/organ/external/C in E.children)
for (var/obj/item/organ/external/C in E.children)
C.status &= ~ORGAN_DEAD
@@ -244,7 +244,7 @@
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
for (var/datum/organ/external/E in H.organs)
for (var/obj/item/organ/external/E in H.organs)
if (E.status & ORGAN_BROKEN && prob(30))
E.status ^= ORGAN_BROKEN
var/heal_amt = -5*multiplier
@@ -331,14 +331,14 @@
new /obj/effect/decal/cleanable/blood/gibs(Tx,i)
if(2)
if(ishuman(mob))
for (var/datum/organ/external/E in H.organs)
for (var/obj/item/organ/external/E in H.organs)
if(pick(1,0))
E.droplimb(1)
E.droplimb(0,DROPLIMB_BLUNT)
if(3)
if(ishuman(mob))
if(H.species.name != "Skellington")
mob << "<span class = 'warning'> Your necrotic skin ruptures!</span>"
for (var/datum/organ/external/E in H.organs)
for (var/obj/item/organ/external/E in H.organs)
if(pick(1,0))
E.createwound(CUT, pick(2,4))
if(prob(30))
@@ -471,7 +471,7 @@
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
var/datum/organ/internal/brain/B = H.internal_organs_by_name["brain"]
var/obj/item/organ/brain/B = H.internal_organs_by_name["brain"]
if (B.damage < B.min_broken_damage)
B.take_damage(1)
else
@@ -501,13 +501,13 @@
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
for (var/datum/organ/external/E in H.organs)
for (var/obj/item/organ/external/E in H.organs)
E.min_broken_damage = max(5, E.min_broken_damage - 30)
deactivate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
for (var/datum/organ/external/E in H.organs)
for (var/obj/item/organ/external/E in H.organs)
E.min_broken_damage = initial(E.min_broken_damage)
/datum/disease2/effect/shakey
@@ -731,7 +731,7 @@ var/list/compatible_mobs = list(/mob/living/carbon/human, /mob/living/carbon/mon
activate(var/mob/living/carbon/mob,var/multiplier)
if(istype(mob, /mob/living/carbon/human))
var/mob/living/carbon/human/H = mob
var/datum/organ/internal/brain/B = H.internal_organs_by_name["brain"]
var/obj/item/organ/brain/B = H.internal_organs_by_name["brain"]
if (B.damage < B.min_broken_damage)
B.take_damage(0.5)
else
+1 -1
View File
@@ -140,7 +140,7 @@ proc/airborne_can_reach(turf/source, turf/target, var/radius=5)
if (ishuman(victim))
var/mob/living/carbon/human/H = victim
var/datum/organ/external/select_area = H.get_organ(src.zone_sel.selecting)
var/obj/item/organ/external/select_area = H.get_organ(src.zone_sel.selecting)
var/list/clothes = list(H.head, H.wear_mask, H.wear_suit, H.w_uniform, H.gloves, H.shoes)
for(var/obj/item/clothing/C in clothes )
if(C && istype(C))