游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 3e5c876e42 that are changed by the sequence of edits moving toward check-in 9f9e2c9f7f:

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