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

[WIP]Динамические органы и операции к ним #13587

Open
wants to merge 38 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
cfada9b
transferorgans
TriflesChase Oct 13, 2024
65506ff
organs and operations
TriflesChase Oct 13, 2024
3cf34cd
operation_fix
TriflesChase Oct 13, 2024
f523a1d
dme fix
TriflesChase Oct 13, 2024
6b08b09
Update code/modules/surgery/organs/organ.dm
TriflesChase Oct 13, 2024
459fac3
eyes, roles and organs damage
TriflesChase Oct 26, 2024
f126121
Merge branch 'onlyorgans' of https://github.com/TriflesChase/TauCetiC…
TriflesChase Oct 26, 2024
2f54f3e
Merge branch 'onlyorgans' of https://github.com/TriflesChase/TauCetiC…
TriflesChase Oct 26, 2024
c46e1e5
abomination neck
TriflesChase Oct 26, 2024
61b3ff7
mechanize_remove
TriflesChase Dec 6, 2024
fe87626
Dion's, vox's and slot's
TriflesChase Dec 6, 2024
d2aa9c8
Merge branch 'master' into onlyorgans
TriflesChase Dec 6, 2024
85494d5
Update code/modules/mob/living/carbon/human/human.dm
TriflesChase Dec 6, 2024
a79017f
Update code/modules/mob/living/carbon/human/human_defines.dm
TriflesChase Dec 6, 2024
909a8f6
Update code/modules/surgery/organs/organ.dm
TriflesChase Dec 6, 2024
b8e39bc
Kill_appendix
TriflesChase Dec 7, 2024
6599d9d
optimization
TriflesChase Dec 7, 2024
e29a026
More_optimization
TriflesChase Dec 7, 2024
9f6065e
Merge branch 'onlyorgans' of https://github.com/TriflesChase/TauCetiC…
TriflesChase Dec 7, 2024
d84e2bf
Dinamic_heart_is_real
TriflesChase Dec 9, 2024
8100f5d
Dinamic_lungs
TriflesChase Dec 11, 2024
e8846c1
some changes
TriflesChase Dec 11, 2024
8e9288e
Update code/modules/surgery/organs_internal.dm
TriflesChase Dec 11, 2024
b0f8ff5
shadowling
TriflesChase Dec 11, 2024
337fc42
lungs fix
TriflesChase Dec 11, 2024
a2ca29b
Merge branch 'onlyorgans' of https://github.com/TriflesChase/TauCetiC…
TriflesChase Dec 11, 2024
96c46d7
holydays_organ_update
TriflesChase Dec 24, 2024
632a891
tgui_organs
TriflesChase Dec 25, 2024
3660134
operation, kidneys and preference
TriflesChase Dec 25, 2024
e0b13b5
heat,kidneys,organs and operation
TriflesChase Dec 25, 2024
1a7e8bf
span's
TriflesChase Dec 25, 2024
49a5036
brain ipc
TriflesChase Dec 25, 2024
fd875cd
brain, heart, operation
TriflesChase Dec 26, 2024
8f4bbcd
lungs, organs and vox's
TriflesChase Dec 26, 2024
c6d795f
Merge branch 'TauCetiStation:master' into onlyorgans
TriflesChase Dec 27, 2024
cbfb90b
microfix
TriflesChase Dec 27, 2024
9bd62da
deleteorganhelper
TriflesChase Dec 28, 2024
86fcf41
Update taucetistation.dme
TriflesChase Dec 28, 2024
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
7 changes: 4 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
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/defines/obj/weapon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@

if(!H.shoes)
var/obj/item/organ/external/BP = H.bodyparts_by_name[pick(BP_L_LEG , BP_R_LEG)]
if(BP.is_robotic())
if(BP.is_robotic_part())
return
BP.take_damage(5, 0)
if(!H.species.flags[NO_PAIN])
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 @@ -58,7 +58,7 @@
if((BP.status & ORGAN_CUT_AWAY) || (BP.is_stump))
continue
temp = new /icon(icobase, "[BP.body_zone]")
if(BP.is_robotic())
if(BP.is_robotic_part())
temp.MapColors(rgb(77,77,77), rgb(150,150,150), rgb(28,28,28), rgb(0,0,0))
preview_icon.Blend(temp, ICON_OVERLAY)

