游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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