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