Expand Down
3 changes: 2 additions & 1 deletion code/game/gamemodes/modes_gameplays/cult/cult_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@
if(ishuman(L))
var/mob/living/carbon/human/H = L
var/obj/item/organ/internal/eyes/E = H.organs_by_name[O_EYES]
E.damage += rand(4, 8)
if(E)
E.damage += rand(4, 8)
L.flash_eyes()
L.drop_item()
return FALSE
Expand Down
11 changes: 4 additions & 7 deletions code/game/machinery/adv_med.dm
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
var/list/organStatus = list()
if(E.status & ORGAN_BROKEN)
organStatus["broken"] = capitalize(E.broken_description)
if(E.is_robotic())
if(E.is_robotic_part())
organStatus["robotic"] = TRUE
if(E.status & ORGAN_SPLINTED)
organStatus["splinted"] = TRUE
Expand Down Expand Up @@ -279,8 +279,7 @@
organData["maxHealth"] = I.min_broken_damage
organData["bruised"] = I.is_bruised()
organData["broken"] = I.is_broken()
organData["assisted"] = I.robotic == 1
organData["robotic"] = I.robotic == 2
organData["cybernetic"] = I.is_robotic()
TriflesChase marked this conversation as resolved.
Show resolved Hide resolved
organData["dead"] = (I.status & ORGAN_DEAD)

intOrganData.Add(list(organData))
Expand Down Expand Up @@ -398,7 +397,7 @@
bled = "Кровотечение:"
if(BP.status & ORGAN_BROKEN)
AN = "[capitalize(BP.broken_description)]:"
if(BP.is_robotic())
if(BP.is_robotic_part())
robot = "Протез:"
if(BP.open)
open = "Вскрытое:"
Expand Down Expand Up @@ -434,9 +433,7 @@
var/mech = "Органическое:"
var/organ_status = ""
var/infection = ""
if(IO.robotic == 1)
mech = "Со вспомогательными средствами:" // sounds weird
if(IO.robotic == 2)
if(IO.is_robotic())
mech = "Механическое:"

if(istype(IO, /obj/item/organ/internal/heart))
Expand Down
7 changes: 4 additions & 3 deletions code/game/machinery/flasher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@
if (ishuman(O))
var/mob/living/carbon/human/H = O
var/obj/item/organ/internal/eyes/IO = H.organs_by_name[O_EYES]
if (IO.damage > IO.min_bruised_damage && prob(IO.damage + 50))
H.flash_eyes()
IO.damage += rand(1, 5)
if(IO)
if (IO.damage > IO.min_bruised_damage && prob(IO.damage + 50))
H.flash_eyes()
IO.damage += rand(1, 5)
else
if(!O.blinded && isliving(O))
var/mob/living/L = O
Expand Down
1 change: 1 addition & 0 deletions code/game/mecha/mech_fabricator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
"Cyborg Components",
"Misc",
"Stock Parts",
"Organs",
)
required_skills = list(/datum/skill/research = SKILL_LEVEL_PRO)

