Commit 9dca4fc2 authored by ganjingcun's avatar ganjingcun

加入电子界

parent 57c520a7
...@@ -9,3 +9,5 @@ db.config.js ...@@ -9,3 +9,5 @@ db.config.js
test.js test.js
db.sql db.sql
upload/ upload/
plan.md
query.sql
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
"1041": "幻神兽", "1041": "幻神兽",
"1042": "创造神", "1042": "创造神",
"1043": "幻龙", "1043": "幻龙",
"1044": "电子界",
"1050": "怪兽", "1050": "怪兽",
"1051": "魔法", "1051": "魔法",
"1052": "陷阱", "1052": "陷阱",
...@@ -89,6 +90,7 @@ ...@@ -89,6 +90,7 @@
"1041": "Divine-Beast", "1041": "Divine-Beast",
"1042": "Creator God", "1042": "Creator God",
"1043": "Wyrm", "1043": "Wyrm",
"1044": "Cyberse",
"1050": "Monster", "1050": "Monster",
"1051": "Spell", "1051": "Spell",
"1052": "Trap", "1052": "Trap",
......
...@@ -17,6 +17,19 @@ var attrOffset = 1010 ...@@ -17,6 +17,19 @@ var attrOffset = 1010
var raceOffset = 1020 var raceOffset = 1020
var typeOffset = 1050 var typeOffset = 1050
var constants = {
"LINK_MARKERS": {
"LINK_MARKER_BOTTOM_LEFT": 1,
"LINK_MARKER_BOTTOM": 2,
"LINK_MARKER_BOTTOM_RIGHT": 4,
"LINK_MARKER_LEFT": 8,
"LINK_MARKER_RIGHT": 32,
"LINK_MARKER_TOP_LEFT": 64,
"LINK_MARKER_TOP": 128,
"LINK_MARKER_TOP_RIGHT": 256
}
}
//this initializes a connection pool //this initializes a connection pool
//it will keep idle connections open for a 30 seconds //it will keep idle connections open for a 30 seconds
//and set a limit of maximum 10 idle clients //and set a limit of maximum 10 idle clients
...@@ -417,8 +430,32 @@ router.get('/cardinfo', function (req, res) { ...@@ -417,8 +430,32 @@ router.get('/cardinfo', function (req, res) {
result.alias = row.alias result.alias = row.alias
result.setcode = row.setcode result.setcode = row.setcode
result.atk = row.atk result.atk = row.atk
result.def = row.def result.def = row.def
// 电子界 特殊处理防御
if (row.race == 16777216) {
if (result.def & constants.LINK_MARKERS.LINK_MARKER_TOP_LEFT)
result.name += "[↖]";
if (result.def & constants.LINK_MARKERS.LINK_MARKER_TOP)
result.name += "[↑]";
if (result.def & constants.LINK_MARKERS.LINK_MARKER_TOP_RIGHT)
result.name += "[↗]";
if (result.def & constants.LINK_MARKERS.LINK_MARKER_LEFT)
result.name += "[←]";
if (result.def & constants.LINK_MARKERS.LINK_MARKER_RIGHT)
result.name += "[→]";
if (result.def & constants.LINK_MARKERS.LINK_MARKER_BOTTOM_LEFT)
result.name += "[↙]";
if (result.def & constants.LINK_MARKERS.LINK_MARKER_BOTTOM)
result.name += "[↓]";
if (result.def & constants.LINK_MARKERS.LINK_MARKER_BOTTOM_RIGHT)
result.name += "[↘]";
result.def = '-'
}
if (row.level <= 12) { if (row.level <= 12) {
result.level = row.level result.level = row.level
} else { } else {
......
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