增加跳跃次数的显示

This commit is contained in:
unanmed 2023-04-22 17:01:35 +08:00
parent aad49a0c30
commit 0b0c7c7958
3 changed files with 34 additions and 6 deletions

View File

@ -20,7 +20,7 @@ var ignoreInJump = {
}; };
/** @type {FloorIds[]} */ /** @type {FloorIds[]} */
const jumpIgnoreFloor = [ export const jumpIgnoreFloor = [
'MT31', 'MT31',
'snowTown', 'snowTown',
'MT36', 'MT36',
@ -177,5 +177,6 @@ export function jumpSkill() {
} }
core.plugin.skillEffects = { core.plugin.skillEffects = {
jumpSkill jumpSkill,
jumpIgnoreFloor
}; };

View File

@ -31,6 +31,7 @@ interface PluginDeclaration
hero: GamePluginHeroRealStatus; hero: GamePluginHeroRealStatus;
skills: Record<Chapter, Skill[]>; skills: Record<Chapter, Skill[]>;
skillEffects: SkillEffects;
/** /**
* 使core.addPop或core.plugin.addPop调用 * 使core.addPop或core.plugin.addPop调用
@ -435,6 +436,10 @@ interface PluginAchievement {
checkVisitedFloor(): void; checkVisitedFloor(): void;
} }
interface SkillEffects {
jumpIgnoreFloor: FloorIds[];
}
type Chapter = 'chapter1' | 'chapter2'; type Chapter = 'chapter1' | 'chapter2';
interface Skill { interface Skill {

View File

@ -25,6 +25,12 @@
class="status-icon" class="status-icon"
/> />
<span>{{ skill }}</span> <span>{{ skill }}</span>
<span
v-if="has(spring)"
id="status-spring"
class="status-extra"
>剩余{{ spring }}</span
>
</div> </div>
<div id="status-hp" class="status-item"> <div id="status-hp" class="status-item">
<img src="/project/images/hp.png" class="status-icon" /> <img src="/project/images/hp.png" class="status-icon" />
@ -37,10 +43,10 @@
>+{{ format(hero.hpmax!) }}/t</span >+{{ format(hero.hpmax!) }}/t</span
> >
<span <span
v-if="has(spring)" v-if="has(jumpCnt)"
id="status-spring" id="status-jump"
class="status-extra" class="status-extra"
>剩余{{ spring }}</span >跳跃剩余{{ jumpCnt }}</span
> >
</div> </div>
<div id="status-atk" class="status-item"> <div id="status-atk" class="status-item">
@ -124,7 +130,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref, shallowReactive, watch } from 'vue'; import { onMounted, ref, shallowReactive, watch } from 'vue';
import Box from '../components/box.vue'; import Box from '../components/box.vue';
import Scroll from '../components/scroll.vue'; import Scroll from '../components/scroll.vue';
import { status } from '../plugin/ui/statusBar'; import { status } from '../plugin/ui/statusBar';
@ -150,6 +156,7 @@ const up = ref(0);
const spring = ref<number>(); const spring = ref<number>();
const skillOpened = ref(core.getFlag('chapter', 0) > 0); const skillOpened = ref(core.getFlag('chapter', 0) > 0);
const studyOpened = ref(core.plugin.skillTree.getSkillLevel(11) > 0); const studyOpened = ref(core.plugin.skillTree.getSkillLevel(11) > 0);
const jumpCnt = ref<number>();
/** /**
* 要展示的勇士属性 * 要展示的勇士属性
*/ */
@ -198,6 +205,11 @@ function update() {
} }
skillOpened.value = core.getFlag('chapter', 0) > 0; skillOpened.value = core.getFlag('chapter', 0) > 0;
studyOpened.value = core.plugin.skillTree.getSkillLevel(11) > 0; studyOpened.value = core.plugin.skillTree.getSkillLevel(11) > 0;
jumpCnt.value =
flags.skill2 &&
!core.plugin.skillEffects.jumpIgnoreFloor.includes(core.status.floorId)
? 3 - flags[`jump_${core.status.floorId}`]
: void 0;
} }
function openSkillTree() { function openSkillTree() {
@ -213,6 +225,10 @@ function viewMap() {
} }
function openStudy() {} function openStudy() {}
onMounted(() => {
update();
});
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
@ -300,6 +316,12 @@ function openStudy() {}
font-size: 1.4vw; font-size: 1.4vw;
} }
#status-jump {
line-height: 0;
top: 0;
font-size: 1.3vw;
}
#status-key { #status-key {
display: flex; display: flex;
flex-direction: row; flex-direction: row;