游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

                         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:   
d1721f832d 2023-07-16  245: --~   effect_1 = Effect.GlobalEffect()
d1721f832d 2023-07-16  246: --~   
d1721f832d 2023-07-16  247: --~   effect_1:SetType(EFFECT_TYPE_FIELD
d1721f832d 2023-07-16  248: --~   + EFFECT_TYPE_CONTINUOUS)
d1721f832d 2023-07-16  249: --~   
d1721f832d 2023-07-16  250: --~   effect_1:SetCode(EVENT_ADJUST)
d1721f832d 2023-07-16  251: --~   
d1721f832d 2023-07-16  252: --~   effect_1:SetCountLimit(1)
d1721f832d 2023-07-16  253: --~   
d1721f832d 2023-07-16  254: --~   function cache_1() --{
d1721f832d 2023-07-16  255: --~     
d1721f832d 2023-07-16  256: --~     if str["已添加手卡"] == 1 then --{
d1721f832d 2023-07-16  257: --~       
d1721f832d 2023-07-16  258: --~       return false
d1721f832d 2023-07-16  259: --~       
d1721f832d 2023-07-16  260: --~       --}
d1721f832d 2023-07-16  261: --~       
d1721f832d 2023-07-16  262: --~     else --{
d1721f832d 2023-07-16  263: --~       
d1721f832d 2023-07-16  264: --~       str["已添加手卡"] = 1
d1721f832d 2023-07-16  265: --~       
d1721f832d 2023-07-16  266: --~       return true
d1721f832d 2023-07-16  267: --~       
d1721f832d 2023-07-16  268: --~       end --}
d1721f832d 2023-07-16  269: --~       
d1721f832d 2023-07-16  270: --~     end--}
d1721f832d 2023-07-16  271: --~     
d1721f832d 2023-07-16  272: --~   effect_1:SetCondition(cache_1)
d1721f832d 2023-07-16  273: --~   
d1721f832d 2023-07-16  274: --~   function cache_1(effect_event
d1721f832d 2023-07-16  275: --~   , player_who_activate_the_effect) --{
d1721f832d 2023-07-16  276: --~     
d1721f832d 2023-07-16  277: --~     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
d1721f832d 2023-07-16  278: --~     , Card.IsAbleToHand
d1721f832d 2023-07-16  279: --~     , player_who_activate_the_effect
d1721f832d 2023-07-16  280: --~     , LOCATION_DECK
d1721f832d 2023-07-16  281: --~     , 0
d1721f832d 2023-07-16  282: --~     , str_1
d1721f832d 2023-07-16  283: --~     , str_1
d1721f832d 2023-07-16  284: --~     , nil)
d1721f832d 2023-07-16  285: --~     
d1721f832d 2023-07-16  286: --~     Duel.SendtoHand(str["玩家选定的卡"]
d1721f832d 2023-07-16  287: --~     , nil
d1721f832d 2023-07-16  288: --~     , REASON_RULE)
d1721f832d 2023-07-16  289: --~     
d1721f832d 2023-07-16  290: --~     end --}
d1721f832d 2023-07-16  291: --~     
d1721f832d 2023-07-16  292: --~   effect_1:SetOperation(cache_1)
d1721f832d 2023-07-16  293: --~   
d1721f832d 2023-07-16  294: --~   Duel.RegisterEffect(effect_1
d1721f832d 2023-07-16  295: --~   , 0)
d1721f832d 2023-07-16  296: 
d1721f832d 2023-07-16  297:     str["玩家选定的卡"] = Duel.SelectMatchingCard(0
                       298:     , Card.IsAbleToHand
d1721f832d 2023-07-16  299:     , 0
                       300:     , LOCATION_DECK
                       301:     , 0
                       302:     , str_1
                       303:     , str_1
                       304:     , nil)
                       305:     
                       306:     Duel.SendtoHand(str["玩家选定的卡"]
                       307:     , nil
                       308:     , REASON_RULE)
d1721f832d 2023-07-16  309:   
                       310:   end --}
                       311:   
                       312: fun["禁格"] = function(str_1) --{
                       313:   
                       314:   str["禁格"] = str_1
                       315:   
                       316:   effect_1 = Effect.GlobalEffect()
                       317:   
                       318:   effect_1:SetType(EFFECT_TYPE_FIELD)
                       319:   
                       320:   effect_1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       321:   
                       322:   effect_1:SetValue(str_1)
                       323:   
                       324:   Duel.RegisterEffect(effect_1,0)
                       325:   
                       326:   end --}
                       327:   
                       328: fun["印卡"] = function(str_1, str_2, str_3) --{
                       329:   
                       330:   str["印卡"] = 1
                       331:   
                       332:   if str_3 then --{
                       333:     
                       334:     --}
                       335:     
                       336:   else --{
                       337:     
                       338:     str_3 = str_2
                       339:     
                       340:     end --}
                       341:     
                       342:   str["当前印卡数"] = 1
                       343:   
                       344:   effect_1 = Effect.CreateEffect(str_1)
                       345:   
                       346:   effect_1:SetType(EFFECT_TYPE_IGNITION)
                       347:   
                       348:   effect_1:SetProperty(EFFECT_FLAG_BOTH_SIDE
                       349:   + EFFECT_FLAG_UNCOPYABLE
                       350:   + EFFECT_FLAG_CANNOT_NEGATE
                       351:   + EFFECT_FLAG_CANNOT_DISABLE)
                       352:   
                       353:   cache_1 = function() --{
                       354:     
                       355:     Duel.SetChainLimit(aux.FALSE)
                       356:     
                       357:     return true
                       358:     
                       359:     end --}
                       360:     
                       361:   effect_1:SetTarget(cache_1)
                       362:   
                       363:   effect_1:SetRange(LOCATION_EXTRA)
                       364:   
                       365:   function print_hand(effect_event
                       366:   , player_who_activate_the_effect) --{
                       367:     
                       368:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
                       369:     
                       370:     card = Duel.CreateToken(player_who_activate_the_effect
                       371:     , announce_card)
                       372:     
                       373:     if str["当前印卡数"] <= str_2 then --{
                       374:       
                       375:       str["当前印卡数"] = str["当前印卡数"] + 1
                       376:       
                       377:       Duel.SendtoHand(card,nil,REASON_RULE)
                       378:       
                       379:       --}
                       380:       
                       381:     else --{
                       382:       
                       383:       if str["当前印卡数"] <= str_3 then --{
                       384:         
                       385:         str["当前印卡数"] = str["当前印卡数"] + 1
                       386:         
                       387:         Duel.Remove(card,POS_FACEUP,REASON_RULE)
                       388:         
                       389:         Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
                       390:         
                       391:         --}
                       392:         
                       393:       else --{
                       394:         
                       395:         Debug.ShowHint("印卡过多!")
                       396:         
                       397:         end --}
                       398:         
                       399:       end --}
                       400:       
                       401:     end --}
                       402:     
                       403:   effect_1:SetOperation(print_hand)
                       404:   
                       405:   str_1:RegisterEffect(effect_1)
                       406:   
                       407:   end --}
                       408:   
                       409: fun["全部回到卡组"] = function() --{
                       410:   
                       411:   Debug.ShowHint("胜利条件:让对方的卡回到卡组。")
                       412:   
                       413:   effect_1 = Effect.GlobalEffect()
                       414:   
                       415:   effect_1:SetType(EFFECT_TYPE_FIELD
                       416:   + EFFECT_TYPE_CONTINUOUS)
                       417:   
                       418:   effect_1:SetCode(EVENT_ADJUST)
                       419:   
                       420:   cache_1 = function() --{
                       421:     
                       422:     cache_1 = 0
                       423:     cache_1 = cache_1 + LOCATION_HAND
                       424:     cache_1 = cache_1 + LOCATION_MZONE
                       425:     cache_1 = cache_1 + LOCATION_SZONE
                       426:     cache_1 = cache_1 + LOCATION_GRAVE
                       427:     cache_1 = cache_1 + LOCATION_REMOVED
                       428:     
                       429:     cache_1 = Duel.GetFieldGroupCount(1,cache_1,0)
                       430:     
                       431:     if cache_1 == 0 then --{
                       432:       
                       433:       return true
                       434:       
                       435:       --}
                       436:       
                       437:     else --{
                       438:       
                       439:       return false
                       440:       
                       441:       end --}
                       442:       
                       443:     end --}
                       444:     
                       445:   effect_1:SetCondition(cache_1)
                       446:   
                       447:   cache_1 = function() --{
                       448:     
                       449:     Debug.ShowHint("目标已达成!")
                       450:     
                       451:     Duel.SetLP(1,0)
                       452:     
                       453:     end --}
                       454:     
                       455:   effect_1:SetOperation(cache_1)
                       456:   
                       457:   Duel.RegisterEffect(effect_1,0)
                       458:   
                       459:   end --}
                       460: