Skip to content

Commit

Permalink
Merge pull request #77960 from RenechCDDA/fresh_food_pricing_2
Browse files Browse the repository at this point in the history
Food price scales with freshness
  • Loading branch information
Night-Pryanik authored Nov 18, 2024
2 parents bf5a65f + c8d7a07 commit fc8e177
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 fc8e177

Please sign in to comment.