游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 6efb524b73 that are changed by the sequence of edits moving toward check-in 9a271771c6:

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