Skip to content

Commit

Permalink
Food price scales with freshness
Browse files Browse the repository at this point in the history
  • Loading branch information
RenechCDDA committed Nov 18, 2024
1 parent 2ca630f commit c8d7a07
Showing 1 changed file with 5 additions and 0 deletions.
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

0 comments on commit c8d7a07

Please sign in to comment.