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