游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

                         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:   fun["aux.BeginPuzzle"]()
                        50:   fun["开局说明"]()
                        51:   fun["通关邀请"]()
                        52:   end --}
cd5279993d 2023-07-16   53: 
cd5279993d 2023-07-16   54: 
                        55: fun["通关邀请"] = function() --{
                        56:   
                        57:   effect_1 = Effect.GlobalEffect()
                        58:   
                        59:   effect_1:SetType(EFFECT_TYPE_FIELD
                        60:   + EFFECT_TYPE_CONTINUOUS)
                        61:   
                        62:   effect_1:SetCode(EVENT_DAMAGE)
                        63:   
                        64:   function cache_1() --{
                        65:     
                        66:     cache_1 = Duel.GetLP(1)
                        67:     
                        68:     if cache_1 <= 0 then --{
                        69:       
                        70:       if cache_1 < 0 then --{
                        71:         
                        72:         Debug.ShowHint("QB:「你居然二解了,请加群告诉我怎么二解。」")
                        73:         
                        74:         end --}
                        75:         
                        76:       cache_1 = true
                        77:       
                        78:       --}
                        79:       
                        80:     else --{
                        81:       
                        82:       cache_1 = false
                        83:       
                        84:       end --}
                        85:       
                        86:     return cache_1
                        87:     
                        88:     end --}
                        89:     
                        90:   effect_1:SetCondition(cache_1)
                        91:   
                        92:   function cache_1() --{
                        93:     
                        94:     Debug.ShowHint("残局群181175613")
                        95:     
                        96:     end --}
                        97:     
                        98:   effect_1:SetOperation(cache_1)
                        99:   
                       100:   Duel.RegisterEffect(effect_1
                       101:   , 0)
                       102:   
                       103:   end --}
                       104:   
                       105: fun["是否效果卡"] = function(card) --{
                       106:   
                       107:   cache_1 = Card.IsType(card, TYPE_SPELL)
                       108:   
                       109:   cache_2 = Card.IsType(card, TYPE_TRAP)
                       110:   
                       111:   cache_3 = Card.IsType(card, TYPE_EFFECT)
                       112:   
                       113:   if cache_1
                       114:   or cache_2
                       115:   or cache_3 then --{
                       116:     
                       117:     return true
                       118:     
                       119:     end --}
                       120:     
                       121:   cache_1 = Card.IsType(card, TYPE_PENDULUM)
                       122:   
                       123:   if cache_1 then --{
                       124:     
                       125:     cache_1 = Card.IsCode(card, 28363749)
                       126:     
                       127:     cache_2 = Card.IsCode(card, 19474136)
                       128:     
                       129:     cache_3 = Card.IsCode(card, 17390179)
                       130:     
                       131:     cache_4 = Card.IsCode(card, 83980492)
                       132:     
                       133:     if cache_1
                       134:     or cache_2
                       135:     or cache_3
                       136:     or cache_4 then --{
                       137:       
                       138:       --}
                       139:       
                       140:     else --{
                       141:       
                       142:       return true
                       143:       
                       144:       end --}
                       145:       
                       146:     end --}
                       147:     
                       148:   return false
                       149:   
                       150:   end --}
                       151:   
                       152: fun["开局说明"] = function() --{
                       153:   
                       154:   if str["开局说明吗"] == 1 then --{
                       155:     
                       156:     return
                       157:     
                       158:     --}
                       159:     
                       160:   else --{
                       161:     
                       162:     str["开局说明吗"] = 1
                       163:     
                       164:     end --}
                       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:   
cd5279993d 2023-07-16  236:   fun["通关邀请"]()
cd5279993d 2023-07-16  237:   
                       238:   end --}
                       239:   
                       240: fun["开局添加手卡"] = function(str_1) --{
                       241:   
                       242:   str["开局添加手卡"] = str_1
                       243:   
                       244:   effect_1 = Effect.GlobalEffect()
                       245:   
                       246:   effect_1:SetType(EFFECT_TYPE_FIELD
                       247:   + EFFECT_TYPE_CONTINUOUS)
                       248:   
                       249:   effect_1:SetCode(EVENT_ADJUST)
                       250:   
                       251:   effect_1:SetCountLimit(1)
                       252:   
                       253:   function cache_1() --{
                       254:     
                       255:     if str["已添加手卡"] == 1 then --{
                       256:       
                       257:       return false
                       258:       
                       259:       --}
                       260:       
                       261:     else --{
                       262:       
                       263:       str["已添加手卡"] = 1
                       264:       
                       265:       return true
                       266:       
                       267:       end --}
                       268:       
                       269:     end--}
                       270:     
                       271:   effect_1:SetCondition(cache_1)
                       272:   
                       273:   function cache_1(effect_event
                       274:   , player_who_activate_the_effect) --{
                       275:     
                       276:     str["玩家选定的卡"] = Duel.SelectMatchingCard(player_who_activate_the_effect
                       277:     , Card.IsAbleToHand
                       278:     , player_who_activate_the_effect
                       279:     , LOCATION_DECK
                       280:     , 0
                       281:     , str_1
                       282:     , str_1
                       283:     , nil)
                       284:     
                       285:     Duel.SendtoHand(str["玩家选定的卡"]
                       286:     , nil
                       287:     , REASON_RULE)
                       288:     
                       289:     end --}
                       290:     
                       291:   effect_1:SetOperation(cache_1)
                       292:   
                       293:   Duel.RegisterEffect(effect_1
                       294:   , 0)
cd5279993d 2023-07-16  295:   
                       296:   
                       297:   end --}
                       298:   
                       299: fun["禁格"] = function(str_1) --{
                       300:   
                       301:   str["禁格"] = str_1
                       302:   
                       303:   effect_1 = Effect.GlobalEffect()
                       304:   
                       305:   effect_1:SetType(EFFECT_TYPE_FIELD)
                       306:   
                       307:   effect_1:SetCode(EFFECT_USE_EXTRA_MZONE)
                       308:   
                       309:   effect_1:SetValue(str_1)
                       310:   
                       311:   Duel.RegisterEffect(effect_1,0)
                       312:   
                       313:   end --}
                       314:   
                       315: fun["印卡"] = function(str_1, str_2, str_3) --{
                       316:   
                       317:   str["印卡"] = 1
                       318:   
                       319:   if str_3 then --{
                       320:     
                       321:     --}
                       322:     
                       323:   else --{
                       324:     
                       325:     str_3 = str_2
                       326:     
                       327:     end --}
                       328:     
                       329:   str["当前印卡数"] = 1
                       330:   
                       331:   effect_1 = Effect.CreateEffect(str_1)
                       332:   
                       333:   effect_1:SetType(EFFECT_TYPE_IGNITION)
                       334:   
                       335:   effect_1:SetProperty(EFFECT_FLAG_BOTH_SIDE
                       336:   + EFFECT_FLAG_UNCOPYABLE
                       337:   + EFFECT_FLAG_CANNOT_NEGATE
                       338:   + EFFECT_FLAG_CANNOT_DISABLE)
                       339:   
                       340:   cache_1 = function() --{
                       341:     
                       342:     Duel.SetChainLimit(aux.FALSE)
                       343:     
                       344:     return true
                       345:     
                       346:     end --}
                       347:     
                       348:   effect_1:SetTarget(cache_1)
                       349:   
                       350:   effect_1:SetRange(LOCATION_EXTRA)
                       351:   
                       352:   function print_hand(effect_event
                       353:   , player_who_activate_the_effect) --{
                       354:     
                       355:     announce_card = Duel.AnnounceCard(player_who_activate_the_effect)
                       356:     
                       357:     card = Duel.CreateToken(player_who_activate_the_effect
                       358:     , announce_card)
                       359:     
                       360:     if str["当前印卡数"] <= str_2 then --{
                       361:       
                       362:       str["当前印卡数"] = str["当前印卡数"] + 1
                       363:       
                       364:       Duel.SendtoHand(card,nil,REASON_RULE)
                       365:       
                       366:       --}
                       367:       
                       368:     else --{
                       369:       
                       370:       if str["当前印卡数"] <= str_3 then --{
                       371:         
                       372:         str["当前印卡数"] = str["当前印卡数"] + 1
                       373:         
                       374:         Duel.Remove(card,POS_FACEUP,REASON_RULE)
                       375:         
                       376:         Duel.SendtoDeck(card,player_who_activate_the_effect,0,REASON_RULE)
                       377:         
                       378:         --}
                       379:         
                       380:       else --{
                       381:         
                       382:         Debug.ShowHint("印卡过多!")
                       383:         
                       384:         end --}
                       385:         
                       386:       end --}
                       387:       
                       388:     end --}
                       389:     
                       390:   effect_1:SetOperation(print_hand)
                       391:   
                       392:   str_1:RegisterEffect(effect_1)
                       393:   
                       394:   end --}
                       395:   
                       396: fun["全部回到卡组"] = function() --{
                       397:   
                       398:   Debug.ShowHint("胜利条件:让对方的卡回到卡组。")
                       399:   
                       400:   effect_1 = Effect.GlobalEffect()
                       401:   
                       402:   effect_1:SetType(EFFECT_TYPE_FIELD
                       403:   + EFFECT_TYPE_CONTINUOUS)
                       404:   
                       405:   effect_1:SetCode(EVENT_ADJUST)
                       406:   
                       407:   cache_1 = function() --{
                       408:     
                       409:     cache_1 = 0
                       410:     cache_1 = cache_1 + LOCATION_HAND
                       411:     cache_1 = cache_1 + LOCATION_MZONE
                       412:     cache_1 = cache_1 + LOCATION_SZONE
                       413:     cache_1 = cache_1 + LOCATION_GRAVE
                       414:     cache_1 = cache_1 + LOCATION_REMOVED
                       415:     
                       416:     cache_1 = Duel.GetFieldGroupCount(1,cache_1,0)
                       417:     
                       418:     if cache_1 == 0 then --{
                       419:       
                       420:       return true
                       421:       
                       422:       --}
                       423:       
                       424:     else --{
                       425:       
                       426:       return false
                       427:       
                       428:       end --}
                       429:       
                       430:     end --}
                       431:     
                       432:   effect_1:SetCondition(cache_1)
                       433:   
                       434:   cache_1 = function() --{
                       435:     
                       436:     Debug.ShowHint("目标已达成!")
                       437:     
                       438:     Duel.SetLP(1,0)
                       439:     
                       440:     end --}
                       441:     
                       442:   effect_1:SetOperation(cache_1)
                       443:   
                       444:   Duel.RegisterEffect(effect_1,0)
                       445:   
                       446:   end --}
                       447: