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