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

simplify item::damage_level() #44563

Merged
merged 3 commits into from
Oct 7, 2020

Conversation

Hirmuolio
Copy link
Contributor

@Hirmuolio Hirmuolio commented Oct 2, 2020

Summary

SUMMARY: Infrastructure "simplify item::damage_level()"

Purpose of change

item::damage_level( int max ) had max value of 4 in every single place where it was used. The max value does not need to exist.

Describe the solution

Find and replace damage_level( 4 ) -> damage_level()
Replace the max value in the equations with 4.
Update definitions.

Describe alternatives you've considered

Let it be.

Testing

Compiles, test pass.
Item damage levels still showthe same.

Additional context

Maybe it should have return damage_ > 0 ? 4 : -1; instead of return damage_ > 0 ? 4 : damage_; to match how its behavior with negative item damage is described in item.h. But I decided not to change its behavior at all and I don't think there is any place where code cares about it.

@kevingranade
Copy link
Member

I think @ZhilkinSerg had some plans for this in the future, namely expanding field intensity levels once his overhaul has progressed far enough.

@ZhilkinSerg
Copy link
Contributor

I think @ZhilkinSerg had some plans for this in the future, namely expanding field intensity levels once his overhaul has progressed far enough.

Item damage level (capped at 4) is a different thing from field intensity levels (capped at 3).

@ZhilkinSerg ZhilkinSerg added [C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact labels Oct 4, 2020
@kevingranade
Copy link
Member

kevingranade commented Oct 6, 2020 via email

@ZhilkinSerg ZhilkinSerg merged commit 0692265 into CleverRaven:master Oct 7, 2020
@Hirmuolio Hirmuolio deleted the simplify-damage branch November 3, 2020 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Items / Item Actions / Item Qualities Items and how they work and interact
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants