Lines of
script/c0.lua
from check-in fd436744e5
that are changed by the sequence of edits moving toward
check-in 7029b5245e:
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 s = {}
8: s["效牌之类排"] = {
9: TYPE_SPELL
10: , TYPE_TRAP
11: , TYPE_EFFECT
12: }
13: s["无效灵摆怪兽之卡编排"] = {
14: 28363749
15: , 19474136
16: , 17390179
17: , 83980492
18: }
19: s["全区"] = LOCATION_HAND + LOCATION_MZONE + LOCATION_SZONE + LOCATION_GRAVE + LOCATION_REMOVED + LOCATION_DECK + LOCATION_EXTRA
20: do
21: local h1
22: --~ 则对
23: h1 = {
24: [3] = "大师3 "
25: , [4] = "新大师 "
26: , [5] = "大师2020 "
27: }
28: s["Debug.ReloadFieldBegin"] = _G.Debug.ReloadFieldBegin
29: --~ 模
30: --~ 则数
31: function _G.Debug.ReloadFieldBegin(u1, u2)
32: s["伪洗牌"] = u1 & DUEL_PSEUDO_SHUFFLE
33: s["战段"] = u1 & DUEL_ATTACK_FIRST_TURN
34: s["机智"] = u1 & DUEL_SIMPLE_AI
35: if u2 then
36: s["则"] = h1[u2]
37: else
38: s["则"] = h1[5]
39: end
40: s["Debug.ReloadFieldBegin"](u1, u2)
41: end
42: end
43: do
44: local h1
45: --~ “调该效果”的效果
46: function s["_开局洗牌抽牌"](u1)
47: Duel.ShuffleDeck(0)
48: --~ 抽卡之数
49: Duel.Draw(0, h1, REASON_RULE)
50: u1:Reset()
51: end
52: function s["开局洗牌抽牌"](u1)
53: local h2
54: s["开局洗牌抽牌之数"] = u1
55: --~ 效果
56: h2 = Effect.GlobalEffect()
57: h2:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
58: h2:SetCode(EVENT_ADJUST)
59: h2:SetCondition(aux.TRUE)
60: h1 = u1
61: h2:SetOperation(s["_开局洗牌抽牌"])
62: Duel.RegisterEffect(h2, 0)
63: end
64: end
65: function s.["不被连锁"]()
66: Duel.SetChainLimit(aux.FALSE)
67: return true
68: end
69: do
70: local h1, h2
71: --~ 原解邀请
72: h1 = "残局群181175613"
73: --~ 二解邀请,备用:圣魔术师
74: h2 = "爆貘团:「你居然二解了,请加群告诉我怎么二解。」"
75: --~ 通关之邀
76: function s["_通关之邀"]()
77: local h3
78: --~ 对方之血
79: h3 = Duel.GetLP(1)
80: if h3 <= 0 then
81: if h3 == 0 then
82: Debug.ShowHint(h1)
83: else
84: Debug.ShowHint(h2)
85: end
86: end
87: end
88: function s["通关之邀"]()
89: local h1, h2
90: --~ 效果
91: h1 = Effect.GlobalEffect()
92: h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
93: h1:SetCode(EVENT_DAMAGE)
94: h1:SetCondition(s["_通关之邀"])
95: h1:SetOperation(aux.NULL)
96: Duel.RegisterEffect(h1, 0)
97: end
98: end
99: function s.["是否效牌"](card)
100: for i = 1, #s["效牌之类排"] do
101: if Card.IsType(card, s["效牌之类排"][i]) then
102: return true
103: end
104: end
105: if Card.IsType(card, TYPE_PENDULUM) then
106: for i = 1, #s["无效灵摆怪兽之卡编排"] do
107: if Card.IsCode(card, s["无效灵摆怪兽之卡编排"][i]) then
108: else
109: return true
110: end
111: end
112: end
113: end
114: do
115: --~ “调该效果”的效果
116: --~ “调该效果”的玩家
117: function h2(u2, u3)
118: local h3
119: --~ 玩家选定的牌
120: h3 = Duel.SelectMatchingCard(u3, Card.IsAbleToHand, u3, LOCATION_DECK, 0, u1, u1, nil)
121: Duel.SendtoHand(h3, nil, REASON_RULE)
122: u2:Reset()
123: end
124: function s["开局选牌入手"](u1)
125: local h1, h2
126: str["开局选牌入手之数"] = u1
127: --~ 效果
128: h1 = Effect.GlobalEffect()
129: h1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
130: h1:SetCode(EVENT_ADJUST)
131: h1:SetCondition(aux.TRUE)
132: --~ 调该效果的效果
133: --~ 调该效果的玩家
134: function h2(u2, u3)
135: local h3
136: --~ 玩家选定的牌
137: h3 = Duel.SelectMatchingCard(u3, Card.IsAbleToHand, u3, LOCATION_DECK, 0, u1, u1, nil)
138: Duel.SendtoHand(h3, nil, REASON_RULE)
139: u2:Reset()
140: end
141: h1:SetOperation(h2)
142: Duel.RegisterEffect(h1, 0)
143: end
144: end
145: function s["禁格"](u1)
146: local h1
147: s["禁格之数"] = u1
148: --~ 效果
149: h1 = Effect.GlobalEffect()
150: h1:SetCode(EFFECT_USE_EXTRA_MZONE)
151: h1:SetValue(u1)
152: Duel.RegisterEffect(h1, 0)
153: end
154: do
155: s["Debug.ReloadFieldEnd"] = _G.Debug.ReloadFieldEnd
156: --~ 开局洗牌抽牌之数
157: function _G.Debug.ReloadFieldEnd(u1)
158: s["Debug.ReloadFieldEnd"]()
159: if u1 then
160: s["开局洗牌抽牌"](u1)
161: end
162: end
163: end
164: do
165: local h1, h2, h3, h4
166: --~ 印牌过多之示
167: h1 = "印牌过多"
168: --~ 现之印牌数
169: h2 = 1
170: --~ 印手牌之上限
171: h3 = 0
172: --~ 总印牌之上限
173: h4 = 0
174: --~ 「调该效果」的效果
175: --~ 「调该效果」的玩家
176: function s["_印牌"](u1, u2)
177: local h5, h6
178: --~ 印卡之卡编
179: h5 = Duel.AnnounceCard(u2)
180: --~ 卡
181: h6 = Duel.CreateToken(u2, h5)
182: if h2 <= h3 then
183: h2 = h2 + 1
184: Duel.SendtoHand(h6, nil, REASON_RULE)
185: else
186: if h2 <= h4 then
187: h2 = h2 + 1
188: Duel.Remove(h6, POS_FACEUP, REASON_RULE)
189: Duel.SendtoDeck(card, u2, 0, REASON_RULE)
190: else
fd436744e5 2024-02-14 191: Debug.ShowHint("印牌过多")
fd436744e5 2024-02-14 192: 4:Reset()
193: end
194: end
195: end
196: function s.["印牌"](u1, u2, u3)
fd436744e5 2024-02-14 197: local h1, h2, h3
fd436744e5 2024-02-14 198: u3 = u3 or u2
199: Debug.ShowHint("点击对方额外牌组可以进行印牌。\n手牌只能印 " .. u2 .. " 张。\n最多可以印 " .. u3 .. " 张")
fd436744e5 2024-02-14 200: h1 = Effect.CreateEffect(u1)
fd436744e5 2024-02-14 201: --~ 现之印牌数
fd436744e5 2024-02-14 202: h2 = 1
fd436744e5 2024-02-14 203: h1:SetType(EFFECT_TYPE_IGNITION)
fd436744e5 2024-02-14 204: h1:SetProperty(EFFECT_FLAG_BOTH_SIDE + EFFECT_FLAG_UNCOPYABLE + EFFECT_FLAG_CANNOT_NEGATE + EFFECT_FLAG_CANNOT_DISABLE)
fd436744e5 2024-02-14 205: h1:SetTarget(s["不被连锁"])
fd436744e5 2024-02-14 206: h1:SetRange(LOCATION_EXTRA)
fd436744e5 2024-02-14 207: -- 印牌
fd436744e5 2024-02-14 208: --~ 调该效果的效果
fd436744e5 2024-02-14 209: --~ 调该效果的玩家
fd436744e5 2024-02-14 210: function h3(u4, u5)
fd436744e5 2024-02-14 211: local h4, h5
fd436744e5 2024-02-14 212: --~ 印卡之卡编
fd436744e5 2024-02-14 213: h4 = Duel.AnnounceCard(u5)
fd436744e5 2024-02-14 214: --~ 卡
fd436744e5 2024-02-14 215: h5 = Duel.CreateToken(u5, h4)
fd436744e5 2024-02-14 216: if h2 <= u2 then
fd436744e5 2024-02-14 217: h2 = h2 + 1
fd436744e5 2024-02-14 218: Duel.SendtoHand(h5, nil, REASON_RULE)
fd436744e5 2024-02-14 219: else
fd436744e5 2024-02-14 220: if h2 <= u3 then
fd436744e5 2024-02-14 221: h2 = h2 + 1
fd436744e5 2024-02-14 222: Duel.Remove(h5, POS_FACEUP, REASON_RULE)
fd436744e5 2024-02-14 223: Duel.SendtoDeck(card, u5, 0, REASON_RULE)
fd436744e5 2024-02-14 224: else
fd436744e5 2024-02-14 225: Debug.ShowHint("印牌过多")
fd436744e5 2024-02-14 226: u4:Reset()
fd436744e5 2024-02-14 227: end
fd436744e5 2024-02-14 228: end
fd436744e5 2024-02-14 229: end
fd436744e5 2024-02-14 230: h1:SetOperation(h3)
fd436744e5 2024-02-14 231: u1:RegisterEffect(h1)
232: end
233: end
234: function s.["开局之示"]()
235: local h1, h2, h3
236: --~ 此局效牌之数
237: h2 = Duel.GetMatchingGroupCount(s["是否效牌"], 0, s["全区"], s["全区"], nil)
238: --~ 超量材组
239: h3 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
240: for u1 in aux.Next(h3) do
241: if s["是否效牌"](u1) then
242: h2 = h2 + 1
243: end
244: end
245: --~ 开局说明
246: h1 = h2 .. "牌 " .. s["则"]
247: if s["伪洗牌"] == 0 then
248: else
249: h1 = h1 .. "伪洗牌 "
250: end
251: if s["战段"] == 0 then
252: h1 = h1 .. "无战段 "
253: end
254: if s["机智"] == 0 then
255: h1 = h1 .. "无机智 "
256: end
257: if s["开局选牌入手之数"] then
258: h1 = h1 .. "选" .. s["开局选牌入手之数"] .. "牌 "
259: end
260: if s["禁格之数"] then
261: h1 = h1 .. "禁" .. s["禁格之数"] .. "格 "
262: end
263: if s["开局洗牌抽牌之数"] then
264: h1 = h1 .. "抽" .. s["开局洗牌抽牌之数"] .. "牌 "
265: end
266: Debug.ShowHint(h1)
267: end
268: do
269: s["aux.BeginPuzzle"] = _G.aux.BeginPuzzle
270: --~ 开局选牌入手之数
271: --~ 禁格之数
272: function _G.aux.BeginPuzzle(u1, u2)
273: s["aux.BeginPuzzle"]()
274: if u1 then
275: s["开局选牌入手"](u1)
276: end
277: if u2 then
278: s["禁格"](u2)
279: end
280: s["开局之示"]()
281: s["通关之邀"]()
282: end
283: end