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

Food price scales with freshness #77960

Merged
merged 1 commit into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7104,6 +7104,11 @@ int item::price_no_contents( bool practical, std::optional<int> price_override )

}

// Nominal price for perfectly fresh food, decreasing linearly as it gets closer to expiry
if( is_food() ) {
price *= ( 1.0 - get_relative_rot() );
}

if( is_filthy() ) {
// Filthy items receieve a fixed price malus. This means common clothing ends up
// with no value (it's *everywhere*), but valuable items retain most of their value.
Expand Down
Loading