游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

Lines of script/c0.lua from check-in 27cb01cd8e that are changed by the sequence of edits moving toward check-in 874d638fda:

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