--- scripts/restaurant/restaurant.gd +++ scripts/restaurant/restaurant.gd @@ -47,6 +47,8 @@ # sienne, en secondes franches. Cette valeur ne sert plus qu'a repondre quand on # la demande sans client sous la main. const EATING_SECONDS := 8.0 +# Fixed-meal guests wait briefly when their order cannot be supplied. +const UNAVAILABLE_FIXED_MEAL_WAIT_RATIO := 0.25 # Finished meals are plated directly on the stove. const PLATING_OFFSET := Vector2.ZERO # Une table est un tabouret: une seule place, un seul client. Les emplacements @@ -2476,6 +2478,13 @@ ready += 1 return ready +# Reusable by every profile with a fixed recipe, independent of its quest. +func order_supply_patience_ratio(guest: Customer) -> float: + var fixed := str(DataCatalog.CUSTOMER_PROFILES.get(guest.profile_id, {}).get("fixed_recipe", "")) + if fixed.is_empty() or fixed != guest.requested_recipe or _recipe_is_available(fixed): + return 1.0 + return UNAVAILABLE_FIXED_MEAL_WAIT_RATIO + func _recipe_is_available(recipe_id: String) -> bool: return GameState.can_cook(recipe_id) or _servings_ready(recipe_id) > 0 @@ -4326,11 +4335,13 @@ # produisible, et ce contrôle passe à chaque changement de stock. if not current_customer.has_live_order(): continue + var fixed := str(DataCatalog.CUSTOMER_PROFILES.get(current_customer.profile_id, {}).get("fixed_recipe", "")) + if fixed == current_customer.requested_recipe: + current_customer.refresh_order_patience() + continue if _recipe_is_available(current_customer.requested_recipe): continue # Il est venu pour ce plat-là: il ne change pas d'avis faute de stock. - if str(DataCatalog.CUSTOMER_PROFILES.get(current_customer.profile_id, {}).get("fixed_recipe", "")) == current_customer.requested_recipe: - continue var alternative := _choose_available_recipe(current_customer) if alternative.is_empty(): GameState.toast_from(self, Loc.ui("ui.restaurant.customer_left_last_meal") % current_customer.display_name)