游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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