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 all 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
16 changes: 13 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 @@ -276,3 +277,12 @@
#define TRAUMATIC_SHOCK_MIND_SHATTERING 80
#define TRAUMATIC_SHOCK_CRITICAL 100

// Initial blood volume.
#define SPECIES_BLOOD_DEFAULT 560

//Blood levels. These are percentages based on the species blood_volume far.
#define BLOOD_VOLUME_FULL_P 100
#define BLOOD_VOLUME_SAFE_P 85
#define BLOOD_VOLUME_OKAY_P 70
#define BLOOD_VOLUME_BAD_P 60
#define BLOOD_VOLUME_SURVIVE_P 30
22 changes: 20 additions & 2 deletions code/datums/qualities/quirkieish.dm
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,26 @@
var/obj/item/organ/external/r_leg/robot/RL = new(null)
RL.insert_organ(H)

for(var/obj/item/organ/internal/IO in H.organs)
IO.mechanize()
qdel(H.organs_by_name[O_HEART])
qdel(H.organs_by_name[O_KIDNEYS])
qdel(H.organs_by_name[O_LIVER])
qdel(H.organs_by_name[O_LUNGS])
qdel(H.organs_by_name[O_EYES])
TriflesChase marked this conversation as resolved.
Show resolved Hide resolved

var/obj/item/organ/internal/heart/cybernetic/CH = new(null)
CH.insert_organ(H)

var/obj/item/organ/internal/kidneys/cybernetic/CK = new(null)
CK.insert_organ(H)

var/obj/item/organ/internal/liver/cybernetic/CL = new(null)
CL.insert_organ(H)

var/obj/item/organ/internal/lungs/cybernetic/CU = new(null)
CU.insert_organ(H)

var/obj/item/organ/internal/eyes/cybernetic/CE = new(null)
CE.insert_organ(H)

H.regenerate_icons()

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
3 changes: 3 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,9 @@
return flags & INSERT_CONTAINER
*/

/atom/proc/return_air_for_internal_lifeform()
return return_air()

/atom/proc/allow_drop()
return 1

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 @@ -867,21 +867,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
31 changes: 13 additions & 18 deletions code/modules/client/character_menu/general.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,9 @@
else if(status == "amputated")
++ind
. += "<li>Amputated [organ_name]</li>"
else if(status == "mechanical")
else if(status == "Cybernetic")
++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>"
. += "<li>Cybernetic [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
24 changes: 19 additions & 5 deletions code/modules/client/preferences.dm
Original file line number Diff line number Diff line change
Expand Up @@ -499,11 +499,25 @@ 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)
IO.mechanize()

else if(status == "Cybernetic" && IO)
if(IO)
qdel(IO)
switch(name)
Copy link
Contributor

Choose a reason for hiding this comment

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

мы разве тут не по тегу должны смотреть?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Я взяла код из bodyparts, и не уверена, зачем менять

if(O_HEART)
var/obj/item/organ/internal/heart/cybernetic/C = new(null)
C.insert_organ(character)
if(O_KIDNEYS)
var/obj/item/organ/internal/kidneys/cybernetic/C = new(null)
C.insert_organ(character)
if(O_LIVER)
var/obj/item/organ/internal/liver/cybernetic/C = new(null)
C.insert_organ(character)
if(O_LUNGS)
var/obj/item/organ/internal/lungs/cybernetic/C = new(null)
C.insert_organ(character)
if(O_EYES)
var/obj/item/organ/internal/eyes/cybernetic/C = new(null)
C.insert_organ(character)
else
continue

Expand Down
2 changes: 1 addition & 1 deletion code/modules/client/preferences_savefile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
if(current_version < 32)
popup(parent, "Части тела вашего персонажа ([real_name]) несовместимы с текущей версией. Части тела данного персонажа восстановлены до обычного состояния.", "Preferences")
organ_data = list()
for(var/i in list(BP_L_LEG, BP_R_LEG, BP_L_ARM, BP_R_ARM, O_HEART, O_EYES))
for(var/i in list(BP_L_LEG, BP_R_LEG, BP_L_ARM, BP_R_ARM, O_HEART, O_EYES, O_LIVER, O_KIDNEYS, O_LUNGS))
organ_data[i] = null

if(current_version < 33)
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
Loading
Loading