Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Хирургические манипуляции с органами + импланты для них #13552

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions code/__DEFINES/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
#define ORGAN_BLEEDING 4
#define ORGAN_BROKEN 8
#define ORGAN_SPLINTED 16
#define ORGAN_DEAD 32
#define ORGAN_MUTATED 64
#define ORGAN_ARTERY_CUT 128
#define ORGAN_ROBOT 32
#define ORGAN_DEAD 64
#define ORGAN_MUTATED 128
#define ORGAN_ARTERY_CUT 256

#define DROPLIMB_EDGE 0
#define DROPLIMB_BLUNT 1
Expand Down Expand Up @@ -41,6 +42,8 @@
#define O_LIVER "liver"
#define O_KIDNEYS "kidneys"
#define O_APPENDIX "appendix"
#define O_AUG "augamentation"
#define O_AUG_EYES "augamentation_eyes"

#define TARGET_ZONE_ALL list(BP_CHEST, BP_GROIN, BP_HEAD, BP_L_ARM, BP_R_ARM, BP_L_LEG, BP_R_LEG, O_EYES, O_MOUTH)

Expand Down
2 changes: 1 addition & 1 deletion code/datums/spells/inflict_handler.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
if(ishuman(target) || ismonkey(target))
var/mob/living/carbon/C = target
if(C.has_brain()) // Their brain is already taken out
var/obj/item/brain/B = new(C.loc)
var/obj/item/organ/internal/brain/B = new(C.loc)
B.transfer_identity(C)
target.gib()
if("disintegrate")
Expand Down
2 changes: 1 addition & 1 deletion code/game/dna/dna_modifier.dm
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
occupant = occupant_body = C
break
if(isbrain(M))
var/obj/item/brain/B = M
var/obj/item/organ/internal/brain/B = M
occupant = B.brainmob
occupant_body = B
break
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,10 +385,10 @@ var/global/list/sting_paths
chem_recharge_rate = initial(chem_recharge_rate)
chem_charges = min(chem_charges, chem_storage)
mimicing = ""
if(isliving(antag.current))
/* if(isliving(antag.current))
var/mob/living/L = antag.current
L.changeling_aug = FALSE

*/
/mob/proc/remove_changeling_powers(keep_free_powers=0)
Chip11-n marked this conversation as resolved.
Show resolved Hide resolved
if(ishuman(src) || ismonkey(src))
if(ischangeling(src))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,20 @@
helptext = "Grants us night vision and thermal vision. It may be toggled on or off."
button_icon_state = "augmented_eyesight"
chemical_cost = 0
genomecost = 3
genomecost = 1
var/active = 0 //Whether or not vision is enhanced
req_stat = UNCONSCIOUS

/obj/effect/proc_holder/changeling/augmented_eyesight/sting_action(mob/living/user)
/obj/effect/proc_holder/changeling/augmented_eyesight/sting_action(mob/living/carbon/human/user)
if(!istype(user))
return
var/obj/item/organ/internal/cyberimp/eyes/thermals/ling/IO = user.get_int_organ(/obj/item/organ/internal/cyberimp/eyes/thermals/ling)
if(!IO)
var/obj/item/organ/internal/cyberimp/eyes/O = new /obj/item/organ/internal/cyberimp/eyes/thermals/ling()
O.insert_organ(user)
return TRUE
TriflesChase marked this conversation as resolved.
Show resolved Hide resolved

/*
active = !active
user.changeling_aug = !user.changeling_aug
if(active)
Expand All @@ -21,3 +30,48 @@

/mob/living
var/changeling_aug = 0
*/

/obj/item/organ/internal/cyberimp/eyes/shield/ling
TriflesChase marked this conversation as resolved.
Show resolved Hide resolved
name = "protective membranes"
desc = "These variable transparency organic membranes will protect you from welders and flashes and heal your eye damage."
icon_state = "ling_eyeshield"
eye_colour = null
implant_overlay = null
origin_tech = "biotech=4"
slot = "eye_ling"
status = 0

