游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in fffb53847d that are changed by the sequence of edits moving toward check-in fbca5305b2:

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