游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

                         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["印卡"] = false
                        31: 
                        32: str["当前印卡数"] = 1
                        33: 
                        34: str["印卡过多的弹窗"] = "印卡过多!"
                        35: 
                        36: str["不洗牌"] = false
                        37: str["无BP"] = false
                        38: 
                        39: str["不洗牌的说明"] = "伪洗牌 "
                        40: str["无BP的说明"] = "无BP "
                        41: 
                        42: str["开局说明"] = false
                        43: 
                        44: str["这个残局的效果卡数量"] = 0
                        45: str["效果卡数量的后缀"] = "卡 "
                        46: 
                        47: str["开局添加手卡"] = false
                        48: str["选卡的前缀"] = "选"
                        49: str["选卡的后缀"] = "卡 "
                        50: 
                        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() --{
                       112:   
                       113:   fun["aux.BeginPuzzle"]()
                       114:   
                       115:   fun["开局说明"]()
                       116:   
                       117:   fun["通关邀请"]()
                       118:   
                       119:   end --}
                       120:   
                       121: fun["通关邀请"] = function() --{
                       122:   
                       123:   effect_1 = Effect.GlobalEffect()
                       124:   
                       125:   effect_1:SetType(EFFECT_TYPE_FIELD
                       126:   + EFFECT_TYPE_CONTINUOUS)
                       127:   
                       128:   effect_1:SetCode(EVENT_DAMAGE)
                       129:   
                       130:   function cache_1() --{
                       131:     
                       132:     cache_1 = Duel.GetLP(1)
                       133:     
                       134:     if cache_1 <= 0 then --{
                       135:       
                       136:       if cache_1 == 0 then --{
                       137:         
                       138:         --}
                       139:         
                       140:       else  --{
                       141:         
                       142:         Debug.ShowHint(str["二解弹窗"])
                       143:         
                       144:         end --}
                       145:         
                       146:       Debug.ShowHint(str["原解弹窗"])
                       147:       
                       148:       --}
                       149:       
                       150:     else --{
                       151:       
                       152:       return false
                       153:       
                       154:       end --}
                       155:       
                       156:     end --}
                       157:     
                       158:   effect_1:SetCondition(cache_1)
                       159:   
                       160:   effect_1:SetOperation(aux.NULL)
                       161:   
                       162:   Duel.RegisterEffect(effect_1
                       163:   , 0)
                       164:   
                       165:   end --}
                       166:   
                       167: fun["是否效果卡"] = function(card) --{
                       168:   
                       169:   cache_1 = #str["效果卡的种类表"]
                       170:   
                       171:   for i = 1, cache_1 do --{
                       172:     
                       173:     cache_1 = Card.IsType(card, str["效果卡的种类表"][i])
                       174:     
                       175:     if cache_1 then --{
                       176:       
                       177:       return true
                       178:       end --}
                       179:       
                       180:     end --}
                       181:     
                       182:   cache_1 = Card.IsType(card, TYPE_PENDULUM)
                       183:   
                       184:   if cache_1 then --{
                       185:     
                       186:     cache_1 = #str["无效果灵摆怪兽表"]
                       187:     
                       188:     for i = 1, cache_1 do --{
                       189:       
                       190:       cache_1 = Card.IsCode(card, str["无效果灵摆怪兽表"][i])
                       191:       
                       192:       if cache_1 then --{
                       193:         
                       194:         --}
                       195:         
                       196:       else  --{
                       197:         
                       198:         return true
                       199:         
                       200:         end --}
                       201:         
                       202:       end --}
                       203:       
                       204:     end --}
                       205:     
                       206:   return false
                       207:   
                       208:   end --}
                       209:   
                       210: fun["开局说明"] = function() --{
                       211:   
                       212:   str["这个残局的效果卡数量"] = Duel.GetMatchingGroupCount(fun["是否效果卡"],0,str["所有区域"],str["所有区域"],nil)
                       213:   
                       214:   cache_1 = Duel.GetOverlayGroup(0, LOCATION_MZONE, LOCATION_MZONE)
                       215:   
                       216:   for k in aux.Next(cache_1) do --{
                       217:     
                       218:     cache_1 = fun["是否效果卡"](k)
                       219:     
                       220:     if cache_1 then --{
                       221:       
                       222:       str["这个残局的效果卡数量"] = str["这个残局的效果卡数量"] + 1
                       223:       
                       224:       end --}
                       225:       
                       226:     end --}
                       227:     
                       228:   str["开局说明"] = ""
                       229:   
                       230:   str["开局说明"] = str["开局说明"] .. str["这个残局的效果卡数量"]
                       231:   str["开局说明"] = str["开局说明"] .. str["效果卡数量的后缀"]
                       232:   
                       233:   str["开局说明"] = str["开局说明"] .. str["规则"]
                       234:   
                       235:   if str["不洗牌"] == 0 then --{
                       236:     
                       237:     --}
                       238:     
                       239:   else --{
                       240:     
                       241:     str["开局说明"] = str["开局说明"] .. str["不洗牌的说明"]
                       242:     
                       243:     end --}
                       244:     
                       245:   if str["无BP"] == 0 then --{
                       246:     
                       247:     str["开局说明"] = str["开局说明"] .. str["无BP的说明"]
                       248:     
                       249:     end --}
                       250:     
                       251:   if str["开局添加手卡"] then --{
                       252:     
                       253:     str["开局说明"] = str["开局说明"] .. str["选卡的前缀"]
                       254:     str["开局说明"] = str["开局说明"] .. str["开局添加手卡"]
                       255:     str["开局说明"] = str["开局说明"] .. str["选卡的后缀"]
                       256:     
                       257:     end --}
                       258:     
                       259:   if str["禁格"] then --{
                       260:     
                       261:     str["开局说明"] = str["开局说明"] .. str["禁格的前缀"]
                       262:     str["开局说明"] = str["开局说明"] .. str["禁格"]
                       263:     str["开局说明"] = str["开局说明"] .. str["禁格的后缀"]
                       264:     
                       265:     end --}
                       266:     
                       267:   if str["印卡"] then --{
                       268:     
                       269:     str["开局说明"] = str["开局说明"] .. "印卡 "
                       270:     
                       271:     end --}
                       272:     
                       273:   Debug.ShowHint(str["开局说明"])
                       274:   
                       275:   end --}
                       276:   
                       277: fun["开局添加手卡"] = function(str_1) --{
                       278:   
                       279:   str["开局添加手卡"] = str_1
                       280:   
                       281:   effect_1 = Effect.GlobalEffect()
                       282:   
                       283:   effect_1:SetType(EFFECT_TYPE_FIELD
                       284:   + EFFECT_TYPE_CONTINUOUS)
                       285:   
                       286:   effect_1:SetCode(EVENT_ADJUST)
                       287:   
                       288:   effect_1:SetCondition(aux.TRUE)
                       289:   
                       290:   function cache_1(effect_event
                       291:   , player_who_activate_the_effect) --{
                       292:     
                       293:     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
                       294:     , Card.IsAbleToHand
                       295:     , player_who_activate_the_effect
                       296:     , LOCATION_DECK
                       297:     , 0
                       298:     , str_1
                       299:     , str_1
                       300:     , nil)
                       301:     
                       302:     Duel.SendtoHand(str["玩家选定的卡"]
                       303:     , nil
                       304:     , REASON_RULE)
                       305:     
                       306:     effect_event:Reset()
                       307:     
                       308:     end --}
                       309:     
                       310:   effect_1:SetOperation(cache_1)
                       311:   
                       312:   Duel.RegisterEffect(effect_1
                       313:   , 0)
                       314:   
                       315:   end --}
                       316:   
                       317: fun["禁格"] = function(str_1) --{
                       318:   
                       319:   str["禁格"] = str_1
                       320:   
                       321:   effect_1 = Effect.GlobalEffect()
                       322:   
                       323:   effect_1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       324:   
                       325:   effect_1:SetValue(str_1)
                       326:   
                       327:   Duel.RegisterEffect(effect_1,0)
                       328:   
                       329:   end --}
                       330:   
                       331: fun["印卡"] = function(str_1, str_2, str_3) --{
                       332:   
                       333:   str["印卡"] = 1
                       334:   
                       335:   if str_3 then --{
                       336:     
                       337:     --}
                       338:     
                       339:   else --{
                       340:     
                       341:     str_3 = str_2
                       342:     
                       343:     end --}
                       344:     
                       345:   effect_1 = Effect.CreateEffect(str_1)
                       346:   
                       347:   effect_1:SetType(EFFECT_TYPE_IGNITION)
                       348:   
                       349:   effect_1:SetProperty(EFFECT_FLAG_BOTH_SIDE
                       350:   + EFFECT_FLAG_UNCOPYABLE
                       351:   + EFFECT_FLAG_CANNOT_NEGATE
                       352:   + EFFECT_FLAG_CANNOT_DISABLE)
                       353:   
                       354:   cache_1 = function() --{
                       355:     
                       356:     Duel.SetChainLimit(aux.FALSE)
                       357:     
                       358:     return true
                       359:     
                       360:     end --}
                       361:     
                       362:   effect_1:SetTarget(cache_1)
                       363:   
                       364:   effect_1:SetRange(LOCATION_EXTRA)
                       365:   
                       366:   function print_hand(effect_event
                       367:   , player_who_activate_the_effect) --{
                       368:     
                       369:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
                       370:     
                       371:     card = Duel.CreateToken(player_who_activate_the_effect
                       372:     , announce_card)
                       373:     
                       374:     if str["当前印卡数"] <= str_2 then --{
                       375:       
                       376:       str["当前印卡数"] = str["当前印卡数"] + 1
                       377:       
                       378:       Duel.SendtoHand(card,nil,REASON_RULE)
                       379:       
                       380:       --}
                       381:       
                       382:     else --{
                       383:       
                       384:       if str["当前印卡数"] <= str_3 then --{
                       385:         
                       386:         str["当前印卡数"] = str["当前印卡数"] + 1
                       387:         
                       388:         Duel.Remove(card,POS_FACEUP,REASON_RULE)
                       389:         
                       390:         Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
                       391:         
                       392:         --}
                       393:         
                       394:       else --{
                       395:         
                       396:         Debug.ShowHint(str["印卡过多的弹窗"])
                       397:         
                       398:         effect_event:Reset()
                       399:         
                       400:         end --}
                       401:         
                       402:       end --}
                       403:       
                       404:     end --}
                       405:     
                       406:   effect_1:SetOperation(print_hand)
                       407:   
                       408:   str_1:RegisterEffect(effect_1)
                       409:   
                       410:   end --}
                       411: