勋章 杂项

This commit is contained in:
2025-04-08 00:00:38 +08:00
parent f7b9cdbd2b
commit 25805ce331
14 changed files with 298 additions and 558 deletions
+9
View File
@@ -34,6 +34,15 @@ export interface ICharacterInfo {
suits: ISuit[]
avatar: Record<string, IAvatarInfo[]>
jades:IJade[]
sundry:Record<string, ISundry>
}
export interface ISundry {
id:number,
options:{
name:string,
value:number
}[],
}
export interface IEquipment {
@@ -0,0 +1,123 @@
<template>
<div class="flex flex-wrap equ-profile">
<div class="equ-profile-item">
<div class="row-name">勋章</div>
<calc-select
v-for="(key, index) in ['medal_rarity', 'medal_reinforce']"
:key="index"
v-model="sundryData[key as keyof typeof sundryData]"
class="flex-1 !h-20px"
>
<calc-option v-for="(item, idx) in list(key)" :key="idx" :value="item.value">
{{ item.name }}
</calc-option>
</calc-select>
</div>
<div class="equ-profile-item">
<div class="row-name">宝石</div>
<calc-select
v-for="(key, index) in ['medal_gem_0', 'medal_gem_1', 'medal_gem_2', 'medal_gem_3']"
:key="index"
v-model="sundryData[key as keyof typeof sundryData]"
class="flex-1 !h-20px !min-w-10"
>
<calc-option v-for="(item, idx) in list(key)" :key="idx" :value="item.value">
{{ item.name }}
</calc-option>
</calc-select>
</div>
<div class="equ-profile-item">
<div class="row-name">冒险团</div>
<calc-select v-model="sundryData['adventure']" class="flex-1 !h-20px">
<calc-option v-for="(item, idx) in list('adventure')" :key="idx" :value="item.value">
{{ item.name }}
</calc-option>
</calc-select>
</div>
<div class="equ-profile-item">
<div class="row-name">结婚系统</div>
<calc-select
v-for="(key, index) in ['marriage_house', 'marriage_ring']"
:key="index"
v-model="sundryData[key as keyof typeof sundryData]"
class="flex-1 !h-20px !min-w-10"
>
<calc-option v-for="(item, idx) in list(key)" :key="idx" :value="item.value">
{{ item.name }}
</calc-option>
</calc-select>
</div>
<div class="equ-profile-item">
<div class="row-name">晶体契约</div>
<calc-select v-model="sundryData['contract']" class="flex-1 !h-20px">
<calc-option v-for="(item, idx) in list('contract')" :key="idx" :value="item.value">
{{ item.name }}
</calc-option>
</calc-select>
</div>
<div class="equ-profile-item">
<div class="row-name">收集箱</div>
<calc-select
v-for="(key, index) in ['collection_type', 'collection_num_0', 'collection_num_1']"
:key="index"
v-model="sundryData[key as keyof typeof sundryData]"
class="flex-1 !h-20px !min-w-10"
>
<calc-option v-for="(item, idx) in list(key)" :key="idx" :value="item.value">
{{ item.name }}
</calc-option>
</calc-select>
</div>
<div class="equ-profile-item">
<div class="row-name">名称装扮</div>
<calc-select v-model="sundryData['costume_card']" class="flex-1 !h-20px !min-w-10">
<calc-option v-for="(item, idx) in list('costume_card')" :key="idx" :value="item.value">
{{ item.name }}
</calc-option>
</calc-select>
</div>
</div>
</template>
<script setup lang="ts">
import { useConfigStore, useInfoStore } from '@/stores'
const configStore = useConfigStore()
const infoStore = useInfoStore()
const currentInfo = function <T>(name: string, defaultValue?: T) {
return computed<string | number>({
get() {
return configStore.config.sundry?.[name] ?? defaultValue ?? 0
},
set(val) {
if (val == undefined) {
return
}
configStore.config.sundry[name] = val
},
})
}
const list = computed(() => {
return (key: string) => {
return infoStore.sundries[key].options
}
})
const sundryData = reactive({
medal_rarity: currentInfo('medal_rarity', 5),
medal_reinforce: currentInfo('medal_reinforce', 12),
medal_gem_0: currentInfo('medal_gem_0', 4),
medal_gem_1: currentInfo('medal_gem_1', 4),
medal_gem_2: currentInfo('medal_gem_2', 4),
medal_gem_3: currentInfo('medal_gem_3', 4),
adventure: currentInfo('adventure', 30),
marriage_house: currentInfo('marriage_house', 4),
marriage_ring: currentInfo('marriage_ring', 2),
contract: currentInfo('contract', 1),
collection_type: currentInfo('collection_type', 1),
collection_num_0: currentInfo('collection_num_0', 5),
collection_num_1: currentInfo('collection_num_1', 5),
costume_card: currentInfo('costume_card', 1),
})
</script>
@@ -11,12 +11,16 @@
<calc-collapse class="w-100%" title="辟邪玉">
<jade></jade>
</calc-collapse>
<calc-collapse class="w-100%" title="其它">
<sundry></sundry>
</calc-collapse>
</div>
</template>
<script setup lang="ts">
import equipment from './components/Equipments.vue'
import clothes from './components/Avatars.vue';
import jade from './components/Jades.vue';
import sundry from './components/Sundry.vue';
const partTab = ref(0)
</script>
@@ -48,7 +48,7 @@ const data = computed(() => {
})
const formatDamage = (skill: IResultSkill) => {
const standardSkill = props.standard?.find((a) => a.name == skill.name)
const standardSkill = props.standard?.find((a) => a.name == skill.name && a.mode == skill.mode)
if (standardSkill && standardSkill.damage > 0 && standardSkill.cd > 0) {
const damageValue = (skill.damage - standardSkill.damage) / standardSkill.damage
const damage = h(
+4 -1
View File
@@ -49,6 +49,7 @@ export interface IConfig {
option: string
}
>
sundry: Record<string, any>
}
const defaultEqusConfig = {
@@ -79,6 +80,7 @@ export const useConfigStore = defineStore('configStore', () => {
equips: {},
jades: {},
avatar: {},
sundry: {},
})
const skillCountConfig = ref<Record<string, { count: number }>>({})
@@ -99,11 +101,13 @@ export const useConfigStore = defineStore('configStore', () => {
equips: {},
jades: {},
avatar: {},
sundry: {},
}
if (!config.value?.equips) config.value.equips = {}
if (!config.value?.skills) config.value.skills = {}
if (!config.value?.jades) config.value.jades = {}
if (!config.value?.avatar) config.value.avatar = {}
if (!config.value?.sundry)config.value.sundry = {}
const part = [...infoStore.parts, '宠物'].filter((a) => !config.value?.equips.hasOwnProperty(a))
const avatarPart = infoStore.avatarParts
@@ -128,7 +132,6 @@ export const useConfigStore = defineStore('configStore', () => {
lv: infoStore.skills.find((skill) => skill.id.toString() === id)?.maxLearnLv ?? 0,
})
})
;(
['0', '1', '2', '3'].filter((key) => !Object.keys(config.value.jades).includes(key)) ?? []
).forEach((key) => {
+4 -1
View File
@@ -24,6 +24,8 @@ export const useInfoStore = defineStore('infoStore', () => {
const jades = computed(() => infos.value?.jades ?? [])
const sundries = computed(() => infos.value?.sundry ?? {})
const standardUUID = ref<string>()
const setStandard = (result?: IResult) => {
@@ -100,6 +102,7 @@ export const useInfoStore = defineStore('infoStore', () => {
avatars,
jades,
setStandard,
standard
standard,
sundries
}
})