添加判定character[4]的一些init后的filter基底
This commit is contained in:
parent
2766fbbad1
commit
6dde6321e4
|
@ -540,6 +540,13 @@ export class Get extends Uninstantable {
|
|||
}
|
||||
return info;
|
||||
}
|
||||
static characterInitFilter(name) {
|
||||
const info = get.character(name);
|
||||
if (!info || !info[4]) return [];
|
||||
const filter = info[4].find(tag => tag.startsWith('InitFilter'));
|
||||
if (!filter) return [];
|
||||
return filter.split(':').slice(1);
|
||||
}
|
||||
static characterIntro(name) {
|
||||
if (lib.characterIntro[name]) return lib.characterIntro[name];
|
||||
var tags = get.character(name, 4);
|
||||
|
|
|
@ -8321,6 +8321,18 @@ export class Player extends HTMLDivElement {
|
|||
if (mode == 'versus' && (_status.mode == 'four' || _status.mode == 'guandu')) return true;
|
||||
return false;
|
||||
}
|
||||
isInitFilter(tag) {
|
||||
const player = this;
|
||||
for (const name of [player.name, player.name1, player.name2]) {
|
||||
if (name && lib.character[name]) {
|
||||
const filter = get.characterInitFilter(name);
|
||||
if (!filter.includes(tag)) continue;
|
||||
if (lib.characterInitFilter[name] && lib.characterInitFilter[name](tag) === false) continue;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
hasZhuSkill(skill, player) {
|
||||
if (!this.hasSkill(skill)) return false;
|
||||
if (player) {
|
||||
|
|
Loading…
Reference in New Issue