/obj/item/organ/internal/cyberimp/eyes/shield/ling/on_life()
..()
var/obj/item/organ/internal/eyes/E = owner.get_int_organ(/obj/item/organ/internal/eyes)
if(owner.eye_blind || owner.eye_blurry || (owner.sdisabilities & BLIND) || (owner.disabilities & NEARSIGHTED) || (E.damage > 0))
owner.reagents.add_reagent("imidazoline", 1)


/obj/item/organ/internal/cyberimp/eyes/thermals/ling
name = "heat receptors"
desc = "These heat receptors dramatically increases eyes light sensing ability."
icon_state = "ling_thermal"
eye_colour = null
implant_overlay = null
origin_tech = "biotech=5;magnets=5"
slot = "eye_ling"
status = 0
vision_flags = SEE_MOBS
aug_message = "We feel a minute twitch in our eyes, and darkness creeps away."

/obj/item/organ/internal/cyberimp/eyes/thermals/ling/emp_act(severity)
return

/obj/item/organ/internal/cyberimp/eyes/thermals/ling/insert_organ(mob/living/carbon/human/M, special = 0)
..()
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.weakeyes = 1

/obj/item/organ/internal/cyberimp/eyes/thermals/ling/remove(mob/living/carbon/M, special = 0)
if(ishuman(owner))
var/mob/living/carbon/human/H = owner
H.weakeyes = 0
..()
Comment on lines +41 to +51
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

А потом орган присваивает значение этой переменной у хумана, жесть

3 changes: 3 additions & 0 deletions code/game/machinery/flasher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@
if (ishuman(O))
var/mob/living/carbon/human/H = O
var/obj/item/organ/internal/eyes/IO = H.organs_by_name[O_EYES]
if(O.weakeyes)
O.Weaken(strength * 1.5)
O.visible_message("<span class='disarm'><b>[O]</b> gasps and shields their eyes!</span>")
if (IO.damage > IO.min_bruised_damage && prob(IO.damage + 50))
H.flash_eyes()
IO.damage += rand(1, 5)
Expand Down
13 changes: 13 additions & 0 deletions code/game/objects/items/weapons/defibrillator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,9 @@
if(!check_brain(H))
return "buzzes, \"Error - Patient's brain is missing or is too damaged to be functional. Operation aborted.\""

if(!check_heart(H))
return "buzzes, \"Error - Patient's heart is missing or is too damaged to be functional. Operation aborted.\""

/obj/item/weapon/shockpaddles/proc/check_contact(mob/living/carbon/human/H, sel_zone = BP_CHEST)
if(!combat)
if(H.check_pierce_protection(target_zone = sel_zone))
Expand All @@ -309,6 +312,16 @@
return FALSE
return TRUE

/obj/item/weapon/shockpaddles/proc/check_heart(mob/living/carbon/human/H)
if(!H.should_have_organ(O_HEART))
return TRUE
if(!H.organs_by_name[O_HEART])
return FALSE
var/obj/item/organ/external/bodypart_chest = H.bodyparts_by_name[BP_CHEST]
if(!bodypart_chest)
return FALSE
return TRUE

/obj/item/weapon/shockpaddles/proc/check_charge(charge_amt)
return TRUE

Expand Down
2 changes: 1 addition & 1 deletion code/modules/food/recipes_microwave.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
/datum/recipe/microwave/brainburger
items = list(
/obj/item/weapon/reagent_containers/food/snacks/bun,
/obj/item/brain
/obj/item/organ/internal/brain
)
result = /obj/item/weapon/reagent_containers/food/snacks/brainburger

Expand Down
2 changes: 1 addition & 1 deletion code/modules/food/recipes_oven.dm
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/weapon/reagent_containers/food/snacks/dough,
/obj/item/brain
/obj/item/organ/internal/brain
)
result = /obj/item/weapon/reagent_containers/food/snacks/sliceable/cake/brain

Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/living/carbon/brain/MMI.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
var/mob/living/carbon/brain/brainmob = null//The current occupant.

/obj/item/device/mmi/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/brain) && !brainmob) //Time to stick a brain in it --NEO
var/obj/item/brain/B = I
if(istype(I, /obj/item/organ/internal/brain) && !brainmob) //Time to stick a brain in it --NEO
var/obj/item/organ/internal/brain/B = I
if(!B.brainmob)
to_chat(user, "<span class='warning'>You aren't sure where this brain came from, but you're pretty sure it's a useless brain.</span>")
return
Expand Down Expand Up @@ -83,7 +83,7 @@
QDEL_NULL(brainmob)
return

var/obj/item/brain/brain
var/obj/item/organ/internal/brain/brain
if(user)
to_chat(user, "<span class='notice'>You upend the MMI, spilling the brain onto the floor.</span>")
brain = new(get_turf(user))
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/carbon/brain/brain_item.dm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/obj/item/brain
/obj/item/organ/internal/brain
name = "brain"
desc = "A piece of juicy meat found in a persons head."
icon = 'icons/obj/surgery.dmi'
Expand All @@ -13,14 +13,14 @@

var/mob/living/carbon/brain/brainmob = null

/obj/item/brain/atom_init()
/obj/item/organ/internal/brain/atom_init()
. = ..()
//Shifting the brain "mob" over to the brain object so it's easier to keep track of. --NEO
//WASSSSSUUUPPPP /N
spawn(5)
brainmob?.client?.screen.len = null //clear the hud

/obj/item/brain/proc/transfer_identity(mob/living/carbon/H)
/obj/item/organ/internal/brain/proc/transfer_identity(mob/living/carbon/H)
name = "[H]'s brain"
brainmob = new(src)
brainmob.name = H.real_name
Expand All @@ -31,7 +31,7 @@
H.mind.transfer_to(brainmob)

to_chat(brainmob, "<span class='notice'>You feel slightly disoriented. That's normal when you're just a brain.</span>")
/obj/item/brain/examine(mob/user) // -- TLE
/obj/item/organ/internal/brain/examine(mob/user) // -- TLE
..()
if(brainmob && brainmob.client)//if thar be a brain inside... the brain.
to_chat(user, "You can feel the small spark of life still left in this one.")
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/brain/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
..()
if(container && isMMI(container))
qdel(container)//Gets rid of the MMI if there is one
if(istype(old_loc, /obj/item/brain))
if(istype(old_loc, /obj/item/organ/internal/brain))
qdel(old_loc)//Gets rid of the brain item
16 changes: 15 additions & 1 deletion code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,18 @@
inhaling = inhale_pp >= druggy_inhale_pp ? inhaling : druggy_inhaling
inhale_pp = inhale_pp >= druggy_inhale_pp ? inhale_pp : druggy_inhale_pp

var/lungs = get_int_organ_by_name(O_LUNGS)
if(!lungs)
adjustOxyLoss(10)
if(prob(20))
emote("gasp")
TriflesChase marked this conversation as resolved.
Show resolved Hide resolved
//CRIT
if(!breath || (breath.total_moles == 0) || !lungs)
adjustOxyLoss(5)
throw_alert("not_enough_oxy", /atom/movable/screen/alert/oxy)
return FALSE


if(inhale_pp < safe_pressure_min)
if(prob(20))
emote("gasp")
Expand Down Expand Up @@ -1197,11 +1209,13 @@

see_invisible = see_in_dark > 2 ? SEE_INVISIBLE_LEVEL_ONE : SEE_INVISIBLE_LIVING

sight &= ~(SEE_TURFS|SEE_MOBS|SEE_OBJS)
/*
if(changeling_aug)
sight |= SEE_MOBS
see_in_dark = 8
new_lighting_alpha = LIGHTING_PLANE_ALPHA_MOSTLY_INVISIBLE

*/
if(XRAY in mutations)
sight |= SEE_TURFS|SEE_MOBS|SEE_OBJS
see_in_dark = 8
Expand Down
2 changes: 2 additions & 0 deletions code/modules/mob/living/carbon/carbon_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
var/list/datum/disease2/disease/virus2 = list()
var/antibodies = 0

