游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 9a4f580be7 that are changed by the sequence of edits moving toward check-in 832da4f615:

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