feat: 在后台管理添加AI小班长钓鱼触发概率配置

This commit is contained in:
2026-03-28 17:15:09 +08:00
parent 8fcccf72a5
commit f0618aad4b
3 changed files with 21 additions and 2 deletions
+1 -1
View File
@@ -130,7 +130,7 @@ class AiHeartbeatCommand extends Command
// 7. 钓鱼小游戏随机参与逻辑
$fishingEnabled = Sysparam::getValue('chatbot_fishing_enabled', '0') === '1';
$fishingChance = (int) Sysparam::getValue('chatbot_fishing_chance', '5'); // 默认 5% 概率
$fishingChance = (int) Sysparam::getValue('chatbot_fishing_chance', '100'); // 默认 5% 概率
if ($fishingEnabled && $fishingChance > 0 && rand(1, 100) <= $fishingChance && \App\Models\GameConfig::isEnabled('fishing')) {
$cost = (int) (\App\Models\GameConfig::param('fishing', 'fishing_cost') ?? Sysparam::getValue('fishing_cost', '5'));
if ($user->jjb >= $cost) {