尝试修复积分系统

This commit is contained in:
2025-10-29 12:56:57 +08:00
parent 8e883fe5e1
commit 581a516610
4 changed files with 22 additions and 42 deletions

View File

@@ -90,16 +90,9 @@ class AlchemyGame(BaseGame):
_, args = CommandParser.extract_command_args(command)
args = args.strip().lower()
# 炼金统计
if args in ['stats', '统计', '记录']:
return self._get_alchemy_stats(user_id)
# 炼金记录
elif args in ['records', '历史', 'log']:
return self._get_alchemy_records(user_id)
# 炼金说明
elif args in ['help', '帮助', 'info']:
if args in ['help', '帮助', 'info']:
return self._get_alchemy_help()
# 默认:炼金抽奖
@@ -129,8 +122,8 @@ class AlchemyGame(BaseGame):
"""
# 检查用户积分是否足够
user_points = self.db.get_user_points(user_id)
if user_points['available_points'] < cost_points:
return f"❌ 积分不足!需要 {cost_points} 积分,当前可用 {user_points['available_points']} 积分"
if user_points['points'] < cost_points:
return f"❌ 积分不足!需要 {cost_points} 积分,当前可用 {user_points['points']} 积分"
# 选择奖品池
if cost_points == 10:
@@ -158,11 +151,7 @@ class AlchemyGame(BaseGame):
penalty_points = abs(reward['value'])
self.db.consume_points(user_id, penalty_points, "alchemy", f"炼金失败")
# 记录炼金抽奖
self.db.add_alchemy_record(
user_id, cost_points, reward['type'],
reward['value'], reward['description']
)
# 炼金系统已简化,不再记录历史
# 获取更新后的积分信息
updated_points = self.db.get_user_points(user_id)
@@ -190,7 +179,7 @@ class AlchemyGame(BaseGame):
else:
text += f"**获得奖励**{reward['description']}\n\n"
text += f"**当前积分**{updated_points['available_points']}\n\n"
text += f"**当前积分**{updated_points['points']}\n\n"
text += "---\n\n"
text += "💡 提示:炼金有风险,投资需谨慎!"