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
Moves breathing from species to the lung organ #20869
Conversation
Slightly related, we really really really need to refactor eye damage/color to be dependent on an eyes organ |
Does this make it so if you transplant ashwalker lungs into yourself, you'll be able to breathe on lavaland without equipment? |
@@ -257,8 +257,10 @@ var/list/non_simple_animals = typecacheof(list(/mob/living/carbon/monkey,/mob/li | |||
switch(upgrade_type) | |||
if(VAULT_TOXIN) | |||
H << "<span class='notice'>You feel resistant to airborne toxins.</span>" | |||
S.tox_breath_dam_min = 0 | |||
S.tox_breath_dam_max = 0 | |||
if(/obj/item/organ/lungs in H.internal_organs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
false.
the H.internal_organs
list will never contain the path /obj/item/organ/lungs
, or any paths at all for that matter!
It's a lit of objects.
you're probably forgetting a locate()
call
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh. I didn't know that didn't work with objects.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well /obj/item/organ/lungs
and an instantiated lung object are completely different.
that lung object's .type
variable however is a 100% match for /obj/item/organ/lungs
paths != objects
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be if(locate(/obj/item/organ/lungs) in H.internal_organs)
then, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RemieRichards k. I fixed it.
@WJohn actually, no. |
What lung types are there? Could I give a guy Xeno lungs for breathing plasma and removing the need for oxygen? Cybernetic lungs for immunity to toxic gasses? Plasmaman lungs for FORCING people to breathe plasma? |
@GunHog |
If you steal ashwalker/golem lungs, and aug a body, then suppliment a heat gene you are effectively space proof when revived from practically any condition of death with strange reagent. This is a slightly better alternative to reattaching to a ashwalker torso, and will fuel my surgeon experiments. |
You don't need augs to space proof, cold res handles pressure resistance |
Double checked, ashwalkers and NOBREATHE related races have their lungs qdeleted in the code. So no-breathe transplanted lungs are currently impossible without badminnery to restore said lungs and assign them to the owner. |
I specifically did the NOBREATH species having no lungs, because it made no sense for golems and skeletons to have a set of lungs. If ashwalkers are being switched to a lavaland gas mixture, then they won't be NOBREATH anymore. |
|
||
return 0 | ||
else | ||
if(istype(L,/obj/item/organ/lungs)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
people can have an organ in the lung slot that isn't /obj/item/organ/lungs ??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Badmins? Idk.
I just like to do an istype before casting stuff, just in case.
Should I remove this check then?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I don't really see what admins could use a non lung organ in the lung slot for. But I guess it prevents potential runtimes, so let's keep it.
I cant wait for the entire server to die of suffocation within 3 minutes of starting the round if this bugs out. |
I tested it. it works fine |
famous last words |
Wonderful |
HMMMMMMM. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving stuff from mobs\species to organs is the goal
Thats the first one i see so its first for me |
|
||
//-- TRACES --// | ||
|
||
if(breath && !(NOBREATH in specflags)) // If there's some other shit in the air lets deal with it here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there's no point in checking this because NOBREATH species will have no lungs and this line will never be reached if that is the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what if you insert lungs into a human with NOBREATH?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dunno. Haven't tested it post check removal yet.
I'd assume either the check in the species would make them still not breath, or they would need to breath.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Things with nobreath shouldnt even try to call their lungs procs
Thus inserting lungs into them should be as impactful as inserting a bike horn into their cavity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well there is what should happen and then what the code actually does, so you would need to check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, tested it. If the species has nobreath, they basically skip breathe(), and don't call check_breath() which is where the lung code is.
So they don't breathe if you transplant lungs into them.
I'm hopeful for this PR |
@@ -150,6 +132,9 @@ | |||
else if((!(NOBREATH in specflags)) && (!lungs)) | |||
lungs = new() | |||
lungs.Insert(C) | |||
if(lungs) | |||
lungs.breathlevels = list("safe_oxygen_min" = safe_oxygen_min,"safe_oxygen_max" = safe_oxygen_max,"safe_co2_min" = safe_co2_min,"safe_co2_max" = safe_co2_max, | |||
"safe_toxins_min" = safe_toxins_min,"safe_toxins_max" = safe_toxins_max,"SA_para_min" = SA_para_min,"SA_sleep_min" = SA_sleep_min,"BZ_trip_balls_min" = BZ_trip_balls_min) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in human/New() organs are created after setting up the species, so if we make lizard have special values, their lung won't have those.
creates lung subtypes
@phil235 I did the change you suggested, but now the lungs aren't spawning in humans. |
if(dna.species.mutantlungs) | ||
internal_organs += new dna.species.mutantlungs() | ||
else | ||
internal_organs += new /obj/item/organ/lungs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
()
throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox) | ||
else if(S.safe_co2_min) | ||
else if(S.breathid = "co2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw_alert("oxy", /obj/screen/alert/oxy) | ||
else if(S.safe_toxins_min) | ||
else if(S.breathid = "tox") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -108,11 +108,11 @@ | |||
if(dna && dna.species) | |||
var/datum/species/S = dna.species | |||
|
|||
if(S.safe_oxygen_min) | |||
if(S.breathid = "o2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
throw_alert("oxy", /obj/screen/alert/oxy) | ||
else if(S.breathid = "tox") | ||
throw_alert("not_enough_tox", /obj/screen/alert/not_enough_tox) | ||
else if(S.breathid = "co2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"=="
|
||
if(S.breathid = "o2") | ||
throw_alert("oxy", /obj/screen/alert/oxy) | ||
else if(S.breathid = "tox") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"=="
if(dna && dna.species) | ||
var/datum/species/S = dna.species | ||
|
||
if(S.breathid = "o2") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"=="
Compiles now. lungs still not spawning ;_; |
Manually calling create_internal_organs() gives lungs, and adminspawned humans correctly have lungs. So it's only happening when players are first spawned by the game, or when they join the game. edit: found the issue. |
@@ -144,11 +119,14 @@ | |||
heart = new() | |||
heart.Insert(C) | |||
|
|||
if((NOBREATH in specflags) && lungs) | |||
if(lungs) | |||
lungs.Remove(C) | |||
qdel(lungs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you're not immediately nullifying lungs so the if(!lungs) check below fails.
🆑
experiment: Breathing has been moved from species to the lung organ
add: Lung transplants are now possible!
/:cl: