mirror of
https://github.com/webxoss/webxoss-client.git
synced 2025-02-12 08:23:42 +01:00
add rise, trap and acce searching
This commit is contained in:
parent
6326ef9a50
commit
5c106afa04
2 changed files with 16 additions and 3 deletions
|
@ -20,7 +20,8 @@ TextualRule.prototype.parse = function (words) {
|
||||||
return function filter (info) {
|
return function filter (info) {
|
||||||
if (!keywords.length) return true;
|
if (!keywords.length) return true;
|
||||||
return keywords.some(function (keyword) {
|
return keywords.some(function (keyword) {
|
||||||
var value = info[prop].toLowerCase();
|
if (info[prop] && typeof info[prop] !== 'string') info[prop] = true;
|
||||||
|
var value = ('' + info[prop]).toLowerCase();
|
||||||
if (exact) {
|
if (exact) {
|
||||||
return value === keyword;
|
return value === keyword;
|
||||||
} else {
|
} else {
|
||||||
|
@ -43,10 +44,10 @@ TextualRule.prototype.parseWord = function (word) {
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// 枚举型规则,包括:
|
// 枚举型规则,包括:
|
||||||
// ColorRule,TypeRule,RarityRule
|
// ColorRule,TypeRule,RarityRule,RiseRule,TrapRule,AcceRule
|
||||||
// 匹配例子:
|
// 匹配例子:
|
||||||
// "白 LRIG SR 红"
|
// "白 LRIG SR 红"
|
||||||
// "白色 精灵 lr red"
|
// "白色 精灵 lr red rise"
|
||||||
//
|
//
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
var ColorRule = new TextualRule('color',{
|
var ColorRule = new TextualRule('color',{
|
||||||
|
@ -74,6 +75,15 @@ var RarityRule = new TextualRule('rarity',{
|
||||||
'pr': ['pr'],
|
'pr': ['pr'],
|
||||||
'sp': ['sp']
|
'sp': ['sp']
|
||||||
},true);
|
},true);
|
||||||
|
var RiseRule = new TextualRule('rise',{
|
||||||
|
'true': ['rise','升阶','ライズ'],
|
||||||
|
},true);
|
||||||
|
var TrapRule = new TextualRule('trap',{
|
||||||
|
'true': ['trap','陷阱','陷阱标记','トラップ'],
|
||||||
|
},true);
|
||||||
|
var AcceRule = new TextualRule('acce',{
|
||||||
|
'true': ['acce','accessory','附属','アクセ'],
|
||||||
|
},true);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
|
|
|
@ -5,6 +5,9 @@ function Searcher () {
|
||||||
CrossRule,
|
CrossRule,
|
||||||
TypeRule,
|
TypeRule,
|
||||||
RarityRule,
|
RarityRule,
|
||||||
|
RiseRule,
|
||||||
|
TrapRule,
|
||||||
|
AcceRule,
|
||||||
SkillRule,
|
SkillRule,
|
||||||
NoBurstRule,
|
NoBurstRule,
|
||||||
// LifeBurstRule,
|
// LifeBurstRule,
|
||||||
|
|
Loading…
Reference in a new issue