Browse Source

设置副本等级上限为100级

v1.0
许孟阳 2 weeks ago
parent
commit
6fc03f1443
  1. 15
      src/views/dungeon/dungeonMap.vue

15
src/views/dungeon/dungeonMap.vue

@ -20,7 +20,7 @@ @@ -20,7 +20,7 @@
<script lang="ts" setup>
import { useStore } from "vuex";
import { onBeforeUnmount, onMounted, ref } from "vue";
import { onBeforeUnmount, onMounted, ref, computed, watch } from "vue";
import { useI18n } from "vue3-i18n";
import { Tooltip, Dialog } from "@/components"
import { menu_icons, Dungeon, refresh_icon, close_icon, dungeon_icon } from "@/config";
@ -34,6 +34,14 @@ const showMap = ref(false); @@ -34,6 +34,14 @@ const showMap = ref(false);
const dungeons = ref<Dungeon[]>()
const battle = ref();
const curDungeon = ref();
const min = computed(() => {
const lv = state.playerAttribute.lv;
return lv < 6 ? 1 : lv - 5;
})
const max = computed(() => {
const lv = state.playerAttribute.lv;
return lv + 5 > 100 ? 100 : lv + 5;
})
const showMenu = () => {
showMap.value = !showMap.value;
@ -53,8 +61,7 @@ const startBattle = (dungeon) => { @@ -53,8 +61,7 @@ const startBattle = (dungeon) => {
const refreshDungeons = () => {
const tmp = new Array();
const lv = state.playerAttribute.lv;
for (let i = lv < 6 ? 1 : lv - 5; i < lv + 6; i++) {
for (let i = min.value; i <= max.value; i++) {
const df = randomDungeonDifficulty();
tmp.push(new Dungeon(i, df));
}
@ -81,7 +88,7 @@ const keydown = (e) => { @@ -81,7 +88,7 @@ const keydown = (e) => {
onMounted(() => {
document.addEventListener('keydown', keydown)
refreshDungeons();
setTimeout(refreshDungeons, 500);
setStype();
window.onresize = setStype;
});

Loading…
Cancel
Save