-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Slimes can now eat every item in the game. #79727
base: master
Are you sure you want to change the base?
Conversation
Slimes are now able to eat everything that is an item. This may result in accidental item consumption. See issue here for more information: CleverRaven#79209
@@ -7181,7 +7181,18 @@ bool Character::invoke_item( item *used, const std::string &method, const tripoi | |||
return false; | |||
} | |||
|
|||
if( actually_used->is_comestible() ) { | |||
actually_used->activation_consume(charges_used.value(), pt, this); |
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.
[JSON & C++ formatters] reported by reviewdog 🐶
actually_used->activation_consume(charges_used.value(), pt, this); | |
actually_used->activation_consume( charges_used.value(), pt, this ); |
if (actually_used->has_flag(flag_SINGLE_USE) || actually_used->is_bionic() || | ||
actually_used->is_deployable()) { | ||
i_rem(actually_used); |
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.
[JSON & C++ formatters] reported by reviewdog 🐶
if (actually_used->has_flag(flag_SINGLE_USE) || actually_used->is_bionic() || | |
actually_used->is_deployable()) { | |
i_rem(actually_used); | |
if( actually_used->has_flag( flag_SINGLE_USE ) || actually_used->is_bionic() || | |
actually_used->is_deployable() ) { | |
i_rem( actually_used ); |
// Slimes are now able to eat literally everything that is an item. | ||
// FIXME: Slimes could accidentally eat things they don't want to eat and vice versa. | ||
// There is no limit on what a slime could or could not eat. See issue for reference: https://github.com/CleverRaven/Cataclysm-DDA/issues/79209 | ||
if( actually_used->is_comestible() || ( has_trait( trait_PER_SLIME ) || has_trait( trait_PER_SLIME_OK ) )) { |
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.
[JSON & C++ formatters] reported by reviewdog 🐶
if( actually_used->is_comestible() || ( has_trait( trait_PER_SLIME ) || has_trait( trait_PER_SLIME_OK ) )) { | |
if( actually_used->is_comestible() || ( has_trait( trait_PER_SLIME ) || | |
has_trait( trait_PER_SLIME_OK ) ) ) { |
|
That's funny, but we do not define calories for literally every item in the game, so it's somewhat pointless, no? |
I'm not keen on this. Sure, all kinds of food and other organic material, but not everything: there's already a boss monster like that. This change would mean it would be rather pointless to fight slimes as they leave no loot behind, so just shut the door to the lost areas or avoid them, unless you have to get through. |
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.
This feels nonactionable, and does not in fact tackle what the referenced issue talks about.
The issue says slime mutants should be able to eat all ORGANIC matter, and that is somewhat believable, although I don't see a way to do it in current code (no, making everything made of wood or leather into type:COMESTIBLE
is not an acceptable solution). Making slimes able to eat LITERALLY ANY ITEM is not acceptable, as there's simply no reason why they would be able to do so. Just because you're made of jelly doesn't mean you should suddenly be able to digest metal or rocks.
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 it's just for slimes, you need some kind of override that goes "if this is slime-edible but not a comestible type item, do some ad-hoc thing to figure out calories", as previously noted, we're definitely not mass converting things to comestible to cater to a corner case like slime mutants.
As is this change is just going to wildly break because it's passing an item to a method that expects a comestible.
Slimes are now able to eat everything that is an item. This may result in accidental item consumption.
See issue here for more information:
Summary
Balance "Slimes can eat every item in the game."
Purpose of change
I am making this change as a step to complete this issue that was posted a month about.
#79209
Describe the solution
I changed the if statement that checks if something is edible to share its true condition to whether the player is a slime.
Describe alternatives you've considered
I haven't considered any alternate solutions. Hypothetically, you could give some items the "edible by slimes" trait and have that determine whether a slime could eat it.
Testing
I have not made any tests because I was in a rush.
Additional context
N/A