游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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