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