|
@@ -412,6 +412,11 @@ export default {
|
|
// 点击添加英雄到阵容中
|
|
// 点击添加英雄到阵容中
|
|
addHero(_hero) {
|
|
addHero(_hero) {
|
|
if (this.currentPopulation < this.currentMaxHero) {
|
|
if (this.currentPopulation < this.currentMaxHero) {
|
|
|
|
+ if(_hero.name === '大元素使 拉克丝') {
|
|
|
|
+ if(this.selectedHeroes.find(h => h && h.name === '大元素使 拉克丝')) {
|
|
|
|
+ return alert('场上只能存在一个拉克丝。')
|
|
|
|
+ }
|
|
|
|
+ }
|
|
this.currentHero = JSON.parse(JSON.stringify(_hero))
|
|
this.currentHero = JSON.parse(JSON.stringify(_hero))
|
|
this.selectedHeroes.splice(
|
|
this.selectedHeroes.splice(
|
|
this.currentGird,
|
|
this.currentGird,
|
|
@@ -707,7 +712,19 @@ export default {
|
|
this.currentSelectType = 'hero'
|
|
this.currentSelectType = 'hero'
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- currentElement() {
|
|
|
|
|
|
+ currentElement(newVal) {
|
|
|
|
+ // 这里的逻辑针对琪亚娜这个英雄做特殊处理
|
|
|
|
+ const heroIndex = this.selectedHeroes.findIndex(h => h && h.name === '元素女皇 琪亚娜')
|
|
|
|
+ if(heroIndex !== -1) {
|
|
|
|
+ const elementToFetter = {
|
|
|
|
+ water: 'heroSort7',
|
|
|
|
+ fire: 'heroSort5',
|
|
|
|
+ wind: 'heroSort2',
|
|
|
|
+ earth: 'heroSort11'
|
|
|
|
+ }
|
|
|
|
+ this.selectedHeroes[heroIndex].sort = [elementToFetter[newVal]]
|
|
|
|
+ }
|
|
|
|
+ // 这里的逻辑针对阵容中在元素位置上的英雄的元素装备做修改
|
|
this.memoElementsIndexes.forEach(i => {
|
|
this.memoElementsIndexes.forEach(i => {
|
|
const hero = this.selectedHeroes[i]
|
|
const hero = this.selectedHeroes[i]
|
|
if(hero) {
|
|
if(hero) {
|
|
@@ -715,6 +732,7 @@ export default {
|
|
hero.selectedEquipments.splice(elementEquipmentIndex, 1, elementEquipmentsMap[this.currentElement])
|
|
hero.selectedEquipments.splice(elementEquipmentIndex, 1, elementEquipmentsMap[this.currentElement])
|
|
}
|
|
}
|
|
})
|
|
})
|
|
|
|
+
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|