游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 0d5ba0fc61 that are changed by the sequence of edits moving toward check-in 154313a5bc:

                         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 i
                        15: 
                        16: _G.fun = {}
                        17: 
                        18: ---------------------------------
                        19: 
                        20: str["二解弹窗"] = "QB:「你居然二解了,请加群告诉我怎么二解。」"
                        21: str["原解弹窗"] = "残局群181175613"
                        22: 
                        23: str["规则"] = ""
                        24: 
                        25: str["规则表"] = {}
                        26: str["规则表"][3] = "大师3 "
                        27: str["规则表"][4] = "新大师 "
                        28: str["规则表"][5] = "大师2020 "
                        29: 
                        30: str["印卡过多的弹窗"] = "印卡过多!"
                        31: 
                        32: str["印卡弹窗1"] = "点击对方额外卡组可以进行印卡。\n手卡只能印 "
                        33: str["印卡弹窗2"] = " 张。\n最多可以印 "
                        34: str["印卡弹窗3"] = " 张"
                        35: 
                        36: str["不洗牌的说明"] = "伪洗牌 "
                        37: str["无BP的说明"] = "无BP "
                        38: 
                        39: str["效果卡数量的后缀"] = "卡 "
                        40: 
                        41: str["选卡的前缀"] = "选"
                        42: str["选卡的后缀"] = "卡 "
                        43: 
                        44: str["禁格的前缀"] = "禁"
                        45: str["禁格的后缀"] = "格 "
                        46: 
                        47: str["效果卡的种类表"] = {}
                        48: 
                        49: str["效果卡的种类表"][1] = TYPE_SPELL
                        50: str["效果卡的种类表"][2] = TYPE_TRAP
                        51: str["效果卡的种类表"][3] = TYPE_EFFECT
                        52: 
                        53: str["无效果灵摆怪兽表"] = {}
                        54: 
                        55: str["无效果灵摆怪兽表"][1] = 28363749
                        56: str["无效果灵摆怪兽表"][2] = 19474136
                        57: str["无效果灵摆怪兽表"][3] = 17390179
                        58: str["无效果灵摆怪兽表"][4] = 83980492
                        59: 
                        60: cache_1 = 0
                        61: 
                        62: cache_1 = cache_1 + LOCATION_HAND
                        63: cache_1 = cache_1 + LOCATION_MZONE
                        64: cache_1 = cache_1 + LOCATION_SZONE
                        65: cache_1 = cache_1 + LOCATION_GRAVE
                        66: cache_1 = cache_1 + LOCATION_REMOVED
                        67: 
                        68: str["除卡组与额外卡组以外的区域"] = cache_1
                        69: 
                        70: cache_1 = cache_1 + LOCATION_DECK
                        71: cache_1 = cache_1 + LOCATION_EXTRA
                        72: 
                        73: str["所有区域"] = cache_1
                        74: 
                        75: str["随机抽卡的前缀"] = "抽"
                        76: str["随机抽卡的后缀"] = "卡 "
                        77: 
                        78: ---------------------------------
                        79: 
                        80: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
                        81: 
                        82: Debug.ReloadFieldBegin = function(str_1, str_2) --{
                        83:   
                        84:   str["不洗牌"] = str_1 & DUEL_PSEUDO_SHUFFLE
                        85:   
                        86:   str["无BP"] = str_1 & DUEL_ATTACK_FIRST_TURN
                        87:   
                        88:   if str_2 then --{
                        89:     
                        90:     str["规则"] = str["规则表"][str_2]
                        91:     
                        92:     --}
                        93:     
                        94:   else --{
                        95:     
                        96:     str["规则"] = str["规则表"][5]
                        97:     
                        98:     end --}
                        99:     
                       100:   fun["Debug.ReloadFieldBegin"](str_1, str_2)
                       101:   
                       102:   end --}
                       103:   
                       104: fun["aux.BeginPuzzle"] = aux.BeginPuzzle
                       105: 
                       106: aux.BeginPuzzle = function(str_1, str_2) --{
                       107:   
                       108:   fun["aux.BeginPuzzle"]()
                       109:   
                       110:   if str_1 then --{
                       111:     
                       112:     fun["开局添加手卡"](str_1)
                       113:     
                       114:     end --}
                       115:     
                       116:   if str_2 then --{
                       117:     
                       118:     fun["禁格"](str_2)
                       119:     
                       120:     end --}
                       121:     
                       122:   fun["开局说明"]()
                       123:   
                       124:   fun["通关邀请"]()
                       125:   
                       126:   end --}
                       127:   
                       128: fun["通关邀请"] = function() --{
                       129:   
                       130:   str["效果"] = Effect.GlobalEffect()
                       131:   
                       132:   str["效果"]:SetType(EFFECT_TYPE_FIELD
                       133:   + EFFECT_TYPE_CONTINUOUS)
                       134:   
                       135:   str["效果"]:SetCode(EVENT_DAMAGE)
                       136:   
                       137:   function cache_1() --{
                       138:     
                       139:     cache_1 = Duel.GetLP(1)
                       140:     
                       141:     if cache_1 <= 0 then --{
                       142:       
                       143:       if cache_1 == 0 then --{
                       144:         
                       145:         --}
                       146:         
                       147:       else  --{
                       148:         
                       149:         Debug.ShowHint(str["二解弹窗"])
                       150:         
                       151:         end --}
                       152:         
                       153:       Debug.ShowHint(str["原解弹窗"])
                       154:       
                       155:       --}
                       156:       
                       157:     else --{
                       158:       
                       159:       return false
                       160:       
                       161:       end --}
                       162:       
                       163:     end --}
                       164:     
                       165:   str["效果"]:SetCondition(cache_1)
                       166:   
                       167:   str["效果"]:SetOperation(aux.NULL)
                       168:   
                       169:   Duel.RegisterEffect(str["效果"]
                       170:   , 0)
                       171:   
                       172:   end --}
                       173:   
                       174: fun["是否效果卡"] = function(card) --{
                       175:   
                       176:   cache_1 = #str["效果卡的种类表"]
                       177:   
                       178:   for i = 1, cache_1 do --{
                       179:     
                       180:     cache_1 = Card.IsType(card, str["效果卡的种类表"][i])
                       181:     
                       182:     if cache_1 then --{
                       183:       
                       184:       return true
                       185:       end --}
                       186:       
                       187:     end --}
                       188:     
                       189:   cache_1 = Card.IsType(card, TYPE_PENDULUM)
                       190:   
                       191:   if cache_1 then --{
                       192:     
                       193:     cache_1 = #str["无效果灵摆怪兽表"]
                       194:     
                       195:     for i = 1, cache_1 do --{
                       196:       
                       197:       cache_1 = Card.IsCode(card, str["无效果灵摆怪兽表"][i])
                       198:       
                       199:       if cache_1 then --{
                       200:         
                       201:         --}
                       202:         
                       203:       else  --{
                       204:         
                       205:         return true
                       206:         
                       207:         end --}
                       208:         
                       209:       end --}
                       210:       
                       211:     end --}
                       212:     
                       213:   return false
                       214:   
                       215:   end --}
                       216:   
                       217: fun["开局说明"] = function() --{
                       218:   
                       219:   str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"]
                       220:   , 0
                       221:   , str["所有区域"]
                       222:   , str["所有区域"]
                       223:   , nil)
                       224:   
                       225:   cache_1 = Duel.GetOverlayGroup(0
                       226:   , LOCATION_MZONE
                       227:   , LOCATION_MZONE)
                       228:   
                       229:   for k in aux.Next(cache_1) do --{
                       230:     
                       231:     cache_1 = fun["是否效果卡"](k)
                       232:     
                       233:     if cache_1 then --{
                       234:       
                       235:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
                       236:       
                       237:       end --}
                       238:       
                       239:     end --}
                       240:     
                       241:   str["开局说明"] = str["这个残局的效果卡数量"]
                       242:   .. "卡 "
                       243:   .. str["规则"]