Expand Down
29 changes: 15 additions & 14 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -860,21 +860,22 @@
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/internal/eyes/IO = H.organs_by_name[O_EYES]
IO.damage += rand(force * 0.5, force)
if(IO.damage >= IO.min_bruised_damage)
if(H.stat != DEAD)
if(IO.robotic <= 1) //robot eyes bleeding might be a bit silly
to_chat(H, "<span class='warning'>Your eyes start to bleed profusely!</span>")
if(prob(10 * force))
if(IO)
IO.damage += rand(force * 0.5, force)
if(IO.damage >= IO.min_bruised_damage)
if(H.stat != DEAD)
to_chat(H, "<span class='warning'>You drop what you're holding and clutch at your eyes!</span>")
H.drop_item()
H.adjustBlurriness(10)
H.Paralyse(1)
H.Weaken(4)
if (IO.damage >= IO.min_broken_damage)
if(H.stat != DEAD)
to_chat(H, "<span class='warning'>You go blind!</span>")
if(!IO.is_robotic()) //robot eyes bleeding might be a bit silly
to_chat(H, "<span class='warning'>Your eyes start to bleed profusely!</span>")
if(prob(10 * force))
if(H.stat != DEAD)
to_chat(H, "<span class='warning'>You drop what you're holding and clutch at your eyes!</span>")
H.drop_item()
H.adjustBlurriness(10)
H.Paralyse(1)
H.Weaken(4)
if (IO.damage >= IO.min_broken_damage)
if(H.stat != DEAD)
to_chat(H, "<span class='warning'>You go blind!</span>")
var/obj/item/organ/external/BP = H.bodyparts_by_name[BP_HEAD]
BP.take_damage(force)
else
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/stacks/nanopaste.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/BP = H.get_bodypart(def_zone)

if(BP && BP.is_robotic())
if(BP && BP.is_robotic_part())
if(can_operate(H))
for(var/obj/item/organ/internal/IO in BP.bodypart_organs)
if(IO.is_bruised())
Expand Down
15 changes: 8 additions & 7 deletions code/game/objects/items/weapons/grenades/flashbang.dm
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/internal/eyes/IO = H.organs_by_name[O_EYES]
if(IO.damage >= IO.min_bruised_damage)
to_chat(M, "<span class='warning'>Ваши глаза сильно щиплит!</span>")
if(!banglet && !(istype(src , /obj/item/weapon/grenade/clusterbuster)))
if(IO.damage >= IO.min_broken_damage)
to_chat(M, "<span class='warning'>Вы ничего не видите!</span>")
if(H.species.name == SHADOWLING) // BBQ from shadowling ~Zve
H.adjustFireLoss(rand(15, 25))
if(IO)
if(IO.damage >= IO.min_bruised_damage)
to_chat(M, "<span class='warning'>Ваши глаза сильно щиплит!</span>")
if(!banglet && !(istype(src , /obj/item/weapon/grenade/clusterbuster)))
if(IO.damage >= IO.min_broken_damage)
to_chat(M, "<span class='warning'>Вы ничего не видите!</span>")
if(H.species.name == SHADOWLING) // BBQ from shadowling ~Zve
H.adjustFireLoss(rand(15, 25))
if(M.ear_damage >= 15)
to_chat(M, "<span class='warning'>Вы чувствуете сильный звон в ушах!</span>")
if(!banglet && !(istype(src , /obj/item/weapon/grenade/clusterbuster)))
Expand Down
4 changes: 3 additions & 1 deletion code/game/objects/items/weapons/tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@
if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/internal/eyes/IO = H.organs_by_name[O_EYES]
if(!IO)
return
if(H.species.flags[IS_SYNTHETIC])
return
switch(safety)
Expand Down Expand Up @@ -566,7 +568,7 @@
var/obj/item/organ/external/BP = H.get_bodypart(def_zone)
if(!BP)
return
if(!(BP.is_robotic()) || user.a_intent != INTENT_HELP)
if(!(BP.is_robotic_part()) || user.a_intent != INTENT_HELP)
return ..()

if(H.species.flags[IS_SYNTHETIC])
Expand Down
27 changes: 11 additions & 16 deletions code/modules/client/character_menu/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,6 @@
else if(status == "mechanical")
++ind
. += "<li>Mechanical [organ_name]</li>"
else if(status == "assisted")
++ind
switch(organ_name)
if("heart")
. += "<li>Pacemaker-assisted [organ_name]</li>"
if("eyes")
. += "<li>Retinal overlayed [organ_name]</li>"
else
. += "<li>Mechanically assisted [organ_name]</li>"
if(species == IPC)
. += "<br>Head: <a href='byond://?src=\ref[user];preference=ipc_head;task=input'>[ipc_head]</a>"

Expand Down Expand Up @@ -573,7 +564,7 @@
organ_data[limb] = "cyborg"

if("Organs")
var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in list("Heart", "Eyes")
var/organ_name = input(user, "Which internal function do you want to change?") as null|anything in list("Heart", "Eyes", "lungs", "liver", "kidneys")
if(!organ_name) return

var/organ = null
Expand All @@ -582,17 +573,21 @@
organ = O_HEART
if("Eyes")
organ = O_EYES

var/new_state = input(user, "What state do you wish the organ to be in?") as null|anything in list("Normal","Assisted","Mechanical")
if("lungs")
organ = O_LUNGS
if("liver")
organ = O_LIVER
if("kidneys")
organ = O_KIDNEYS

var/new_state = input(user, "What state do you wish the organ to be in?") as null|anything in list("Normal","Cybernetic")
if(!new_state) return

switch(new_state)
if("Normal")
organ_data[organ] = null
if("Assisted")
organ_data[organ] = "assisted"
if("Mechanical")
organ_data[organ] = "mechanical"
Comment on lines -592 to -595
Copy link
Contributor

Choose a reason for hiding this comment

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

это все останется в префах игрока, это нужно поубирать
вместе с этим бампнуть этот лист

for(var/i in list(BP_L_LEG, BP_R_LEG, BP_L_ARM, BP_R_ARM, O_HEART, O_EYES))
organ_data[i] = null

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Не совсем поняла, как бампнуть, и как убрать

if("Cybernetic")
organ_data[organ] = "Cybernetic"
TriflesChase marked this conversation as resolved.
Show resolved Hide resolved
// Choosing a head for an IPC
if("ipc_head")
var/list/ipc_heads = list("Default", "Alien", "Double", "Pillar", "Human")
Expand Down
4 changes: 1 addition & 3 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -497,9 +497,7 @@ var/global/list/datum/preferences/preferences_datums = list()
var/obj/item/organ/external/new_BP = new type(null)
new_BP.insert_organ(character)

else if(status == "assisted" && IO)
IO.mechassist()
else if(status == "mechanical" && IO)
else if(status == "Cybernetic" && IO)
IO.mechanize()

else
Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/rig/modules/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@

if(repairModule)
for(var/obj/item/organ/external/BP in H.bodyparts)
if(BP.is_robotic() && (BP.brute_dam || BP.burn_dam))
if(BP.is_robotic_part() && (BP.brute_dam || BP.burn_dam))
repairModule.activate()
break

Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/spacesuits/rig/modules/utility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
var/obj/item/organ/external/DBP

for(var/obj/item/organ/external/BP in H.bodyparts)
if(BP.is_robotic())
if(BP.is_robotic_part())
if(BP.brute_dam)
DBP = BP
else if(BP.burn_dam)
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
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@
if(HAS_TRAIT(M, TRAIT_WET_HANDS) && ishuman(src))
var/mob/living/carbon/human/H = src
var/obj/item/organ/external/BP = H.get_bodypart(M.get_targetzone())
if(BP && BP.is_robotic())
if(BP && BP.is_robotic_part())
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
sparks.set_up(3, 0, get_turf(H))
sparks.start()
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/human/death.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
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()))
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@
applying_pressure = "<span class='info'>[t_He] is applying pressure to [t_his] [BP.name].</span><br>"
else
applying_pressure = "<span class='info'>[BP.applied_pressure] is applying pressure to [t_his] [BP.name].</span><br>"
if(BP.is_robotic())
if(BP.is_robotic_part())
if(!(BP.brute_dam + BP.burn_dam))
if(!species.flags[IS_SYNTHETIC])
wound_flavor_text[BP_Name] = "<span class='warning'>[t_He] has a robot [BP.name]!</span>\n"
Expand Down
Loading
Loading