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

Added Durability Bonus Prop #281

Conversation

DragonSlayer62
Copy link
Contributor

No description provided.

@DragonSlayer62
Copy link
Contributor Author

This is ready to go

@strattond
Copy link
Contributor

Like the artifact rarity (#280), this exposes the stuff to JS via Item, but it is added to the Base Object - this makes more sense to hang off cItem instead, as it doesn't have a conceptual value for a character

@strattond strattond added the enhancement New feature or request label Jan 14, 2025
moved from base to item
source/cItem.cpp Outdated
void CItem::SetDurabilityHpBonus(SI16 newValue)
{
durabilityHpBonus = newValue;
if (CanBeObjType(OT_ITEM))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given this only applies to Items (i.e. CanBeObjType(OT_ITEM) is always true), you can probably remove the IF directly and just call UpdateRegion().

You also shouldn't need to do a static cast, as you're already in CItem at this point.

So this whole if could be reduced to, hopefully, UpdateRegion();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay will update

Copy link
Contributor

@strattond strattond left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pending testing, this looks OK to me

@strattond strattond added the nomerge - future ref For future reference, not to be merged directly label Jan 17, 2025
@DragonSlayer62 DragonSlayer62 deleted the Durability-Bonus-property branch January 17, 2025 04:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request nomerge - future ref For future reference, not to be merged directly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants