1.签到系统错误修复2.商店系统修复bug并更新购买逻辑3.将炉灰加入商店并添加炉渣配方4.修改一些炼金系统的逻辑

This commit is contained in:
2025-11-09 21:46:21 +08:00
parent f0cc04d2c1
commit 22d2271bac
6 changed files with 200 additions and 62 deletions

View File

@@ -15,6 +15,7 @@ from .WPSBackpackSystem import (
WPSBackpackSystem,
)
from .WPSConfigSystem import WPSConfigAPI
from .WPSStoreSystem import WPSStoreSystem
from .WPSFortuneSystem import WPSFortuneSystem
@@ -40,7 +41,7 @@ class WPSAlchemyGame(WPSAPI):
ASH_ITEM_NAME = "炉灰"
SLAG_ITEM_ID = "alchemy_slag"
SLAG_ITEM_NAME = "炉渣"
MAX_BATCH_TIMES = 9999
MAX_BATCH_TIMES = 99
_PHASE_TABLE: List[Tuple[float, float, str, str]] = [
(0.1481481481, 0.0, "爆炸", "💥 炼金反噬,积分化为飞灰……"),
@@ -58,7 +59,7 @@ class WPSAlchemyGame(WPSAPI):
@override
def dependencies(self) -> List[type]:
return [WPSAPI, WPSBackpackSystem, WPSConfigAPI, WPSFortuneSystem]
return [WPSAPI, WPSBackpackSystem, WPSConfigAPI, WPSFortuneSystem, WPSStoreSystem]
@override
def wake_up(self) -> None:
@@ -83,6 +84,19 @@ class WPSAlchemyGame(WPSAPI):
"Warning",
f"{ConsoleFrontColor.YELLOW}注册炉灰物品时出现问题: {exc}{ConsoleFrontColor.RESET}",
)
else:
try:
store_system = Architecture.Get(WPSStoreSystem)
store_system.register_mode(
item_id=self.ASH_ITEM_ID,
price=8,
limit_amount=999,
)
except Exception as exc:
logger.Log(
"Warning",
f"{ConsoleFrontColor.YELLOW}注册炉灰商店模式时出现问题: {exc}{ConsoleFrontColor.RESET}",
)
try:
backpack.register_item(
self.SLAG_ITEM_ID,
@@ -180,7 +194,7 @@ class WPSAlchemyGame(WPSAPI):
if points <= 0:
return "❌ 投入积分必须大于 0"
config_api: WPSConfigAPI = Architecture.Get(WPSConfigAPI)
current_points = config_api.get_user_points(chat_id, user_id)
current_points = config_api.get_user_points(user_id)
if current_points < points:
return f"❌ 积分不足,需要 {points} 分,当前仅有 {current_points}"
@@ -205,7 +219,7 @@ class WPSAlchemyGame(WPSAPI):
backpack: WPSBackpackSystem = Architecture.Get(WPSBackpackSystem)
backpack.add_item(user_id, self.ASH_ITEM_ID, ash_reward)
final_points = config_api.get_user_points(chat_id, user_id)
final_points = config_api.get_user_points(user_id)
extra_line = ""
if ash_reward > 0:
extra_line = (