游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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