getMainConfig()->get('IsekaiAIToolboxUserPoints'); if (!is_array($pointConfig) && !isset($pointConfig[$action])) { return false; } $pointConfig = $pointConfig[$action]; if (!isset($pointConfig['pointType'])) { return false; } $cost = 0; $pointType = $pointConfig['pointType']; // Fixed cost if (isset($pointConfig['fixedCost'])) { $cost += $pointConfig['fixedCost']; } // Per token cost if (isset($pointConfig['perTokenCost'])) { if (isset($pointConfig['fixedTokens'])) { $tokens = max(0, $tokens - $pointConfig['fixedTokens']); } $cost += $pointConfig['perTokenCost'] * $tokens; } // Per extract cost if (isset($pointConfig['perExtractCost'])) { $cost += $pointConfig['perExtractCost'] * $extractLimit; } $cost = (int) ceil($cost); return [$pointType, $cost]; } }