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

Slimes can now eat every item in the game. #79727

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Roy-Boi-21
Copy link

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

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
@github-actions github-actions bot added [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. new contributor labels Feb 19, 2025
@@ -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);
Copy link
Contributor

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 🐶

Suggested change
actually_used->activation_consume(charges_used.value(), pt, this);
actually_used->activation_consume( charges_used.value(), pt, this );

Comment on lines +7186 to +7188
if (actually_used->has_flag(flag_SINGLE_USE) || actually_used->is_bionic() ||
actually_used->is_deployable()) {
i_rem(actually_used);
Copy link
Contributor

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 🐶

Suggested change
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 ) )) {
Copy link
Contributor

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 🐶

Suggested change
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 ) ) ) {

@TheShadowFerret
Copy link
Contributor

New anti-grenade strategy just dropped

@github-actions github-actions bot added the json-styled JSON lint passed, label assigned by github actions label Feb 19, 2025
@GuardianDll
Copy link
Member

That's funny, but we do not define calories for literally every item in the game, so it's somewhat pointless, no?

@PatrikLundell
Copy link
Contributor

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.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 19, 2025
Copy link
Contributor

@Karol1223 Karol1223 left a 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.

Copy link
Member

@kevingranade kevingranade left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` Game: Balance Balancing of (existing) in-game features. json-styled JSON lint passed, label assigned by github actions new contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants