CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.33k stars 4.14k forks source link

Cocoon Samples #63791

Open Grubleafeater opened 1 year ago

Grubleafeater commented 1 year ago

Describe the bug

So, according to Venera, this is a bug. If you kill something and let it become a cocoon, killing it leaves behind some samples.

Attach save file

N/a

Steps to reproduce

Kill razorclaws, wait, kill cocoons

Expected behavior

Apparently, not samples dropping?

Screenshots

No response

Versions and configuration

Additional context

No response

ehughsbaird commented 1 year ago

Confirmed on dc8a598f522b2c37805932b1c006dbf66e62f237

Going to a shipwreck and killing the razorclaws there, then waiting for them to turn into cocoons will result in the cocoon dropping fish and insect samples when killed.

ehughsbaird commented 1 year ago

This is because they don't leave a corpse behind, so the dissectables are just dropped, https://github.com/CleverRaven/Cataclysm-DDA/blob/dc8a598f522b2c37805932b1c006dbf66e62f237/src/monster.cpp#L2683-L2690

alp7292 commented 1 year ago

oh i always tought it was a feature

MNG-cataclysm commented 1 year ago

What if we just make this a feature, instead of considering it a bug?

Venera3 commented 1 year ago

Why would we? Nothing says "extract the characteristic parts of X" quite like "hey what if we melted it down to gloop but exploded before finishing"

On the design side getting to bypass dissection like this is immensely abuseable. It's a bug with the dissection samples living in a corpse pocket and the "no corpse" setting not erasing the contents.

RenechCDDA commented 9 months ago

I think this can be cleared up by adding a check during zombify_into, something like this (please excuse the syntax, written without access to a compiler)

for ( item this_item : corpse_pocket_contents ) {
if ( std::find(harvest_results) == this_item {
i_rem this_item;
      }
}

The brute force way is to simply clear that pocket entirely during zombify into, but that pocket is also used for bionics and things like embedded arrows I think. So we don't really want to do that, we want our removal to be as precise as possible.

GuardianDll commented 9 months ago

So apparently it is not about monster dropping the sample when it left no corpse, but it's about zombify_into carrying the sample of the original monster, no matter does monster has defined sample or not image Ren already posted the possible fix for this

TheSaddestGoomba commented 8 months ago

I've encountered this again while testing #71475 As established here, it seems to only occur when a living creature (with samples dropped by dissection) dies and zombifies into something that leaves no corpse. I've encountered it only in the "warted monstrosity" when it zombifies from a "gargantuan toad" corpse. Debug spawning the "warted monstrosity" and then killing it leaves the intended scrap body parts. Interestingly, when it drops the "frog samples" it only drops the samples (in large numbers) and not the contents of the "explode_toad" death drop object.