mirror of
https://github.com/sui-feng-cb/AzurLaneAutoScript1.git
synced 2026-08-18 20:45:58 +08:00
Fix: island production and restaurant should keep task target items
This commit is contained in:
@@ -15,6 +15,8 @@ from module.island.data import DIC_ISLAND_ITEM, DIC_ISLAND_RESTAURANT_MENU_TO_RE
|
||||
from module.island.utils import (
|
||||
get_stuck_season_order_requirements,
|
||||
load_hard_floor_items,
|
||||
load_item_mapping,
|
||||
merge_task_target_stuck_order_items,
|
||||
normalize_item_keys,
|
||||
)
|
||||
from module.island_handler.assets import *
|
||||
@@ -277,8 +279,9 @@ class IslandRestaurant(IslandDock):
|
||||
item for item in items
|
||||
if item.id in menu
|
||||
# Sell one full waitress-capacity tranche while preserving manual
|
||||
# hard floors and remaining season-order requirements. Reserves and
|
||||
# daily buffers are soft and may be consumed by restaurants.
|
||||
# hard floors, task targets, and remaining season-order
|
||||
# requirements. Reserves and daily buffers are soft and may be
|
||||
# consumed by restaurants.
|
||||
and has_sellable_capacity(item)
|
||||
]
|
||||
surplus_items = [
|
||||
@@ -303,13 +306,18 @@ class IslandRestaurant(IslandDock):
|
||||
stuck_season_order_id = self.config.cross_get(
|
||||
"IslandOrder.IslandOrder.StuckSeasonOrderId", 0
|
||||
)
|
||||
season_order_items = normalize_item_keys(
|
||||
get_stuck_season_order_requirements(stuck_season_order_id)
|
||||
task_target_items = load_item_mapping(
|
||||
self.config.cross_get("IslandSeasonTask.IslandSeasonTask.TaskTarget", "{}"),
|
||||
config_name='TaskTarget',
|
||||
)
|
||||
item_ids = set(hard_floor_items) | set(season_order_items)
|
||||
protected_target_items = merge_task_target_stuck_order_items(
|
||||
task_target_items,
|
||||
get_stuck_season_order_requirements(stuck_season_order_id),
|
||||
)
|
||||
item_ids = set(hard_floor_items) | set(protected_target_items)
|
||||
return {
|
||||
item_id: max(hard_floor_items.get(item_id, 0), 0)
|
||||
+ max(season_order_items.get(item_id, 0), 0)
|
||||
+ max(protected_target_items.get(item_id, {}).get('total_need_count', 0), 0)
|
||||
for item_id in item_ids
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user