游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 0912fe4f22 that are changed by the sequence of edits moving toward check-in 7282130e6b:

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