游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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