|
|
@ -31,17 +31,23 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="btn-group" v-if='!auto'> |
|
|
|
<div class="btn-group" v-if='!auto'> |
|
|
|
<p>需要金币:<span :class="{ 'red': useCoins < needCoins }">{{ needCoins }}</span></p> |
|
|
|
<p>{{ t('stren.0') }}:<span :class="{ 'red': useCoins < needCoins }">{{ needCoins }}</span></p> |
|
|
|
<button class="button" @click="strengthen">强化至+{{ parseInt(equip.strengthenLv) + 1 }}</button> |
|
|
|
<button class="button" @click="strengthen(false)">{{ t('stren.1') }}+{{ parseInt(equip.strengthenLv) + 1 |
|
|
|
|
|
|
|
}}</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="btn-group" v-if='!auto'> |
|
|
|
<div class="btn-group" v-if='!auto'> |
|
|
|
<p>自动强化目标等级:</p> |
|
|
|
<p>{{ t('stren.0') }}:<span :class="{ 'red': useCoins < needCoins }">{{ needCoins }}</span></p> |
|
|
|
<p><input type="number" placeholder="目标等级" max="15" min="5" v-model="autoLv"></p> |
|
|
|
<button class="button" @click="strengthen(true)">{{ t('stren.2') }}</button> |
|
|
|
<button class="button" @click="startAuto">自动强化</button> |
|
|
|
<span v-if="testFlag">{{equip.strengthenLv}}<span class="arror">➡</span>{{ testResult }}</span> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="btn-group" v-if='!auto'> |
|
|
|
|
|
|
|
<p>{{ t('stren.3') }}:</p> |
|
|
|
|
|
|
|
<p><input type="number" :placeholder="t('stren32')" max="15" min="5" v-model="autoLv"></p> |
|
|
|
|
|
|
|
<button class="button" @click="startAuto">{{ t('stren.4') }}</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="btn-group" v-if='auto'> |
|
|
|
<div class="btn-group" v-if='auto'> |
|
|
|
<p>自动强化中...</p> |
|
|
|
<p>{{ t('stren.5') }}...</p> |
|
|
|
<button class="button" @click="stopAuto">中断自动强化</button> |
|
|
|
<button class="button" @click="stopAuto">{{ t('stren.6') }}</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<Tooltip :infos="[t('reforgeDesc.1'), t('reforgeDesc.2')]" width="8rem"> |
|
|
|
<Tooltip :infos="[t('reforgeDesc.1'), t('reforgeDesc.2')]" width="8rem"> |
|
|
|
<div class="descript">- {{ t('reforgeDesc.0') }} -</div> |
|
|
|
<div class="descript">- {{ t('reforgeDesc.0') }} -</div> |
|
|
@ -80,6 +86,8 @@ const successLv = 5; |
|
|
|
const rates = [0.8, 0.65, 0.45, 0.3, 0.2]; |
|
|
|
const rates = [0.8, 0.65, 0.45, 0.3, 0.2]; |
|
|
|
const reforgeFlag = ref(false); |
|
|
|
const reforgeFlag = ref(false); |
|
|
|
const reforgeing = ref(false); |
|
|
|
const reforgeing = ref(false); |
|
|
|
|
|
|
|
const testFlag = ref(false); |
|
|
|
|
|
|
|
const testResult = ref(0); |
|
|
|
const height = computed(() => { |
|
|
|
const height = computed(() => { |
|
|
|
if (prop.equip) { |
|
|
|
if (prop.equip) { |
|
|
|
return prop.equip.extraEntry.length * 2.5 + 'rem'; |
|
|
|
return prop.equip.extraEntry.length * 2.5 + 'rem'; |
|
|
@ -108,7 +116,7 @@ const needCoins = computed(() => { |
|
|
|
return Math.round((prop.equip.lv + 1) * (1.1 ** (prop.equip.strengthenLv) ** 1.1) * (10 + prop.equip.lv / 5) + 100); |
|
|
|
return Math.round((prop.equip.lv + 1) * (1.1 ** (prop.equip.strengthenLv) ** 1.1) * (10 + prop.equip.lv / 5) + 100); |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
const strengthen = () => { |
|
|
|
const strengthen = (test?) => { |
|
|
|
if (auto.value && prop.equip.strengthenLv >= autoLv.value) { |
|
|
|
if (auto.value && prop.equip.strengthenLv >= autoLv.value) { |
|
|
|
auto.value = false; |
|
|
|
auto.value = false; |
|
|
|
commit("set_sys_info", { msg: t('strengthenFinish'), type: "win", }); |
|
|
|
commit("set_sys_info", { msg: t('strengthenFinish'), type: "win", }); |
|
|
@ -127,11 +135,16 @@ const strengthen = () => { |
|
|
|
idx = idx > len ? len : idx; |
|
|
|
idx = idx > len ? len : idx; |
|
|
|
rate = rates[idx] || 0.2; |
|
|
|
rate = rates[idx] || 0.2; |
|
|
|
} |
|
|
|
} |
|
|
|
if (Math.random() < rate) { |
|
|
|
const result = Math.random() < rate ? 1 : -1; |
|
|
|
prop.equip.strengthenLv++ |
|
|
|
|
|
|
|
} else if (lv >= 5) { |
|
|
|
if (test) { |
|
|
|
prop.equip.strengthenLv-- |
|
|
|
testFlag.value = true; |
|
|
|
|
|
|
|
testResult.value = prop.equip.strengthenLv + result; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
testFlag.value = false; |
|
|
|
|
|
|
|
prop.equip.strengthenLv += result; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
commit("add_player_coins", -1 * needCoins.value); |
|
|
|
commit("add_player_coins", -1 * needCoins.value); |
|
|
|
auto.value && setTimeout(strengthen, 200); |
|
|
|
auto.value && setTimeout(strengthen, 200); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -181,7 +194,8 @@ onMounted(() => { }); |
|
|
|
padding: 0 1rem; |
|
|
|
padding: 0 1rem; |
|
|
|
box-sizing: border-box; |
|
|
|
box-sizing: border-box; |
|
|
|
} |
|
|
|
} |
|
|
|
.coins{ |
|
|
|
|
|
|
|
|
|
|
|
.coins { |
|
|
|
display: flex; |
|
|
|
display: flex; |
|
|
|
align-items: center !important; |
|
|
|
align-items: center !important; |
|
|
|
justify-content: center; |
|
|
|
justify-content: center; |
|
|
|