var/list/internal_organs_slot = list() //Same as above, but stores "slot ID" - "organ" pairs for easy access.

var/life_tick = 0 // The amount of life ticks that have processed on this mob.
var/analgesic = 0 // when this is set, the mob isn't affected by shock or pain
// life should decrease this by 1 every tick
Expand Down
5 changes: 5 additions & 0 deletions code/modules/mob/living/carbon/human/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,17 @@
flick(icon('icons/mob/mob.dmi', "gibbed-h"), animation)
QDEL_IN(animation, 2 SECOND)

for(var/obj/item/organ/internal/IO in organs)
IO.remove(src)
IO.forceMove(get_turf(src))

for(var/obj/item/organ/external/BP in bodyparts)
// Only make the limb drop if it's not too damaged
if(prob(100 - BP.get_damage()))
// Override the current limb status and don't cause an explosion
BP.droplimb(TRUE, null, DROPLIMB_EDGE)


..()

/mob/living/carbon/human/dust()
Expand Down
8 changes: 6 additions & 2 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1240,11 +1240,15 @@
germ_level += n

/mob/living/carbon/human/proc/is_lung_ruptured()
var/obj/item/organ/internal/lungs/IO = organs_by_name[O_LUNGS]
var/obj/item/organ/internal/lungs/IO = get_int_organ(/obj/item/organ/internal/lungs)
if(!IO)
return 0

return IO.is_bruised()


/mob/living/carbon/human/proc/rupture_lung()
var/obj/item/organ/internal/lungs/IO = organs_by_name[O_LUNGS]
var/obj/item/organ/internal/lungs/IO = get_int_organ(/obj/item/organ/internal/lungs)

if(!IO.is_bruised())
custom_pain("You feel a stabbing pain in your chest!", 1)
Expand Down
8 changes: 8 additions & 0 deletions code/modules/mob/living/carbon/human/human_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
ChangeToHusk()
return

/mob/living/carbon/human/proc/get_organ(var/zone)
if(!zone)
zone = BP_CHEST
if(zone in list(O_EYES, O_MOUTH))
zone = BP_HEAD

return organs_by_name[zone]

// =============================================

/mob/living/carbon/human/getBrainLoss()
Expand Down
29 changes: 17 additions & 12 deletions code/modules/mob/living/carbon/human/life.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1233,18 +1233,23 @@ var/global/list/tourette_bad_words= list(
if(stat == DEAD)
return PULSE_NONE //that's it, you're dead, nothing can influence your pulse

var/obj/item/organ/internal/heart/IO = organs_by_name[O_HEART]
if(life_tick % 10)
switch(IO.heart_status)
if(HEART_FAILURE)
to_chat(src, "<span class='userdanger'>Your feel a prick in your heart!</span>")
apply_effect(5,AGONY,0)
return PULSE_NONE
if(HEART_FIBR)
to_chat(src, "<span class='danger'>Your heart hurts a little.</span>")
playsound_local(null, 'sound/machines/cardio/pulse_fibrillation.ogg', VOL_EFFECTS_MASTER, vary = FALSE)
apply_effect(1,AGONY,0)
return PULSE_SLOW
var/obj/item/organ/internal/heart/H = get_int_organ(/obj/item/organ/internal/heart)
if(!H)
return

else
var/obj/item/organ/internal/heart/IO = organs_by_name[O_HEART]
if(life_tick % 10)
switch(IO.heart_status)
if(HEART_FAILURE)
to_chat(src, "<span class='userdanger'>Your feel a prick in your heart!</span>")
apply_effect(5,AGONY,0)
return PULSE_NONE
if(HEART_FIBR)
to_chat(src, "<span class='danger'>Your heart hurts a little.</span>")
playsound_local(null, 'sound/machines/cardio/pulse_fibrillation.ogg', VOL_EFFECTS_MASTER, vary = FALSE)
apply_effect(1,AGONY,0)
return PULSE_SLOW

var/temp = PULSE_NORM

Expand Down
Loading
Loading