From c8d7a07de8e2ada97ba6663407b0b44dc7d3a2b5 Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:58:40 -0500 Subject: [PATCH] Food price scales with freshness --- src/item.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/item.cpp b/src/item.cpp index f3c921fa82bfc..7ffa2bce87fbe 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -7104,6 +7104,11 @@ int item::price_no_contents( bool practical, std::optional 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.