游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 626009b1d8 that are changed by the sequence of edits moving toward check-in 6bc1a4dce2:

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