游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

                         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["规则"] = ""
                        22: str["大师3"] = "大师3 "
                        23: str["新大师"] = "新大师 "
                        24: str["大师2020"] = "大师2020 "
                        25: 
                        26: str["不洗牌"] = false
                        27: str["无BP"] = false
                        28: 
d284579690 2023-07-19   29: str["开局说明"] = ""
d284579690 2023-07-19   30: str["这个残局的效果卡数量"] = 0
d284579690 2023-07-19   31: 
d284579690 2023-07-19   32: str["效果卡数量的后缀"] = "卡 "
                        33: str["不洗牌的说明"] = "伪洗牌 "
                        34: str["无BP的说明"] = "无BP "
                        35: 
                        36: str["开局添加手卡"] = false
                        37: str["选卡的前缀"] = "选"
                        38: str["选卡的后缀"] = "卡 "
                        39: 
                        40: 
                        41: str["胜利条件表"] = {}
                        42: 
                        43: str["胜利条件表"][0] = false
                        44: str["胜利条件表"][1] = "胜利条件:让对方的卡全部回到卡组·额外卡组。"
                        45: 
                        46: str["达成胜利条件弹窗"] = "目标已达成!"
                        47: 
                        48: str["效果卡的种类表"] = {}
                        49: 
                        50: str["效果卡的种类表"][1] = TYPE_SPELL
                        51: str["效果卡的种类表"][2] = TYPE_TRAP
                        52: str["效果卡的种类表"][3] = TYPE_EFFECT
                        53: 
                        54: str["无效果灵摆怪兽表"] = {}
                        55: 
                        56: str["无效果灵摆怪兽表"][1] = 28363749
                        57: str["无效果灵摆怪兽表"][2] = 19474136
                        58: str["无效果灵摆怪兽表"][3] = 17390179
                        59: str["无效果灵摆怪兽表"][4] = 83980492
                        60: 
                        61: cache_1 = 0
                        62: 
                        63: cache_1 = cache_1 + LOCATION_HAND
                        64: cache_1 = cache_1 + LOCATION_MZONE
                        65: cache_1 = cache_1 + LOCATION_SZONE
                        66: cache_1 = cache_1 + LOCATION_GRAVE
                        67: cache_1 = cache_1 + LOCATION_REMOVED
                        68: 
                        69: str["除卡组与额外卡组以外的区域"] = cache_1
                        70: 
                        71: cache_1 = cache_1 + LOCATION_DECK
                        72: cache_1 = cache_1 + LOCATION_EXTRA
                        73: 
                        74: str["所有区域"] = cache_1
                        75: 
                        76: fun["Debug.ReloadFieldBegin"] = Debug.ReloadFieldBegin
                        77: 
                        78: Debug.ReloadFieldBegin = function(str_1, str_2) --{
                        79:   
                        80:   str["不洗牌"] = str_1 & DUEL_PSEUDO_SHUFFLE
                        81:   
                        82:   str["无BP"] = str_1 & DUEL_ATTACK_FIRST_TURN
                        83:   
                        84:   if str_2 then --{
                        85:     
                        86:     if str_2 == 3 then --{
                        87:       
                        88:       str["规则"] = str["大师3"]
                        89:       
                        90:       --}
                        91:       
                        92:     elseif str_2 == 4 then --{
                        93:       
                        94:       str["规则"] = str["新大师"]
                        95:       
                        96:       --}
                        97:       
                        98:     elseif str_2 == 5 then --{
                        99:       
                       100:       str["规则"] = str["大师2020"]
                       101:       
                       102:       --}
                       103:       
                       104:     end --}
                       105:     
                       106:   else --{
                       107:     
                       108:     str["规则"] = str["大师2020"]
                       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:     Debug.ShowHint(str["胜利条件表"][0])
                       124:     end --}
                       125:   
                       126:   fun["开局说明"]()
                       127:   
                       128:   fun["通关邀请"]()
                       129:   
                       130:   end --}
                       131:   
                       132: fun["通关邀请"] = function() --{
                       133:   
                       134:   effect_1 = Effect.GlobalEffect()
                       135:   
                       136:   effect_1:SetType(EFFECT_TYPE_FIELD
                       137:   + EFFECT_TYPE_CONTINUOUS)
                       138:   
                       139:   effect_1:SetCode(EVENT_DAMAGE)
                       140:   
                       141:   function cache_1() --{
                       142:     
                       143:     cache_1 = Duel.GetLP(1)
                       144:     
                       145:     if cache_1 <= 0 then --{
                       146:       
                       147:       if cache_1 == 0 then --{
                       148:         
                       149:         --}
                       150:         
                       151:       else  --{
                       152:         
                       153:         Debug.ShowHint(str["二解弹窗"])
                       154:         
                       155:         end --}
                       156:         
                       157:       Debug.ShowHint(str["原解弹窗"])
                       158:       
                       159:       --}
                       160:       
                       161:     else --{
                       162:       
                       163:       return false
                       164:       
                       165:       end --}
                       166:       
                       167:     end --}
                       168:     
                       169:   effect_1:SetCondition(cache_1)
                       170:   
                       171:   effect_1:SetOperation(aux.NULL)
                       172:   
                       173:   Duel.RegisterEffect(effect_1
                       174:   , 0)
                       175:   
                       176:   end --}
                       177:   
                       178: fun["是否效果卡"] = function(card) --{
                       179:   
                       180:   cache_1 = #str["效果卡的种类表"]
                       181:   
                       182:   for i = 1, cache_1 do --{
                       183:     
                       184:     cache_1 = Card.IsType(card, str["效果卡的种类表"][i])
                       185:     
                       186:     if cache_1 then --{
                       187:       
                       188:       return true
                       189:       end --}
                       190:       
                       191:     end --}
                       192:     
                       193:   cache_1 = Card.IsType(card, TYPE_PENDULUM)
                       194:   
                       195:   if cache_1 then --{
                       196:     
                       197:     cache_1 = #str["无效果灵摆怪兽表"]
                       198:     
                       199:     for i = 1, cache_1 do --{
                       200:       
                       201:       cache_1 = Card.IsCode(card, str["无效果灵摆怪兽表"][i])
                       202:       
                       203:       if cache_1 then --{
                       204:         
                       205:         --}
                       206:         
                       207:       else  --{
                       208:         
                       209:         return true
                       210:         
                       211:         end --}
                       212:         
                       213:       end --}
                       214:       
                       215:     end --}
                       216:     
                       217:   return false
                       218:   
                       219:   end --}
                       220:   
                       221: fun["开局说明"] = function() --{
                       222:   
                       223:   str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"],0,str["所有区域"],str["所有区域"],nil)
                       224:   
                       225:   cache_1 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
                       226:   
                       227:   for k in aux.Next(cache_1) do --{
                       228:     
                       229:     cache_1 = fun["是否效果卡"](k)
                       230:     
                       231:     if cache_1 then --{
                       232:       
                       233:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
                       234:       
                       235:       end --}
                       236:       
                       237:     end --}
                       238:     
                       239:   
                       240:   str["开局说明"] = str["开局说明"] .. str["这个残局的效果卡数量"]
                       241:   str["开局说明"] = str["开局说明"] .. str["效果卡数量的后缀"]
                       242:   
                       243:   str["开局说明"] = str["开局说明"] .. str["规则"]
                       244:   
                       245:   if str["不洗牌"] == 0 then --{
                       246:     
                       247:     --}
                       248:     
                       249:   else --{
                       250:     
                       251:     str["开局说明"] = str["开局说明"] .. str["不洗牌的说明"]
                       252:     
                       253:     end --}
                       254:     
                       255:   if str["无BP"] == 0 then --{
                       256:     
                       257:     str["开局说明"] = str["开局说明"] .. str["无BP的说明"]
                       258:     
                       259:     end --}
                       260:     
                       261:   if str["开局添加手卡"] then --{
                       262:     
                       263:     str["开局说明"] = str["开局说明"] .. str["选卡的前缀"]
                       264:     str["开局说明"] = str["开局说明"] .. str["开局添加手卡"]
                       265:     str["开局说明"] = str["开局说明"] .. str["选卡的后缀"]
                       266:     
                       267:     end --}
                       268:     
                       269:   if str["禁格"] then --{
                       270:     
                       271:     str["开局说明"] = str["开局说明"] .. "禁"
                       272:     str["开局说明"] = str["开局说明"] .. str["禁格"]
                       273:     str["开局说明"] = str["开局说明"] .. "格 "
                       274:     
                       275:     end --}
                       276:     
                       277:   if str["印卡"] then --{
                       278:     
                       279:     str["开局说明"] = str["开局说明"] .. "印卡 "
                       280:     
                       281:     end --}
                       282:     
                       283:   Debug.ShowHint(str["开局说明"])
                       284:   
                       285:   end --}
                       286:   
                       287: fun["开局添加手卡"] = function(str_1) --{
                       288:   
                       289:   str["开局添加手卡"] = str_1
                       290:   
                       291:   effect_1 = Effect.GlobalEffect()
                       292:   
                       293:   effect_1:SetType(EFFECT_TYPE_FIELD
                       294:   + EFFECT_TYPE_CONTINUOUS)
                       295:   
                       296:   effect_1:SetCode(EVENT_ADJUST)
                       297:   
                       298:   effect_1:SetCondition(aux.TRUE)
                       299:   
                       300:   function cache_1(effect_event
                       301:   , player_who_activate_the_effect) --{
                       302:     
                       303:     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
                       304:     , Card.IsAbleToHand
                       305:     , player_who_activate_the_effect
                       306:     , LOCATION_DECK
                       307:     , 0
                       308:     , str_1
                       309:     , str_1
                       310:     , nil)
                       311:     
                       312:     Duel.SendtoHand(str["玩家选定的卡"]
                       313:     , nil
                       314:     , REASON_RULE)
                       315:     
                       316:     effect_event:Reset()
                       317:     
                       318:     end --}
                       319:     
                       320:   effect_1:SetOperation(cache_1)
                       321:   
                       322:   Duel.RegisterEffect(effect_1
                       323:   , 0)
                       324:   
                       325:   end --}
                       326:   
                       327: fun["禁格"] = function(str_1) --{
                       328:   
                       329:   str["禁格"] = str_1
                       330:   
                       331:   effect_1 = Effect.GlobalEffect()
                       332:   
                       333:   effect_1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       334:   
                       335:   effect_1:SetValue(str_1)
                       336:   
                       337:   Duel.RegisterEffect(effect_1,0)
                       338:   
                       339:   end --}
                       340:   
                       341: fun["印卡"] = function(str_1, str_2, str_3) --{
                       342:   
                       343:   str["印卡"] = 1
                       344:   
                       345:   if str_3 then --{
                       346:     
                       347:     --}
                       348:     
                       349:   else --{
                       350:     
                       351:     str_3 = str_2
                       352:     
                       353:     end --}
                       354:     
                       355:   str["当前印卡数"] = 1
                       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("印卡过多!")
                       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: