Commit fc096346 authored by Chunchi Che's avatar Chunchi Che

handle lscales condition

parent 5c47d1ff
Pipeline #26147 passed with stages
in 5 minutes and 45 seconds
......@@ -48,7 +48,7 @@ export function invokeFts(db: Database, params: FtsParams): CardMeta[] {
}
function getFtsCondtions(conditions: FtsConditions): string {
const { types, levels, atk, def, races, attributes } = conditions;
const { types, levels, lscales, atk, def, races, attributes } = conditions;
const assertMonster = `(type & ${TYPE_MONSTER}) > 0`;
const typesCondition = types
......@@ -57,6 +57,9 @@ function getFtsCondtions(conditions: FtsConditions): string {
const levelsCondition = levels
.map((level) => `(level & 0xff) = ${level}`)
.join(" OR ");
const lscalesCondition = lscales
.map((lscale) => `((level >> 0x18) & 0xff) = ${lscale}`)
.join(" OR ");
const atkCondition =
atk.min !== null || atk.max !== null
? `atk BETWEEN ${handleFinite(atk.min, "min")} AND ${handleFinite(
......@@ -79,6 +82,7 @@ function getFtsCondtions(conditions: FtsConditions): string {
const merged = [
typesCondition,
levelsCondition,
lscalesCondition,
atkCondition,
defCondition,
raceCondition,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment