Browse Source

设置副本等级上限为100级

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

15
src/views/dungeon/dungeonMap.vue

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

Loading…
Cancel
Save