2022-11-16 23:01:23 +08:00
|
|
|
<template>
|
2022-11-19 18:15:42 +08:00
|
|
|
<div
|
|
|
|
class="enemy-container"
|
|
|
|
@click="select"
|
|
|
|
@mouseenter="enter"
|
|
|
|
:selected="selected"
|
|
|
|
>
|
2022-11-16 23:01:23 +08:00
|
|
|
<div class="info">
|
|
|
|
<div class="leftbar">
|
|
|
|
<span class="name">{{ enemy.name }}</span>
|
|
|
|
<BoxAnimate
|
|
|
|
:id="enemy.id"
|
2022-12-29 19:57:31 +08:00
|
|
|
:width="isMobile ? 32 : w"
|
|
|
|
:height="isMobile ? 32 : w"
|
2022-11-16 23:01:23 +08:00
|
|
|
style="margin: 5%"
|
|
|
|
></BoxAnimate>
|
|
|
|
<div
|
|
|
|
class="special-text"
|
|
|
|
v-if="has(enemy.special) && enemy.special.length > 0"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
v-for="(text, i) in enemy.toShowSpecial"
|
2022-12-28 12:13:52 +08:00
|
|
|
:style="{ color: enemy.toShowColor![i] as string }"
|
2022-11-19 18:15:42 +08:00
|
|
|
> {{ text }} </span
|
2022-11-16 23:01:23 +08:00
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="special-text" v-else>无属性</div>
|
|
|
|
</div>
|
|
|
|
<a-divider
|
|
|
|
type="vertical"
|
|
|
|
dashed
|
2022-11-19 11:30:14 +08:00
|
|
|
style="height: 100%; margin: 0 3% 0 1%; border-color: #ddd4"
|
2022-11-16 23:01:23 +08:00
|
|
|
></a-divider>
|
|
|
|
<div class="rightbar">
|
|
|
|
<div class="detail">
|
|
|
|
<div class="detail-info">
|
|
|
|
<span style="color: lightgreen"
|
|
|
|
>生命 {{
|
|
|
|
core.formatBigNumber(enemy.hp)
|
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="detail-info">
|
|
|
|
<span style="color: lightcoral"
|
|
|
|
>攻击 {{
|
|
|
|
core.formatBigNumber(enemy.atk)
|
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="detail-info">
|
|
|
|
<span style="color: lightblue"
|
|
|
|
>防御 {{
|
|
|
|
core.formatBigNumber(enemy.def)
|
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="detail-info">
|
|
|
|
<span style="color: lightyellow"
|
|
|
|
>金币 {{
|
|
|
|
core.formatBigNumber(enemy.money)
|
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="detail-info">
|
|
|
|
<span style="color: lawngreen"
|
|
|
|
>经验 {{
|
2022-12-29 13:39:40 +08:00
|
|
|
core.formatBigNumber(enemy.exp)
|
2022-11-16 23:01:23 +08:00
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="detail-info">
|
2022-12-30 14:14:28 +08:00
|
|
|
<span :style="{color: enemy.damageColor! as string}"
|
|
|
|
>伤害 {{
|
|
|
|
core.formatBigNumber(enemy.damage!)
|
2022-11-16 23:01:23 +08:00
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</div>
|
2022-12-30 14:14:28 +08:00
|
|
|
|
2022-11-16 23:01:23 +08:00
|
|
|
<div class="detail-info">
|
|
|
|
<span style="color: lightsalmon"
|
|
|
|
>临界 {{
|
|
|
|
core.formatBigNumber(enemy.critical)
|
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="detail-info">
|
|
|
|
<span style="color: lightpink"
|
|
|
|
>减伤 <span
|
|
|
|
:style="{
|
|
|
|
color:
|
|
|
|
enemy.criticalDamage < 0
|
|
|
|
? 'gold'
|
|
|
|
: 'lightpink'
|
|
|
|
}"
|
2022-12-28 12:13:52 +08:00
|
|
|
><span style="font-family: 'Fira Code'">{{
|
2022-12-31 19:49:43 +08:00
|
|
|
enemy.criticalDamage < 0
|
|
|
|
? isMobile
|
|
|
|
? '-'
|
|
|
|
: '=>'
|
|
|
|
: ''
|
2022-12-28 12:13:52 +08:00
|
|
|
}}</span
|
2022-11-16 23:01:23 +08:00
|
|
|
>{{
|
|
|
|
core.formatBigNumber(
|
|
|
|
enemy.criticalDamage < 0
|
2022-12-28 12:13:52 +08:00
|
|
|
? -enemy.criticalDamage
|
|
|
|
: enemy.criticalDamage
|
2022-11-16 23:01:23 +08:00
|
|
|
)
|
|
|
|
}}</span
|
|
|
|
></span
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<div class="detail-info">
|
2022-12-30 14:14:28 +08:00
|
|
|
<span style="color: cyan"
|
|
|
|
>{{
|
|
|
|
core.formatBigNumber(core.status.thisMap.ratio)
|
|
|
|
}}防 {{
|
|
|
|
core.formatBigNumber(enemy.defDamage)
|
2022-11-16 23:01:23 +08:00
|
|
|
}}</span
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
import { has } from '../plugin/utils';
|
|
|
|
import BoxAnimate from '../components/boxAnimate.vue';
|
|
|
|
import { isMobile } from '../plugin/use';
|
|
|
|
|
|
|
|
const props = defineProps<{
|
2022-12-28 12:13:52 +08:00
|
|
|
enemy: DetailedEnemy;
|
2022-11-19 18:15:42 +08:00
|
|
|
selected?: boolean;
|
2022-11-16 23:01:23 +08:00
|
|
|
}>();
|
|
|
|
|
2022-11-19 11:30:14 +08:00
|
|
|
const emits = defineEmits<{
|
|
|
|
(e: 'select'): void;
|
2022-11-19 18:15:42 +08:00
|
|
|
(e: 'hover'): void;
|
2022-11-19 11:30:14 +08:00
|
|
|
}>();
|
|
|
|
|
2022-11-16 23:01:23 +08:00
|
|
|
const core = window.core;
|
2022-11-19 11:30:14 +08:00
|
|
|
|
2022-12-29 19:57:31 +08:00
|
|
|
const w = window.innerWidth * 0.032;
|
|
|
|
|
2022-11-19 11:30:14 +08:00
|
|
|
/**
|
|
|
|
* 选择这个怪物时
|
|
|
|
*/
|
|
|
|
function select(e: MouseEvent) {
|
|
|
|
emits('select');
|
|
|
|
}
|
2022-11-19 18:15:42 +08:00
|
|
|
|
|
|
|
function enter() {
|
|
|
|
emits('hover');
|
|
|
|
}
|
2022-11-16 23:01:23 +08:00
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
.enemy-container {
|
|
|
|
border: 1.5px solid transparent;
|
2022-12-31 19:49:43 +08:00
|
|
|
border-radius: 1.1vw;
|
2022-11-16 23:01:23 +08:00
|
|
|
transition: all 0.2s linear;
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
.info {
|
|
|
|
flex-basis: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: stretch;
|
|
|
|
height: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-11-19 18:15:42 +08:00
|
|
|
.enemy-container:hover,
|
|
|
|
.enemy-container[selected='true'] {
|
2022-11-16 23:01:23 +08:00
|
|
|
border: 1.5px solid gold;
|
|
|
|
}
|
|
|
|
|
|
|
|
.leftbar {
|
2022-11-19 11:30:14 +08:00
|
|
|
width: 15%;
|
2022-11-16 23:01:23 +08:00
|
|
|
height: 100%;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: center;
|
2022-11-19 11:30:14 +08:00
|
|
|
font-size: 2vh;
|
|
|
|
padding-left: 1%;
|
2022-11-16 23:01:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.name {
|
|
|
|
text-align: center;
|
|
|
|
max-width: 100%;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
display: block;
|
|
|
|
}
|
|
|
|
|
|
|
|
.special-text {
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
2022-11-19 11:30:14 +08:00
|
|
|
display: flex;
|
|
|
|
flex-direction: row;
|
|
|
|
align-items: center;
|
|
|
|
justify-items: space-between;
|
2022-11-16 23:01:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.rightbar {
|
2022-11-19 11:30:14 +08:00
|
|
|
font-size: 2.5vh;
|
2022-11-16 23:01:23 +08:00
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
padding: 1.5vh 0 1.5vh 0;
|
|
|
|
|
|
|
|
.detail {
|
|
|
|
display: flex;
|
2022-12-30 14:14:28 +08:00
|
|
|
flex-direction: row;
|
2022-11-16 23:01:23 +08:00
|
|
|
flex-wrap: wrap;
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
.detail-info {
|
2022-11-19 11:30:14 +08:00
|
|
|
flex-basis: 33.3%;
|
2022-11-16 23:01:23 +08:00
|
|
|
line-height: 0;
|
|
|
|
display: flex;
|
|
|
|
flex-direction: column;
|
|
|
|
justify-content: center;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-11-19 11:30:14 +08:00
|
|
|
|
|
|
|
@media screen and (max-width: 600px) {
|
|
|
|
.rightbar {
|
2022-12-31 19:49:43 +08:00
|
|
|
font-size: 3.2vw;
|
2022-11-19 11:30:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
.leftbar {
|
|
|
|
font-size: 2vw;
|
|
|
|
}
|
2022-12-31 19:49:43 +08:00
|
|
|
|
|
|
|
.enemy-container {
|
|
|
|
border-radius: 1.6vh;
|
|
|
|
}
|
2022-11-19 11:30:14 +08:00
|
|
|
}
|
2022-11-16 23:01:23 +08:00
|
|
|
</style>
|