Lines of script/c0.lua from check-in 8a913822c3 that are changed by the sequence of edits moving toward check-in 15cf256272:
1: local string = string
2: local table = table
3: local Debug = Debug
4: local Effect = Effect
5: local Duel = Duel
6: local Card = Card
7: local d = {}
8: local f = {}
9: d["排_效果卡之类型"] = {
10: TYPE_SPELL,
11: TYPE_TRAP,
12: TYPE_EFFECT,
13: TYPE_DUAL,
14: }
15: d["排_非效果灵摆怪兽之卡片编号"] = {
16: 28363749,
17: 19474136,
18: 17390179,
19: 83980492,
20: }
21: d["数_所有区域"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA
22: do
23: f["Debug.ReloadFieldBegin"] = _G.Debug.ReloadFieldBegin
24: --~ 数_这一局的模式
25: --~ 数_规则参数
26: function _G.Debug.ReloadFieldBegin(o1, o2)
27: --~ 这一局所适用规则的对
28: local k1
29: k1 = {
30: [3] = "大师规则三(2014) ",
31: [4] = "新大师规则(2017) ",
32: [5] = "大师规则(2020) ",
33: }
34: d["数_假洗卡"] = o1 & DUEL_PSEUDO_SHUFFLE
35: d["数_战斗阶段"] = o1 & DUEL_ATTACK_FIRST_TURN
36: d["数_人工智能"] = o1 & DUEL_SIMPLE_AI
37: if o2 then
38: d["字_这一局的规则"] = k1[o2]
39: else
40: d["字_这一局的规则"] = k1[5]
41: end
42: f["Debug.ReloadFieldBegin"](o1, o2)
43: end
44: end
45: f["不被连锁"] = function()
46: Duel.SetChainLimit(aux.FALSE)
47: return true
48: end
49: f["是否有效果卡"] = function(card)
50: for k1 = 1, #d["排_效果卡之类型"] do
51: if Card.IsType(card, d["排_效果卡之类型"][k1]) then
52: return true
53: end
54: end
55: if Card.IsType(card, TYPE_PENDULUM) then
56: for k1 = 1, #d["排_非效果灵摆怪兽之卡片编号"] do
57: if Card.IsCode(card, d["排_非效果灵摆怪兽之卡片编号"][k1]) then
58: return false
59: else
60: end
61: end
62: return true
63: end
64: end
65: do
66: --~ 量_从卡组选几张卡加入手卡
67: local k1
68: --~ 效果_所调用这个效果的效果
69: --~ 数_所调用这个效果的玩家
70: f["_从卡组选卡加入手卡"] = function(o1, o2)
71: --~ 卡_玩家选定的卡
72: local k11
73: k11 = Duel.SelectMatchingCard(o2, Card.IsAbleToHand, o2, LOCATION_DECK, 0, k1, k1, nil)
74: Duel.SendtoHand(k11, nil, REASON_RULE)
75: o1:Reset()
76: end
77: --~ 量_从卡组选几张卡加入手卡
78: f["从卡组选卡加入手卡"] = function(o1)
79: --~ 效果
80: local k11
81: d["量_从卡组选几张卡加入手卡"] = o1
82: k1 = o1
83: k11 = Effect.GlobalEffect()
84: k11:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
85: k11:SetCode(EVENT_ADJUST)
86: k11:SetCondition(aux.TRUE)
87: k11:SetCountLimit(1)
88: k11:SetOperation(f["_从卡组选卡加入手卡"])
89: Duel.RegisterEffect(k11, 0)
90: end
91: end
92: --~ 量_禁用几个我方主要怪兽区域
93: f["禁用我方主要怪兽区域"] = function(o1)
94: --~ 效果
95: local k1
96: d["量_禁用几个我方主要怪兽区域"] = o1
97: k1 = Effect.GlobalEffect()
98: k1:SetCode(EFFECT_USE_EXTRA_MZONE)
99: k1:SetValue(o1)
100: Duel.RegisterEffect(k1, 0)
101: end
102: do
103: --~ 字_印卡过多时的文字提示
104: --~ 量_现在的印卡数量
105: --~ 量_手卡印卡数量的上限
106: --~ 量_印卡总数量的上限
107: local k1, k2, k3, k4
108: k1 = "印卡过多"
109: k2 = 1
110: k3 = 0
111: k4 = 0
112: --~ 效果_所调用这个效果的效果
113: --~ 数_所调用这个效果的玩家
114: f["_印卡"] = function(o1, o2)
115: --~ 数_玩家宣言要印的卡之卡片编号
116: --~ 卡
117: local k11, k12
118: k11 = Duel.AnnounceCard(o2)
119: k6 = Duel.CreateToken(o2, k11)
120: if k2 <= k3 then
121: k2 = k2 + 1
122: Duel.SendtoHand(k12, nil, REASON_RULE)
123: else
124: if k2 <= k4 then
125: k2 = k2 + 1
126: Duel.SendtoDeck(k12, o2, 0, REASON_RULE)
127: else
128: Debug.ShowHint(k1)
129: o1:Reset()
130: end
131: end
132: end
133: --~ 卡_印卡的启动源
134: --~ 量_手卡印卡数量的上限
135: --~ 量_印卡总数量的上限
136: f["印卡"] = function(o1, o2, o3)
137: --~ 效果
138: local k11
139: k3 = o2
140: k4 = o3 or o2
141: Debug.ShowHint("点击对方额外卡组,可以印卡\n只能印 " .. k3 .. " 张手卡\n最多可印 " .. k4 .. " 张卡")
142: k11 = Effect.CreateEffect(o1)
143: k11:SetType(EFFECT_TYPE_IGNITION)
144: k11:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_DISABLE)
145: k11:SetTarget(f["不被连锁"])
146: k11:SetRange(LOCATION_EXTRA)
147: k11:SetOperation(f["_印卡"])
148: o1:RegisterEffect(k11)
149: end
150: end
151: f["开局说明"] = function()
152: --~ 字_开局说明
153: --~ 量_我方的效果卡
154: --~ 组_我方超量素材
155: --~ 量_对方的效果卡
156: --~ 组_对方超量素材
157: --~ 量_效果卡
158: local k1, k2, k3, k4, k5, k6
159: k2 = Duel.GetMatchingGroupCount(f["是否有效果卡"], 0, d["数_所有区域"], nil, nil)
160: k3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, nil)
161: for o1 in aux.Next(k3) do
162: if f["是否有效果卡"](o1) then
163: k2 = k2 + 1
164: end
165: end
166: k4 = Duel.GetMatchingGroupCount(f["是否有效果卡"], 0, nil, d["数_所有区域"], nil)
167: k5 = Duel.GetOverlayGroup(0, nil, LOCATION_MZONE)
168: for o1 in aux.Next(k5) do
169: if f["是否有效果卡"](o1) then
170: k4 = k4 + 1
171: end
172: end
173: k6 = k2 + k4
8a913822c3 2024-07-21 174: k1 = "" .. k6 .. "卡 " .. k4 .. "卡 " .. d["字_这一局的规则"]
175: if d["数_假洗卡"] == 0 then
176: else
177: k1 = k1 .. "假洗卡 "
178: end
179: if d["数_战斗阶段"] == 0 then
180: k1 = k1 .. "无战斗阶段 "
181: end
182: if d["数_人工智能"] == 0 then
183: k1 = k1 .. "无人工智能 "
184: end
185: if d["量_从卡组选几张卡加入手卡"] then
186: k1 = k1 .. "选" .. d["量_从卡组选几张卡加入手卡"] .. "卡加入手卡 "
187: end
188: if d["量_禁用几个我方主要怪兽区域"] then
189: k1 = k1 .. "禁用" .. d["量_禁用几个我方主要怪兽区域"] .. "个我方主要怪兽区域 "
190: end
191: Debug.ShowHint(k1)
192: end
193: do
194: f["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
195: --~ 量_从卡组选几张卡加入手卡
196: --~ 量_禁几个我方主要怪兽格
197: --~ 卡_传入对方额外卡组最上面的表侧卡,并将其作为印卡源
198: --~ 量_能印几张手卡
199: --~ 量_最多能印几张卡
200: function _G.aux.BeginPuzzle(o1, o2, o3, o4, o5)
201: f["aux.BeginPuzzle"]()
202: if o1 then
203: f["从卡组选卡加入手卡"](o1)
204: else
205: end
206: if o2 then
207: f["禁用我方主要怪兽区域"](o2)
208: else
209: end
210: if o3 then
211: f["印卡"](o3, o4, o5)
212: else
213: end
214: f["开局说明"]()
215: end
216: end
217: Auxiliary.PuzzleOp = function()
218: Duel.SetLP(0,0)
219: for i = 1, #d["排_局末提示"] do
220: Debug.ShowHint(d["排_局末提示"][i])
221: end
222: end
223: do
224: f["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
225: --~ 局末提示
226: function _G.Debug.ReloadFieldEnd(...)
227: f["Debug.ReloadFieldEnd"]()
228: d["排_局末提示"] = {...}
229: end
230: end