游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

                         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) --{
                       148:   
                       149:   cache_1 = #str["效果卡的种类表"]
                       150:   
                       151:   for i = 1, cache_1 do --{
                       152:     
                       153:     cache_1 = Card.IsType(card, str["效果卡的种类表"][i])
                       154:     
                       155:     if cache_1 then --{
                       156:       
                       157:       return true
                       158:       end --}
                       159:       
                       160:     end --}
                       161:     
                       162:   cache_1 = Card.IsType(card, TYPE_PENDULUM)
                       163:   
                       164:   if cache_1 then --{
                       165:     
add769c64d 2023-07-19  166:     cache_1 = Card.IsCode(card, 28363749)
add769c64d 2023-07-19  167:     
add769c64d 2023-07-19  168:     cache_2 = Card.IsCode(card, 19474136)
add769c64d 2023-07-19  169:     
add769c64d 2023-07-19  170:     cache_3 = Card.IsCode(card, 17390179)
add769c64d 2023-07-19  171:     
add769c64d 2023-07-19  172:     cache_4 = Card.IsCode(card, 83980492)
add769c64d 2023-07-19  173:     
add769c64d 2023-07-19  174:     if cache_1
add769c64d 2023-07-19  175:     or cache_2
add769c64d 2023-07-19  176:     or cache_3
add769c64d 2023-07-19  177:     or cache_4 then --{
add769c64d 2023-07-19  178:       
add769c64d 2023-07-19  179:       --}
add769c64d 2023-07-19  180:       
add769c64d 2023-07-19  181:     else --{
add769c64d 2023-07-19  182:       
add769c64d 2023-07-19  183:       return true
add769c64d 2023-07-19  184:       
                       185:       end --}
                       186:       
                       187:     end --}
                       188:     
                       189:   return false
                       190:   
                       191:   end --}
                       192:   
                       193: fun["开局说明"] = function() --{
                       194:   
                       195:   str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"],0,str["所有区域"],str["所有区域"],nil)
                       196:   
                       197:   cache_1 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
                       198:   
                       199:   for k in aux.Next(cache_1) do --{
                       200:     
                       201:     cache_1 = fun["是否效果卡"](k)
                       202:     
                       203:     if cache_1 then --{
                       204:       
                       205:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
                       206:       
                       207:       end --}
                       208:       
                       209:     end --}
                       210:     
                       211:   str["开局说明"] = ""
                       212:   str["开局说明"] = str["开局说明"] .. str["这个残局的效果卡数量"]
                       213:   str["开局说明"] = str["开局说明"] .. "卡 "
                       214:   str["开局说明"] = str["开局说明"] .. str["规则"]
                       215:   
                       216:   if str["不洗牌"] == 0 then --{
                       217:     
                       218:     --}
                       219:     
                       220:   else --{
                       221:     
                       222:     str["开局说明"] = str["开局说明"] .. "伪洗牌 "
                       223:     
                       224:     end --}
                       225:     
                       226:   if str["无BP"] == 0 then --{
                       227:     
                       228:     str["开局说明"] = str["开局说明"] .. "无BP "
                       229:     
                       230:     end --}
                       231:     
                       232:   if str["开局添加手卡"] then --{
                       233:     
                       234:     str["开局说明"] = str["开局说明"] .. "选"
                       235:     str["开局说明"] = str["开局说明"] .. str["开局添加手卡"]
                       236:     str["开局说明"] = str["开局说明"] .. "卡 "
                       237:     
                       238:     end --}
                       239:     
                       240:   if str["禁格"] then --{
                       241:     
                       242:     str["开局说明"] = str["开局说明"] .. "禁"
                       243:     str["开局说明"] = str["开局说明"] .. str["禁格"]
                       244:     str["开局说明"] = str["开局说明"] .. "格 "
                       245:     
                       246:     end --}
                       247:     
                       248:   if str["印卡"] then --{
                       249:     
                       250:     str["开局说明"] = str["开局说明"] .. "印卡 "
                       251:     
                       252:     end --}
                       253:     
                       254:   Debug.ShowHint(str["开局说明"])
                       255:   
                       256:   end --}
                       257:   
                       258: fun["开局添加手卡"] = function(str_1) --{
                       259:   
                       260:   str["开局添加手卡"] = str_1
                       261:   
                       262:   effect_1 = Effect.GlobalEffect()
                       263:   
                       264:   effect_1:SetType(EFFECT_TYPE_FIELD
                       265:   + EFFECT_TYPE_CONTINUOUS)
                       266:   
                       267:   effect_1:SetCode(EVENT_ADJUST)
                       268:   
                       269:   effect_1:SetCondition(aux.TRUE)
                       270:   
                       271:   function cache_1(effect_event
                       272:   , player_who_activate_the_effect) --{
                       273:     
                       274:     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
                       275:     , Card.IsAbleToHand
                       276:     , player_who_activate_the_effect
                       277:     , LOCATION_DECK
                       278:     , 0
                       279:     , str_1
                       280:     , str_1
                       281:     , nil)
                       282:     
                       283:     Duel.SendtoHand(str["玩家选定的卡"]
                       284:     , nil
                       285:     , REASON_RULE)
                       286:     
                       287:     effect_event:Reset()
                       288:     
                       289:     end --}
                       290:     
                       291:   effect_1:SetOperation(cache_1)
                       292:   
                       293:   Duel.RegisterEffect(effect_1
                       294:   , 0)
                       295:   
                       296:   end --}
                       297:   
                       298: fun["禁格"] = function(str_1) --{
                       299:   
                       300:   str["禁格"] = str_1
                       301:   
                       302:   effect_1 = Effect.GlobalEffect()
                       303:   
                       304:   effect_1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       305:   
                       306:   effect_1:SetValue(str_1)
                       307:   
                       308:   Duel.RegisterEffect(effect_1,0)
                       309:   
                       310:   end --}
                       311:   
                       312: fun["印卡"] = function(str_1, str_2, str_3) --{
                       313:   
                       314:   str["印卡"] = 1
                       315:   
                       316:   if str_3 then --{
                       317:     
                       318:     --}
                       319:     
                       320:   else --{
                       321:     
                       322:     str_3 = str_2
                       323:     
                       324:     end --}
                       325:     
                       326:   str["当前印卡数"] = 1
                       327:   
                       328:   effect_1 = Effect.CreateEffect(str_1)
                       329:   
                       330:   effect_1:SetType(EFFECT_TYPE_IGNITION)
                       331:   
                       332:   effect_1:SetProperty(EFFECT_FLAG_BOTH_SIDE
                       333:   + EFFECT_FLAG_UNCOPYABLE
                       334:   + EFFECT_FLAG_CANNOT_NEGATE
                       335:   + EFFECT_FLAG_CANNOT_DISABLE)
                       336:   
                       337:   cache_1 = function() --{
                       338:     
                       339:     Duel.SetChainLimit(aux.FALSE)
                       340:     
                       341:     return true
                       342:     
                       343:     end --}
                       344:     
                       345:   effect_1:SetTarget(cache_1)
                       346:   
                       347:   effect_1:SetRange(LOCATION_EXTRA)
                       348:   
                       349:   function print_hand(effect_event
                       350:   , player_who_activate_the_effect) --{
                       351:     
                       352:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
                       353:     
                       354:     card = Duel.CreateToken(player_who_activate_the_effect
                       355:     , announce_card)
                       356:     
                       357:     if str["当前印卡数"] <= str_2 then --{
                       358:       
                       359:       str["当前印卡数"] = str["当前印卡数"] + 1
                       360:       
                       361:       Duel.SendtoHand(card,nil,REASON_RULE)
                       362:       
                       363:       --}
                       364:       
                       365:     else --{
                       366:       
                       367:       if str["当前印卡数"] <= str_3 then --{
                       368:         
                       369:         str["当前印卡数"] = str["当前印卡数"] + 1
                       370:         
                       371:         Duel.Remove(card,POS_FACEUP,REASON_RULE)
                       372:         
                       373:         Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
                       374:         
                       375:         --}
                       376:         
                       377:       else --{
                       378:         
                       379:         Debug.ShowHint("印卡过多!")
                       380:         
                       381:         effect_event:Reset()
                       382:         
                       383:         end --}
                       384:         
                       385:       end --}
                       386:       
                       387:     end --}
                       388:     
                       389:   effect_1:SetOperation(print_hand)
                       390:   
                       391:   str_1:RegisterEffect(effect_1)
                       392:   
                       393:   end --}
                       394:   
                       395: fun["全部回到卡组"] = function() --{
                       396:   
                       397:   Debug.ShowHint("胜利条件:让对方的卡回到卡组。")
                       398:   
                       399:   effect_1 = Effect.GlobalEffect()
                       400:   
                       401:   effect_1:SetType(EFFECT_TYPE_FIELD
                       402:   + EFFECT_TYPE_CONTINUOUS)
                       403:   
                       404:   effect_1:SetCode(EVENT_ADJUST)
                       405:   
                       406:   cache_1 = function() --{
                       407:     
                       408:     cache_1 = Duel.GetFieldGroupCount(1,str["除卡组与额外卡组以外的区域"],0)
                       409:     
                       410:     if cache_1 == 0 then --{
                       411:       
                       412:       return true
                       413:       
                       414:       --}
                       415:       
                       416:     else --{
                       417:       
                       418:       return false
                       419:       
                       420:       end --}
                       421:       
                       422:     end --}
                       423:     
                       424:   effect_1:SetCondition(cache_1)
                       425:   
                       426:   cache_1 = function() --{
                       427:     
                       428:     Debug.ShowHint("目标已达成!")
                       429:     
                       430:     Duel.SetLP(1,0)
                       431:     
                       432:     end --}
                       433:     
                       434:   effect_1:SetOperation(cache_1)
                       435:   
                       436:   Duel.RegisterEffect(effect_1,0)
                       437:   
                       438:   end --}
                       439: