1.修改胜利之树的果酒为不会合成失败2.尝试修复菜园陷阱的bug
This commit is contained in:
@@ -588,7 +588,7 @@ class WPSCombatBase(WPSAPI):
|
|||||||
(victory_tree_crop.fruit_id, victory_tree_crop.fruit_id, victory_tree_crop.fruit_id),
|
(victory_tree_crop.fruit_id, victory_tree_crop.fruit_id, victory_tree_crop.fruit_id),
|
||||||
victory_tree_crop.wine_item_id,
|
victory_tree_crop.wine_item_id,
|
||||||
"garden_item_rot_fruit",
|
"garden_item_rot_fruit",
|
||||||
0.75,
|
1, # 胜利之树的果酒不会合成失败
|
||||||
)
|
)
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
logger.Log(
|
logger.Log(
|
||||||
|
|||||||
@@ -525,16 +525,28 @@ class WPSGardenBase(WPSAPI):
|
|||||||
formatted_time = self._format_timestamp(mature_at)
|
formatted_time = self._format_timestamp(mature_at)
|
||||||
if is_mature:
|
if is_mature:
|
||||||
remaining = plot["remaining_fruit"]
|
remaining = plot["remaining_fruit"]
|
||||||
theft_users = len(json.loads(plot["theft_users"])) if plot.get("theft_users") else 0
|
try:
|
||||||
|
theft_users_str = plot["theft_users"]
|
||||||
|
theft_users = len(json.loads(theft_users_str)) if theft_users_str else 0
|
||||||
|
except (KeyError, TypeError, json.JSONDecodeError):
|
||||||
|
theft_users = 0
|
||||||
|
|
||||||
trap_info = ""
|
trap_info = ""
|
||||||
if show_trap:
|
if show_trap:
|
||||||
trap_item_id = plot.get("trap_item_id")
|
try:
|
||||||
if trap_item_id and isinstance(trap_item_id, str) and trap_item_id.strip():
|
trap_item_id = plot["trap_item_id"]
|
||||||
trap_durability = int(plot.get("trap_durability", 0))
|
if trap_item_id and isinstance(trap_item_id, str) and trap_item_id.strip():
|
||||||
from .garden_models import GARDEN_TRAPS_DICT
|
try:
|
||||||
trap = GARDEN_TRAPS_DICT.get(trap_item_id)
|
trap_durability = int(plot["trap_durability"]) if plot["trap_durability"] is not None else 0
|
||||||
if trap:
|
except (KeyError, TypeError, ValueError):
|
||||||
trap_info = f"|陷阱:{trap.display_name}({trap_durability}次)"
|
trap_durability = 0
|
||||||
|
from .garden_models import GARDEN_TRAPS_DICT
|
||||||
|
trap = GARDEN_TRAPS_DICT.get(trap_item_id)
|
||||||
|
if trap:
|
||||||
|
trap_info = f"|陷阱:{trap.display_name}({trap_durability}次)"
|
||||||
|
except (KeyError, TypeError):
|
||||||
|
# 字段不存在或值为None,不显示陷阱信息
|
||||||
|
pass
|
||||||
status = f"✅ 已成熟(成熟于 {formatted_time})"
|
status = f"✅ 已成熟(成熟于 {formatted_time})"
|
||||||
lines.append(
|
lines.append(
|
||||||
f"- 地块 {idx}|{name}|{status}|剩余果实 {remaining}|被偷次数 {theft_users}{trap_info}"
|
f"- 地块 {idx}|{name}|{status}|剩余果实 {remaining}|被偷次数 {theft_users}{trap_info}"
|
||||||
|
|||||||
Reference in New Issue
Block a user