游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 9a1184f29f that are changed by the sequence of edits moving toward check-in 0852ed07b8:

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