Lines of
script/c0.lua
from check-in dd1a253607
that are changed by the sequence of edits moving toward
check-in c458c143fc:
1:
2: local str = {}
3:
4: local math = math
5: local string = string
6: local table = table
7:
8: _G.fun = {}
9:
10: ---------------------------------
11:
12: local cache_1
13: local cache_2
14: local cache_3
15: local cache_4
16: local cache_5
17: local cache_6
18: local cache_7
19: local cache_8
20: local cache_9
21:
22: local _
23:
24: str["效果卡的种类表"] = {
25:
26: TYPE_SPELL
27: , TYPE_TRAP
28: , TYPE_EFFECT
29: }
30:
31: str["无效果灵摆怪兽表"] = {
32:
33: 28363749
34: , 19474136
35: , 17390179
36: , 83980492
37: }
38:
39: cache_1 = 0
40:
41: cache_1 = cache_1 + LOCATION_HAND
42: + LOCATION_MZONE
43: + LOCATION_SZONE
44: + LOCATION_GRAVE
45: + LOCATION_REMOVED
46:
47: str["除卡组与额外卡组以外的区域"] = cache_1
48:
49: cache_1 = cache_1 + LOCATION_DECK
50: + LOCATION_EXTRA
51:
52: str["所有区域"] = cache_1
53:
54: --第一层-------------------------------
55:
56: local cache_1
57: local cache_2
58: local cache_3
59: local cache_4
60: local cache_5
61: local cache_6
62: local cache_7
63: local cache_8
64: local cache_9
65:
66: local _
67:
68: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
69:
70: Debug.ReloadFieldBegin = function(str_1, str_2) --{
71:
72: str["不洗牌"] = str_1 & DUEL_PSEUDO_SHUFFLE
73:
74: str["无BP"] = str_1 & DUEL_ATTACK_FIRST_TURN
75:
76: str["规则表"] = {
77:
78: [3] = "大师3 "
79: , [4] = "新大师 "
80: , [5] = "大师2020 "
81: }
82:
83: if str_2 then --{
84:
85: str["规则"] = str["规则表"][str_2]
86:
87: --}
88:
89: else --{
90:
91: str["规则"] = str["规则表"][5]
92:
93: end --}
94:
95: fun["Debug.ReloadFieldBegin"](str_1, str_2)
96:
97: end --}
98:
99: fun["Debug.ReloadFieldEnd"] = Debug.ReloadFieldEnd
100:
101: Debug.ReloadFieldEnd = function(str_1) --{
102:
103: fun["Debug.ReloadFieldEnd"]()
104:
105: if str_1 then --{
106:
107: fun["随机抽卡"](str_1)
108:
109: end --}
110:
111: end --}
112:
113: fun["aux.BeginPuzzle"] = aux.BeginPuzzle
114:
115: aux.BeginPuzzle = function(str_1, str_2) --{
116:
117: fun["aux.BeginPuzzle"]()
118:
119: if str_1 then --{
120:
121: fun["开局添加手卡"](str_1)
122:
123: end --}
124:
125: if str_2 then --{
126:
127: fun["禁格"](str_2)
128:
129: end --}
130:
131: fun["开局说明"]()
132:
133: fun["通关邀请"]()
134:
135: fun["失败得分"]()
136:
137: end --}
138:
139: fun["通关邀请"] = function() --{
140:
141: str["效果"] = Effect.GlobalEffect()
142:
143: str["效果"]:SetType(EFFECT_TYPE_FIELD
144: + EFFECT_TYPE_CONTINUOUS)
145:
146: str["效果"]:SetCode(EVENT_DAMAGE)
147:
148: function cache_1() --{
149:
150: cache_1 = Duel.GetLP(1)
151:
152: if cache_1 <= 0 then --{
153:
154: if cache_1 == 0 then --{
155:
156: --}
157:
158: else --{
159:
160: Debug.ShowHint("QB:「你居然二解了,请加群告诉我怎么二解。」")
161:
162: end --}
163:
164: Debug.ShowHint("残局群181175613")
165:
166: --}
167:
168: else --{
169:
170: return false
171:
172: end --}
173:
174: end --}
175:
176: str["效果"]:SetCondition(cache_1)
177:
178: str["效果"]:SetOperation(aux.NULL)
179:
180: Duel.RegisterEffect(str["效果"]
181: , 0)
182:
183: end --}
184:
185: fun["是否效果卡"] = function(card) --{
186:
187: for i = 1, #str["效果卡的种类表"] do --{
188:
189: if Card.IsType(card, str["效果卡的种类表"][i]) then --{
190:
191: return true
192: end --}
193:
194: end --}
195:
196: if Card.IsType(card, TYPE_PENDULUM) then --{
197:
198: for i = 1, #str["无效果灵摆怪兽表"] do --{
199:
200: if Card.IsCode(card, str["无效果灵摆怪兽表"][i]) then --{
201:
202: --}
203:
204: else --{
205:
206: return true
207:
208: end --}
209:
210: end --}
211:
212: end --}
213:
214: return false
215:
216: end --}
217:
218: fun["开局说明"] = function() --{
219:
220: str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"]
221: , 0
222: , str["所有区域"]
223: , str["所有区域"]
224: , nil)
225:
226: str["超量素材组"] = Duel.GetOverlayGroup(0
227: , LOCATION_MZONE
228: , LOCATION_MZONE)
229:
230: for k in aux.Next(str["超量素材组"]) do --{
231:
232: if fun["是否效果卡"](k) then --{
233:
234: str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
235:
236: end --}
237:
238: end --}
239:
240: str["开局说明"] = str["这个残局的效果卡数量"]
241: .. "卡 "
242: .. str["规则"]
243:
244: if str["不洗牌"] == 0 then --{
245:
246: --}
247:
248: else --{
249:
250: str["开局说明"] = str["开局说明"] .. "伪洗牌 "
251:
252: end --}
253:
254: if str["无BP"] == 0 then --{
255:
256: str["开局说明"] = str["开局说明"] .. "无BP "
257:
258: end --}
259:
260: if str["开局添加手卡"] then --{
261:
262: str["开局说明"] = str["开局说明"]
263: .. "选"
264: .. str["开局添加手卡的数量"]
265: .. "卡 "
266:
267: end --}
268:
269: if str["禁格"] then --{
270:
271: str["开局说明"] = str["开局说明"]
272: .. "禁"
273: .. str["禁格的数量"]
274: .. "格 "
275:
276: end --}
277:
278: if str["随机抽卡的数量"] then --{
279:
280: str["开局说明"] = str["开局说明"]
281: .. "抽"
282: .. str["随机抽卡的数量"]
283: .. "卡 "
284: end --}
285:
286: Debug.ShowHint(str["开局说明"])
287:
288: end --}
289:
290: fun["开局添加手卡"] = function(str_1) --{
291:
292: str["开局添加手卡的数量"] = str_1
293:
294: str["效果"] = Effect.GlobalEffect()
295:
296: str["效果"]:SetType(EFFECT_TYPE_FIELD
297: + EFFECT_TYPE_CONTINUOUS)
298:
299: str["效果"]:SetCode(EVENT_ADJUST)
300:
301: str["效果"]:SetCondition(aux.TRUE)
302:
303: function cache_1(effect_event
304: , player_who_activate_the_effect) --{
305:
306: str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
307: , Card.IsAbleToHand
308: , player_who_activate_the_effect
309: , LOCATION_DECK
310: , 0
311: , str_1
312: , str_1
313: , nil)
314:
315: Duel.SendtoHand(str["玩家选定的卡"]
316: , nil
317: , REASON_RULE)
318:
319: effect_event:Reset()
320:
321: end --}
322:
323: str["效果"]:SetOperation(cache_1)
324:
325: Duel.RegisterEffect(str["效果"]
326: , 0)
327:
328: end --}
329:
330: fun["禁格"] = function(str_1) --{
331:
332: str["禁格的数量"] = str_1
333:
334: str["效果"] = Effect.GlobalEffect()
335:
336: str["效果"]:SetCode(EFFECT_USE_EXTRA_MZONE)
337:
338: str["效果"]:SetValue(str_1)
339:
340: Duel.RegisterEffect(str["效果"],0)
341:
342: end --}
343:
344: fun["该效果不能被连锁"] = function() --{
345:
346: Duel.SetChainLimit(aux.FALSE)
347:
348: return true
349: end --}
350:
351: fun["印卡"] = function(str_1, str_2, str_3) --{
352:
353: if str_3 then --{
354:
355: --}
356:
357: else --{
358:
359: str_3 = str_2
360:
361: end --}
362:
363: Debug.ShowHint("点击对方额外卡组可以进行印卡。\n手卡只能印 "
364: .. str_2
365: .. " 张。\n最多可以印 "
366: .. str_3
367: .. " 张")
368:
369: str["效果"] = Effect.CreateEffect(str_1)
370:
371: str["当前印卡数"] = 1
372:
373: str["效果"]:SetType(EFFECT_TYPE_IGNITION)
374:
375: str["效果"]:SetProperty(EFFECT_FLAG_BOTH_SIDE
376: + EFFECT_FLAG_UNCOPYABLE
377: + EFFECT_FLAG_CANNOT_NEGATE
378: + EFFECT_FLAG_CANNOT_DISABLE)
379:
380: str["效果"]:SetTarget(fun["该效果不能被连锁"])
381:
382: str["效果"]:SetRange(LOCATION_EXTRA)
383:
384: function print_hand(effect_event
385: , player_who_activate_the_effect) --{
386:
387: announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
388:
389: card = Duel.CreateToken(player_who_activate_the_effect
390: , announce_card)
391:
392: if str["当前印卡数"] <= str_2 then --{
393:
394: str["当前印卡数"] = str["当前印卡数"] + 1
395:
396: Duel.SendtoHand(card,nil,REASON_RULE)
397:
398: --}
399:
400: else --{
401:
402: if str["当前印卡数"] <= str_3 then --{
403:
404: str["当前印卡数"] = str["当前印卡数"] + 1
405:
406: Duel.Remove(card,POS_FACEUP,REASON_RULE)
407:
408: Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
409:
410: --}
411:
412: else --{
413:
414: Debug.ShowHint("印卡过多!")
415:
416: effect_event:Reset()
417:
418: end --}
419:
420: end --}
421:
422: end --}
423:
424: str["效果"]:SetOperation(print_hand)
425:
426: str_1:RegisterEffect(str["效果"])
427:
428: end --}
429:
430: fun["随机抽卡"] = function(str_1) --{
431:
432: str["随机抽卡的数量"] = str_1
433:
434: str["效果"] = Effect.GlobalEffect()
435:
436: str["效果"]:SetType(EFFECT_TYPE_FIELD
437: + EFFECT_TYPE_CONTINUOUS)
438:
439: str["效果"]:SetCode(EVENT_ADJUST)
440:
441: str["效果"]:SetCondition(aux.TRUE)
442:
443: function cache_1(effect_event
444: , player_who_activate_the_effect) --{
445:
446: Duel.ShuffleDeck(0)
447:
448: Duel.Draw(0,str_1,REASON_RULE)
449:
450: effect_event:Reset()
451:
452: end --}
453:
454: str["效果"]:SetOperation(cache_1)
455:
456: Duel.RegisterEffect(str["效果"]
457: , 0)
458:
459: end --}
460:
461: fun["失败得分"] = function() --{
462:
463: str["失败得分表"] = {
464:
465: [0] = "神龙之圣刻印"
466: , [100] = "调和支援士"
467: , [200] = "深渊的暗杀者"
468: , [300] = "救援猫"
469: , [400] = "注射天使 莉莉"
470: , [500] = "不知火的隐者"
471: , [600] = "影依猎鹰"
472: , [700] = "铁兽战线 姬特"
473: , [800] = "召唤僧"
474: , [900] = "恩底弥翁的仆从"
475: , [1000] = "机壳工具 丑恶"
476: , [1100] = "欧尼斯特"
477: , [1200] = "次元吸引者"
478: , [1300] = "黑羽-疾风之盖尔"
479: , [1400] = "加农炮兵"
480: , [1500] = "教导的大神祗官"
481: , [1600] = "地中族导师"
482: , [1700] = "相剑师-莫邪"
483: , [1800] = "宝玉兽-青玉飞马"
484: , [1900] = "命运英雄 血魔-D"
485: , [2000] = "流离的狮鹫骑手"
486: , [2100] = "电子龙"
487: , [2200] = "古遗物-死镰"
488: , [2300] = "能朋克 调狐"
489: , [2400] = "俱舍怒威族·芬里尔狼"
490: , [2500] = "黑魔术师"
491: , [2600] = "雅典娜"
492: , [2700] = "暗黑界的龙神 格拉法"
493: , [2800] = "魔导兽 刻耳柏洛斯尊主"
494: , [2900] = "元素英雄 永生侠"
495: , [3000] = "青眼白龙"
496: }
497:
498: str["对方玩家的初始生命值"] = Duel.GetLP(1)
499:
500: str["效果"] = Effect.GlobalEffect()
501:
502: str["效果"]:SetType(EFFECT_TYPE_FIELD
503: + EFFECT_TYPE_CONTINUOUS)
504:
505: str["效果"]:SetCode(EVENT_PHASE_START+PHASE_END)
506:
507: function cache_1(effect_event
508: , player_who_activate_the_effect) --{
509:
510: cache_1 = Duel.GetLP(1) - str["对方玩家的初始生命值"]
511:
512: if cache_1 > 0 then --{
513:
514: return
515:
516: --}
517:
518: else --{
519:
520: cache_1 = math.abs(cache_1) / (str["对方玩家的初始生命值"] - 100)
521:
522: cache_1 = math.tointeger(cache_1 * 3000 // 100 * 100)
523:
524: end --}
525:
526: if cache_1 > 3000 then --{
527:
528: --}
529:
530: else --{
531:
532: Debug.ShowHint("这局,您的得分是 "
533: .. cache_1
534: .. " 分!\n处于「"
535: .. str["失败得分表"][cache_1]
536: .. "」级别!")
537:
538: end --}
539:
540: effect_event:Reset()
541:
542: end --}
543:
544: str["效果"]:SetOperation(cache_1)
545:
546: Duel.RegisterEffect(str["效果"]
547: , 0)
548:
549: end --}
550: