Lines of
script/c0.lua
from check-in 27c36deea8
that are changed by the sequence of edits moving toward
check-in 661e35fb9e:
1:
2: local str = {}
3:
4: local cache_1
5: local cache_2
6: local cache_3
7: local cache_4
8: local cache_5
9: local cache_6
10: local cache_7
11: local cache_8
12: local cache_9
27c36deea8 2023-07-23 13:
27c36deea8 2023-07-23 14: local i
15:
16: _G.fun = {}
17:
18: ---------------------------------
19:
20: str["规则表"] = {}
21: str["规则表"][3] = "大师3 "
22: str["规则表"][4] = "新大师 "
23: str["规则表"][5] = "大师2020 "
24:
25: str["效果卡的种类表"] = {}
26: str["效果卡的种类表"][1] = TYPE_SPELL
27: str["效果卡的种类表"][2] = TYPE_TRAP
28: str["效果卡的种类表"][3] = TYPE_EFFECT
29:
30: str["无效果灵摆怪兽表"] = {}
31:
32: str["无效果灵摆怪兽表"][1] = 28363749
33: str["无效果灵摆怪兽表"][2] = 19474136
34: str["无效果灵摆怪兽表"][3] = 17390179
35: str["无效果灵摆怪兽表"][4] = 83980492
36:
37: cache_1 = 0
38:
39: cache_1 = cache_1 + LOCATION_HAND
40: cache_1 = cache_1 + LOCATION_MZONE
41: cache_1 = cache_1 + LOCATION_SZONE
42: cache_1 = cache_1 + LOCATION_GRAVE
43: cache_1 = cache_1 + LOCATION_REMOVED
44:
45: str["除卡组与额外卡组以外的区域"] = cache_1
46:
47: cache_1 = cache_1 + LOCATION_DECK
48: cache_1 = cache_1 + LOCATION_EXTRA
49:
50: str["所有区域"] = cache_1
51:
52: ---------------------------------
53:
54: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
55:
56: Debug.ReloadFieldBegin = function(str_1, str_2) --{
57:
58: str["不洗牌"] = str_1 & DUEL_PSEUDO_SHUFFLE
59:
60: str["无BP"] = str_1 & DUEL_ATTACK_FIRST_TURN
61:
62: if str_2 then --{
63:
64: str["规则"] = str["规则表"][str_2]
65:
66: --}
67:
68: else --{
69:
70: str["规则"] = str["规则表"][5]
71:
72: end --}
73:
74: fun["Debug.ReloadFieldBegin"](str_1, str_2)
75:
76: end --}
77:
78: fun["aux.BeginPuzzle"] = aux.BeginPuzzle
79:
80: aux.BeginPuzzle = function(str_1, str_2) --{
81:
82: fun["aux.BeginPuzzle"]()
83:
84: if str_1 then --{
85:
86: fun["开局添加手卡"](str_1)
87:
88: end --}
89:
90: if str_2 then --{
91:
92: fun["禁格"](str_2)
93:
94: end --}
95:
96: fun["开局说明"]()
97:
98: fun["通关邀请"]()
99:
100: end --}
101:
102: fun["通关邀请"] = function() --{
103:
104: str["效果"] = Effect.GlobalEffect()
105:
106: str["效果"]:SetType(EFFECT_TYPE_FIELD
107: + EFFECT_TYPE_CONTINUOUS)
108:
109: str["效果"]:SetCode(EVENT_DAMAGE)
110:
111: function cache_1() --{
112:
113: cache_1 = Duel.GetLP(1)
114:
115: if cache_1 <= 0 then --{
116:
117: if cache_1 == 0 then --{
118:
119: --}
120:
121: else --{
122:
123: Debug.ShowHint("QB:「你居然二解了,请加群告诉我怎么二解。」")
124:
125: end --}
126:
127: Debug.ShowHint("残局群181175613")
128:
129: --}
130:
131: else --{
132:
133: return false
134:
135: end --}
136:
137: end --}
138:
139: str["效果"]:SetCondition(cache_1)
140:
141: str["效果"]:SetOperation(aux.NULL)
142:
143: Duel.RegisterEffect(str["效果"]
144: , 0)
145:
146: end --}
147:
148: fun["是否效果卡"] = function(card) --{
149:
150: cache_1 = #str["效果卡的种类表"]
151:
152: for i = 1, cache_1 do --{
153:
154: cache_1 = Card.IsType(card, str["效果卡的种类表"][i])
155:
156: if cache_1 then --{
157:
158: return true
159: end --}
160:
161: end --}
162:
163: cache_1 = Card.IsType(card, TYPE_PENDULUM)
164:
165: if cache_1 then --{
166:
167: cache_1 = #str["无效果灵摆怪兽表"]
168:
169: for i = 1, cache_1 do --{
170:
171: cache_1 = Card.IsCode(card, str["无效果灵摆怪兽表"][i])
172:
173: if cache_1 then --{
174:
175: --}
176:
177: else --{
178:
179: return true
180:
181: end --}
182:
183: end --}
184:
185: end --}
186:
187: return false
188:
189: end --}
190:
191: fun["开局说明"] = function() --{
192:
193: str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"]
194: , 0
195: , str["所有区域"]
196: , str["所有区域"]
197: , nil)
198:
199: cache_1 = Duel.GetOverlayGroup(0
200: , LOCATION_MZONE
201: , LOCATION_MZONE)
202:
203: for k in aux.Next(cache_1) do --{
204:
205: cache_1 = fun["是否效果卡"](k)
206:
207: if cache_1 then --{
208:
209: str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
210:
211: end --}
212:
213: end --}
214:
215: str["开局说明"] = str["这个残局的效果卡数量"]
216: .. "卡 "
217: .. str["规则"]
218:
219: if str["不洗牌"] == 0 then --{
220:
221: --}
222:
223: else --{
224:
225: str["开局说明"] = str["开局说明"] .. "伪洗牌 "
226:
227: end --}
228:
229: if str["无BP"] == 0 then --{
230:
231: str["开局说明"] = str["开局说明"] .. "无BP "
232:
233: end --}
234:
235: if str["开局添加手卡"] then --{
236:
237: str["开局说明"] = str["开局说明"]
238: .. "选"
239: .. str["开局添加手卡的数量"]
240: .. "卡 "
241:
242: end --}
243:
244: if str["禁格"] then --{
245:
246: str["开局说明"] = str["开局说明"]
247: .. "禁"
248: .. str["禁格的数量"]
249: .. "格 "
250:
251: end --}
252:
253: if str["随机抽卡的数量"] then --{
254:
255: str["开局说明"] = str["开局说明"]
256: .. "抽"
257: .. str["随机抽卡的数量"]
258: .. "卡 "
259: end --}
260:
261: Debug.ShowHint(str["开局说明"])
262:
263: end --}
264:
265: fun["开局添加手卡"] = function(str_1) --{
266:
267: str["开局添加手卡的数量"] = str_1
268:
269: str["效果"] = Effect.GlobalEffect()
270:
271: str["效果"]:SetType(EFFECT_TYPE_FIELD
272: + EFFECT_TYPE_CONTINUOUS)
273:
274: str["效果"]:SetCode(EVENT_ADJUST)
275:
276: str["效果"]:SetCondition(aux.TRUE)
277:
278: function cache_1(effect_event
279: , player_who_activate_the_effect) --{
280:
281: str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
282: , Card.IsAbleToHand
283: , player_who_activate_the_effect
284: , LOCATION_DECK
285: , 0
286: , str_1
287: , str_1
288: , nil)
289:
290: Duel.SendtoHand(str["玩家选定的卡"]
291: , nil
292: , REASON_RULE)
293:
294: effect_event:Reset()
295:
296: end --}
297:
298: str["效果"]:SetOperation(cache_1)
299:
300: Duel.RegisterEffect(str["效果"]
301: , 0)
302:
303: end --}
304:
305: fun["禁格"] = function(str_1) --{
306:
307: str["禁格的数量"] = str_1
308:
309: str["效果"] = Effect.GlobalEffect()
310:
311: str["效果"]:SetCode(EFFECT_USE_EXTRA_MZONE)
312:
313: str["效果"]:SetValue(str_1)
314:
315: Duel.RegisterEffect(str["效果"],0)
316:
317: end --}
318:
319: fun["印卡"] = function(str_1, str_2, str_3) --{
320:
321: if str_3 then --{
322:
323: --}
324:
325: else --{
326:
327: str_3 = str_2
328:
329: end --}
330:
331: Debug.ShowHint("点击对方额外卡组可以进行印卡。\n手卡只能印 "
332: .. str_2
333: .. " 张。\n最多可以印 "
334: .. str_3
335: .. " 张")
336:
337: str["效果"] = Effect.CreateEffect(str_1)
338:
339: str["当前印卡数"] = 1
340:
341: str["效果"]:SetType(EFFECT_TYPE_IGNITION)
342:
343: str["效果"]:SetProperty(EFFECT_FLAG_BOTH_SIDE
344: + EFFECT_FLAG_UNCOPYABLE
345: + EFFECT_FLAG_CANNOT_NEGATE
346: + EFFECT_FLAG_CANNOT_DISABLE)
347:
348: cache_1 = function() --{
349:
350: Duel.SetChainLimit(aux.FALSE)
351:
352: return true
353:
354: end --}
355:
356: str["效果"]:SetTarget(cache_1)
357:
358: str["效果"]:SetRange(LOCATION_EXTRA)
359:
360: function print_hand(effect_event
361: , player_who_activate_the_effect) --{
362:
363: announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
364:
365: card = Duel.CreateToken(player_who_activate_the_effect
366: , announce_card)
367:
368: if str["当前印卡数"] <= str_2 then --{
369:
370: str["当前印卡数"] = str["当前印卡数"] + 1
371:
372: Duel.SendtoHand(card,nil,REASON_RULE)
373:
374: --}
375:
376: else --{
377:
378: if str["当前印卡数"] <= str_3 then --{
379:
380: str["当前印卡数"] = str["当前印卡数"] + 1
381:
382: Duel.Remove(card,POS_FACEUP,REASON_RULE)
383:
384: Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
385:
386: --}
387:
388: else --{
389:
390: Debug.ShowHint("印卡过多!")
391:
392: effect_event:Reset()
393:
394: end --}
395:
396: end --}
397:
398: end --}
399:
400: str["效果"]:SetOperation(print_hand)
401:
402: str_1:RegisterEffect(str["效果"])
403:
404: end --}
405:
406: fun["随机抽卡"] = function(str_1) --{
407:
408: str["随机抽卡的数量"] = str_1
409:
410: str["效果"] = Effect.GlobalEffect()
411:
412: str["效果"]:SetType(EFFECT_TYPE_FIELD
413: + EFFECT_TYPE_CONTINUOUS)
414:
415: str["效果"]:SetCode(EVENT_ADJUST)
416:
417: str["效果"]:SetCondition(aux.TRUE)
418:
419: function cache_1(effect_event
420: , player_who_activate_the_effect) --{
421:
422: Duel.ShuffleDeck(0)
423:
424: Duel.Draw(0,str_1,REASON_RULE)
425:
426: effect_event:Reset()
427:
428: end --}
429:
430: str["效果"]:SetOperation(cache_1)
431:
432: Duel.RegisterEffect(str["效果"]
433: , 0)
434:
435: end --}
436: