增加跳跃次数的显示

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[]} */
const jumpIgnoreFloor = [
export const jumpIgnoreFloor = [
'MT31',
'snowTown',
'MT36',
@ -177,5 +177,6 @@ export function jumpSkill() {
}
core.plugin.skillEffects = {
jumpSkill
jumpSkill,
jumpIgnoreFloor
};

View File

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

View File

@ -25,6 +25,12 @@
class="status-icon"
/>
<span>{{ skill }}</span>
<span
v-if="has(spring)"
id="status-spring"
class="status-extra"
>剩余{{ spring }}</span
>
</div>
<div id="status-hp" class="status-item">
<img src="/project/images/hp.png" class="status-icon" />
@ -37,10 +43,10 @@
>+{{ format(hero.hpmax!) }}/t</span
>
<span
v-if="has(spring)"
id="status-spring"
v-if="has(jumpCnt)"
id="status-jump"
class="status-extra"
>剩余{{ spring }}</span
>跳跃剩余{{ jumpCnt }}</span
>
</div>
<div id="status-atk" class="status-item">
@ -124,7 +130,7 @@
</template>
<script lang="ts" setup>
import { ref, shallowReactive, watch } from 'vue';
import { onMounted, ref, shallowReactive, watch } from 'vue';
import Box from '../components/box.vue';
import Scroll from '../components/scroll.vue';
import { status } from '../plugin/ui/statusBar';
@ -150,6 +156,7 @@ const up = ref(0);
const spring = ref<number>();
const skillOpened = ref(core.getFlag('chapter', 0) > 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;
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() {
@ -213,6 +225,10 @@ function viewMap() {
}
function openStudy() {}
onMounted(() => {
update();
});
</script>
<style lang="less" scoped>
@ -300,6 +316,12 @@ function openStudy() {}
font-size: 1.4vw;
}
#status-jump {
line-height: 0;
top: 0;
font-size: 1.3vw;
}
#status-key {
display: flex;
flex-direction: row;