update data add talent exclusive

This commit is contained in:
Vick Scarlet
2021-08-22 16:46:13 +08:00
parent 34cbefb31a
commit 7b14f93417
9 changed files with 2960 additions and 146 deletions

View File

@@ -89,6 +89,20 @@ class App{
this.hint('只能选3个天赋');
return;
}
const exclusive = this.#life.exclusive(
Array.from(this.#talentSelected).map(({id})=>id),
talent.id
);
if(exclusive != null) {
for(const { name, id } of this.#talentSelected) {
if(id == exclusive) {
this.hint(`与已选择的天赋【${name}】冲突`);
return;
}
}
return;
}
li.addClass('selected');
this.#talentSelected.add(talent);
}