[色子游戏]奖励配置-新增按规则自动生成奖励配置

This commit is contained in:
2026-03-25 14:34:04 +08:00
parent 1027612cc0
commit ce9062e186
5 changed files with 21 additions and 21 deletions

View File

@@ -243,9 +243,9 @@
<ElFormItem :label="$t('page.configPage.ruleGenT1Row')">
<div class="rule-gen-row">
<div class="rule-gen-cell">
<span class="rule-gen-hint">{{ $t('page.configPage.ruleGenMinCount') }}</span>
<span class="rule-gen-hint">{{ $t('page.configPage.ruleGenFixedCount') }}</span>
<ElInputNumber
v-model="ruleGenT1Min"
v-model="ruleGenT1Fixed"
class="rule-gen-input-num"
:min="0"
:max="26"
@@ -429,7 +429,7 @@
const createRewardLoading = ref(false)
const ruleGenerateDialogVisible = ref(false)
const ruleGenSubmitting = ref(false)
const ruleGenT1Min = ref(3)
const ruleGenT1Fixed = ref(3)
const ruleGenT2Min = ref(5)
const ruleGenT4Fixed = ref(1)
const ruleGenT5Fixed = ref(1)
@@ -654,7 +654,7 @@
ElMessage.warning(t('page.configPage.ruleGenNeedFullGrid'))
return
}
const t1 = Math.max(0, Math.min(26, Math.floor(Number(ruleGenT1Min.value))))
const t1 = Math.max(0, Math.min(26, Math.floor(Number(ruleGenT1Fixed.value))))
const t2 = Math.max(0, Math.min(26, Math.floor(Number(ruleGenT2Min.value))))
const x4 = Math.max(0, Math.min(26, Math.floor(Number(ruleGenT4Fixed.value))))
const x5 = Math.max(0, Math.min(26, Math.floor(Number(ruleGenT5Fixed.value))))
@@ -671,11 +671,11 @@
return
}
const constraints = {
t1MinCw: t1,
t1FixedCw: t1,
t2MinCw: t2,
t4FixedCw: x4,
t5FixedCw: x5,
t1MinCcw: t1,
t1FixedCcw: t1,
t2MinCcw: t2,
t4FixedCcw: x4,
t5FixedCcw: x5

View File

@@ -27,16 +27,16 @@ export interface BoardFrequencies {
}
/**
* 条数约束T1/T2 为「不少于」T4/T5 为「恰好」(加权条数,与 dice_reward 中顺/逆各 26 条摇取结果一致)
* 条数约束T1/T4/T5 为「恰好T2 为「不少于」(加权条数,与 dice_reward 中顺/逆各 26 条摇取结果一致)
*/
export interface TierCountConstraints {
t1MinCw: number
t1FixedCw: number
t2MinCw: number
/** 顺时针方向 T4 加权条数固定为该值 */
t4FixedCw: number
/** 顺时针方向 T5 加权条数固定为该值 */
t5FixedCw: number
t1MinCcw: number
t1FixedCcw: number
t2MinCcw: number
/** 逆时针方向 T4 加权条数固定为该值 */
t4FixedCcw: number
@@ -172,11 +172,11 @@ function meetsConstraints(
const cc4 = sumWeighted(freqCcw, tiers, 'T4')
const cc5 = sumWeighted(freqCcw, tiers, 'T5')
return (
cw1 >= c.t1MinCw &&
cw1 === c.t1FixedCw &&
cw2 >= c.t2MinCw &&
cw4 === c.t4FixedCw &&
cw5 === c.t5FixedCw &&
cc1 >= c.t1MinCcw &&
cc1 === c.t1FixedCcw &&
cc2 >= c.t2MinCcw &&
cc4 === c.t4FixedCcw &&
cc5 === c.t5FixedCcw
@@ -268,7 +268,7 @@ export function generateTiers(input: GenerateTierInput): GenerateTierResult {
}
}
return { ok: false, message: '在当前盘面与约束下未找到可行解,请放宽 T1/T2 下限或调整 T4/T5 固定条数后重试' }
return { ok: false, message: '在当前盘面与约束下未找到可行解,请调整 T1/T4/T5 固定条数或放宽 T2 下限后重试' }
}
/** 展示文案100 + 真实结算中英文相同T5 不使用 */