游戏王残局简化版

Diff
Login

Diff

Differences From Artifact [b112164341]:

To Artifact [96d1dd37ea]:


1
2
3
4
5
6
7
8

9
10
11
12
13
14
15
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16








+







package.path = [[.\lua_lib\?.lua;]] .. package.path
package.cpath = [[.\lua_lib\?.dll;]] .. package.cpath
local 字集库 = require("u8_to_a")
local 文件系库 = require("lfs")
local 档库 = require("lsqlite3")
local 基算库 = require(字集库.u8_to_a("算机_程语_月_基类_数_基算"))
local 位算库 = require(字集库.u8_to_a("算机_程语_月_基类_数_位算"))
local 前缀库 = require(字集库.u8_to_a("算机_程语_月_基类_文_前缀"))
local 文库 = require(字集库.u8_to_a("算机_程语_月_基类_文"))
local 后缀库 = require(字集库.u8_to_a("算机_程语_月_基类_文_后缀"))
local 历排库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_历_基类_表_排_取全"))
local 历对库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_历_基类_表_对_取全"))
local 历文库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_历_基类_文_取全"))
local 数库 = require(字集库.u8_to_a("算机_程语_月_基类_数"))
local 历排取一库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_历_基类_表_排_取一"))
local 基类库 = require(字集库.u8_to_a("算机_程语_月_基类_能_传能_基类"))
38
39
40
41
42
43
44
45

46
47
48
49
50
51

52
53
54
55
56
57
58
39
40
41
42
43
44
45

46
47
48
49
50
51

52
53
54
55
56
57
58
59







-
+





-
+







  k1_0 = d.取卡文(o1)
  --~ 卡数据对
  k2_0 = d.取卡数据(o1)
  return 对库.连两对(k1_0, k2_0)
  end
--~ 卡编
function d.取卡文(o1)
  for o1_4 in 卡档:nrows("select * from texts where id = " .. o1) do
  for o1_4 in 卡档:nrows(文库.连("select * from texts where id = ", o1)) do
    return o1_4
    end
  end
--~ 卡编
function d.取卡数据(o1)
  for o1_4 in 卡档:nrows("select * from datas where id = " .. o1) do
  for o1_4 in 卡档:nrows(文库.连("select * from datas where id = ", o1)) do
    return o1_4
    end
  end
--~ 文
function d.局筛卡编(o1)
  local k1_0
  --~ 卡编排
97
98
99
100
101
102
103











104
105
106
107
108
109

110
111
112

113
114

115
116
117
118
119




120
121
122

123
124

125
126

127
128

129
130

131
132

133
134

135
136

137
138


139
140
141

142
143

144
145

146

147

148
149
150
151
152





153
154
155
156
157
158

159
160
161
162
163
164
165
166
167
168
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118

119

120
121
122

123
124

125





126
127
128
129

130

131
132

133
134

135
136

137
138

139
140

141
142

143
144

145
146

147
148
149


150
151

152
153

154
155
156

157





158
159
160
161
162






163


164
165
166
167
168
169
170
171







+
+
+
+
+
+
+
+
+
+
+



-

-
+


-
+

-
+
-
-
-
-
-
+
+
+
+
-

-
+

-
+

-
+

-
+

-
+

-
+

-
+

-
+

-
+
+

-
-
+

-
+

-
+

+
-
+
-
-
-
-
-
+
+
+
+
+
-
-
-
-
-
-
+
-
-








  k3 = 数库.指数次(k3, 2)
  if 数库.是否最值(k3) then
    return 0
  else
    k3 = 数库.几位小数(k3, 1)
    return 基算库.乘法(k3, 1000)
    end
  end
--~ 文件
--~ 编号
--~ 文件路
function d.察编号(o1, o2, o3)
  local k1
  k1 = string.gsub(o1, 文库.连("Debug", "%.", "SetAIName", "[^\n]+"), 文库.连([[Debug.SetAIName("]], o2, [[")]]), 1)
  if k1 == o1 then
  else
    写文件库.写文件(o3, k1)
    end
  end
--~ 目对
function d.残局改名(o1_0)
  local k1, k2, k3
  local k1_0, k2_0, k3_0, k4_0, k5_0, k6_0, k7_0, k8_0, k9_0
  local k10_0, k11_0
  local k10_0, k11_0, k12_0
  --~ 文件名排
  k1_0 = 历文库.历文(o1_0.文件目, 文件系库.dir)
  k1_0 = 历排库.历排(k1_0, 后缀库.全筛后缀, ".lua")
  k1_0 = 历排库.历排返新(k1_0, 后缀库.全筛后缀, ".lua")
  --~ 文件排
  k2_0 = 历排库.历排(k1_0, 后缀库.全筛后缀, ".lua")
  k2_0 = 历排库.历排返新(k1_0, 后缀库.全筛后缀, ".lua")
  for o1 = 1, #k2_0 do
    k2_0[o1] = 前缀库.加前缀(k2_0[o1], o1_0.文件目)
    k2_0[o1] = 读文件库.读文件(k2_0[o1])
    k2_0[o1] = string.gsub(k2_0[o1], "%-%-" .. "%[(=*)%[" .. ".-" .. "%]%1%]", "")
    k2_0[o1] = string.gsub(k2_0[o1], "%-%-" .. "[^\n]*", "")
  k2_0 = 历排库.历排返旧(k2_0, 前缀库.加前缀, o1_0.文件目)
  k2_0 = 历排库.历排返旧(k2_0, 读文件库.读文件)
  k2_0 = 历排库.历排返旧(k2_0, string.gsub, 文库.连("%-%-", "%[", "(=*)", "%[", ".-", "%]", "%1", "%]"), "")
  k2_0 = 历排库.历排返旧(k2_0, string.gsub, 文库.连("%-%-", "[^\n]*"), "")
    end
  --~ 则数排
  k3_0 = 历排库.历排(k2_0, d.局筛则数)
  k3_0 = 历排库.历排返新(k2_0, d.局筛则数)
  --~ 各文件的卡编排
  k4_0 = 历排库.历排(k2_0, d.局筛卡编)
  k4_0 = 历排库.历排返新(k2_0, d.局筛卡编)
  --~ 各文件的卡对排
  k5_0 = 历排库.历排(k4_0, d.取卡对_一维)
  k5_0 = 历排库.历排返新(k4_0, d.取卡对_一维)
  --~ 有效果卡的卡对排
  k6_0 = 历排库.历排(k5_0, d.筛有效果卡)
  k6_0 = 历排库.历排返新(k5_0, d.筛有效果卡)
  --~ 有效果卡的张数排
  k7_0 = 历排库.历排(k6_0, table.maxn)
  k7_0 = 历排库.历排返新(k6_0, table.maxn)
  --~ 血排
  k11_0 = 历排库.历排(k2_0, d.局筛血)
  k11_0 = 历排库.历排返新(k2_0, d.局筛血)
  --~ 荐名排
  k8_0 = 历排库.历二排(k6_0, k11_0, d.荐名)
  k8_0 = 历排库.历二排返新(k6_0, k11_0, d.荐名)
  --~ 新名排
  k9_0 = 历排库.历排(k1_0, string.gsub, 字集库.u8_to_a(" " .. ".+"), "")
  k9_0 = 历排库.历排返新(k1_0, string.gsub, 字集库.u8_to_a(文库.连(" ", ".+")), "")
  --~ 编号排
  k10_0 = 历排库.历排(k1_0, string.gsub, 字集库.u8_to_a(" " .. ".+"), "")
  k10_0 = 历排库.历排返新(k1_0, string.gsub, 字集库.u8_to_a(文库.连(" ", ".+")), "")
  k9_0 = 历排库.历排返旧(k9_0, string.gsub, 文库.连("%.", "lua", "$"), "")
  for o1 = 1, #k1_0 do
    k9_0[o1] = string.gsub(k9_0[o1], "%." .. "lua".. "$", "")
    k9_0[o1] = 字集库.a_to_u8(o1_0.文件目) .. 字集库.a_to_u8(k9_0[o1]) .. " " .. k3_0[o1] .. "_" .. 数库.几位整数(k7_0[o1], 2)
    k9_0[o1] = 文库.连(字集库.a_to_u8(o1_0.文件目), 字集库.a_to_u8(k9_0[o1]), " ", k3_0[o1], "_", 数库.几位整数(k7_0[o1], 2))
    if k8_0[o1] == 0 then
      k9_0[o1] = k9_0[o1] .. "." .. "lua"
      k9_0[o1] = 文库.连(k9_0[o1], ".", "lua")
    else
      k9_0[o1] = k9_0[o1] .. "_" .. k8_0[o1] .. "." .. "lua"
      k9_0[o1] = 文库.连(k9_0[o1], "_", k8_0[o1], ".", "lua")
      end
    end
    k1_0[o1] = o1_0.文件目 .. k1_0[o1]
  k1_0 = 历排库.历排返旧(k1_0, 前缀库.加前缀, o1_0.文件目)
    --~ 新名
    k1 = 字集库.u8_to_a(k9_0[o1])
    os.rename(k1_0[o1], k1)
    --~ 文
    k2 = 读文件库.读文件(k1)
  k9_0 = 历排库.历排返旧(k9_0, 字集库.u8_to_a)
  历排库.历二排(k1_0, k9_0, os.rename)
  k10_0 = 历排库.历排返旧(k10_0, 字集库.a_to_u8)
  --~ 文
  k12_0 = 历排库.历排返新(k9_0, 读文件库.读文件)
    k10_0[o1] = 字集库.a_to_u8(k10_0[o1])
    --~ 文件
    k3 = string.gsub(k2, "Debug" .. "%." .. "SetAIName" .. "[^\n]+", [[Debug.SetAIName("]] .. k10_0[o1] .. [[")]], 1)
    if k2 == k3 then
    else
      写文件库.写文件(k3, k1)
  历排库.历三排(k12_0, k10_0, k9_0, d.察编号)
      end
    end
  end
d.目对 = {
  ["文件目"] = "../single/"
  , ["卡档路"] = [[D:\install\YGOPro\cards.cdb]]
  }
d.目对 = 历对库.历值(d.目对, 基类库.操类, "string", 字集库.u8_to_a)
卡档 = 档库.open(d.目对.卡档路)
d.残局改名(d.目对)