dev
This commit is contained in:
@@ -467,7 +467,8 @@ class Character(CharacterProperty):
|
||||
'position': skill.position,
|
||||
'line': skill.line,
|
||||
'bind': skill.bind,
|
||||
'damage':skill.damage
|
||||
'hasVP': skill.hasVP,
|
||||
'hasReinforce': skill.hasReinforce
|
||||
}
|
||||
)
|
||||
info['skills'] = skillInfo
|
||||
|
||||
@@ -73,6 +73,10 @@ class Skill:
|
||||
"""是否是增益技能"""
|
||||
bind: bool = None
|
||||
uuid: str = None
|
||||
hasVP: bool = None
|
||||
"""是否有VP形态"""
|
||||
hasReinforce: bool = None
|
||||
"""是否有技能强化"""
|
||||
|
||||
def __init__(self, char):
|
||||
self.char = char
|
||||
@@ -84,6 +88,16 @@ class Skill:
|
||||
self.bind = False
|
||||
if self.learnLv in [50, 85, 100]:
|
||||
self.bind = True
|
||||
if self.hasVP is None:
|
||||
if self.learnLv not in [50, 85, 100] and self.learnLv >= 35 and self.learnLv <= 80 and self.damage:
|
||||
self.hasVP = True
|
||||
else:
|
||||
self.hasVP = False
|
||||
if self.hasReinforce is None:
|
||||
if self.learnLv not in [50, 85, 100] and self.learnLv >= 15 and self.learnLv <= 80 and self.damage:
|
||||
self.hasReinforce = True
|
||||
else:
|
||||
self.hasReinforce = False
|
||||
# self.lv = self._calculate_lv()
|
||||
pass
|
||||
|
||||
@@ -216,7 +230,7 @@ class ActiveSkill(Skill):
|
||||
self.vp_2()
|
||||
|
||||
def setReinforce(self):
|
||||
if self.learnLv in [50, 85, 100] or not self.damage:
|
||||
if not self.hasReinforce:
|
||||
return
|
||||
if self.reinforce == 1:
|
||||
if self.learnLv < 35:
|
||||
|
||||
@@ -83,6 +83,8 @@ export interface ISkill {
|
||||
maxLearnLv: number
|
||||
maxLv: number
|
||||
bind: boolean
|
||||
hasVP: boolean
|
||||
hasReinforce: boolean
|
||||
}
|
||||
|
||||
export interface ISuit {
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { getImageURL, getLocalImageURL } from '@/utils/images'
|
||||
import type { ISkill } from '@/api/info/type'
|
||||
import { useVModel } from '@vueuse/core'
|
||||
import CalcButton from '@/components/calc/button/index.vue'
|
||||
import CalcCheckbox from '@/components/calc/checkbox/index.vue'
|
||||
import { renderList } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'SkillTree',
|
||||
props: {
|
||||
skills: {
|
||||
type: Array as PropType<ISkill[]>,
|
||||
default: () => [],
|
||||
},
|
||||
lvInfo: {
|
||||
type: Object as PropType<Record<string, { lv: number, reinforce:number }>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const lvInfo = useVModel(props, 'lvInfo')
|
||||
const skills = computed(() => props.skills.filter((a) => a.hasReinforce).sort((a, b) => a.learnLv - b.learnLv))
|
||||
|
||||
const reinforce = (type:number,id:number)=>{
|
||||
return computed({
|
||||
get(){
|
||||
return lvInfo.value[id].reinforce
|
||||
},
|
||||
set(value){
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return () => (
|
||||
<>
|
||||
<div class="flex">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
},
|
||||
})
|
||||
@@ -0,0 +1,89 @@
|
||||
import { getImageURL, getLocalImageURL } from '@/utils/images'
|
||||
import type { ISkill } from '@/api/info/type'
|
||||
import { useVModel } from '@vueuse/core'
|
||||
import CalcButton from '@/components/calc/button/index.vue'
|
||||
import CalcCheckbox from '@/components/calc/checkbox/index.vue'
|
||||
import { renderList } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'SkillTree',
|
||||
props: {
|
||||
skills: {
|
||||
type: Array as PropType<ISkill[]>,
|
||||
default: () => [],
|
||||
},
|
||||
lvInfo: {
|
||||
type: Object as PropType<Record<string, { lv: number, vp:number }>>,
|
||||
default: () => ({}),
|
||||
},
|
||||
},
|
||||
setup(props) {
|
||||
const lvInfo = useVModel(props, 'lvInfo')
|
||||
const skills = computed(() => props.skills.filter((a) => a.hasVP).sort((a, b) => a.learnLv - b.learnLv))
|
||||
|
||||
const currentUsedVP = computed(()=>{
|
||||
return Object.keys(lvInfo.value).map(a=>lvInfo.value[a].vp).filter(a=>!!a && a > 0).length
|
||||
})
|
||||
|
||||
const itemChecked = (skillID:string,vp:number)=>{
|
||||
return computed<boolean>({
|
||||
get(){
|
||||
if(!lvInfo.value[skillID].vp){
|
||||
lvInfo.value[skillID].vp = 0
|
||||
}
|
||||
return lvInfo.value[skillID]?.vp == vp
|
||||
},
|
||||
set(value:boolean){
|
||||
// 选中当前VP形态 并且当前已选VP大于5 并且当前技能没有VP
|
||||
if(value && currentUsedVP.value >= 5 && lvInfo.value[skillID]?.vp == 0){
|
||||
return
|
||||
}
|
||||
if(value){
|
||||
lvInfo.value[skillID].vp = vp
|
||||
}else{
|
||||
lvInfo.value[skillID].vp = 0
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
return () => (
|
||||
<>
|
||||
<div>
|
||||
{renderList(skills.value, (item) => (
|
||||
<div class="h-100px flex items-center bg-#202020 gap-2 p-1">
|
||||
<div class="w-50px text-center">{item.learnLv}</div>
|
||||
<div class="w-100px flex flex-col items-center">
|
||||
<img class="w-28px h-28px" src={getImageURL(item.icon)} alt={item.name} />
|
||||
<div class="skill-name">{item.name}</div>
|
||||
</div>
|
||||
{renderList(2, (index) => (
|
||||
<div class="w-200px h-full flex justify-center bg-black" onClick={() => {
|
||||
itemChecked(item.id.toString(), index).value = !itemChecked(item.id.toString(), index).value
|
||||
}}>
|
||||
<div class="flex justify-between w-full h-30px">
|
||||
<div class="w-16px"></div>
|
||||
<div class="relative inline-bloc">
|
||||
<div
|
||||
class="bg-#a128f4 w-26px h-26px top-1px left-1px absolute z-5"
|
||||
style="mix-blend-mode: hue;"
|
||||
></div>
|
||||
<img
|
||||
style="filter:brightness(1) contrast(1) saturate(1.5)"
|
||||
class="w-28px h-28px"
|
||||
src={getImageURL(item.icon)}
|
||||
alt={item.name}
|
||||
/>
|
||||
</div>
|
||||
<CalcCheckbox modelValue={itemChecked(item.id.toString(), index).value}/>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</>
|
||||
)
|
||||
},
|
||||
})
|
||||
@@ -1,11 +1,23 @@
|
||||
<template>
|
||||
<div>
|
||||
<calc-tabs v-model="tab">
|
||||
<calc-tab :value="0">技能加点</calc-tab>
|
||||
<calc-tab :value="1">技能VP</calc-tab>
|
||||
<calc-tab :value="2">技能突破</calc-tab>
|
||||
</calc-tabs>
|
||||
<div class="h-90vh w-auto overflow-y-auto overflow-x-hidden">
|
||||
<SkillTree
|
||||
:skills="infoStore.skills"
|
||||
v-model:lvInfo="configStore.config.skills"
|
||||
v-model:bindAwake="configStore.config.bindAwake"
|
||||
v-if="tab === 0"
|
||||
></SkillTree>
|
||||
<SkillVP
|
||||
:skills="infoStore.skills"
|
||||
v-model:lvInfo="configStore.config.skills"
|
||||
v-model:bindAwake="configStore.config.bindAwake"
|
||||
v-if="tab === 1"
|
||||
></SkillVP>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -13,10 +25,12 @@
|
||||
<script lang="ts" setup name="Index">
|
||||
import { useInfoStore } from '@/stores/info'
|
||||
import SkillTree from './components/SkillTree/index'
|
||||
import SkillVP from './components/SkillReinforce';
|
||||
import { useConfigStore } from '@/stores'
|
||||
const props = defineProps<{
|
||||
alter: string
|
||||
}>()
|
||||
const tab = ref(0)
|
||||
const infoStore = useInfoStore()
|
||||
const configStore = useConfigStore()
|
||||
</script>
|
||||
|
||||
@@ -32,7 +32,7 @@ export interface IConfigEquip {
|
||||
}
|
||||
|
||||
export interface IConfig {
|
||||
skills: Record<string, { lv: number }>
|
||||
skills: Record<string, { lv: number ,vp:number, reinforce: number}>
|
||||
equips: Record<string, IConfigEquip>
|
||||
jades: Record<
|
||||
string,
|
||||
@@ -160,6 +160,8 @@ export const useConfigStore = defineStore('configStore', () => {
|
||||
config.value &&
|
||||
(config.value.skills[id] = {
|
||||
lv: infoStore.skills.find((skill) => skill.id.toString() === id)?.maxLearnLv ?? 0,
|
||||
vp: 0,
|
||||
reinforce: 0,
|
||||
})
|
||||
})
|
||||
;(
|
||||
|
||||
+1
-1
Submodule images updated: 49f13fdced...4163808153
Reference in New Issue
Block a user