游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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