游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

                         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: 
fbca5305b2 2023-08-02  161: fun["开局说明"] = function() --{
                       162:   
                       163:   str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"]
                       164:   , 0
                       165:   , str["所有区域"]
                       166:   , str["所有区域"]
                       167:   , nil)
                       168:   
                       169:   str["超量素材组"] = Duel.GetOverlayGroup(0
                       170:   , LOCATION_MZONE
                       171:   , LOCATION_MZONE)
                       172:   
                       173:   for k in aux.Next(str["超量素材组"]) do --{
                       174:     
                       175:     if fun["一_是否效果卡"](k) then --{
                       176:       
                       177:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
                       178:       
                       179:       end --}
                       180:       
                       181:     end --}
                       182:     
                       183:   str["开局说明"] = str["这个残局的效果卡数量"]
                       184:   .. "卡 "
                       185:   .. str["规则"]
                       186:   
                       187:   if str["不洗牌"] == 0 then --{
                       188:     
                       189:     --}
                       190:     
                       191:   else --{
                       192:     
                       193:     str["开局说明"] = str["开局说明"] .. "伪洗牌 "
                       194:     
                       195:     end --}
                       196:     
                       197:   if str["无BP"] == 0 then --{
                       198:     
                       199:     str["开局说明"] = str["开局说明"] .. "无BP "
                       200:     
                       201:     end --}
                       202:     
                       203:   if str["开局添加手卡"] then --{
                       204:     
                       205:     str["开局说明"] = str["开局说明"]
                       206:     .. "选"
                       207:     .. str["开局添加手卡的数量"]
                       208:     .. "卡 "
                       209:     
                       210:     end --}
                       211:     
                       212:   if str["禁格"] then --{
                       213:     
                       214:     str["开局说明"] = str["开局说明"]
                       215:     .. "禁"
                       216:     .. str["禁格的数量"]
                       217:     .. "格 "
                       218:     
                       219:     end --}
                       220:     
                       221:   if str["随机抽卡的数量"] then --{
                       222:     
                       223:     str["开局说明"] = str["开局说明"]
                       224:     .. "抽"
                       225:     .. str["随机抽卡的数量"]
                       226:     .. "卡 "
                       227:     end --}
                       228:     
                       229:   Debug.ShowHint(str["开局说明"])
                       230:   
                       231:   end --}
                       232: 
                       233: --兼容层-------------------------------
                       234: 
                       235: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
                       236: 
                       237: Debug.ReloadFieldBegin = function(str_1, str_2) --{
                       238:   
                       239:   str["不洗牌"] = str_1 & DUEL_PSEUDO_SHUFFLE
                       240:   
                       241:   str["无BP"] = str_1 & DUEL_ATTACK_FIRST_TURN
                       242:   
                       243:   str["规则表"] = {
                       244:     
                       245:     [3] = "大师3 "
                       246:     , [4] = "新大师 "
                       247:     , [5] = "大师2020 "
                       248:     }
                       249:     
                       250:   if str_2 then --{
                       251:     
                       252:     str["规则"] = str["规则表"][str_2]
                       253:     
                       254:     --}
                       255:     
                       256:   else --{
                       257:     
                       258:     str["规则"] = str["规则表"][5]
                       259:     
                       260:     end --}
                       261:     
                       262:   fun["Debug.ReloadFieldBegin"](str_1, str_2)
                       263:   
                       264:   end --}
                       265:   
                       266: fun["Debug.ReloadFieldEnd"] = Debug.ReloadFieldEnd
                       267: 
                       268: Debug.ReloadFieldEnd = function(str_1) --{
                       269:   
                       270:   fun["Debug.ReloadFieldEnd"]()
                       271:   
                       272:   if str_1 then --{
                       273:     
                       274:     fun["随机抽卡"](str_1)
                       275:     
                       276:     end --}
                       277:     
                       278:   end --}
                       279:   
                       280: fun["aux.BeginPuzzle"] = aux.BeginPuzzle
                       281: 
                       282: aux.BeginPuzzle = function(str_1, str_2) --{
                       283:   
                       284:   fun["aux.BeginPuzzle"]()
                       285:   
                       286:   if str_1 then --{
                       287:     
                       288:     fun["开局添加手卡"](str_1)
                       289:     
                       290:     end --}
                       291:     
                       292:   if str_2 then --{
                       293:     
                       294:     fun["禁格"](str_2)
                       295:     
                       296:     end --}
                       297:     
                       298:   fun["开局说明"]()
                       299:   
                       300:   fun["通关邀请"]()
                       301:   
                       302:   fun["失败得分"]()
                       303:   
                       304:   end --}
                       305:   
                       306: 
                       307:   
                       308: 
                       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: