游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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