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