diff --git a/DeckEditor/Rules.js b/DeckEditor/Rules.js index 17d820b..ce14e11 100644 --- a/DeckEditor/Rules.js +++ b/DeckEditor/Rules.js @@ -20,7 +20,8 @@ TextualRule.prototype.parse = function (words) { return function filter (info) { if (!keywords.length) return true; 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) { return value === keyword; } else { @@ -43,10 +44,10 @@ TextualRule.prototype.parseWord = function (word) { /////////////////////////////////////////////////////////////// // // 枚举型规则,包括: -// ColorRule,TypeRule,RarityRule +// ColorRule,TypeRule,RarityRule,RiseRule,TrapRule,AcceRule // 匹配例子: // "白 LRIG SR 红" -// "白色 精灵 lr red" +// "白色 精灵 lr red rise" // /////////////////////////////////////////////////////////////// var ColorRule = new TextualRule('color',{ @@ -74,6 +75,15 @@ var RarityRule = new TextualRule('rarity',{ 'pr': ['pr'], 'sp': ['sp'] },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); /////////////////////////////////////////////////////////////// // diff --git a/DeckEditor/Searcher.js b/DeckEditor/Searcher.js index 34eda1c..768170a 100644 --- a/DeckEditor/Searcher.js +++ b/DeckEditor/Searcher.js @@ -5,6 +5,9 @@ function Searcher () { CrossRule, TypeRule, RarityRule, + RiseRule, + TrapRule, + AcceRule, SkillRule, NoBurstRule, // LifeBurstRule,