0d5ba0fc61 2023-07-23  244: 
                       245:   
                       246:   if str["不洗牌"] == 0 then --{
                       247:     
                       248:     --}
                       249:     
                       250:   else --{
                       251:     
                       252:     str["开局说明"] = str["开局说明"] .. "伪洗牌 "
                       253:     
                       254:     end --}
                       255:     
                       256:   if str["无BP"] == 0 then --{
                       257:     
                       258:     str["开局说明"] = str["开局说明"] .. "无BP "
                       259:     
                       260:     end --}
                       261:     
                       262:   if str["开局添加手卡"] then --{
                       263:     
                       264:     str["开局说明"] = str["开局说明"]
                       265:     .. "选"
                       266:     .. str["开局添加手卡的数量"]
                       267:     .. "卡 "
                       268:     
                       269:     end --}
                       270:     
                       271:   if str["禁格"] then --{
                       272:     
                       273:     str["开局说明"] = str["开局说明"]
                       274:     .. "禁"
                       275:     .. str["禁格的数量"]
                       276:     .. "格 "
                       277:     
                       278:     end --}
                       279:     
                       280:   if str["随机抽卡的数量"] then --{
                       281:     
                       282:     str["开局说明"] = str["开局说明"]
                       283:     .. "抽"
                       284:     .. str["随机抽卡的数量"]
                       285:     .. "卡 "
                       286:     end --}
                       287:     
                       288:   Debug.ShowHint(str["开局说明"])
                       289:   
                       290:   end --}
                       291:   
                       292: fun["开局添加手卡"] = function(str_1) --{
                       293:   
                       294:   str["开局添加手卡的数量"] = str_1
                       295:   
                       296:   str["效果"] = Effect.GlobalEffect()
                       297:   
                       298:   str["效果"]:SetType(EFFECT_TYPE_FIELD
                       299:   + EFFECT_TYPE_CONTINUOUS)
                       300:   
                       301:   str["效果"]:SetCode(EVENT_ADJUST)
                       302:   
                       303:   str["效果"]:SetCondition(aux.TRUE)
                       304:   
                       305:   function cache_1(effect_event
                       306:   , player_who_activate_the_effect) --{
                       307:     
                       308:     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
                       309:     , Card.IsAbleToHand
                       310:     , player_who_activate_the_effect
                       311:     , LOCATION_DECK
                       312:     , 0
                       313:     , str_1
                       314:     , str_1
                       315:     , nil)
                       316:     
                       317:     Duel.SendtoHand(str["玩家选定的卡"]
                       318:     , nil
                       319:     , REASON_RULE)
                       320:     
                       321:     effect_event:Reset()
                       322:     
                       323:     end --}
                       324:     
                       325:   str["效果"]:SetOperation(cache_1)
                       326:   
                       327:   Duel.RegisterEffect(str["效果"]
                       328:   , 0)
                       329:   
                       330:   end --}
                       331:   
                       332: fun["禁格"] = function(str_1) --{
                       333:   
                       334:   str["禁格的数量"] = str_1
                       335:   
                       336:   str["效果"] = Effect.GlobalEffect()
                       337:   
                       338:   str["效果"]:SetCode(EFFECT_USE_EXTRA_MZONE)
                       339:   
                       340:   str["效果"]:SetValue(str_1)
                       341:   
                       342:   Duel.RegisterEffect(str["效果"],0)
                       343:   
                       344:   end --}
                       345:   
                       346: fun["印卡"] = function(str_1, str_2, str_3) --{
                       347:   
                       348:   if str_3 then --{
                       349:     
                       350:     --}
                       351:     
                       352:   else --{
                       353:     
                       354:     str_3 = str_2
                       355:     
                       356:     end --}
                       357:     
0d5ba0fc61 2023-07-23  358:   
0d5ba0fc61 2023-07-23  359:   
                       360:   Debug.ShowHint("点击对方额外卡组可以进行印卡。\n手卡只能印 "
                       361:   .. str_2
                       362:   .. " 张。\n最多可以印 "
                       363:   .. str_3
                       364:   .. " 张")
                       365:   
                       366:   str["效果"] = Effect.CreateEffect(str_1)
                       367:   
                       368:   str["当前印卡数"] = 1
                       369:   
                       370:   str["效果"]:SetType(EFFECT_TYPE_IGNITION)
                       371:   
                       372:   str["效果"]:SetProperty(EFFECT_FLAG_BOTH_SIDE
                       373:   + EFFECT_FLAG_UNCOPYABLE
                       374:   + EFFECT_FLAG_CANNOT_NEGATE
                       375:   + EFFECT_FLAG_CANNOT_DISABLE)
                       376:   
                       377:   cache_1 = function() --{
                       378:     
                       379:     Duel.SetChainLimit(aux.FALSE)
                       380:     
                       381:     return true
                       382:     
                       383:     end --}
                       384:     
                       385:   str["效果"]:SetTarget(cache_1)
                       386:   
                       387:   str["效果"]:SetRange(LOCATION_EXTRA)
                       388:   
                       389:   function print_hand(effect_event
                       390:   , player_who_activate_the_effect) --{
                       391:     
                       392:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
                       393:     
                       394:     card = Duel.CreateToken(player_who_activate_the_effect
                       395:     , announce_card)
                       396:     
                       397:     if str["当前印卡数"] <= str_2 then --{
                       398:       
                       399:       str["当前印卡数"] = str["当前印卡数"] + 1
                       400:       
                       401:       Duel.SendtoHand(card,nil,REASON_RULE)
                       402:       
                       403:       --}
                       404:       
                       405:     else --{
                       406:       
                       407:       if str["当前印卡数"] <= str_3 then --{
                       408:         
                       409:         str["当前印卡数"] = str["当前印卡数"] + 1
                       410:         
                       411:         Duel.Remove(card,POS_FACEUP,REASON_RULE)
                       412:         
                       413:         Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
                       414:         
                       415:         --}
                       416:         
                       417:       else --{
                       418:         
                       419:         Debug.ShowHint(str["印卡过多的弹窗"])
                       420:         
                       421:         effect_event:Reset()
                       422:         
                       423:         end --}
                       424:         
                       425:       end --}
                       426:       
                       427:     end --}
                       428:     
                       429:   str["效果"]:SetOperation(print_hand)
                       430:   
                       431:   str_1:RegisterEffect(str["效果"])
                       432:   
                       433:   end --}
                       434:   
                       435: fun["随机抽卡"] = function(str_1) --{
                       436:   
                       437:   str["随机抽卡的数量"] = str_1
                       438:   
                       439:   str["效果"] = Effect.GlobalEffect()
                       440:   
                       441:   str["效果"]:SetType(EFFECT_TYPE_FIELD
                       442:   + EFFECT_TYPE_CONTINUOUS)
                       443:   
                       444:   str["效果"]:SetCode(EVENT_ADJUST)
                       445:   
                       446:   str["效果"]:SetCondition(aux.TRUE)
                       447:   
                       448:   function cache_1(effect_event
                       449:   , player_who_activate_the_effect) --{
                       450:     
                       451:     Duel.ShuffleDeck(0)
                       452:     
                       453:     Duel.Draw(0,str_1,REASON_RULE)
                       454:     
                       455:     effect_event:Reset()
                       456:     
                       457:     end --}
                       458:     
                       459:   str["效果"]:SetOperation(cache_1)
                       460:   
                       461:   Duel.RegisterEffect(str["效果"]
                       462:   , 0)
                       463:   
                       464:   end --}
                       465: