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

Durability HP Bonus support #326

Merged
merged 10 commits into from
Jan 29, 2025
Prev Previous commit
Next Next commit
Update items.cpp
DragonSlayer62 committed Jan 17, 2025
commit add5789e065504a138cac07ed8bda8f9d559b00a
4 changes: 4 additions & 0 deletions source/items.cpp
Original file line number Diff line number Diff line change
@@ -1207,6 +1207,10 @@ CItem * cItem::CreateBaseScriptItem( CItem *mCont, std::string ourItem, const UI
{
iCreated->SetMaxHP( iCreated->GetHP() );
}
else
{// If you add a maxhp tag and have durabilityHpBonus, it will increase the Durability (aka Health).
iCreated->SetMaxHP( iCreated->GetMaxHP() + durabilityHpBonus );
}

// If maxUses is higher than usesLeft for a new item, randomize the amount of usesLeft the item should have!
if( iCreated->GetMaxUses() > iCreated->GetUsesLeft() )