游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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