游戏王残局简化版

Annotation For script/c0.lua
Login

Annotation For script/c0.lua

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

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