游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 03f04117d2 that are changed by the sequence of edits moving toward check-in ddbc332f5e:

                         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:   effect_1 = Effect.GlobalEffect()
                       131:   
                       132:   effect_1:SetType(EFFECT_TYPE_FIELD
                       133:   + EFFECT_TYPE_CONTINUOUS)
                       134:   
                       135:   effect_1: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:   effect_1:SetCondition(cache_1)
                       166:   
                       167:   effect_1:SetOperation(aux.NULL)
                       168:   
                       169:   Duel.RegisterEffect(effect_1
                       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["规则"]
                       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:     .. "选"
03f04117d2 2023-07-23  266:     str["开局说明"] = str["开局说明"] .. str["开局添加手卡"]
03f04117d2 2023-07-23  267:     str["开局说明"] = str["开局说明"] .. str["选卡的后缀"]
                       268:     
                       269:     end --}
                       270:     
                       271:   if str["禁格"] then --{
                       272:     
                       273:     str["开局说明"] = str["开局说明"] .. str["禁格的前缀"]
                       274:     str["开局说明"] = str["开局说明"] .. str["禁格"]
                       275:     str["开局说明"] = str["开局说明"] .. str["禁格的后缀"]
                       276:     
                       277:     end --}
                       278:     
                       279:   if str["随机抽卡的数量"] then --{
                       280:     
                       281:     str["开局说明"] = str["开局说明"] .. str["随机抽卡的前缀"]
                       282:     str["开局说明"] = str["开局说明"] .. str["随机抽卡的数量"]
                       283:     str["开局说明"] = str["开局说明"] .. str["随机抽卡的后缀"]
                       284:     end --}
                       285:     
                       286:   Debug.ShowHint(str["开局说明"])
                       287:   
                       288:   end --}
                       289:   
                       290: fun["开局添加手卡"] = function(str_1) --{
                       291:   
                       292:   str["开局添加手卡"] = str_1
                       293:   
                       294:   effect_1 = Effect.GlobalEffect()
                       295:   
                       296:   effect_1:SetType(EFFECT_TYPE_FIELD
                       297:   + EFFECT_TYPE_CONTINUOUS)
                       298:   
                       299:   effect_1:SetCode(EVENT_ADJUST)
                       300:   
                       301:   effect_1:SetCondition(aux.TRUE)
                       302:   
                       303:   function cache_1(effect_event
                       304:   , player_who_activate_the_effect) --{
                       305:     
                       306:     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
                       307:     , Card.IsAbleToHand
                       308:     , player_who_activate_the_effect
                       309:     , LOCATION_DECK
                       310:     , 0
                       311:     , str_1
                       312:     , str_1
                       313:     , nil)
                       314:     
                       315:     Duel.SendtoHand(str["玩家选定的卡"]
                       316:     , nil
                       317:     , REASON_RULE)
                       318:     
                       319:     effect_event:Reset()
                       320:     
                       321:     end --}
                       322:     
                       323:   effect_1:SetOperation(cache_1)
                       324:   
                       325:   Duel.RegisterEffect(effect_1
                       326:   , 0)
                       327:   
                       328:   end --}
                       329:   
                       330: fun["禁格"] = function(str_1) --{
                       331:   
                       332:   str["禁格"] = str_1
                       333:   
                       334:   effect_1 = Effect.GlobalEffect()
                       335:   
                       336:   effect_1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       337:   
                       338:   effect_1:SetValue(str_1)
                       339:   
                       340:   Duel.RegisterEffect(effect_1,0)
                       341:   
                       342:   end --}
                       343:   
                       344: fun["印卡"] = function(str_1, str_2, str_3) --{
                       345:   
                       346:   if str_3 then --{
                       347:     
                       348:     --}
                       349:     
                       350:   else --{
                       351:     
                       352:     str_3 = str_2
                       353:     
                       354:     end --}
                       355:     
                       356:   str["印卡弹窗1"] = str["印卡弹窗1"] .. str_2
                       357:   str["印卡弹窗1"] = str["印卡弹窗1"] .. str["印卡弹窗2"]
                       358:   str["印卡弹窗1"] = str["印卡弹窗1"] .. str_3
                       359:   str["印卡弹窗1"] = str["印卡弹窗1"] .. str["印卡弹窗3"]
                       360:   
                       361:   Debug.ShowHint(str["印卡弹窗1"])
                       362:   
                       363:   effect_1 = Effect.CreateEffect(str_1)
                       364:   
                       365:   str["当前印卡数"] = 1
                       366:   
                       367:   effect_1:SetType(EFFECT_TYPE_IGNITION)
                       368:   
                       369:   effect_1:SetProperty(EFFECT_FLAG_BOTH_SIDE
                       370:   + EFFECT_FLAG_UNCOPYABLE
                       371:   + EFFECT_FLAG_CANNOT_NEGATE
                       372:   + EFFECT_FLAG_CANNOT_DISABLE)
                       373:   
                       374:   cache_1 = function() --{
                       375:     
                       376:     Duel.SetChainLimit(aux.FALSE)
                       377:     
                       378:     return true
                       379:     
                       380:     end --}
                       381:     
                       382:   effect_1:SetTarget(cache_1)
                       383:   
                       384:   effect_1:SetRange(LOCATION_EXTRA)
                       385:   
                       386:   function print_hand(effect_event
                       387:   , player_who_activate_the_effect) --{
                       388:     
                       389:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
                       390:     
                       391:     card = Duel.CreateToken(player_who_activate_the_effect
                       392:     , announce_card)
                       393:     
                       394:     if str["当前印卡数"] <= str_2 then --{
                       395:       
                       396:       str["当前印卡数"] = str["当前印卡数"] + 1
                       397:       
                       398:       Duel.SendtoHand(card,nil,REASON_RULE)
                       399:       
                       400:       --}
                       401:       
                       402:     else --{
                       403:       
                       404:       if str["当前印卡数"] <= str_3 then --{
                       405:         
                       406:         str["当前印卡数"] = str["当前印卡数"] + 1
                       407:         
                       408:         Duel.Remove(card,POS_FACEUP,REASON_RULE)
                       409:         
                       410:         Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
                       411:         
                       412:         --}
                       413:         
                       414:       else --{
                       415:         
                       416:         Debug.ShowHint(str["印卡过多的弹窗"])
                       417:         
                       418:         effect_event:Reset()
                       419:         
                       420:         end --}
                       421:         
                       422:       end --}
                       423:       
                       424:     end --}
                       425:     
                       426:   effect_1:SetOperation(print_hand)
                       427:   
                       428:   str_1:RegisterEffect(effect_1)
                       429:   
                       430:   end --}
                       431:   
                       432: fun["随机抽卡"] = function(str_1) --{
                       433:   
                       434:   str["随机抽卡的数量"] = str_1
                       435:   
                       436:   effect_1 = Effect.GlobalEffect()
                       437:   
                       438:   effect_1:SetType(EFFECT_TYPE_FIELD
                       439:   + EFFECT_TYPE_CONTINUOUS)
                       440:   
                       441:   effect_1:SetCode(EVENT_ADJUST)
                       442:   
                       443:   effect_1:SetCondition(aux.TRUE)
                       444:   
                       445:   function cache_1(effect_event
                       446:   , player_who_activate_the_effect) --{
                       447:     
                       448:     Duel.ShuffleDeck(0)
                       449:     
                       450:     Duel.Draw(0,str_1,REASON_RULE)
                       451:     
                       452:     effect_event:Reset()
                       453:     
                       454:     end --}
                       455:     
                       456:   effect_1:SetOperation(cache_1)
                       457:   
                       458:   Duel.RegisterEffect(effect_1
                       459:   , 0)
                       460:   
                       461:   end --}
                       462: